[gd_scene load_steps=9 format=3 uid="uid://ubyatap3sylf"]

[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/Sliders/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/BaseDraw.gd" id="3"]
[ext_resource type="Script" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="3_76bek"]
[ext_resource type="Script" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="5_kdxku"]

[sub_resource type="ButtonGroup" id="ButtonGroup_7u3x0"]
resource_name = "rotate"
allow_unpress = true

[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

[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

[node name="ToolOptions" instance=ExtResource("2")]
script = ExtResource("3")

[node name="RotationOptions" type="VBoxContainer" parent="." index="2"]
visible = false
layout_mode = 2
theme_type_variation = &"CollapsibleContainer"
script = ExtResource("3_76bek")
text = "Rotation options"
flat = true

[node name="GridContainer" type="GridContainer" parent="RotationOptions" index="1"]
visible = false
layout_mode = 2
columns = 2

[node name="FlipLabel" type="Label" parent="RotationOptions/GridContainer" index="0"]
layout_mode = 2
text = "Flip:"

[node name="Flip" type="HBoxContainer" parent="RotationOptions/GridContainer" index="1"]
layout_mode = 2
size_flags_horizontal = 3

[node name="FlipX" type="CheckBox" parent="RotationOptions/GridContainer/Flip" index="0"]
unique_name_in_owner = true
layout_mode = 2
mouse_default_cursor_shape = 2
text = "X"

[node name="FlipY" type="CheckBox" parent="RotationOptions/GridContainer/Flip" index="1"]
unique_name_in_owner = true
layout_mode = 2
mouse_default_cursor_shape = 2
text = "Y"

[node name="RotateLabel" type="Label" parent="RotationOptions/GridContainer" index="2"]
layout_mode = 2
size_flags_vertical = 0
text = "Rotate:"

[node name="Rotate" type="HFlowContainer" parent="RotationOptions/GridContainer" index="3"]
layout_mode = 2
size_flags_horizontal = 3

[node name="Rotate90" type="CheckBox" parent="RotationOptions/GridContainer/Rotate" index="0"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "rotate the brush 90 degrees"
mouse_default_cursor_shape = 2
button_group = SubResource("ButtonGroup_7u3x0")
text = "90°"

[node name="Rotate180" type="CheckBox" parent="RotationOptions/GridContainer/Rotate" index="1"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "rotate the brush 180 degrees"
mouse_default_cursor_shape = 2
button_group = SubResource("ButtonGroup_7u3x0")
text = "180°"

[node name="Rotate270" type="CheckBox" parent="RotationOptions/GridContainer/Rotate" index="2"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "rotate the brush 270 degrees"
mouse_default_cursor_shape = 2
button_group = SubResource("ButtonGroup_7u3x0")
text = "270°"

[node name="Brush" type="HBoxContainer" parent="." index="3"]
layout_mode = 2
alignment = 1

[node name="Type" type="Button" parent="Brush" 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/focus = SubResource("2")
theme_override_styles/disabled = SubResource("2")
theme_override_styles/hover = SubResource("1")
theme_override_styles/pressed = SubResource("1")
theme_override_styles/normal = SubResource("1")

[node name="Texture" type="TextureRect" parent="Brush/Type" index="0"]
layout_mode = 0
offset_right = 32.0
offset_bottom = 32.0
expand_mode = 1
stretch_mode = 5

[node name="BrushSize" parent="Brush" index="1" instance=ExtResource("1")]
layout_mode = 2
min_value = 1.0
max_value = 25.0
value = 1.0
allow_greater = true
prefix = "Size:"
suffix = "px"
global_increment_action = "brush_size_increment"
global_decrement_action = "brush_size_decrement"

[node name="DensityValueSlider" type="TextureProgressBar" parent="." index="4"]
visible = false
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
focus_mode = 2
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
min_value = 1.0
value = 100.0
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("5_kdxku")
prefix = "Density:"
suffix = "%"

[node name="ColorInterpolation" parent="." index="5" instance=ExtResource("1")]
visible = false
layout_mode = 2
tooltip_text = "0: Color from the brush itself, 100: the currently selected color"
prefix = "Brush color from:"

[connection signal="toggled" from="RotationOptions/GridContainer/Flip/FlipX" to="." method="_on_flip_x_toggled"]
[connection signal="toggled" from="RotationOptions/GridContainer/Flip/FlipY" to="." method="_on_flip_y_toggled"]
[connection signal="toggled" from="RotationOptions/GridContainer/Rotate/Rotate90" to="." method="_on_rotate_90_toggled"]
[connection signal="toggled" from="RotationOptions/GridContainer/Rotate/Rotate180" to="." method="_on_rotate_180_toggled"]
[connection signal="toggled" from="RotationOptions/GridContainer/Rotate/Rotate270" to="." method="_on_rotate_270_toggled"]
[connection signal="pressed" from="Brush/Type" to="." method="_on_BrushType_pressed"]
[connection signal="value_changed" from="Brush/BrushSize" to="." method="_on_BrushSize_value_changed"]
[connection signal="value_changed" from="DensityValueSlider" to="." method="_on_density_value_slider_value_changed"]
[connection signal="value_changed" from="ColorInterpolation" to="." method="_on_InterpolateFactor_value_changed"]
