Major UI changes in Main.tscn

More changes will happen
This commit is contained in:
OverloadedOrama 2020-03-27 03:40:23 +02:00
parent c8d46c7dd7
commit 61c4ea7aa1
6 changed files with 730 additions and 830 deletions

View file

@ -17,19 +17,19 @@ func _on_BrushButton_pressed() -> void:
if custom_brush_index > -1: # Custom brush
if Global.current_left_tool == "Pencil":
Global.left_color_interpolation_container.visible = true
if hint_tooltip == "":
Global.left_brush_type_label.text = tr("Custom brush")
else:
Global.left_brush_type_label.text = tr("Brush:") + " %s" % hint_tooltip
# if hint_tooltip == "":
# Global.left_brush_type_label.text = tr("Custom brush")
# else:
# Global.left_brush_type_label.text = tr("Brush:") + " %s" % hint_tooltip
elif custom_brush_index == -3: # Pixel brush
Global.left_color_interpolation_container.visible = false
Global.left_brush_type_label.text = tr("Brush: Pixel")
# Global.left_brush_type_label.text = tr("Brush: Pixel")
elif custom_brush_index == -2: # Circle brush
Global.left_color_interpolation_container.visible = false
Global.left_brush_type_label.text = tr("Brush: Circle")
# Global.left_brush_type_label.text = tr("Brush: Circle")
elif custom_brush_index == -1: # Filled Circle brush
Global.left_color_interpolation_container.visible = false
Global.left_brush_type_label.text = tr("Brush: Filled Circle")
# Global.left_brush_type_label.text = tr("Brush: Filled Circle")
Global.update_left_custom_brush()
@ -39,19 +39,19 @@ func _on_BrushButton_pressed() -> void:
if custom_brush_index > -1:
if Global.current_right_tool == "Pencil":
Global.right_color_interpolation_container.visible = true
if hint_tooltip == "":
Global.right_brush_type_label.text = tr("Custom brush")
else:
Global.right_brush_type_label.text = tr("Brush:") + " %s" % hint_tooltip
# if hint_tooltip == "":
# Global.right_brush_type_label.text = tr("Custom brush")
# else:
# Global.right_brush_type_label.text = tr("Brush:") + " %s" % hint_tooltip
elif custom_brush_index == -3: # Pixel brush
Global.right_color_interpolation_container.visible = false
Global.right_brush_type_label.text = tr("Brush: Pixel")
# Global.right_brush_type_label.text = tr("Brush: Pixel")
elif custom_brush_index == -2: # Circle brush
Global.right_color_interpolation_container.visible = false
Global.right_brush_type_label.text = tr("Brush: Circle")
# Global.right_brush_type_label.text = tr("Brush: Circle")
elif custom_brush_index == -1: # Filled Circle brush
Global.right_color_interpolation_container.visible = false
Global.right_brush_type_label.text = tr("Brush: Filled Circle")
# Global.right_brush_type_label.text = tr("Brush: Filled Circle")
Global.update_right_custom_brush()
@ -60,12 +60,12 @@ func _on_DeleteButton_pressed() -> void:
if Global.custom_left_brush_index == custom_brush_index:
Global.custom_left_brush_index = -3
Global.current_left_brush_type = Global.Brush_Types.PIXEL
Global.left_brush_type_label.text = "Brush: Pixel"
# Global.left_brush_type_label.text = "Brush: Pixel"
Global.update_left_custom_brush()
if Global.custom_right_brush_index == custom_brush_index:
Global.custom_right_brush_index = -3
Global.current_right_brush_type = Global.Brush_Types.PIXEL
Global.right_brush_type_label.text = "Brush: Pixel"
# Global.right_brush_type_label.text = "Brush: Pixel"
Global.update_right_custom_brush()
var project_brush_index = custom_brush_index - Global.brushes_from_files

View file

@ -294,7 +294,24 @@ func _on_ImageDefaultHeight_value_changed(value: float) -> void:
Global.config_cache.set_value("preferences", "default_height", value)
Global.config_cache.save("user://cache.ini")
func _on_DefaultBackground_color_changed(color: Color) -> void:
Global.default_fill_color = color
Global.config_cache.set_value("preferences", "default_fill_color", color)
Global.config_cache.save("user://cache.ini")
func _on_LeftIndicatorCheckbox_toggled(button_pressed : bool) -> void:
Global.left_square_indicator_visible = button_pressed
func _on_RightIndicatorCheckbox_toggled(button_pressed : bool) -> void:
Global.right_square_indicator_visible = button_pressed
func _on_LeftToolIconCheckbox_toggled(button_pressed : bool) -> void:
Global.show_left_tool_icon = button_pressed
func _on_RightToolIconCheckbox_toggled(button_pressed : bool) -> void:
Global.show_right_tool_icon = button_pressed

View file

