[gd_scene load_steps=13 format=3 uid="uid://c3vcvhh4d8hd7"]

[ext_resource type="Script" path="res://src/UI/ColorPickers/ColorPicker.gd" id="1_r8ot0"]
[ext_resource type="Texture2D" uid="uid://d0v821l01w7go" path="res://assets/graphics/misc/color_switch.png" id="2_ojj3i"]
[ext_resource type="PackedScene" uid="uid://3pmb60gpst7b" path="res://src/UI/Nodes/TransparentChecker.tscn" id="3_vjkb0"]
[ext_resource type="Shader" path="res://src/Shaders/TransparentChecker.gdshader" id="4_oxnnt"]
[ext_resource type="Texture2D" uid="uid://ct8wn8m6x4m54" path="res://assets/graphics/misc/value_arrow.svg" id="6_b86m2"]
[ext_resource type="Texture2D" uid="uid://bhkmiijflfqxx" path="res://assets/graphics/misc/value_arrow_up.svg" id="7_p4te3"]

[sub_resource type="ButtonGroup" id="ButtonGroup_02x7w"]

[sub_resource type="InputEventAction" id="InputEventAction_5llr2"]
action = &"switch_colors"

[sub_resource type="Shortcut" id="19"]
events = [SubResource("InputEventAction_5llr2")]

[sub_resource type="ShaderMaterial" id="1"]
shader = ExtResource("4_oxnnt")
shader_parameter/size = 10.0
shader_parameter/alpha = 1.0
shader_parameter/color1 = Color(0.7, 0.7, 0.7, 1)
shader_parameter/color2 = Color(1, 1, 1, 1)
shader_parameter/offset = Vector2(0, 0)
shader_parameter/scale = Vector2(0, 0)
shader_parameter/rect_size = Vector2(0, 0)
shader_parameter/follow_movement = false
shader_parameter/follow_scale = false

[sub_resource type="InputEventAction" id="InputEventAction_nptxe"]
action = &"reset_colors_default"

[sub_resource type="Shortcut" id="Shortcut_uay2n"]
events = [SubResource("InputEventAction_nptxe")]

[node name="ColorPicker" type="PanelContainer"]
offset_right = 312.0
offset_bottom = 358.0
script = ExtResource("1_r8ot0")

[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 2

[node name="VerticalContainer" type="VBoxContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = -6
alignment = 1

[node name="ColorPicker" type="ColorPicker" parent="ScrollContainer/VerticalContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
can_add_swatches = false
color_modes_visible = false
sliders_visible = false
hex_visible = false
presets_visible = false

[node name="ColorButtons" type="HBoxContainer" parent="ScrollContainer/VerticalContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
alignment = 1

[node name="LeftColorButton" type="Button" parent="ScrollContainer/VerticalContainer/ColorButtons"]
custom_minimum_size = Vector2(42, 32)
layout_mode = 2
size_flags_vertical = 4
tooltip_text = "Choose a color for the left tool"
mouse_default_cursor_shape = 2
toggle_mode = true
button_pressed = true
button_group = SubResource("ButtonGroup_02x7w")

[node name="LeftColorRect" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/LeftColorButton"]
unique_name_in_owner = true
layout_mode = 0
offset_left = 2.0
offset_top = 2.0
offset_right = 40.0
offset_bottom = 30.0
mouse_filter = 2
color = Color(0, 0, 0, 1)
metadata/_edit_lock_ = true

[node name="ColorSwitch" type="TextureButton" parent="ScrollContainer/VerticalContainer/ColorButtons" groups=["UIButtons"]]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
tooltip_text = "Switch left and right colors."
mouse_default_cursor_shape = 2
shortcut = SubResource("19")
texture_normal = ExtResource("2_ojj3i")

[node name="RightColorButton" type="Button" parent="ScrollContainer/VerticalContainer/ColorButtons"]
custom_minimum_size = Vector2(42, 32)
layout_mode = 2
size_flags_vertical = 4
tooltip_text = "Choose a color for the right tool"
mouse_default_cursor_shape = 2
toggle_mode = true
button_group = SubResource("ButtonGroup_02x7w")

[node name="RightColorRect" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/RightColorButton"]
unique_name_in_owner = true
layout_mode = 0
offset_left = 2.0
offset_top = 2.0
offset_right = 40.0
offset_bottom = 30.0
mouse_filter = 2
metadata/_edit_lock_ = true

[node name="ColorButtonsVertical" type="VBoxContainer" parent="ScrollContainer/VerticalContainer/ColorButtons"]
layout_mode = 2
theme_override_constants/separation = 2
alignment = 1

[node name="CopyAverage" type="Button" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical"]
custom_minimum_size = Vector2(15, 15)
layout_mode = 2
size_flags_horizontal = 4
mouse_default_cursor_shape = 2
button_mask = 3

[node name="AverageColor" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage"]
unique_name_in_owner = true
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -5.5
offset_top = -5.5
offset_right = 5.5
offset_bottom = 5.5
mouse_filter = 2
metadata/_edit_lock_ = true

[node name="TransparentChecker" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage/AverageColor" instance=ExtResource("3_vjkb0")]
unique_name_in_owner = true
show_behind_parent = true
material = SubResource("1")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
metadata/_edit_lock_ = true

[node name="ColorDefaults" type="Button" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical"]
custom_minimum_size = Vector2(15, 15)
layout_mode = 2
size_flags_horizontal = 4
tooltip_text = "Reset the colors to their default state (black for left, white for right)"
mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_uay2n")

[node name="ColorRectBlack" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/ColorDefaults"]
layout_mode = 0
offset_left = 2.0
offset_top = 2.0
offset_right = 7.0
offset_bottom = 13.0
mouse_filter = 2
color = Color(0, 0, 0, 1)

[node name="ColorRectWhite" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/ColorDefaults"]
layout_mode = 0
offset_left = 8.0
offset_top = 2.0
offset_right = 13.0
offset_bottom = 13.0
mouse_filter = 2

[node name="ExpandButton" type="TextureButton" parent="ScrollContainer/VerticalContainer" groups=["UIButtons"]]
layout_mode = 2
size_flags_horizontal = 4
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource("6_b86m2")
texture_pressed = ExtResource("7_p4te3")

[connection signal="color_changed" from="ScrollContainer/VerticalContainer/ColorPicker" to="." method="_on_color_picker_color_changed"]
[connection signal="toggled" from="ScrollContainer/VerticalContainer/ColorButtons/LeftColorButton" to="." method="_on_left_color_button_toggled"]
[connection signal="pressed" from="ScrollContainer/VerticalContainer/ColorButtons/ColorSwitch" to="." method="_on_ColorSwitch_pressed"]
[connection signal="button_down" from="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage" to="." method="_on_CopyAverage_button_down"]
[connection signal="button_up" from="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage" to="." method="_on_CopyAverage_button_up"]
[connection signal="gui_input" from="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage" to="." method="_on_copy_average_gui_input"]
[connection signal="pressed" from="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/ColorDefaults" to="." method="_on_ColorDefaults_pressed"]
[connection signal="toggled" from="ScrollContainer/VerticalContainer/ExpandButton" to="." method="_on_expand_button_toggled"]
