fix: negative color error
This commit is contained in:
parent
ef61225eb7
commit
27eba74018
2 changed files with 6 additions and 0 deletions
BIN
icon.png
BIN
icon.png
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.7 KiB |
|
@ -31,6 +31,10 @@ func pick_previous() -> SpriteFrames:
|
||||||
return _pick_non_nullable()
|
return _pick_non_nullable()
|
||||||
|
|
||||||
|
|
||||||
|
func _get_array_index(index: int, size: int) -> int:
|
||||||
|
return ((index % size) + size) % len(outfits)
|
||||||
|
|
||||||
|
|
||||||
func _pick_nullable() -> SpriteFrames:
|
func _pick_nullable() -> SpriteFrames:
|
||||||
_index %= (len(outfits) + 1)
|
_index %= (len(outfits) + 1)
|
||||||
if _index == 0:
|
if _index == 0:
|
||||||
|
@ -45,6 +49,8 @@ func _pick_non_nullable() -> SpriteFrames:
|
||||||
|
|
||||||
|
|
||||||
func get_texture(index: int) -> SpriteFrames:
|
func get_texture(index: int) -> SpriteFrames:
|
||||||
|
if not allow_null:
|
||||||
|
index = _get_array_index(index, len(outfits))
|
||||||
if index < 0 or index >= len(outfits):
|
if index < 0 or index >= len(outfits):
|
||||||
return null
|
return null
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue