1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 09:39:48 +00:00

Prevent users from editing tileset name and size if they choose to not create a new tileset

This commit is contained in:
Emmanouil Papadeas 2024-11-26 00:59:16 +02:00
parent afe51262c9
commit 177428cc1b
2 changed files with 7 additions and 0 deletions

View file

@ -37,3 +37,9 @@ func _on_about_to_popup() -> void:
if not tileset.name.is_empty(): if not tileset.name.is_empty():
item_string += ": " + tileset.name item_string += ": " + tileset.name
tileset_option_button.add_item(tr("Tileset" + item_string)) tileset_option_button.add_item(tr("Tileset" + item_string))
_on_tileset_option_button_item_selected(tileset_option_button.selected)
func _on_tileset_option_button_item_selected(index: int) -> void:
tileset_name_line_edit.editable = index == 0
tile_size_slider.editable = tileset_name_line_edit.editable

View file

@ -67,3 +67,4 @@ suffix_y = "px"
[connection signal="about_to_popup" from="." to="." method="_on_about_to_popup"] [connection signal="about_to_popup" from="." to="." method="_on_about_to_popup"]
[connection signal="confirmed" from="." to="." method="_on_confirmed"] [connection signal="confirmed" from="." to="." method="_on_confirmed"]
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"] [connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="item_selected" from="GridContainer/TilesetOptionButton" to="." method="_on_tileset_option_button_item_selected"]