mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 10:34:43 -04:00
Merge pull request #196 from MatheusPese/master
Added the left and right tool icon option to be saved and restored on startup
This commit is contained in:
commit
2404798749
2 changed files with 17 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue