mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-05 16:34:48 -04:00
Fix Preferences having "General" always chosen when the dialog pops up
This commit is contained in:
parent
4f0c0d77c5
commit
b8bdcfbb62
1 changed files with 4 additions and 1 deletions
|
@ -25,6 +25,8 @@ var preferences = [
|
||||||
["checker_color_2", "Canvas/CheckerOptions/CheckerColor2", "color"],
|
["checker_color_2", "Canvas/CheckerOptions/CheckerColor2", "color"],
|
||||||
]
|
]
|
||||||
|
|
||||||
|
var selected_item := 0
|
||||||
|
|
||||||
onready var list : ItemList = $HSplitContainer/List
|
onready var list : ItemList = $HSplitContainer/List
|
||||||
onready var right_side : VBoxContainer = $HSplitContainer/ScrollContainer/VBoxContainer
|
onready var right_side : VBoxContainer = $HSplitContainer/ScrollContainer/VBoxContainer
|
||||||
onready var general = $HSplitContainer/ScrollContainer/VBoxContainer/General
|
onready var general = $HSplitContainer/ScrollContainer/VBoxContainer/General
|
||||||
|
@ -111,7 +113,7 @@ func _on_PreferencesDialog_about_to_show(changed_language := false) -> void:
|
||||||
list.add_item(" " + tr("Image"))
|
list.add_item(" " + tr("Image"))
|
||||||
list.add_item(" " + tr("Shortcuts"))
|
list.add_item(" " + tr("Shortcuts"))
|
||||||
|
|
||||||
list.select(1 if changed_language else 0)
|
list.select(1 if changed_language else selected_item)
|
||||||
general.get_node("AutosaveInterval/AutosaveInterval").suffix = tr("minute(s)")
|
general.get_node("AutosaveInterval/AutosaveInterval").suffix = tr("minute(s)")
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,5 +122,6 @@ func _on_PreferencesDialog_popup_hide() -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_List_item_selected(index) -> void:
|
func _on_List_item_selected(index) -> void:
|
||||||
|
selected_item = index
|
||||||
for child in right_side.get_children():
|
for child in right_side.get_children():
|
||||||
child.visible = child.name == ["General", "Languages", "Themes", "Canvas", "Image", "Shortcuts"][index]
|
child.visible = child.name == ["General", "Languages", "Themes", "Canvas", "Image", "Shortcuts"][index]
|
||||||
|
|
Loading…
Add table
Reference in a new issue