@ -189,14 +189,10 @@ var left_brush_type_container : Container
var right_brush_type_container : Container
var left_brush_type_button : BaseButton
var right_brush_type_button : BaseButton
var left_brush_type_label : Label
var right_brush_type_label : Label
var brushes_popup : Popup
var file_brush_container : GridContainer
var project_brush_container : GridContainer
var left_brush_size_container : Container
var right_brush_size_container : Container
var left_brush_size_edit : SpinBox
var left_brush_size_slider : HSlider
var right_brush_size_edit : SpinBox
@ -308,41 +304,37 @@ func _ready() -> void:
right_brush_type_container = find_node_by_name(right_tool_options_container, "RightBrushType")
left_brush_type_button = find_node_by_name(left_brush_type_container, "LeftBrushTypeButton")
right_brush_type_button = find_node_by_name(right_brush_type_container, "RightBrushTypeButton")
left_brush_type_label = find_node_by_name(left_brush_type_container, "LeftBrushTypeLabel")
right_brush_type_label = find_node_by_name(right_brush_type_container, "RightBrushTypeLabel")
brushes_popup = find_node_by_name(root, "BrushesPopup")
file_brush_container = find_node_by_name(brushes_popup, "FileBrushContainer")
project_brush_container = find_node_by_name(brushes_popup, "ProjectBrushContainer")
left_brush_size_container = find_node_by_name(left_tool_options_container, "LeftBrushSize")
right_brush_size_container = find_node_by_name(right_tool_options_container, "RightBrushSize")
left_brush_size_edit = find_node_by_name(left_brush_size_container, "LeftBrushSizeEdit")
left_brush_size_slider = find_node_by_name(left_brush_size_container, "LeftBrushSizeSlider")
right_brush_size_edit = find_node_by_name(right_brush_size_container, "RightBrushSizeEdit")
right_brush_size_slider = find_node_by_name(right_brush_size_container, "RightBrushSizeSlider")
left_brush_size_edit = find_node_by_name(root, "LeftBrushSizeEdit")
left_brush_size_slider = find_node_by_name(root, "LeftBrushSizeSlider")
right_brush_size_edit = find_node_by_name(root, "RightBrushSizeEdit")
right_brush_size_slider = find_node_by_name(root, "RightBrushSizeSlider")
left_color_interpolation_container = find_node_by_name(left_tool_options_container, "LeftColorInterpolation")
right_color_interpolation_container = find_node_by_name(right_tool_options_container, "RightColorInterpolation")
left_interpolate_spinbox = find_node_by_name(left_color_interpolation_container, "LeftInterpolateFactor")
left_interpolate_slider = find_node_by_name(left_color_interpolation_container, "LeftInterpolateSlider")
right_interpolate_spinbox = find_node_by_name(right_color_interpolation_container, "RightInterpolateFactor")
right_interpolate_slider = find_node_by_name(right_color_interpolation_container, "RightInterpolateSlider")
left_color_interpolation_container = find_node_by_name(root, "LeftColorInterpolation")
right_color_interpolation_container = find_node_by_name(root, "RightColorInterpolation")
left_interpolate_spinbox = find_node_by_name(root, "LeftInterpolateFactor")
left_interpolate_slider = find_node_by_name(root, "LeftInterpolateSlider")
right_interpolate_spinbox = find_node_by_name(root, "RightInterpolateFactor")
right_interpolate_slider = find_node_by_name(root, "RightInterpolateSlider")
left_fill_area_container = find_node_by_name(left_tool_options_container, "LeftFillArea")
right_fill_area_container = find_node_by_name(right_tool_options_container, "RightFillArea")
left_fill_area_container = find_node_by_name(root, "LeftFillArea")
right_fill_area_container = find_node_by_name(root, "RightFillArea")
left_ld_container = find_node_by_name(left_tool_options_container, "LeftLDOptions")
left_ld_amount_slider = find_node_by_name(left_ld_container, "LeftLDAmountSlider")
left_ld_amount_spinbox = find_node_by_name(left_ld_container, "LeftLDAmountSpinbox")
right_ld_container = find_node_by_name(right_tool_options_container, "RightLDOptions")
right_ld_amount_slider = find_node_by_name(right_ld_container, "RightLDAmountSlider")
right_ld_amount_spinbox = find_node_by_name(right_ld_container, "RightLDAmountSpinbox")
left_ld_container = find_node_by_name(root, "LeftLDOptions")
left_ld_amount_slider = find_node_by_name(root, "LeftLDAmountSlider")
left_ld_amount_spinbox = find_node_by_name(root, "LeftLDAmountSpinbox")
right_ld_container = find_node_by_name(root, "RightLDOptions")
right_ld_amount_slider = find_node_by_name(root, "RightLDAmountSlider")
right_ld_amount_spinbox = find_node_by_name(root, "RightLDAmountSpinbox")
left_colorpicker_container = find_node_by_name(left_tool_options_container, "LeftColorPickerOptions")
right_colorpicker_container = find_node_by_name(right_tool_options_container, "RightColorPickerOptions")
left_colorpicker_container = find_node_by_name(root, "LeftColorPickerOptions")
right_colorpicker_container = find_node_by_name(root, "RightColorPickerOptions")
left_mirror_container = find_node_by_name(left_tool_options_container, "LeftMirroring")
right_mirror_container = find_node_by_name(right_tool_options_container, "RightMirroring")
left_mirror_container = find_node_by_name(root, "LeftMirrorButtons")
right_mirror_container = find_node_by_name(root, "RightMirrorButtons")
animation_timeline = find_node_by_name(root, "AnimationTimeline")

