2020-05-19 00:51:16 +00:00
|
|
|
extends VBoxContainer
|
|
|
|
|
|
|
|
|
2020-07-09 12:22:17 +00:00
|
|
|
onready var left_picker := $ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton
|
|
|
|
onready var right_picker := $ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/RightColorPickerButton
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
Tools.connect("color_changed", self, "update_color")
|
|
|
|
left_picker.get_picker().presets_visible = false
|
|
|
|
right_picker.get_picker().presets_visible = false
|
2020-05-19 00:51:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_ColorSwitch_pressed() -> void:
|
2020-07-09 12:22:17 +00:00
|
|
|
Tools.swap_color()
|
2020-05-19 00:51:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_ColorPickerButton_color_changed(color : Color, right : bool):
|
2020-07-09 12:22:17 +00:00
|
|
|
var button := BUTTON_RIGHT if right else BUTTON_LEFT
|
|
|
|
Tools.assign_color(color, button)
|
2020-05-19 00:51:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_ColorPickerButton_pressed() -> void:
|
|
|
|
Global.can_draw = false
|
|
|
|
|
|
|
|
|
|
|
|
func _on_ColorPickerButton_popup_closed() -> void:
|
|
|
|
Global.can_draw = true
|
|
|
|
|
|
|
|
|
|
|
|
func _on_ColorDefaults_pressed() -> void:
|
2020-07-09 12:22:17 +00:00
|
|
|
Tools.default_color()
|
2020-05-19 00:51:16 +00:00
|
|
|
|
|
|
|
|
2020-07-09 12:22:17 +00:00
|
|
|
func update_color(color : Color, button : int) -> void:
|
|
|
|
if button == BUTTON_LEFT:
|
|
|
|
left_picker.color = color
|
2020-05-19 00:51:16 +00:00
|
|
|
else:
|
2020-07-09 12:22:17 +00:00
|
|
|
right_picker.color = color
|