1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 09:39:48 +00:00
Pixelorama/src/UI/ColorAndToolOptions.gd
Manolis Papadeas c6b9a1fb82
Format code and add static checks (#599)
* gdformat .

* Lint code - Part 1

* Format code - Part 2

* Lint code - Part 2

Trying to fix the max allowed line length errors

* Add normal_map_invert_y to the image .import files

Because of Godot 3.4

* Do not call private methods outside of the script's scope

Lint code - Part 3

* Format code - Part 3

* Fixed more line length exceeded errors - Lint code Part 3

* Export array of licenses - Lint code part 4

* Clean hint_tooltip code from Global

Removes a lot of lines of code

* Create static-checks.yml

* Fix FreeType's license
2021-11-25 14:48:30 +02:00

41 lines
1 KiB
GDScript

extends VBoxContainer
onready var left_picker := $ColorPickersHorizontal/LeftColorPickerButton
onready var right_picker := $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
func _on_ColorSwitch_pressed() -> void:
Tools.swap_color()
func _on_ColorPickerButton_color_changed(color: Color, right: bool):
var button := BUTTON_RIGHT if right else BUTTON_LEFT
Tools.assign_color(color, button)
func _on_ColorPickerButton_pressed() -> void:
Global.can_draw = false
Tools.disconnect("color_changed", self, "update_color")
func _on_ColorPickerButton_popup_closed() -> void:
Global.can_draw = true
Tools.connect("color_changed", self, "update_color")
func _on_ColorDefaults_pressed() -> void:
Tools.default_color()
func update_color(color: Color, button: int) -> void:
if button == BUTTON_LEFT:
left_picker.color = color
else:
right_picker.color = color