[gd_scene load_steps=32 format=3 uid="uid://de8b6h6ieal7r"]

[ext_resource type="Script" uid="uid://ynajlxcomlkc" path="res://addons/better-terrain/editor/Dock.gd" id="1_raoha"]
[ext_resource type="Texture2D" uid="uid://c6lxq2y7mpb18" path="res://addons/better-terrain/icons/EditType.svg" id="2_cpm2t"]
[ext_resource type="Texture2D" uid="uid://y3xy6qdckht6" path="res://addons/better-terrain/icons/Replace.svg" id="2_fvmt6"]
[ext_resource type="Texture2D" uid="uid://bo2cjv08jkvf8" path="res://addons/better-terrain/icons/EditTerrain.svg" id="3_pqb1p"]
[ext_resource type="Texture2D" uid="uid://b0es228gfcykd" path="res://addons/better-terrain/icons/Warning.svg" id="4_6ahwe"]
[ext_resource type="Script" uid="uid://cpm7dq6r0n0sn" path="res://addons/better-terrain/editor/TileView.gd" id="4_nqppq"]
[ext_resource type="Texture2D" uid="uid://co6gwwmog0pjy" path="res://addons/better-terrain/icons/EditSymmetry.svg" id="5_kfjwu"]
[ext_resource type="Texture2D" uid="uid://cs4mdmluiydj6" path="res://addons/better-terrain/icons/ShuffleRandom.svg" id="5_n3owo"]
[ext_resource type="Texture2D" uid="uid://5hm3bfj3dvej" path="res://addons/better-terrain/icons/SymmetryMirror.svg" id="6_mofuh"]
[ext_resource type="Texture2D" uid="uid://dqmc1jp56or8m" path="res://addons/better-terrain/icons/SymmetryFlip.svg" id="7_ojxs0"]
[ext_resource type="Texture2D" uid="uid://cxoewno1cefua" path="res://addons/better-terrain/icons/SymmetryReflect.svg" id="8_8dhyg"]
[ext_resource type="Texture2D" uid="uid://baxhjy28r1iqj" path="res://addons/better-terrain/icons/SymmetryRotateClockwise.svg" id="9_tq76a"]
[ext_resource type="Texture2D" uid="uid://csbwdkr6bc2db" path="res://addons/better-terrain/icons/SymmetryRotateCounterClockwise.svg" id="10_o5h1f"]
[ext_resource type="Texture2D" uid="uid://8mcycyl3e66r" path="res://addons/better-terrain/icons/SymmetryRotate180.svg" id="11_m6syp"]
[ext_resource type="Texture2D" uid="uid://b7fx4mk18lmls" path="res://addons/better-terrain/icons/SymmetryRotateAll.svg" id="12_11vru"]
[ext_resource type="Texture2D" uid="uid://cyjra4g05dwh" path="res://addons/better-terrain/icons/SymmetryAll.svg" id="13_lp5m2"]

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

[sub_resource type="InputEventKey" id="InputEventKey_saph6"]
device = -1
keycode = 68
unicode = 100

[sub_resource type="Shortcut" id="Shortcut_3k2al"]
events = [SubResource("InputEventKey_saph6")]

[sub_resource type="SVGTexture" id="SVGTexture_nkf6h"]
_source = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\"><path fill=\"#ff5d5d\" d=\"M2 1v8.586l1.293-1.293a1 1 0 0 1 1.414 0L7 10.587l2.293-2.293a1 1 0 0 1 1.414 0L13 10.586l1-1V6H9V1H2zm8 0v4h4zm-6 9.414-2 2V15h12v-2.586l-.293.293a1 1 0 0 1-1.414 0L10 10.414l-2.293 2.293a1 1 0 0 1-1.414 0L4 10.414z\"/></svg>
"

[sub_resource type="InputEventKey" id="InputEventKey_q1v0d"]
device = -1
keycode = 76
unicode = 108

[sub_resource type="Shortcut" id="Shortcut_wc6bu"]
events = [SubResource("InputEventKey_q1v0d")]

[sub_resource type="InputEventKey" id="InputEventKey_68n3h"]
device = -1
keycode = 82
unicode = 114

[sub_resource type="InputEventKey" id="InputEventKey_qcu1e"]
device = -1
keycode = 67
unicode = 99

[sub_resource type="Shortcut" id="Shortcut_tcjet"]
events = [SubResource("InputEventKey_68n3h"), SubResource("InputEventKey_qcu1e")]

[sub_resource type="InputEventKey" id="InputEventKey_grxy4"]
device = -1
keycode = 66
unicode = 98

[sub_resource type="Shortcut" id="Shortcut_46fac"]
events = [SubResource("InputEventKey_grxy4")]

[sub_resource type="InputEventKey" id="InputEventKey_xd61m"]
device = -1
keycode = 80
unicode = 112

[sub_resource type="Shortcut" id="Shortcut_uwwa1"]
events = [SubResource("InputEventKey_xd61m")]

[sub_resource type="ButtonGroup" id="ButtonGroup_3wrxn"]
allow_unpress = true

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mpeb7"]
bg_color = Color(0, 0, 0, 0.4)

[node name="Dock" type="Control" node_paths=PackedStringArray("shortcut_context")]
custom_minimum_size = Vector2(0, 100)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
focus_mode = 2
shortcut_context = NodePath(".")
script = ExtResource("1_raoha")

