diff --git a/Main.tscn b/Main.tscn index 03cfb16..6419551 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=78 format=2] +[gd_scene load_steps=81 format=2] [ext_resource path="res://Themes & Styles/Dark Theme.tres" type="Theme" id=1] [ext_resource path="res://Scripts/Main.gd" type="Script" id=2] @@ -55,14 +55,21 @@ [ext_resource path="res://Prefabs/BrushButton.tscn" type="PackedScene" id=53] [ext_resource path="res://Assets/Graphics/Canvas_split.png" type="Texture" id=54] [ext_resource path="res://Assets/Graphics/Canvas_unsplit.png" type="Texture" id=55] -[ext_resource path="res://Scripts/AboutDialog.gd" type="Script" id=56] -[ext_resource path="res://Prefabs/EditPalettePopup.tscn" type="PackedScene" id=57] -[ext_resource path="res://Prefabs/NewPaletteDialog.tscn" type="PackedScene" id=58] -[ext_resource path="res://Prefabs/PaletteImportFileDialog.tscn" type="PackedScene" id=59] +[ext_resource path="res://Prefabs/PreferencesDialog.tscn" type="PackedScene" id=56] +[ext_resource path="res://Scripts/AboutDialog.gd" type="Script" id=57] +[ext_resource path="res://Prefabs/EditPalettePopup.tscn" type="PackedScene" id=58] +[ext_resource path="res://Prefabs/NewPaletteDialog.tscn" type="PackedScene" id=59] +[ext_resource path="res://Prefabs/PaletteImportFileDialog.tscn" type="PackedScene" id=60] [sub_resource type="StyleBoxFlat" id=1] bg_color = Color( 0.0823529, 0.0823529, 0.0823529, 1 ) +[sub_resource type="InputEventKey" id=19] +scancode = 88 + +[sub_resource type="ShortCut" id=20] +shortcut = SubResource( 19 ) + [sub_resource type="Image" id=21] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), @@ -133,7 +140,7 @@ scancode = 16777230 [sub_resource type="ShortCut" id=17] shortcut = SubResource( 16 ) -[sub_resource type="StreamTexture" id=20] +[sub_resource type="StreamTexture" id=18] load_path = "res://.import/new_layer.png-6f042042bc418daa72142f41f436a47c.stex" [node name="Control" type="Control"] @@ -220,6 +227,7 @@ text = "[64×64]" align = 2 [node name="UI" type="HBoxContainer" parent="MenuAndUI"] +editor/display_folded = true margin_top = 28.0 margin_right = 1152.0 margin_bottom = 648.0 @@ -234,6 +242,7 @@ rect_min_size = Vector2( 224, 0 ) size_flags_vertical = 3 [node name="Tools" type="VBoxContainer" parent="MenuAndUI/UI/ToolPanel"] +editor/display_folded = true anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 8.0 @@ -400,6 +409,8 @@ margin_right = 17.0 margin_bottom = 7.0 hint_tooltip = "COLORSWITCH_HT" mouse_default_cursor_shape = 2 +shortcut_in_tooltip = false +shortcut = SubResource( 20 ) texture_normal = ExtResource( 9 ) [node name="ColorDefaults" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorPickersCenter/ColorPickersHorizontal/ColorButtonsCenter/ColorButtonsVertical"] @@ -1128,6 +1139,7 @@ margin_right = 689.0 margin_bottom = 138.0 [node name="LayerPanel" type="Panel" parent="MenuAndUI/UI"] +editor/display_folded = true margin_left = 928.0 margin_right = 1152.0 margin_bottom = 620.0 @@ -1306,7 +1318,7 @@ items = [ "New Empty Palette", null, 0, false, false, 0, 0, null, "", false, "Im [node name="TextureRect" type="TextureRect" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/PaletteVBoxContainer/PaletteButtons/AddPalette"] margin_right = 40.0 margin_bottom = 40.0 -texture = SubResource( 20 ) +texture = SubResource( 18 ) [node name="RemovePalette" type="TextureButton" parent="MenuAndUI/UI/LayerPanel/LayersAndMisc/PaletteVBoxContainer/PaletteButtons"] margin_left = 36.0 @@ -1588,102 +1600,14 @@ text = "Nearest" items = [ "Nearest", null, false, 0, null, "Bilinear", null, false, 1, null, "Cubic", null, false, 2, null, "Trilinear", null, false, 3, null, "Lanczos", null, true, 4, null ] selected = 0 -[node name="PreferencesDialog" type="AcceptDialog" parent="."] -editor/display_folded = true -margin_right = 200.0 -margin_bottom = 70.0 -window_title = "Preferences" -resizable = true - -[node name="VBoxContainer" type="VBoxContainer" parent="PreferencesDialog"] -anchor_left = 0.5 -anchor_right = 0.5 -margin_left = -92.0 -margin_top = 8.0 -margin_right = 92.0 -margin_bottom = 31.0 - -[node name="OptionsContainer" type="GridContainer" parent="PreferencesDialog/VBoxContainer"] -margin_right = 184.0 -margin_bottom = 23.0 -columns = 2 - -[node name="LanguageLabel" type="Label" parent="PreferencesDialog/VBoxContainer/OptionsContainer"] -margin_top = 4.0 -margin_right = 57.0 -margin_bottom = 19.0 -text = "Language:" - -[node name="LanguageOption" type="OptionButton" parent="PreferencesDialog/VBoxContainer/OptionsContainer"] -margin_left = 57.0 -margin_right = 176.0 -margin_bottom = 23.0 -text = "System Language" -items = [ "System Language", null, false, 0, null, "Deutsch [de]", null, false, 1, null, "Ελληνικά [el]", null, false, 2, null, "English [en]", null, false, 3, null, "Français [fr]", null, false, 4, null, "Polski [pl]", null, false, 5, null, "Русский [ru]", null, false, 6, null, "繁體中文 [zh_TW]", null, false, 7, null ] -selected = 0 - -[node name="GridOptionsLabel" type="Label" parent="PreferencesDialog/VBoxContainer"] -margin_top = 27.0 -margin_right = 184.0 -margin_bottom = 42.0 -text = "Grid options" - -[node name="GridOptions" type="GridContainer" parent="PreferencesDialog/VBoxContainer"] -margin_top = 46.0 -margin_right = 184.0 -margin_bottom = 103.0 -columns = 2 - -[node name="WidthLabel" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_top = 1.0 -margin_right = 39.0 -margin_bottom = 16.0 -text = "Width:" - -[node name="GridWidthValue" type="SpinBox" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_left = 39.0 -margin_right = 103.0 -margin_bottom = 17.0 -min_value = 1.0 -max_value = 16384.0 -value = 1.0 -suffix = "px" - -[node name="Height" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_top = 19.0 -margin_right = 39.0 -margin_bottom = 33.0 -text = "Height:" - -[node name="GridHeightValue" type="SpinBox" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_left = 39.0 -margin_top = 19.0 -margin_right = 103.0 -margin_bottom = 34.0 -min_value = 1.0 -max_value = 16384.0 -value = 1.0 -suffix = "px" - -[node name="GridColorLabel" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_top = 42.0 -margin_right = 39.0 -margin_bottom = 53.0 -text = "Color:" - -[node name="GridColor" type="ColorPickerButton" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_left = 39.0 -margin_top = 38.0 -margin_right = 103.0 -margin_bottom = 57.0 -rect_min_size = Vector2( 64, 20 ) +[node name="PreferencesDialog" parent="." instance=ExtResource( 56 )] [node name="AboutDialog" type="AcceptDialog" parent="."] editor/display_folded = true margin_right = 284.0 margin_bottom = 186.0 window_title = "About Pixelorama" -script = ExtResource( 56 ) +script = ExtResource( 57 ) [node name="AboutUI" type="VBoxContainer" parent="AboutDialog"] margin_left = 8.0 @@ -1754,14 +1678,14 @@ margin_bottom = 60.0 window_title = "Error!" dialog_text = "This is an error message!" -[node name="EditPalettePopup" parent="." instance=ExtResource( 57 )] +[node name="EditPalettePopup" parent="." instance=ExtResource( 58 )] visible = false -[node name="NewPaletteDialog" parent="." instance=ExtResource( 58 )] +[node name="NewPaletteDialog" parent="." instance=ExtResource( 59 )] -[node name="PaletteImportFileDialog" parent="." instance=ExtResource( 59 )] -current_dir = "C:/Users/Overloaded/Documents/Godot Projects/Pixelorama-palette_updates" -current_path = "C:/Users/Overloaded/Documents/Godot Projects/Pixelorama-palette_updates/" +[node name="PaletteImportFileDialog" parent="." instance=ExtResource( 60 )] +current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama" +current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/" [node name="AnimationTimer" type="Timer" parent="."] @@ -1836,11 +1760,6 @@ visible = false [connection signal="popup_hide" from="ExportSprites" to="." method="_can_draw_true"] [connection signal="confirmed" from="ScaleImage" to="." method="_on_ScaleImage_confirmed"] [connection signal="popup_hide" from="ScaleImage" to="." method="_can_draw_true"] -[connection signal="popup_hide" from="PreferencesDialog" to="." method="_can_draw_true"] -[connection signal="item_selected" from="PreferencesDialog/VBoxContainer/OptionsContainer/LanguageOption" to="." method="_on_LanguageOption_item_selected"] -[connection signal="value_changed" from="PreferencesDialog/VBoxContainer/GridOptions/GridWidthValue" to="." method="_on_GridWidthValue_value_changed"] -[connection signal="value_changed" from="PreferencesDialog/VBoxContainer/GridOptions/GridHeightValue" to="." method="_on_GridHeightValue_value_changed"] -[connection signal="color_changed" from="PreferencesDialog/VBoxContainer/GridOptions/GridColor" to="." method="_on_GridColor_color_changed"] [connection signal="popup_hide" from="AboutDialog" to="." method="_can_draw_true"] [connection signal="pressed" from="AboutDialog/AboutUI/Links/LinkButtons/Website" to="AboutDialog" method="_on_Website_pressed"] [connection signal="pressed" from="AboutDialog/AboutUI/Links/LinkButtons/GitHub" to="AboutDialog" method="_on_GitHub_pressed"] diff --git a/Prefabs/PreferencesDialog.tscn b/Prefabs/PreferencesDialog.tscn new file mode 100644 index 0000000..b558b91 --- /dev/null +++ b/Prefabs/PreferencesDialog.tscn @@ -0,0 +1,97 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Scripts/PreferencesDialog.gd" type="Script" id=1] + +[node name="PreferencesDialog" type="AcceptDialog"] +margin_right = 200.0 +margin_bottom = 70.0 +window_title = "Preferences" +resizable = true +script = ExtResource( 1 ) + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchor_left = 0.5 +anchor_right = 0.5 +margin_left = -92.0 +margin_top = 8.0 +margin_right = 92.0 +margin_bottom = 34.0 + +[node name="OptionsContainer" type="GridContainer" parent="VBoxContainer"] +margin_right = 184.0 +margin_bottom = 23.0 +columns = 2 + +[node name="LanguageLabel" type="Label" parent="VBoxContainer/OptionsContainer"] +margin_top = 4.0 +margin_right = 57.0 +margin_bottom = 19.0 +text = "Language:" + +[node name="LanguageOption" type="OptionButton" parent="VBoxContainer/OptionsContainer"] +margin_left = 57.0 +margin_right = 176.0 +margin_bottom = 23.0 +text = "System Language" +items = [ "System Language", null, false, 0, null, "Deutsch [de]", null, false, 1, null, "Ελληνικά [el]", null, false, 2, null, "English [en]", null, false, 3, null, "Français [fr]", null, false, 4, null, "Polski [pl]", null, false, 5, null, "Русский [ru]", null, false, 6, null, "繁體中文 [zh_TW]", null, false, 7, null ] +selected = 0 + +[node name="GridOptionsLabel" type="Label" parent="VBoxContainer"] +margin_top = 27.0 +margin_right = 184.0 +margin_bottom = 42.0 +text = "Grid options" + +[node name="GridOptions" type="GridContainer" parent="VBoxContainer"] +margin_top = 46.0 +margin_right = 184.0 +margin_bottom = 103.0 +columns = 2 + +[node name="WidthLabel" type="Label" parent="VBoxContainer/GridOptions"] +margin_top = 1.0 +margin_right = 39.0 +margin_bottom = 16.0 +text = "Width:" + +[node name="GridWidthValue" type="SpinBox" parent="VBoxContainer/GridOptions"] +margin_left = 39.0 +margin_right = 103.0 +margin_bottom = 17.0 +min_value = 1.0 +max_value = 16384.0 +value = 1.0 +suffix = "px" + +[node name="Height" type="Label" parent="VBoxContainer/GridOptions"] +margin_top = 19.0 +margin_right = 39.0 +margin_bottom = 33.0 +text = "Height:" + +[node name="GridHeightValue" type="SpinBox" parent="VBoxContainer/GridOptions"] +margin_left = 39.0 +margin_top = 19.0 +margin_right = 103.0 +margin_bottom = 34.0 +min_value = 1.0 +max_value = 16384.0 +value = 1.0 +suffix = "px" + +[node name="GridColorLabel" type="Label" parent="VBoxContainer/GridOptions"] +margin_top = 42.0 +margin_right = 39.0 +margin_bottom = 53.0 +text = "Color:" + +[node name="GridColor" type="ColorPickerButton" parent="VBoxContainer/GridOptions"] +margin_left = 39.0 +margin_top = 38.0 +margin_right = 103.0 +margin_bottom = 57.0 +rect_min_size = Vector2( 64, 20 ) +[connection signal="item_selected" from="VBoxContainer/OptionsContainer/LanguageOption" to="." method="_on_LanguageOption_item_selected"] +[connection signal="value_changed" from="VBoxContainer/GridOptions/GridWidthValue" to="." method="_on_GridWidthValue_value_changed"] +[connection signal="value_changed" from="VBoxContainer/GridOptions/GridHeightValue" to="." method="_on_GridHeightValue_value_changed"] +[connection signal="color_changed" from="VBoxContainer/GridOptions/GridColor" to="." method="_on_GridColor_color_changed"] diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 662622d..b6ec3ac 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -1,5 +1,8 @@ extends Node +var config_cache := ConfigFile.new() +# warning-ignore:unused_class_variable +var loaded_locales : Array var undo_redo : UndoRedo var undos := 0 #The number of times we added undo properties @@ -491,5 +494,11 @@ func blend_image_with_color(image : Image, color : Color, interpolate_factor : f return blended_image func _exit_tree() -> void: + config_cache.set_value("window", "screen", OS.current_screen) + config_cache.set_value("window", "maximized", OS.window_maximized || OS.window_fullscreen) + config_cache.set_value("window", "position", OS.window_position) + config_cache.set_value("window", "size", OS.window_size) + config_cache.save("user://cache.ini") + # Thanks to qarmin from GitHub for pointing this out - undo_redo.free() \ No newline at end of file + undo_redo.free() diff --git a/Scripts/Main.gd b/Scripts/Main.gd index 7b379a3..ca1a2ec 100644 --- a/Scripts/Main.gd +++ b/Scripts/Main.gd @@ -1,7 +1,5 @@ extends Control -var config_cache := ConfigFile.new() -var loaded_locales : Array var current_save_path := "" var current_export_path := "" var opensprite_file_selected := false @@ -27,28 +25,28 @@ func _ready() -> void: # `TranslationServer.get_loaded_locales()` was added in 3.2beta and in 3.1.2 # The `has_method()` check and the `else` branch can be removed once 3.2 is released. if TranslationServer.has_method("get_loaded_locales"): - loaded_locales = TranslationServer.get_loaded_locales() + Global.loaded_locales = TranslationServer.get_loaded_locales() else: # Hardcoded list of locales - loaded_locales = ["de", "el", "en", "fr", "pl", "ru", "zh_TW"] + Global.loaded_locales = ["de", "el", "en", "fr", "pl", "ru", "zh_TW"] # Make sure locales are always sorted, in the same order - loaded_locales.sort() + Global.loaded_locales.sort() # Load settings from the config file - config_cache.load("user://cache.ini") + Global.config_cache.load("user://cache.ini") # Restore the window position/size if values are present in the configuration cache - if config_cache.has_section_key("window", "screen"): - OS.current_screen = config_cache.get_value("window", "screen") - if config_cache.has_section_key("window", "maximized"): - OS.window_maximized = config_cache.get_value("window", "maximized") + if Global.config_cache.has_section_key("window", "screen"): + OS.current_screen = Global.config_cache.get_value("window", "screen") + if Global.config_cache.has_section_key("window", "maximized"): + OS.window_maximized = Global.config_cache.get_value("window", "maximized") if !OS.window_maximized: - if config_cache.has_section_key("window", "position"): - OS.window_position = config_cache.get_value("window", "position") - if config_cache.has_section_key("window", "size"): - OS.window_size = config_cache.get_value("window", "size") + if Global.config_cache.has_section_key("window", "position"): + OS.window_position = Global.config_cache.get_value("window", "position") + if Global.config_cache.has_section_key("window", "size"): + OS.window_size = Global.config_cache.get_value("window", "size") var file_menu_items := { "New..." : KEY_MASK_CMD + KEY_N, @@ -81,12 +79,12 @@ func _ready() -> void: } # Load language - if config_cache.has_section_key("preferences", "locale"): - var saved_locale : String = config_cache.get_value("preferences", "locale") + if Global.config_cache.has_section_key("preferences", "locale"): + var saved_locale : String = Global.config_cache.get_value("preferences", "locale") TranslationServer.set_locale(saved_locale) # Set the language option menu's default selected option to the loaded locale - var locale_index := loaded_locales.find(saved_locale) + var locale_index := Global.loaded_locales.find(saved_locale) $PreferencesDialog/VBoxContainer/OptionsContainer/LanguageOption.selected = locale_index + 1 else: # If the user doesn't have a language preference, set it to their OS' locale TranslationServer.set_locale(OS.get_locale()) @@ -637,28 +635,6 @@ func _on_ScaleImage_confirmed() -> void: Global.undo_redo.add_do_method(Global, "redo", [Global.canvas]) Global.undo_redo.commit_action() -func _on_LanguageOption_item_selected(ID : int) -> void: - if ID == 0: - TranslationServer.set_locale(OS.get_locale()) - else: - TranslationServer.set_locale(loaded_locales[ID - 1]) - if loaded_locales[ID - 1] == "zh_TW": - theme.default_font = preload("res://Assets/Fonts/NotoSansCJKtc-Regular.tres") - else: - theme.default_font = preload("res://Assets/Fonts/Roboto-Regular.tres") - - config_cache.set_value("preferences", "locale", TranslationServer.get_locale()) - 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 - func _on_ImportSprites_popup_hide() -> void: if !opensprite_file_selected: Global.can_draw = true @@ -1048,14 +1024,6 @@ func _on_QuitDialog_confirmed() -> void: get_tree().quit() -func _exit_tree() -> void: - # Save the window position and size to remember it when restarting the application - config_cache.set_value("window", "screen", OS.current_screen) - config_cache.set_value("window", "maximized", OS.window_maximized || OS.window_fullscreen) - config_cache.set_value("window", "position", OS.window_position) - config_cache.set_value("window", "size", OS.window_size) - config_cache.save("user://cache.ini") - func _on_PaletteOptionButton_item_selected(ID) -> void: var palette_name = Global.palette_option_button.get_item_metadata(ID) Global.palette_container.on_palette_select(palette_name) diff --git a/Scripts/PaletteContainer.gd b/Scripts/PaletteContainer.gd index eb87a52..11b8397 100644 --- a/Scripts/PaletteContainer.gd +++ b/Scripts/PaletteContainer.gd @@ -47,7 +47,7 @@ func on_import_palette() -> void: func on_palette_import_file_selected(path) -> void: var file := File.new() - + file.open(path, File.READ) var text = file.get_as_text() var result_json = JSON.parse(text) diff --git a/Scripts/PreferencesDialog.gd b/Scripts/PreferencesDialog.gd new file mode 100644 index 0000000..9925109 --- /dev/null +++ b/Scripts/PreferencesDialog.gd @@ -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 \ No newline at end of file