diff --git a/Prefabs/Dialogs/PreferencesDialog.tscn b/Prefabs/Dialogs/PreferencesDialog.tscn index ba8195fc0..465491ba3 100644 --- a/Prefabs/Dialogs/PreferencesDialog.tscn +++ b/Prefabs/Dialogs/PreferencesDialog.tscn @@ -5,6 +5,7 @@ [ext_resource path="res://Assets/Fonts/CJK/NotoSansCJKtc-Regular.tres" type="DynamicFont" id=3] [node name="PreferencesDialog" type="AcceptDialog"] +visible = true margin_right = 430.0 margin_bottom = 1347.0 rect_min_size = Vector2( 430, 0 ) @@ -110,9 +111,9 @@ text = "Show right tool icon" [node name="PressureSentivity" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/General"] visible = false -margin_top = 46.0 +margin_top = 116.0 margin_right = 334.0 -margin_bottom = 66.0 +margin_bottom = 136.0 [node name="PressureSensitivityLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/General/PressureSentivity"] margin_top = 3.0 diff --git a/Scripts/Dialogs/PreferencesDialog.gd b/Scripts/Dialogs/PreferencesDialog.gd index 143e7ce94..25f4252b4 100644 --- a/Scripts/Dialogs/PreferencesDialog.gd +++ b/Scripts/Dialogs/PreferencesDialog.gd @@ -11,6 +11,8 @@ onready var shortcuts = $HSplitContainer/ScrollContainer/VBoxContainer/Shortcuts onready var smooth_zoom_button = $"HSplitContainer/ScrollContainer/VBoxContainer/General/SmoothZoom" onready var sensitivity_option = $"HSplitContainer/ScrollContainer/VBoxContainer/General/PressureSentivity/PressureSensitivityOptionButton" +onready var left_tool_icon = $HSplitContainer/ScrollContainer/VBoxContainer/General/GridContainer/LeftToolIconCheckbox +onready var right_tool_icon = $HSplitContainer/ScrollContainer/VBoxContainer/General/GridContainer/RightToolIconCheckbox onready var default_width_value = $HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions/ImageDefaultWidth onready var default_height_value = $HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions/ImageDefaultHeight @@ -58,6 +60,13 @@ func _ready() -> void: if Global.config_cache.has_section_key("preferences", "pressure_sensitivity"): Global.pressure_sensitivity_mode = Global.config_cache.get_value("preferences", "pressure_sensitivity") sensitivity_option.selected = Global.pressure_sensitivity_mode + + if Global.config_cache.has_section_key("preferences", "show_left_tool_icon"): + Global.show_left_tool_icon = Global.config_cache.get_value("preferences", "show_left_tool_icon") + left_tool_icon.pressed = Global.show_left_tool_icon + if Global.config_cache.has_section_key("preferences", "show_right_tool_icon"): + Global.show_right_tool_icon = Global.config_cache.get_value("preferences", "show_right_tool_icon") + right_tool_icon.pressed = Global.show_right_tool_icon # Set default values for Grid & Guide options if Global.config_cache.has_section_key("preferences", "grid_size"): @@ -400,7 +409,7 @@ func _on_DefaultBackground_color_changed(color: Color) -> void: func _on_LeftIndicatorCheckbox_toggled(button_pressed : bool) -> void: - Global.left_square_indicator_visible = button_pressed + Global.left_square_indicator_visible = button_pressed func _on_RightIndicatorCheckbox_toggled(button_pressed : bool) -> void: @@ -409,10 +418,14 @@ func _on_RightIndicatorCheckbox_toggled(button_pressed : bool) -> void: func _on_LeftToolIconCheckbox_toggled(button_pressed : bool) -> void: Global.show_left_tool_icon = button_pressed + Global.config_cache.set_value("preferences", "show_left_tool_icon", Global.show_left_tool_icon) + Global.config_cache.save("user://cache.ini") func _on_RightToolIconCheckbox_toggled(button_pressed : bool) -> void: Global.show_right_tool_icon = button_pressed + Global.config_cache.set_value("preferences", "show_right_tool_icon", Global.show_right_tool_icon) + Global.config_cache.save("user://cache.ini") func _on_Shortcut_button_pressed(button : Button) -> void: