[gd_scene load_steps=6 format=3 uid="uid://bbvvkrrjyxugo"]

[ext_resource type="PackedScene" path="res://src/UI/Nodes/ValueSlider.tscn" id="1"]
[ext_resource type="PackedScene" uid="uid://ctfgfelg0sho8" path="res://src/Tools/BaseTool.tscn" id="2"]
[ext_resource type="Script" path="res://src/Tools/Bucket.gd" id="3"]

[sub_resource type="StyleBoxFlat" id="1"]
bg_color = Color(1, 1, 1, 1)
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
anti_aliasing = false

[sub_resource type="StyleBoxFlat" id="2"]
bg_color = Color(1, 1, 1, 1)
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
anti_aliasing = false

[node name="ToolOptions" instance=ExtResource("2")]
offset_right = 138.0
offset_bottom = 105.0
script = ExtResource("3")

[node name="FillArea" type="Label" parent="." index="2"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
text = "Fill area:"

[node name="FillAreaOptions" type="OptionButton" parent="." index="3"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
item_count = 3
selected = 0
popup/item_0/text = "Similar area"
popup/item_0/id = 0
popup/item_1/text = "Similar colors"
popup/item_1/id = 1
popup/item_2/text = "Whole selection"
popup/item_2/id = 2

[node name="SimilaritySlider" parent="." index="4" instance=ExtResource("1")]
visible = false
layout_mode = 2
focus_mode = 2
theme_type_variation = &"ValueSlider"
value = 100.0
prefix = "Similarity:"

[node name="FillWith" type="Label" parent="." index="5"]
layout_mode = 2
size_flags_horizontal = 3
text = "Fill with:"

[node name="FillWithOptions" type="OptionButton" parent="." index="6"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
item_count = 2
selected = 0
popup/item_0/text = "Selected color"
popup/item_0/id = 0
popup/item_1/text = "Pattern"
popup/item_1/id = 1

[node name="FillPattern" type="VBoxContainer" parent="." index="7"]
visible = false
layout_mode = 2
size_flags_horizontal = 3

[node name="Type" type="Button" parent="FillPattern" index="0"]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 0
tooltip_text = "Select a brush"
mouse_default_cursor_shape = 2
theme_override_styles/normal = SubResource("1")
theme_override_styles/hover = SubResource("1")
theme_override_styles/pressed = SubResource("1")
theme_override_styles/disabled = SubResource("2")
theme_override_styles/focus = SubResource("2")

[node name="Texture2D" type="TextureRect" parent="FillPattern/Type" index="0"]
layout_mode = 0
offset_right = 32.0
offset_bottom = 32.0
expand_mode = 1
stretch_mode = 6

[node name="OffsetX" parent="FillPattern" index="1" instance=ExtResource("1")]
layout_mode = 2
focus_mode = 2
theme_type_variation = &"ValueSlider"
prefix = "Offset X:"

[node name="OffsetY" parent="FillPattern" index="2" instance=ExtResource("1")]
layout_mode = 2
focus_mode = 2
theme_type_variation = &"ValueSlider"
prefix = "Offset Y:"

[connection signal="item_selected" from="FillAreaOptions" to="." method="_on_FillAreaOptions_item_selected"]
[connection signal="value_changed" from="SimilaritySlider" to="." method="_on_SimilaritySlider_value_changed"]
[connection signal="item_selected" from="FillWithOptions" to="." method="_on_FillWithOptions_item_selected"]
[connection signal="pressed" from="FillPattern/Type" to="." method="_on_PatternType_pressed"]
[connection signal="value_changed" from="FillPattern/OffsetX" to="." method="_on_PatternOffsetX_value_changed"]
[connection signal="value_changed" from="FillPattern/OffsetY" to="." method="_on_PatternOffsetY_value_changed"]