[node name="VBox" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Toolbar" type="HBoxContainer" parent="VBox"]
layout_mode = 2

[node name="Draw" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Draw terrain
Shift: Draw line.
Ctrl/Cmd+Shift: Draw rectangle."
toggle_mode = true
button_pressed = true
button_group = SubResource("ButtonGroup_aon7c")
shortcut = SubResource("Shortcut_3k2al")
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="Line" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Draw line"
toggle_mode = true
button_group = SubResource("ButtonGroup_aon7c")
shortcut = SubResource("Shortcut_wc6bu")
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="Rectangle" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Fill a rectangle of terrain"
toggle_mode = true
button_group = SubResource("ButtonGroup_aon7c")
shortcut = SubResource("Shortcut_tcjet")
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="Fill" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Bucket fill terrain"
toggle_mode = true
button_group = SubResource("ButtonGroup_aon7c")
shortcut = SubResource("Shortcut_46fac")
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="Replace" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Toggle replace mode"
toggle_mode = true
shortcut = SubResource("Shortcut_uwwa1")
icon = ExtResource("2_fvmt6")

[node name="VSeparator" type="VSeparator" parent="VBox/Toolbar"]
layout_mode = 2

[node name="SelectTiles" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Select"
toggle_mode = true
button_group = SubResource("ButtonGroup_3wrxn")
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="PaintType" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Paint terrain types"
toggle_mode = true
button_group = SubResource("ButtonGroup_3wrxn")
icon = ExtResource("2_cpm2t")
flat = true

[node name="PaintTerrain" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Paint terrain connecting types"
toggle_mode = true
button_group = SubResource("ButtonGroup_3wrxn")
icon = ExtResource("3_pqb1p")
flat = true

[node name="PaintSymmetry" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Paint tile symmetry"
toggle_mode = true
button_group = SubResource("ButtonGroup_3wrxn")
icon = ExtResource("5_kfjwu")
flat = true

[node name="SymmetryOptions" type="OptionButton" parent="VBox/Toolbar"]
visible = false
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
selected = 0
item_count = 9
popup/item_0/text = "No symmetry"
popup/item_0/id = 8
popup/item_1/text = "Mirror"
popup/item_1/icon = ExtResource("6_mofuh")
popup/item_1/id = 1
popup/item_2/text = "Flip"
popup/item_2/icon = ExtResource("7_ojxs0")
popup/item_2/id = 1
popup/item_3/text = "Reflect"
popup/item_3/icon = ExtResource("8_8dhyg")
popup/item_3/id = 2
popup/item_4/text = "Rotate clockwise"
popup/item_4/icon = ExtResource("9_tq76a")
popup/item_4/id = 3
popup/item_5/text = "Rotate counter-clockwise"
popup/item_5/icon = ExtResource("10_o5h1f")
popup/item_5/id = 4
popup/item_6/text = "Rotate 180"
popup/item_6/icon = ExtResource("11_m6syp")
popup/item_6/id = 5
popup/item_7/text = "All rotations"
popup/item_7/icon = ExtResource("12_11vru")
popup/item_7/id = 6
popup/item_8/text = "All reflections & rotations"
popup/item_8/icon = ExtResource("13_lp5m2")
popup/item_8/id = 7

[node name="VSeparator3" type="VSeparator" parent="VBox/Toolbar"]
layout_mode = 2

[node name="ZoomContainer" type="VBoxContainer" parent="VBox/Toolbar"]
layout_mode = 2
alignment = 1

[node name="Sources" type="MenuBar" parent="VBox/Toolbar"]
layout_mode = 2

[node name="Sources" type="PopupMenu" parent="VBox/Toolbar/Sources"]
auto_translate_mode = 2
auto_translate = false
hide_on_item_selection = false
hide_on_checkable_item_selection = false

[node name="Spacer" type="Control" parent="VBox/Toolbar"]
layout_mode = 2
size_flags_horizontal = 3

[node name="ShuffleRandom" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Shuffle random tiles each update"
toggle_mode = true
icon = ExtResource("5_n3owo")
flat = true

[node name="Clean" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
text = "Clean tile data"
icon = ExtResource("4_6ahwe")

[node name="VSeparator2" type="VSeparator" parent="VBox/Toolbar"]
layout_mode = 2

[node name="LayerUp" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Select previous layer"
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="LayerDown" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Select next layer"
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="LayerHighlight" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Highlight selected layer"
toggle_mode = true
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="LayerGrid" type="Button" parent="VBox/Toolbar"]
layout_mode = 2
tooltip_text = "Toggle grid visibility"
toggle_mode = true
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="HSplit" type="HSplitContainer" parent="VBox"]
layout_mode = 2
size_flags_vertical = 3
split_offset = 325

[node name="Terrains" type="VBoxContainer" parent="VBox/HSplit"]
layout_mode = 2

[node name="Panel" type="PanelContainer" parent="VBox/HSplit/Terrains"]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_mpeb7")

[node name="ScrollContainer" type="ScrollContainer" parent="VBox/HSplit/Terrains/Panel"]
layout_mode = 2
horizontal_scroll_mode = 3

[node name="TerrainList" type="HFlowContainer" parent="VBox/HSplit/Terrains/Panel/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="LowerToolbar" type="HBoxContainer" parent="VBox/HSplit/Terrains"]
layout_mode = 2

[node name="GridMode" type="Button" parent="VBox/HSplit/Terrains/LowerToolbar"]
layout_mode = 2
tooltip_text = "Toggle grid view"
toggle_mode = true
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="QuickMode" type="Button" parent="VBox/HSplit/Terrains/LowerToolbar"]
auto_translate_mode = 1
layout_mode = 2
tooltip_text = "Toggle quick mode. Only shows paintable terrain types."
toggle_mode = true
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="VSeparator" type="VSeparator" parent="VBox/HSplit/Terrains/LowerToolbar"]
layout_mode = 2

[node name="EditTools" type="HBoxContainer" parent="VBox/HSplit/Terrains/LowerToolbar"]
layout_mode = 2
size_flags_horizontal = 3
alignment = 2

[node name="AddTerrain" type="Button" parent="VBox/HSplit/Terrains/LowerToolbar/EditTools"]
layout_mode = 2
tooltip_text = "Add terrain type"
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="EditTerrain" type="Button" parent="VBox/HSplit/Terrains/LowerToolbar/EditTools"]
layout_mode = 2
tooltip_text = "Edit terrain type"
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="PickIcon" type="Button" parent="VBox/HSplit/Terrains/LowerToolbar/EditTools"]
layout_mode = 2
tooltip_text = "Pick terrain icon from tileset"
toggle_mode = true
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="MoveUp" type="Button" parent="VBox/HSplit/Terrains/LowerToolbar/EditTools"]
layout_mode = 2
tooltip_text = "Move selected terrain up"
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="MoveDown" type="Button" parent="VBox/HSplit/Terrains/LowerToolbar/EditTools"]
layout_mode = 2
tooltip_text = "Move selected terrain down"
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="RemoveTerrain" type="Button" parent="VBox/HSplit/Terrains/LowerToolbar/EditTools"]
layout_mode = 2
tooltip_text = "Remove selected terrain type(s)"
icon = SubResource("SVGTexture_nkf6h")
flat = true

[node name="Panel" type="Panel" parent="VBox/HSplit"]
custom_minimum_size = Vector2(0, 80)
layout_mode = 2

[node name="ScrollArea" type="ScrollContainer" parent="VBox/HSplit/Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3

[node name="TileView" type="Control" parent="VBox/HSplit/Panel/ScrollArea"]
texture_filter = 1
texture_repeat = 1
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
focus_mode = 2
script = ExtResource("4_nqppq")

[connection signal="item_selected" from="VBox/Toolbar/SymmetryOptions" to="." method="_on_symmetry_selected"]
[connection signal="id_pressed" from="VBox/Toolbar/Sources/Sources" to="." method="_on_terrain_enable_id_pressed"]
[connection signal="pressed" from="VBox/Toolbar/ShuffleRandom" to="." method="_on_shuffle_random_pressed"]
[connection signal="pressed" from="VBox/Toolbar/Clean" to="." method="_on_clean_pressed"]
[connection signal="pressed" from="VBox/Toolbar/LayerUp" to="." method="_on_layer_up_pressed"]
[connection signal="pressed" from="VBox/Toolbar/LayerDown" to="." method="_on_layer_down_pressed"]
[connection signal="toggled" from="VBox/Toolbar/LayerHighlight" to="." method="_on_layer_highlight_toggled"]
[connection signal="toggled" from="VBox/Toolbar/LayerGrid" to="." method="_on_layer_grid_toggled"]
[connection signal="pressed" from="VBox/HSplit/Terrains/LowerToolbar/GridMode" to="." method="_on_grid_mode_pressed"]
[connection signal="pressed" from="VBox/HSplit/Terrains/LowerToolbar/QuickMode" to="." method="_on_quick_mode_pressed"]
[connection signal="pressed" from="VBox/HSplit/Terrains/LowerToolbar/EditTools/AddTerrain" to="." method="_on_add_terrain_pressed"]
[connection signal="pressed" from="VBox/HSplit/Terrains/LowerToolbar/EditTools/EditTerrain" to="." method="_on_edit_terrain_pressed"]
[connection signal="focus_exited" from="VBox/HSplit/Terrains/LowerToolbar/EditTools/PickIcon" to="." method="_on_pick_icon_focus_exited"]
[connection signal="pressed" from="VBox/HSplit/Terrains/LowerToolbar/EditTools/PickIcon" to="." method="_on_pick_icon_pressed"]
[connection signal="pressed" from="VBox/HSplit/Terrains/LowerToolbar/EditTools/MoveUp" to="." method="_on_move_pressed" binds= [false]]
[connection signal="pressed" from="VBox/HSplit/Terrains/LowerToolbar/EditTools/MoveDown" to="." method="_on_move_pressed" binds= [true]]
[connection signal="pressed" from="VBox/HSplit/Terrains/LowerToolbar/EditTools/RemoveTerrain" to="." method="_on_remove_terrain_pressed"]
[connection signal="mouse_exited" from="VBox/HSplit/Panel/ScrollArea/TileView" to="VBox/HSplit/Panel/ScrollArea/TileView" method="clear_highlighted_tile"]
