mirror of
https://github.com/Relintai/godot-resources-as-sheets-plugin.git
synced 2025-04-08 17:41:50 +02:00
Don't error when an enum property has an invalid value.
This commit is contained in:
parent
7b08a43faa
commit
3240a56aa6
@ -6,7 +6,15 @@ func can_edit_value(value, type, property_hint, column_index) -> bool:
|
||||
|
||||
|
||||
func set_value(node : Control, value):
|
||||
node.text = hint_strings_array[node.get_position_in_parent() % hint_strings_array.size()][value]
|
||||
var arr = hint_strings_array[node.get_position_in_parent() % hint_strings_array.size()]
|
||||
var s : int = arr.size()
|
||||
|
||||
if value < s && value >= 0:
|
||||
node.text = arr[value]
|
||||
else:
|
||||
print("CellEditor: Invalid enum value! " + str(value))
|
||||
node.text = str(value)
|
||||
|
||||
node.self_modulate = Color(node.text.hash()) + Color(0.25, 0.25, 0.25, 1.0)
|
||||
node.align = Label.ALIGN_CENTER
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user