mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 21:14:42 -04:00
PreferencesDialog is now a scene of its own
We should change the organization of the project, and use multiple saved scenes instead of everything being on Main.tscn. Also restored "X" as a shortcut for color switch, because that somehow got lost.
This commit is contained in:
parent
4586853636
commit
432c9690ff
6 changed files with 172 additions and 156 deletions
23
Scripts/PreferencesDialog.gd
Normal file
23
Scripts/PreferencesDialog.gd
Normal file
|
@ -0,0 +1,23 @@
|
|||
extends AcceptDialog
|
||||
|
||||
func _on_LanguageOption_item_selected(ID : int) -> void:
|
||||
if ID == 0:
|
||||
TranslationServer.set_locale(OS.get_locale())
|
||||
else:
|
||||
TranslationServer.set_locale(Global.loaded_locales[ID - 1])
|
||||
if Global.loaded_locales[ID - 1] == "zh_TW":
|
||||
Global.control.theme.default_font = preload("res://Assets/Fonts/NotoSansCJKtc-Regular.tres")
|
||||
else:
|
||||
Global.control.theme.default_font = preload("res://Assets/Fonts/Roboto-Regular.tres")
|
||||
|
||||
Global.config_cache.set_value("preferences", "locale", TranslationServer.get_locale())
|
||||
Global.config_cache.save("user://cache.ini")
|
||||
|
||||
func _on_GridWidthValue_value_changed(value : float) -> void:
|
||||
Global.grid_width = value
|
||||
|
||||
func _on_GridHeightValue_value_changed(value : float) -> void:
|
||||
Global.grid_height = value
|
||||
|
||||
func _on_GridColor_color_changed(color : Color) -> void:
|
||||
Global.grid_color = color
|
Loading…
Add table
Add a link
Reference in a new issue