View file

@ -169,8 +169,8 @@ func _ready() -> void:
Import.import_brushes("Brushes")
$MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton.get_picker().presets_visible = false
$MenuAndUI/UI/ToolPanel/Tools/ColorAndToolOptions/ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/RightColorPickerButton.get_picker().presets_visible = false
Global.left_color_picker.get_picker().presets_visible = false
Global.right_color_picker.get_picker().presets_visible = false
$QuitAndSaveDialog.add_button("Save & Exit", false, "Save")
$QuitAndSaveDialog.get_ok().text = "Exit without saving"
@ -626,19 +626,19 @@ func _on_Tool_pressed(tool_pressed : BaseButton, mouse_press := true, key_for_le
# Tool options visible depending on the selected tool
if current_action == "Pencil":
Global.left_brush_type_container.visible = true
Global.left_brush_size_container.visible = true
# Global.left_brush_size_container.visible = true
Global.left_mirror_container.visible = true
if Global.current_left_brush_type == Global.Brush_Types.FILE || Global.current_left_brush_type == Global.Brush_Types.CUSTOM || Global.current_left_brush_type == Global.Brush_Types.RANDOM_FILE:
Global.left_color_interpolation_container.visible = true
elif current_action == "Eraser":
Global.left_brush_type_container.visible = true
Global.left_brush_size_container.visible = true
# Global.left_brush_size_container.visible = true
Global.left_mirror_container.visible = true
elif current_action == "Bucket":
Global.left_fill_area_container.visible = true
Global.left_mirror_container.visible = true
elif current_action == "LightenDarken":
Global.left_brush_size_container.visible = true
# Global.left_brush_size_container.visible = true
Global.left_ld_container.visible = true
Global.left_mirror_container.visible = true
elif current_action == "ColorPicker":
@ -653,19 +653,19 @@ func _on_Tool_pressed(tool_pressed : BaseButton, mouse_press := true, key_for_le
# Tool options visible depending on the selected tool
if current_action == "Pencil":
Global.right_brush_type_container.visible = true
Global.right_brush_size_container.visible = true
# Global.right_brush_size_container.visible = true
Global.right_mirror_container.visible = true
if Global.current_right_brush_type == Global.Brush_Types.FILE || Global.current_right_brush_type == Global.Brush_Types.CUSTOM || Global.current_right_brush_type == Global.Brush_Types.RANDOM_FILE:
Global.right_color_interpolation_container.visible = true
elif current_action == "Eraser":
Global.right_brush_type_container.visible = true
Global.right_brush_size_container.visible = true
# Global.right_brush_size_container.visible = true
Global.right_mirror_container.visible = true
elif current_action == "Bucket":
Global.right_fill_area_container.visible = true
Global.right_mirror_container.visible = true
elif current_action == "LightenDarken":
Global.right_brush_size_container.visible = true
# Global.right_brush_size_container.visible = true
Global.right_ld_container.visible = true
Global.right_mirror_container.visible = true
elif current_action == "ColorPicker":
@ -685,17 +685,6 @@ func _on_Tool_pressed(tool_pressed : BaseButton, mouse_press := true, key_for_le
Global.left_cursor_tool_texture.create_from_image(load("res://Assets/Graphics/Tool Cursors/%s_Cursor.png" % Global.current_left_tool), 0)
Global.right_cursor_tool_texture.create_from_image(load("res://Assets/Graphics/Tool Cursors/%s_Cursor.png" % Global.current_right_tool), 0)
func _on_LeftIndicatorCheckbox_toggled(button_pressed) -> void:
Global.left_square_indicator_visible = button_pressed
func _on_RightIndicatorCheckbox_toggled(button_pressed) -> void:
Global.right_square_indicator_visible = button_pressed
func _on_LeftToolIconCheckbox_toggled(button_pressed) -> void:
Global.show_left_tool_icon = button_pressed
func _on_RightToolIconCheckbox_toggled(button_pressed) -> void:
Global.show_right_tool_icon = button_pressed
func _on_LeftBrushTypeButton_pressed() -> void:
Global.brushes_popup.popup(Rect2(Global.left_brush_type_button.rect_global_position, Vector2(226, 72)))