1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-30 23:19:49 +00:00

Check the correct tile mode button in View > Tile Mode when changing between projects

Also changed the buttons to radiobuttons
This commit is contained in:
Manolis Papadeas 2020-12-03 03:49:53 +02:00
parent cf35060e74
commit 46939bd74d
3 changed files with 13 additions and 6 deletions

View file

@ -221,11 +221,11 @@ func _ready() -> void:
tile_mode_submenu = PopupMenu.new() tile_mode_submenu = PopupMenu.new()
tile_mode_submenu.set_name("tile_mode_submenu") tile_mode_submenu.set_name("tile_mode_submenu")
tile_mode_submenu.add_check_item("None", 0) tile_mode_submenu.add_radio_check_item("None", 0)
tile_mode_submenu.set_item_checked(0, true) tile_mode_submenu.set_item_checked(0, true)
tile_mode_submenu.add_check_item("Tiled In Both Axis", 1) tile_mode_submenu.add_radio_check_item("Tiled In Both Axis", 1)
tile_mode_submenu.add_check_item("Tiled In X Axis", 2) tile_mode_submenu.add_radio_check_item("Tiled In X Axis", 2)
tile_mode_submenu.add_check_item("Tiled In Y Axis", 3) tile_mode_submenu.add_radio_check_item("Tiled In Y Axis", 3)
tile_mode_submenu.hide_on_checkable_item_selection = false tile_mode_submenu.hide_on_checkable_item_selection = false
new_image_dialog = find_node_by_name(root, "CreateNewImage") new_image_dialog = find_node_by_name(root, "CreateNewImage")

View file

@ -206,6 +206,13 @@ func change_project() -> void:
else: else:
Global.file_menu.get_popup().set_item_text(6, tr("Export") + " %s" % (file_name + Export.file_format_string(file_format))) Global.file_menu.get_popup().set_item_text(6, tr("Export") + " %s" % (file_name + Export.file_format_string(file_format)))
for j in range(len(Global.Tile_Mode)):
if j != tile_mode:
Global.tile_mode_submenu.set_item_checked(j, false)
else:
Global.tile_mode_submenu.set_item_checked(j, true)
func serialize() -> Dictionary: func serialize() -> Dictionary:
var layer_data := [] var layer_data := []

View file

@ -271,10 +271,10 @@ func view_menu_id_pressed(id : int) -> void:
Global.canvas.update() Global.canvas.update()
func tile_mode_submenu_id_pressed(id : int): func tile_mode_submenu_id_pressed(id : int) -> void:
Global.transparent_checker._init_position(id) Global.transparent_checker._init_position(id)
for i in range(len(Global.Tile_Mode)): for i in range(len(Global.Tile_Mode)):
if i != id: if i != id:
Global.tile_mode_submenu.set_item_checked(i, false) Global.tile_mode_submenu.set_item_checked(i, false)
else: else:
Global.tile_mode_submenu.set_item_checked(i, true) Global.tile_mode_submenu.set_item_checked(i, true)