mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:54:44 -04:00
Added ItemList to themes
This commit is contained in:
parent
69f08e90fd
commit
71fa2795b1
7 changed files with 1517 additions and 1466 deletions
|
@ -15,11 +15,11 @@ var preferences = [
|
|||
["right_square_indicator_visible", "General/GridContainer/RightIndicatorCheckbox", "pressed"],
|
||||
["autosave_interval", "General/AutosaveInterval/AutosaveInterval", "value"],
|
||||
["enable_autosave", "General/EnableAutosave", "pressed"],
|
||||
|
||||
|
||||
["default_image_width", "Image/ImageOptions/ImageDefaultWidth", "value"],
|
||||
["default_image_height", "Image/ImageOptions/ImageDefaultHeight", "value"],
|
||||
["default_fill_color", "Image/ImageOptions/DefaultFillColor", "color"],
|
||||
|
||||
|
||||
["grid_width", "Canvas/GridOptions/GridWidthValue", "value"],
|
||||
["grid_height", "Canvas/GridOptions/GridHeightValue", "value"],
|
||||
["grid_color", "Canvas/GridOptions/GridColor", "color"],
|
||||
|
@ -32,15 +32,15 @@ var preferences = [
|
|||
func _ready() -> void:
|
||||
# Replace OK with Close since preference changes are being applied immediately, not after OK confirmation
|
||||
get_ok().text = tr("Close")
|
||||
|
||||
|
||||
for pref in preferences:
|
||||
var node = right_side.get_node(pref[1])
|
||||
|
||||
|
||||
if Global.config_cache.has_section_key("preferences", pref[0]):
|
||||
var value = Global.config_cache.get_value("preferences", pref[0])
|
||||
Global.set(pref[0], value)
|
||||
node.set(pref[2], value)
|
||||
|
||||
|
||||
match pref[2]:
|
||||
"pressed":
|
||||
node.connect("toggled", self, "_on_Preference_toggled", [pref[0]])
|
||||
|
@ -87,19 +87,19 @@ func _on_Preference_item_selected(id : int, prop : String) -> void:
|
|||
func preference_update(prop : String) -> void:
|
||||
if prop in ["autosave_interval", "enable_autosave"]:
|
||||
OpenSave.update_autosave()
|
||||
|
||||
|
||||
if prop in ["grid_width", "grid_height", "grid_color"]:
|
||||
Global.canvas.update()
|
||||
|
||||
|
||||
if prop in ["checker_size", "checker_color_1", "checker_color_2"]:
|
||||
Global.transparent_checker._ready()
|
||||
|
||||
|
||||
if prop in ["guide_color"]:
|
||||
for canvas in Global.canvases:
|
||||
for guide in canvas.get_children():
|
||||
if guide is Guide:
|
||||
guide.default_color = Global.guide_color
|
||||
|
||||
|
||||
Global.config_cache.save("user://cache.ini")
|
||||
|
||||
|
||||
|
@ -110,7 +110,7 @@ func _on_PreferencesDialog_about_to_show(changed_language := false) -> void:
|
|||
list.add_item(" " + tr("Canvas"))
|
||||
list.add_item(" " + tr("Image"))
|
||||
list.add_item(" " + tr("Shortcuts"))
|
||||
|
||||
|
||||
list.select(1 if changed_language else 0)
|
||||
general.get_node("AutosaveInterval/AutosaveInterval").suffix = tr("minute(s)")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue