[gd_scene load_steps=28 format=3 uid="uid://bfbragmmdwfbl"]

[ext_resource type="Script" path="res://src/UI/TilesPanel.gd" id="1_d2oc5"]
[ext_resource type="Texture2D" uid="uid://d4by47alul2qw" path="res://assets/graphics/tiles_panel/tiles_draw.png" id="2_h0p0x"]
[ext_resource type="Texture2D" uid="uid://bv7ldl8obhawm" path="res://assets/graphics/misc/icon_reload.png" id="2_r1kie"]
[ext_resource type="Texture2D" uid="uid://bpsfilx47bw3r" path="res://assets/graphics/misc/mirror_x.svg" id="3_5o62r"]
[ext_resource type="Texture2D" uid="uid://bk6iaxiyl74ih" path="res://assets/graphics/misc/mirror_y.svg" id="4_2xhnr"]
[ext_resource type="Texture2D" uid="uid://dfq0wpxsd51co" path="res://assets/graphics/tiles_panel/tiles_manual.png" id="6_gwj5u"]
[ext_resource type="Texture2D" uid="uid://7m4hln3mo2e5" path="res://assets/graphics/tiles_panel/tiles_auto.png" id="7_afsgi"]
[ext_resource type="Texture2D" uid="uid://uo1ikty26del" path="res://assets/graphics/tiles_panel/tiles_stack.png" id="8_yoaya"]
[ext_resource type="Texture2D" uid="uid://dwoilatxfh1s7" path="res://assets/graphics/misc/options.png" id="9_macrc"]
[ext_resource type="Script" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="10_wfr6s"]

[sub_resource type="InputEventAction" id="InputEventAction_klv67"]
action = &"toggle_draw_tiles_mode"

[sub_resource type="Shortcut" id="Shortcut_6ebuw"]
events = [SubResource("InputEventAction_klv67")]

[sub_resource type="InputEventAction" id="InputEventAction_yr0lx"]
action = &"tile_rotate_left"

[sub_resource type="Shortcut" id="Shortcut_yas23"]
events = [SubResource("InputEventAction_yr0lx")]

[sub_resource type="InputEventAction" id="InputEventAction_g6d5p"]
action = &"tile_rotate_right"

[sub_resource type="Shortcut" id="Shortcut_cmy2w"]
events = [SubResource("InputEventAction_g6d5p")]

[sub_resource type="InputEventAction" id="InputEventAction_yh67l"]
action = &"tile_flip_horizontal"

[sub_resource type="Shortcut" id="Shortcut_ouoxo"]
events = [SubResource("InputEventAction_yh67l")]

[sub_resource type="InputEventAction" id="InputEventAction_18g3a"]
action = &"tile_flip_vertical"

[sub_resource type="Shortcut" id="Shortcut_jj4yy"]
events = [SubResource("InputEventAction_18g3a")]

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

[sub_resource type="InputEventAction" id="InputEventAction_mhgo3"]
action = &"tile_edit_mode_manual"

[sub_resource type="Shortcut" id="Shortcut_pgg48"]
events = [SubResource("InputEventAction_mhgo3")]

[sub_resource type="InputEventAction" id="InputEventAction_h1wos"]
action = &"tile_edit_mode_auto"

[sub_resource type="Shortcut" id="Shortcut_a0fx5"]
events = [SubResource("InputEventAction_h1wos")]

[sub_resource type="InputEventAction" id="InputEventAction_i4ufh"]
action = &"tile_edit_mode_stack"

[sub_resource type="Shortcut" id="Shortcut_ysxej"]
events = [SubResource("InputEventAction_i4ufh")]

[node name="Tiles" type="PanelContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_d2oc5")

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

[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
layout_mode = 2

[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MarginContainer"]
layout_mode = 2

[node name="Buttons" type="HBoxContainer" parent="VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="PlaceTiles" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(25, 25)
layout_mode = 2
size_flags_vertical = 0
tooltip_text = "Draw tiles"
mouse_default_cursor_shape = 2
toggle_mode = true
shortcut = SubResource("Shortcut_6ebuw")

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/PlaceTiles"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_h0p0x")
expand_mode = 1
stretch_mode = 3

[node name="VSeparator" type="VSeparator" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons"]
layout_mode = 2

[node name="TransformButtonsContainer" type="HFlowContainer" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons"]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_horizontal = 3

[node name="RotateLeftButton" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Rotate tile left (counterclockwise)"
mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_yas23")

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer/RotateLeftButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_r1kie")
stretch_mode = 3

[node name="RotateRightButton" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Rotate tile right (clockwise)"
mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_cmy2w")

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer/RotateRightButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_r1kie")
stretch_mode = 3
flip_h = true

[node name="FlipHorizontalButton" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Flip tile horizontally"
mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_ouoxo")

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer/FlipHorizontalButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("3_5o62r")
stretch_mode = 3

[node name="FlipVerticalButton" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Flip tile vertically"
mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_jj4yy")

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer/FlipVerticalButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("4_2xhnr")
stretch_mode = 3

[node name="ModeButtonsContainer" type="HFlowContainer" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3

[node name="Manual" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Manual"
mouse_default_cursor_shape = 2
toggle_mode = true
button_group = SubResource("ButtonGroup_uxnt0")
shortcut = SubResource("Shortcut_pgg48")

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Manual"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("6_gwj5u")
expand_mode = 1
stretch_mode = 3

[node name="Auto" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Auto"
mouse_default_cursor_shape = 2
toggle_mode = true
button_pressed = true
button_group = SubResource("ButtonGroup_uxnt0")
shortcut = SubResource("Shortcut_a0fx5")

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Auto"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("7_afsgi")
expand_mode = 1
stretch_mode = 3

[node name="Stack" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Stack"
mouse_default_cursor_shape = 2
toggle_mode = true
button_group = SubResource("ButtonGroup_uxnt0")
shortcut = SubResource("Shortcut_ysxej")

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Stack"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("8_yoaya")
expand_mode = 1
stretch_mode = 3

[node name="OptionButton" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
size_flags_vertical = 4
mouse_default_cursor_shape = 2

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/OptionButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("9_macrc")
expand_mode = 1
stretch_mode = 3

[node name="HSeparator" type="HSeparator" parent="VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="Tip" type="Label" parent="VBoxContainer/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(20, 0)
layout_mode = 2
autowrap_mode = 3

[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/MarginContainer/VBoxContainer"]
layout_mode = 2

[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3

[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="TileButtonContainer" type="HFlowContainer" parent="VBoxContainer/ScrollContainer/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2

[node name="Options" type="Popup" parent="."]
position = Vector2i(0, 36)
size = Vector2i(210, 100)
unresizable = false
borderless = false

[node name="MarginContainer" type="MarginContainer" parent="Options"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="ScrollContainer" type="ScrollContainer" parent="Options/MarginContainer"]
layout_mode = 2

[node name="GridContainer" type="GridContainer" parent="Options/MarginContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
columns = 2

[node name="TileSizeLabel" type="Label" parent="Options/MarginContainer/ScrollContainer/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Tile button size:"

[node name="TileSizeSlider" type="TextureProgressBar" parent="Options/MarginContainer/ScrollContainer/GridContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
min_value = 36.0
max_value = 144.0
value = 36.0
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("10_wfr6s")

[node name="ShowEmptyTileLabel" type="Label" parent="Options/MarginContainer/ScrollContainer/GridContainer"]
layout_mode = 2
text = "Show empty tile:"

[node name="ShowEmptyTile" type="CheckBox" parent="Options/MarginContainer/ScrollContainer/GridContainer"]
layout_mode = 2
mouse_default_cursor_shape = 2
button_pressed = true
text = "On"

[node name="TileButtonPopupMenu" type="PopupMenu" parent="."]
item_count = 2
item_0/text = "Properties"
item_1/text = "Delete"
item_1/id = 1

[node name="TileProperties" type="AcceptDialog" parent="."]
title = "Tile properties"
size = Vector2i(300, 200)

[node name="GridContainer" type="GridContainer" parent="TileProperties"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -49.0
grow_horizontal = 2
grow_vertical = 2
columns = 2

[node name="TileProbabilityLabel" type="Label" parent="TileProperties/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Probability:"

[node name="TileProbabilitySlider" type="TextureProgressBar" parent="TileProperties/GridContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
max_value = 10.0
step = 0.001
value = 1.0
allow_greater = true
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("10_wfr6s")

[node name="TileUserDataLabel" type="Label" parent="TileProperties/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "User data:"

[node name="TileUserDataTextEdit" type="TextEdit" parent="TileProperties/GridContainer"]
unique_name_in_owner = true
layout_mode = 2
scroll_fit_content_height = true

[connection signal="toggled" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/PlaceTiles" to="." method="_on_place_tiles_toggled"]
[connection signal="pressed" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer/RotateLeftButton" to="." method="_on_rotate_pressed" binds= [false]]
[connection signal="pressed" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer/RotateRightButton" to="." method="_on_rotate_pressed" binds= [true]]
[connection signal="pressed" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer/FlipHorizontalButton" to="." method="_on_flip_horizontal_button_pressed"]
[connection signal="pressed" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/TransformButtonsContainer/FlipVerticalButton" to="." method="_on_flip_vertical_button_pressed"]
[connection signal="toggled" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Manual" to="." method="_on_manual_toggled"]
[connection signal="toggled" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Auto" to="." method="_on_auto_toggled"]
[connection signal="toggled" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Stack" to="." method="_on_stack_toggled"]
[connection signal="pressed" from="VBoxContainer/MarginContainer/VBoxContainer/Buttons/OptionButton" to="." method="_on_option_button_pressed"]
[connection signal="value_changed" from="Options/MarginContainer/ScrollContainer/GridContainer/TileSizeSlider" to="." method="_on_tile_size_slider_value_changed"]
[connection signal="toggled" from="Options/MarginContainer/ScrollContainer/GridContainer/ShowEmptyTile" to="." method="_on_show_empty_tile_toggled"]
[connection signal="index_pressed" from="TileButtonPopupMenu" to="." method="_on_tile_button_popup_menu_index_pressed"]
[connection signal="value_changed" from="TileProperties/GridContainer/TileProbabilitySlider" to="." method="_on_tile_probability_slider_value_changed"]
[connection signal="text_changed" from="TileProperties/GridContainer/TileUserDataTextEdit" to="." method="_on_tile_user_data_text_edit_text_changed"]
