a game about throwing hammers made for the github game off
-rw-r--r--assets/ui/04B_19.ttf.import4
-rw-r--r--assets/ui/boxchecked.pngbin0 -> 288 bytes
-rw-r--r--assets/ui/boxchecked.png.import34
-rw-r--r--assets/ui/boxunchecked.pngbin0 -> 187 bytes
-rw-r--r--assets/ui/boxunchecked.png.import34
-rw-r--r--godot.lock4
-rw-r--r--godot.package2
-rw-r--r--project.godot20
-rw-r--r--ui/button/button_pressed.tres6
-rw-r--r--ui/cfg.gd18
-rw-r--r--ui/cfg.tscn315
-rw-r--r--ui/components/caretoptionbutton/caretoptionbutton.gd22
-rw-r--r--ui/components/caretoptionbutton/caretoptionbutton.tscn66
-rw-r--r--ui/darkener_panel_bottom.tres8
-rw-r--r--ui/darkener_panel_top.tres17
-rw-r--r--ui/exitbutton.tscn49
-rw-r--r--ui/graphics.gd80
-rw-r--r--ui/graphics.tscn111
-rw-r--r--ui/keybinds.tscn196
-rw-r--r--ui/main.theme.tres12
-rw-r--r--ui/popup.gd24
-rw-r--r--ui/start.gd11
-rw-r--r--ui/start.tscn31
23 files changed, 746 insertions, 318 deletions
diff --git a/assets/ui/04B_19.ttf.import b/assets/ui/04B_19.ttf.import
index 88a5883..98d3609 100644
--- a/assets/ui/04B_19.ttf.import
+++ b/assets/ui/04B_19.ttf.import
@@ -2,7 +2,7 @@
importer="font_data_dynamic"
type="FontFile"
-uid="uid://w8xa1kya7ls5"
+uid="uid://b71ec3fvrtl4w"
path="res://.godot/imported/04B_19.ttf-1f1fec99972bfc3a081c3771b03d1498.fontdata"
[deps]
@@ -30,7 +30,7 @@ preload=[{
"chars": [],
"glyphs": [],
"name": "New Configuration",
-"size": 22,
+"size": 9,
"variation_embolden": 0.0
}]
language_support={}
diff --git a/assets/ui/boxchecked.png b/assets/ui/boxchecked.png
new file mode 100644
index 0000000..7392b20
--- /dev/null
+++ b/assets/ui/boxchecked.png
Binary files differ
diff --git a/assets/ui/boxchecked.png.import b/assets/ui/boxchecked.png.import
new file mode 100644
index 0000000..a55318b
--- /dev/null
+++ b/assets/ui/boxchecked.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bkajml7tkyfcl"
+path="res://.godot/imported/boxchecked.png-c2c0f939fa54587d8a08478fb223a690.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/ui/boxchecked.png"
+dest_files=["res://.godot/imported/boxchecked.png-c2c0f939fa54587d8a08478fb223a690.ctex"]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/bptc_ldr=0
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/assets/ui/boxunchecked.png b/assets/ui/boxunchecked.png
new file mode 100644
index 0000000..60c3dd4
--- /dev/null
+++ b/assets/ui/boxunchecked.png
Binary files differ
diff --git a/assets/ui/boxunchecked.png.import b/assets/ui/boxunchecked.png.import
new file mode 100644
index 0000000..ec5e6d1
--- /dev/null
+++ b/assets/ui/boxunchecked.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://d00nnr4kk16bd"
+path="res://.godot/imported/boxunchecked.png-0b0330b37309b75efefecca2e19db8a5.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/ui/boxunchecked.png"
+dest_files=["res://.godot/imported/boxunchecked.png-0b0330b37309b75efefecca2e19db8a5.ctex"]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/bptc_ldr=0
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/godot.lock b/godot.lock
index 5725628..ff5a7a2 100644
--- a/godot.lock
+++ b/godot.lock
@@ -1,6 +1,6 @@
{
"@bendn/remap": {
- "version": "4.1.1",
- "integrity": "sha512-zKFoc62rTp9noe1G+EPSboBtoqGVbPmmTaWVNljm2qJEmh9OvvUFoc6X63BS0yYr0jpzAfMj4i/Llv8u5c2U2g=="
+ "version": "4.1.2",
+ "integrity": "sha512-USl69xQBO7kuC6kB/5l/H6wigU09dbc04LR2jFElZL9evm3F1/UuQN86sqH0T4HFuD2xdf+9US9WbFmOkQ8rTA=="
}
} \ No newline at end of file
diff --git a/godot.package b/godot.package
index efd9e26..77e8073 100644
--- a/godot.package
+++ b/godot.package
@@ -1,6 +1,6 @@
{
"name": "hammer_space",
"packages": {
- "@bendn/remap": "4.1.1"
+ "@bendn/remap": "4.1.2"
}
} \ No newline at end of file
diff --git a/project.godot b/project.godot
index ffa6260..4c793d6 100644
--- a/project.godot
+++ b/project.godot
@@ -14,6 +14,11 @@ _global_script_classes=[{
"language": &"GDScript",
"path": "res://world/door/block_door.gd"
}, {
+"base": "HBoxContainer",
+"class": &"CaretOptionButton",
+"language": &"GDScript",
+"path": "res://ui/components/caretoptionbutton/caretoptionbutton.gd"
+}, {
"base": "Area2D",
"class": &"Door",
"language": &"GDScript",
@@ -64,6 +69,11 @@ _global_script_classes=[{
"language": &"GDScript",
"path": "res://player/player.gd"
}, {
+"base": "Control",
+"class": &"Popuppable",
+"language": &"GDScript",
+"path": "res://ui/popup.gd"
+}, {
"base": "Line2D",
"class": &"Trail2D",
"language": &"GDScript",
@@ -76,6 +86,7 @@ _global_script_classes=[{
}]
_global_script_class_icons={
"BlockDoor": "",
+"CaretOptionButton": "",
"Door": "",
"Enemy": "",
"Hammer": "res://assets/hammers/hammer01.png",
@@ -86,6 +97,7 @@ _global_script_class_icons={
"Maze": "",
"OneWayPlatform": "",
"Player": "",
+"Popuppable": "",
"Trail2D": "res://fx/trail2d_icon.svg",
"Util": ""
}
@@ -124,6 +136,14 @@ window/size/test_height=1280
[input]
+ui_focus_next={
+"deadzone": 0.5,
+"events": []
+}
+ui_focus_prev={
+"deadzone": 0.5,
+"events": []
+}
left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"unicode":0,"echo":false,"script":null)
diff --git a/ui/button/button_pressed.tres b/ui/button/button_pressed.tres
index 8a95654..9688467 100644
--- a/ui/button/button_pressed.tres
+++ b/ui/button/button_pressed.tres
@@ -6,7 +6,11 @@ content_margin_top = 10.0
content_margin_right = 10.0
content_margin_bottom = 10.0
bg_color = Color(0.101961, 0.172549, 0.192157, 1)
-border_color = Color(0.933333, 0.909804, 0.835294, 1)
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
+border_color = Color(0.14902, 0.545098, 0.823529, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
diff --git a/ui/cfg.gd b/ui/cfg.gd
deleted file mode 100644
index 87e6f32..0000000
--- a/ui/cfg.gd
+++ /dev/null
@@ -1,18 +0,0 @@
-extends ColorRect
-
-signal close
-
-@export var focus: Control
-
-func open() -> void:
- show()
- focus.button.grab_focus()
-
-func _input(event: InputEvent) -> void:
- if visible and event is InputEventKey and event.keycode == KEY_ESCAPE:
- close.emit()
- hide()
-
-func _on_exit_pressed() -> void:
- close.emit()
- hide()
diff --git a/ui/cfg.tscn b/ui/cfg.tscn
index fc2dd12..81a0cad 100644
--- a/ui/cfg.tscn
+++ b/ui/cfg.tscn
@@ -1,84 +1,9 @@
-[gd_scene load_steps=11 format=3 uid="uid://c0u64ju7url7g"]
+[gd_scene load_steps=5 format=3 uid="uid://c0u64ju7url7g"]
[ext_resource type="Theme" uid="uid://b5sr8elfovyw3" path="res://ui/main.theme.tres" id="1_14aww"]
-[ext_resource type="Script" path="res://addons/remap/RemapButton.gd" id="1_c3nk4"]
-[ext_resource type="Script" path="res://ui/cfg.gd" id="2_3rpdm"]
-[ext_resource type="FontFile" uid="uid://ck4uai24afp11" path="res://addons/remap/PromptFont.ttf" id="3_g7yde"]
-
-[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n07ao"]
-bg_color = Color(0, 0.0784314, 0.168627, 0.615686)
-corner_radius_top_left = 15
-corner_radius_top_right = 15
-corner_radius_bottom_right = 15
-corner_radius_bottom_left = 15
-
-[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nd1ad"]
-content_margin_left = 15.0
-content_margin_top = 15.0
-content_margin_right = 15.0
-content_margin_bottom = 15.0
-bg_color = Color(0, 0, 0, 0)
-border_width_left = 5
-border_width_top = 5
-border_width_right = 5
-border_width_bottom = 5
-corner_radius_top_left = 15
-corner_radius_top_right = 15
-corner_radius_bottom_right = 15
-corner_radius_bottom_left = 15
-
-[sub_resource type="GDScript" id="GDScript_gnxo1"]
-resource_name = "holder"
-script/source = "extends VBoxContainer
-
-@export var font_size: int
-
-func _ready() -> void:
- for c in get_children():
- if c.name == \"bbar\":
- continue
- c.button.add_theme_font_size_override(\"font_size\", font_size)
-"
-
-[sub_resource type="GDScript" id="GDScript_dodrb"]
-resource_name = "reset"
-script/source = "extends Button
-
-func _pressed() -> void:
- InputMap.load_from_project_settings()
-"
-
-[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_t7ea5"]
-content_margin_left = 10.0
-content_margin_top = 10.0
-content_margin_right = 10.0
-content_margin_bottom = 10.0
-bg_color = Color(0.427451, 0.117647, 0.156863, 1)
-border_width_left = 5
-border_width_top = 5
-border_width_right = 5
-border_width_bottom = 5
-border_color = Color(0.658824, 0.129412, 0.294118, 1)
-corner_radius_top_left = 10
-corner_radius_top_right = 10
-corner_radius_bottom_right = 10
-corner_radius_bottom_left = 10
-
-[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_it6gr"]
-content_margin_left = 10.0
-content_margin_top = 10.0
-content_margin_right = 10.0
-content_margin_bottom = 10.0
-bg_color = Color(0.513726, 0.117647, 0.156863, 1)
-border_width_left = 5
-border_width_top = 5
-border_width_right = 5
-border_width_bottom = 5
-border_color = Color(0.92549, 0.345098, 0.278431, 1)
-corner_radius_top_left = 10
-corner_radius_top_right = 10
-corner_radius_bottom_right = 10
-corner_radius_bottom_left = 10
+[ext_resource type="Script" path="res://ui/popup.gd" id="2_l8wlj"]
+[ext_resource type="PackedScene" uid="uid://ds7n3sd3bfnu8" path="res://ui/keybinds.tscn" id="3_7eok8"]
+[ext_resource type="PackedScene" uid="uid://bvka0056uk3q4" path="res://ui/graphics.tscn" id="4_rtxkf"]
[node name="cfg" type="ColorRect" node_paths=PackedStringArray("focus")]
anchors_preset = 15
@@ -87,186 +12,56 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_14aww")
-color = Color(0, 0, 0, 0.192157)
-script = ExtResource("2_3rpdm")
-focus = NodePath("margin/Scroll/V/left")
-
-[node name="margin" type="MarginContainer" parent="."]
-layout_mode = 1
-anchors_preset = 15
-anchor_right = 1.0
-anchor_bottom = 1.0
-grow_horizontal = 2
-grow_vertical = 2
-theme_override_constants/margin_left = 10
-theme_override_constants/margin_top = 10
-theme_override_constants/margin_right = 10
-theme_override_constants/margin_bottom = 10
-
-[node name="Panel" type="Panel" parent="margin"]
-layout_mode = 2
-offset_left = 10.0
-offset_top = 10.0
-offset_right = 310.0
-offset_bottom = 310.0
-mouse_filter = 2
-theme_override_styles/panel = SubResource("StyleBoxFlat_n07ao")
-
-[node name="Scroll" type="ScrollContainer" parent="margin"]
-layout_mode = 2
-offset_left = 10.0
-offset_top = 10.0
-offset_right = 310.0
-offset_bottom = 310.0
-grow_horizontal = 2
-grow_vertical = 2
-theme_override_styles/panel = SubResource("StyleBoxFlat_nd1ad")
-follow_focus = true
-horizontal_scroll_mode = 3
-vertical_scroll_mode = 3
-
-[node name="V" type="VBoxContainer" parent="margin/Scroll"]
-show_behind_parent = true
-layout_mode = 2
-offset_left = 15.0
-offset_top = 15.0
-offset_right = 285.0
-offset_bottom = 285.0
+color = Color(0, 0, 0, 0.596078)
+script = ExtResource("2_l8wlj")
+focus = NodePath("V/graphics")
+
+[node name="V" type="VBoxContainer" parent="."]
+anchors_preset = 8
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+offset_left = -70.0
+offset_top = -76.0
+offset_right = 70.0
+offset_bottom = 76.0
grow_horizontal = 2
grow_vertical = 2
-size_flags_horizontal = 3
-size_flags_vertical = 3
-script = SubResource("GDScript_gnxo1")
-font_size = 15
-
-[node name="bbar" type="HBoxContainer" parent="margin/Scroll/V"]
-show_behind_parent = true
-layout_mode = 2
-offset_right = 270.0
-offset_bottom = 36.0
-
-[node name="space3" type="Control" parent="margin/Scroll/V/bbar"]
-custom_minimum_size = Vector2(20, 0)
-layout_mode = 2
-anchors_preset = 0
-offset_right = 20.0
-offset_bottom = 36.0
-
-[node name="reset" type="Button" parent="margin/Scroll/V/bbar"]
-show_behind_parent = true
-layout_mode = 2
-offset_left = 24.0
-offset_right = 79.0
-offset_bottom = 36.0
-size_flags_horizontal = 4
-theme_override_font_sizes/font_size = 12
-text = "reset"
-script = SubResource("GDScript_dodrb")
-
-[node name="space" type="Control" parent="margin/Scroll/V/bbar"]
-layout_mode = 2
-anchors_preset = 0
-offset_left = 83.0
-offset_right = 190.0
-offset_bottom = 36.0
-size_flags_horizontal = 3
-
-[node name="exit" type="Button" parent="margin/Scroll/V/bbar"]
-show_behind_parent = true
-layout_mode = 2
-offset_left = 194.0
-offset_right = 226.0
-offset_bottom = 36.0
-size_flags_horizontal = 4
-theme_override_fonts/font = ExtResource("3_g7yde")
-theme_override_font_sizes/font_size = 12
-theme_override_styles/normal = SubResource("StyleBoxFlat_t7ea5")
-theme_override_styles/hover = SubResource("StyleBoxFlat_it6gr")
-theme_override_styles/pressed = SubResource("StyleBoxFlat_it6gr")
-theme_override_styles/focus = SubResource("StyleBoxFlat_it6gr")
-text = "✗"
-
-[node name="space2" type="Control" parent="margin/Scroll/V/bbar"]
-custom_minimum_size = Vector2(40, 0)
-layout_mode = 2
-anchors_preset = 0
-offset_left = 230.0
-offset_right = 270.0
-offset_bottom = 36.0
-
-[node name="left" type="HBoxContainer" parent="margin/Scroll/V"]
-show_behind_parent = true
-custom_minimum_size = Vector2(42, 42)
-layout_mode = 2
-offset_top = 40.0
-offset_right = 270.0
-offset_bottom = 82.0
-script = ExtResource("1_c3nk4")
-prompt_text = "push button"
-_name = "left"
-action = "left"
-icon_size = Vector2(35, 35)
-font_size = 19
-continuous_updating = true
-
-[node name="right" type="HBoxContainer" parent="margin/Scroll/V"]
-show_behind_parent = true
-custom_minimum_size = Vector2(42, 42)
-layout_mode = 2
-offset_top = 86.0
-offset_right = 270.0
-offset_bottom = 128.0
-script = ExtResource("1_c3nk4")
-prompt_text = "push button"
-_name = "right"
-action = "right"
-icon_size = Vector2(35, 35)
-font_size = 19
-continuous_updating = true
-
-[node name="up" type="HBoxContainer" parent="margin/Scroll/V"]
-show_behind_parent = true
-custom_minimum_size = Vector2(42, 42)
-layout_mode = 2
-offset_top = 132.0
-offset_right = 270.0
-offset_bottom = 174.0
-script = ExtResource("1_c3nk4")
-prompt_text = "push button"
-_name = "jump"
-action = "jump"
-icon_size = Vector2(35, 35)
-font_size = 19
-continuous_updating = true
-
-[node name="down" type="HBoxContainer" parent="margin/Scroll/V"]
-show_behind_parent = true
-custom_minimum_size = Vector2(42, 42)
-layout_mode = 2
-offset_top = 178.0
-offset_right = 270.0
-offset_bottom = 220.0
-script = ExtResource("1_c3nk4")
-prompt_text = "push button"
-_name = "fall"
-action = "down"
-icon_size = Vector2(35, 35)
-font_size = 19
-continuous_updating = true
-
-[node name="shoot" type="HBoxContainer" parent="margin/Scroll/V"]
-show_behind_parent = true
-custom_minimum_size = Vector2(42, 42)
-layout_mode = 2
-offset_top = 224.0
-offset_right = 270.0
-offset_bottom = 266.0
-script = ExtResource("1_c3nk4")
-prompt_text = "push button"
-_name = "shoot"
-action = "shoot"
-icon_size = Vector2(35, 35)
-font_size = 19
-continuous_updating = true
-
-[connection signal="pressed" from="margin/Scroll/V/bbar/exit" to="." method="_on_exit_pressed"]
+alignment = 1
+
+[node name="graphics" type="Button" parent="V"]
+offset_top = 7.0
+offset_right = 140.0
+offset_bottom = 50.0
+focus_neighbor_top = NodePath("../back")
+focus_neighbor_bottom = NodePath("../keybinds")
+text = "graphics"
+
+[node name="keybinds" type="Button" parent="V"]
+offset_top = 54.0
+offset_right = 140.0
+offset_bottom = 97.0
+focus_neighbor_top = NodePath("../graphics")
+focus_neighbor_bottom = NodePath("../back")
+text = "controls"
+
+[node name="back" type="Button" parent="V"]
+offset_top = 101.0
+offset_right = 140.0
+offset_bottom = 144.0
+focus_neighbor_top = NodePath("../keybinds")
+focus_neighbor_bottom = NodePath("../graphics")
+text = "back"
+
+[node name="keybinds" parent="." instance=ExtResource("3_7eok8")]
+visible = false
+
+[node name="graphics" parent="." instance=ExtResource("4_rtxkf")]
+visible = false
+
+[connection signal="pressed" from="V/graphics" to="graphics" method="open"]
+[connection signal="pressed" from="V/keybinds" to="keybinds" method="open"]
+[connection signal="pressed" from="V/back" to="." method="exit"]
+[connection signal="close" from="keybinds" to="." method="open"]
+[connection signal="close" from="graphics" to="." method="open"]
diff --git a/ui/components/caretoptionbutton/caretoptionbutton.gd b/ui/components/caretoptionbutton/caretoptionbutton.gd
new file mode 100644
index 0000000..b46ef1b
--- /dev/null
+++ b/ui/components/caretoptionbutton/caretoptionbutton.gd
@@ -0,0 +1,22 @@
+extends HBoxContainer
+class_name CaretOptionButton
+
+signal changed(current_option: int)
+
+@onready var button: Button = $button as Button
+@export var options: PackedStringArray = []
+@export var current_option: int = 0:
+ set(val):
+ current_option = wrapi(val, 0, len(options))
+ if not button: return
+ button.text = options[current_option]
+ changed.emit(current_option)
+
+func _ready() -> void:
+ current_option = current_option
+
+func sub() -> void:
+ current_option -= 1
+
+func add() -> void:
+ current_option += 1
diff --git a/ui/components/caretoptionbutton/caretoptionbutton.tscn b/ui/components/caretoptionbutton/caretoptionbutton.tscn
new file mode 100644
index 0000000..fe1e4c4
--- /dev/null
+++ b/ui/components/caretoptionbutton/caretoptionbutton.tscn
@@ -0,0 +1,66 @@
+[gd_scene load_steps=5 format=3 uid="uid://bcgfik2femipi"]
+
+[ext_resource type="Theme" uid="uid://b5sr8elfovyw3" path="res://ui/main.theme.tres" id="1_ccknv"]
+[ext_resource type="Script" path="res://ui/components/caretoptionbutton/caretoptionbutton.gd" id="2_e0ttn"]
+
+[sub_resource type="ShaderMaterial" id="ShaderMaterial_fctpt"]
+
+[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8pewa"]
+
+[node name="<OptionButton>" type="HBoxContainer"]
+offset_left = 10.0
+offset_top = 10.0
+offset_right = 194.0
+offset_bottom = 41.0
+mouse_filter = 2
+theme = ExtResource("1_ccknv")
+script = ExtResource("2_e0ttn")
+
+[node name="leftcaret" type="Button" parent="."]
+material = SubResource("ShaderMaterial_fctpt")
+offset_right = 13.0
+offset_bottom = 43.0
+theme_override_colors/font_color = Color(1, 0.345098, 0.278431, 1)
+theme_override_colors/font_pressed_color = Color(0.996078, 0, 0, 1)
+theme_override_colors/font_hover_color = Color(1, 0.690196, 0.639216, 1)
+theme_override_colors/font_focus_color = Color(1, 0.647059, 0.596078, 1)
+theme_override_colors/font_hover_pressed_color = Color(0.968627, 0, 0, 1)
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 5
+theme_override_styles/normal = SubResource("StyleBoxEmpty_8pewa")
+theme_override_styles/hover = SubResource("StyleBoxEmpty_8pewa")
+theme_override_styles/pressed = SubResource("StyleBoxEmpty_8pewa")
+theme_override_styles/disabled = SubResource("StyleBoxEmpty_8pewa")
+theme_override_styles/focus = SubResource("StyleBoxEmpty_8pewa")
+text = "<"
+
+[node name="button" type="Button" parent="."]
+offset_left = 17.0
+offset_right = 153.0
+offset_bottom = 43.0
+grow_horizontal = 2
+grow_vertical = 2
+text = "fullscreen"
+
+[node name="rightcaret" type="Button" parent="."]
+material = SubResource("ShaderMaterial_fctpt")
+offset_left = 157.0
+offset_right = 170.0
+offset_bottom = 43.0
+theme_override_colors/font_color = Color(1, 0.345098, 0.278431, 1)
+theme_override_colors/font_pressed_color = Color(0.996078, 0, 0, 1)
+theme_override_colors/font_hover_color = Color(1, 0.690196, 0.639216, 1)
+theme_override_colors/font_focus_color = Color(1, 0.647059, 0.596078, 1)
+theme_override_colors/font_hover_pressed_color = Color(0.968627, 0, 0, 1)
+theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
+theme_override_constants/outline_size = 5
+theme_override_styles/normal = SubResource("StyleBoxEmpty_8pewa")
+theme_override_styles/hover = SubResource("StyleBoxEmpty_8pewa")
+theme_override_styles/pressed = SubResource("StyleBoxEmpty_8pewa")
+theme_override_styles/disabled = SubResource("StyleBoxEmpty_8pewa")
+theme_override_styles/focus = SubResource("StyleBoxEmpty_8pewa")
+text = ">"
+
+[connection signal="pressed" from="leftcaret" to="." method="sub"]
+[connection signal="pressed" from="button" to="." method="add"]
+[connection signal="pressed" from="rightcaret" to="." method="add"]
diff --git a/ui/darkener_panel_bottom.tres b/ui/darkener_panel_bottom.tres
new file mode 100644
index 0000000..11fe4a2
--- /dev/null
+++ b/ui/darkener_panel_bottom.tres
@@ -0,0 +1,8 @@
+[gd_resource type="StyleBoxFlat" format=3 uid="uid://dfisjyikb066o"]
+
+[resource]
+bg_color = Color(0, 0.0784314, 0.168627, 0.615686)
+corner_radius_top_left = 15
+corner_radius_top_right = 15
+corner_radius_bottom_right = 15
+corner_radius_bottom_left = 15
diff --git a/ui/darkener_panel_top.tres b/ui/darkener_panel_top.tres
new file mode 100644
index 0000000..522b005
--- /dev/null
+++ b/ui/darkener_panel_top.tres
@@ -0,0 +1,17 @@
+[gd_resource type="StyleBoxFlat" format=3 uid="uid://bt4oraf4hpx7b"]
+
+[resource]
+content_margin_left = 15.0
+content_margin_top = 15.0
+content_margin_right = 15.0
+content_margin_bottom = 15.0
+bg_color = Color(0, 0, 0, 0)
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
+corner_radius_top_left = 15
+corner_radius_top_right = 15
+corner_radius_bottom_right = 15
+corner_radius_bottom_left = 15
+corner_detail = 15
diff --git a/ui/exitbutton.tscn b/ui/exitbutton.tscn
new file mode 100644
index 0000000..975682d
--- /dev/null
+++ b/ui/exitbutton.tscn
@@ -0,0 +1,49 @@
+[gd_scene load_steps=4 format=3 uid="uid://b7b1oujujfumh"]
+
+[ext_resource type="FontFile" uid="uid://ck4uai24afp11" path="res://addons/remap/PromptFont.ttf" id="1_t80il"]
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_t7ea5"]
+content_margin_left = 10.0
+content_margin_top = 10.0
+content_margin_right = 10.0
+content_margin_bottom = 10.0
+bg_color = Color(0.427451, 0.117647, 0.156863, 1)
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
+border_color = Color(0.658824, 0.129412, 0.294118, 1)
+corner_radius_top_left = 10
+corner_radius_top_right = 10
+corner_radius_bottom_right = 10
+corner_radius_bottom_left = 10
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_it6gr"]
+content_margin_left = 10.0
+content_margin_top = 10.0
+content_margin_right = 10.0
+content_margin_bottom = 10.0
+bg_color = Color(0.513726, 0.117647, 0.156863, 1)
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
+border_color = Color(0.92549, 0.345098, 0.278431, 1)
+corner_radius_top_left = 10
+corner_radius_top_right = 10
+corner_radius_bottom_right = 10
+corner_radius_bottom_left = 10
+
+[node name="exit" type="Button"]
+show_behind_parent = true
+offset_left = 194.0
+offset_right = 226.0
+offset_bottom = 36.0
+size_flags_horizontal = 4
+theme_override_fonts/font = ExtResource("1_t80il")
+theme_override_font_sizes/font_size = 12
+theme_override_styles/normal = SubResource("StyleBoxFlat_t7ea5")
+theme_override_styles/hover = SubResource("StyleBoxFlat_it6gr")
+theme_override_styles/pressed = SubResource("StyleBoxFlat_it6gr")
+theme_override_styles/focus = SubResource("StyleBoxFlat_it6gr")
+text = "✗"
diff --git a/ui/graphics.gd b/ui/graphics.gd
new file mode 100644
index 0000000..b074ed5
--- /dev/null
+++ b/ui/graphics.gd
@@ -0,0 +1,80 @@
+extends Popuppable
+
+const file = "user://graphics.settings"
+const SaveLoad := preload("res://addons/remap/private/SaveLoadUtils.gd") # so what its private, im using gdscript
+
+enum {FULLSCREEN, BORDERLESS_FS, WINDOWED}
+const map := {
+ FULLSCREEN: DisplayServer.WINDOW_MODE_FULLSCREEN,
+ WINDOWED: DisplayServer.WINDOW_MODE_WINDOWED,
+}
+const default_settings_data := {
+ window = WINDOWED,
+ vsync = false,
+}
+
+@onready var vsync: CheckBox = $"%vsyncbutton"
+@onready var window: CaretOptionButton = $"%windowbutton"
+
+var ignore_set_settings := false
+var has_loaded := false
+
+var settings := default_settings_data
+
+func save() -> void:
+ SaveLoad.save(file, settings)
+
+func _ready() -> void:
+ var lod := SaveLoad.load_file(file)
+ settings = lod if dict_cmp(lod, default_settings_data) else default_settings_data # check if the keys and vaue types are correct
+ has_loaded = true
+ update_button_visuals()
+
+static func dict_cmp(d1: Dictionary, d2: Dictionary) -> bool:
+ return (
+ len(d1) == len(d2)
+ and sort(d1.keys()) == sort(d2.keys())
+ and value_types(d1.values()) == value_types(d2.values())
+ )
+
+static func sort(arr: Array) -> Array:
+ arr.sort()
+ return arr
+
+static func value_types(arr: Array) -> Array:
+ var types = []
+ for value in arr:
+ types.append(typeof(value))
+ types.sort()
+ return types
+
+func update_button_visuals():
+ ignore_set_settings = true
+ vsync.button_pressed = settings.vsync
+ window.current_option = settings.window
+ ignore_set_settings = false
+
+func update_window():
+ if settings.window == BORDERLESS_FS:
+ DisplayServer.window_set_mode(map[FULLSCREEN])
+ DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_BORDERLESS, true)
+ else:
+ DisplayServer.window_set_mode(map[settings.window])
+
+func update_vsync():
+ var vsync_mode := DisplayServer.VSYNC_DISABLED if not settings.vsync else DisplayServer.VSYNC_ENABLED
+ DisplayServer.window_set_vsync_mode(vsync_mode)
+
+func _on_vsync_toggled(button_pressed: bool) -> void:
+ if not has_loaded: return
+ if not ignore_set_settings:
+ settings.vsync = button_pressed
+ save()
+ update_vsync()
+
+func _on_window_mode_changed(current_option: int) -> void:
+ if not has_loaded: return
+ if not ignore_set_settings:
+ settings.window = current_option
+ save()
+ update_window()
diff --git a/ui/graphics.tscn b/ui/graphics.tscn
new file mode 100644
index 0000000..3aa7a46
--- /dev/null
+++ b/ui/graphics.tscn
@@ -0,0 +1,111 @@
+[gd_scene load_steps=7 format=3 uid="uid://bvka0056uk3q4"]
+
+[ext_resource type="Theme" uid="uid://b5sr8elfovyw3" path="res://ui/main.theme.tres" id="1_be2xy"]
+[ext_resource type="StyleBox" uid="uid://dfisjyikb066o" path="res://ui/darkener_panel_bottom.tres" id="2_g8edo"]
+[ext_resource type="Script" path="res://ui/graphics.gd" id="2_s8nd1"]
+[ext_resource type="StyleBox" uid="uid://bt4oraf4hpx7b" path="res://ui/darkener_panel_top.tres" id="3_pgqel"]
+[ext_resource type="PackedScene" uid="uid://b7b1oujujfumh" path="res://ui/exitbutton.tscn" id="5_082rc"]
+[ext_resource type="PackedScene" uid="uid://bcgfik2femipi" path="res://ui/components/caretoptionbutton/caretoptionbutton.tscn" id="5_kv1ys"]
+
+[node name="graphics" type="MarginContainer" node_paths=PackedStringArray("focus")]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("1_be2xy")
+theme_override_constants/margin_left = 10
+theme_override_constants/margin_top = 10
+theme_override_constants/margin_right = 10
+theme_override_constants/margin_bottom = 10
+script = ExtResource("2_s8nd1")
+focus = NodePath("Panel2/V/h/vsyncbutton")
+
+[node name="Panel" type="Panel" parent="."]
+layout_mode = 2
+offset_left = 10.0
+offset_top = 10.0
+offset_right = 310.0
+offset_bottom = 310.0
+theme_override_styles/panel = ExtResource("2_g8edo")
+
+[node name="Panel2" type="PanelContainer" parent="."]
+clip_contents = true
+layout_mode = 2
+offset_left = 10.0
+offset_top = 10.0
+offset_right = 310.0
+offset_bottom = 310.0
+theme_override_styles/panel = ExtResource("3_pgqel")
+
+[node name="V" type="VBoxContainer" parent="Panel2"]
+show_behind_parent = true
+layout_mode = 2
+offset_left = 15.0
+offset_top = 15.0
+offset_right = 285.0
+offset_bottom = 285.0
+size_flags_horizontal = 3
+size_flags_vertical = 3
+
+[node name="h" type="HBoxContainer" parent="Panel2/V"]
+layout_mode = 2
+offset_right = 270.0
+offset_bottom = 43.0
+theme_override_constants/separation = 50
+alignment = 2
+
+[node name="vsyncbutton" type="CheckBox" parent="Panel2/V/h"]
+unique_name_in_owner = true
+layout_mode = 2
+offset_left = 77.0
+offset_right = 188.0
+offset_bottom = 43.0
+size_flags_horizontal = 4
+focus_neighbor_left = NodePath("../exit")
+focus_neighbor_top = NodePath("../../windowbutton/button")
+focus_neighbor_right = NodePath("../exit")
+focus_neighbor_bottom = NodePath("../../windowbutton/button")
+text = "vsync"
+
+[node name="exit" parent="Panel2/V/h" instance=ExtResource("5_082rc")]
+layout_mode = 2
+offset_left = 238.0
+offset_right = 270.0
+offset_bottom = 43.0
+focus_neighbor_left = NodePath("../vsyncbutton")
+focus_neighbor_top = NodePath("../../windowbutton/button")
+focus_neighbor_right = NodePath("../vsyncbutton")
+focus_neighbor_bottom = NodePath("../../windowbutton/button")
+
+[node name="windowbutton" parent="Panel2/V" instance=ExtResource("5_kv1ys")]
+unique_name_in_owner = true
+layout_mode = 2
+offset_left = 50.0
+offset_top = 47.0
+offset_right = 220.0
+offset_bottom = 90.0
+size_flags_horizontal = 4
+options = PackedStringArray("fullscreen", "borderless fs", "windowed")
+current_option = 2
+
+[node name="leftcaret" parent="Panel2/V/windowbutton" index="0"]
+layout_mode = 2
+focus_neighbor_top = NodePath("../../h/vsyncbutton")
+focus_neighbor_bottom = NodePath("../../h/vsyncbutton")
+
+[node name="button" parent="Panel2/V/windowbutton" index="1"]
+layout_mode = 2
+focus_neighbor_top = NodePath("../../h/vsyncbutton")
+focus_neighbor_bottom = NodePath("../../h/vsyncbutton")
+
+[node name="rightcaret" parent="Panel2/V/windowbutton" index="2"]
+layout_mode = 2
+focus_neighbor_top = NodePath("../../h/vsyncbutton")
+focus_neighbor_bottom = NodePath("../../h/vsyncbutton")
+
+[connection signal="toggled" from="Panel2/V/h/vsyncbutton" to="." method="_on_vsync_toggled"]
+[connection signal="pressed" from="Panel2/V/h/exit" to="." method="exit"]
+[connection signal="changed" from="Panel2/V/windowbutton" to="." method="_on_window_mode_changed"]
+
+[editable path="Panel2/V/windowbutton"]
diff --git a/ui/keybinds.tscn b/ui/keybinds.tscn
new file mode 100644
index 0000000..75e1a54
--- /dev/null
+++ b/ui/keybinds.tscn
@@ -0,0 +1,196 @@
+[gd_scene load_steps=9 format=3 uid="uid://ds7n3sd3bfnu8"]
+
+[ext_resource type="Theme" uid="uid://b5sr8elfovyw3" path="res://ui/main.theme.tres" id="1_cqlw2"]
+[ext_resource type="Script" path="res://ui/popup.gd" id="1_f036x"]
+[ext_resource type="StyleBox" uid="uid://dfisjyikb066o" path="res://ui/darkener_panel_bottom.tres" id="1_wrc13"]
+[ext_resource type="StyleBox" uid="uid://bt4oraf4hpx7b" path="res://ui/darkener_panel_top.tres" id="2_rkypo"]
+[ext_resource type="PackedScene" uid="uid://b7b1oujujfumh" path="res://ui/exitbutton.tscn" id="5_w2is5"]
+[ext_resource type="Script" path="res://addons/remap/RemapButton.gd" id="6_s2rfm"]
+
+[sub_resource type="GDScript" id="GDScript_gnxo1"]
+resource_name = "holder"
+script/source = "extends VBoxContainer
+
+const RemapButton := preload(\"res://addons/remap/RemapButton.gd\")
+
+@export var font_size: int
+
+func _ready() -> void:
+ for c in get_children():
+ if c is RemapButton:
+ c.button.add_theme_font_size_override(\"font_size\", font_size)
+
+func _on_reset_pressed() -> void:
+ for c in get_children():
+ if c is RemapButton:
+ c.save()
+ c.update()
+"
+
+[sub_resource type="GDScript" id="GDScript_dodrb"]
+resource_name = "reset"
+script/source = "extends Button
+
+func _pressed() -> void:
+ InputMap.load_from_project_settings()
+"
+
+[node name="keybinds" type="MarginContainer" node_paths=PackedStringArray("focus")]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+theme = ExtResource("1_cqlw2")
+theme_override_constants/margin_left = 10
+theme_override_constants/margin_top = 10
+theme_override_constants/margin_right = 10
+theme_override_constants/margin_bottom = 10
+script = ExtResource("1_f036x")
+focus = NodePath("Scroll/V/left")
+
+[node name="Panel" type="Panel" parent="."]
+layout_mode = 2
+offset_left = 10.0
+offset_top = 10.0
+offset_right = 310.0
+offset_bottom = 310.0
+mouse_filter = 2
+theme_override_styles/panel = ExtResource("1_wrc13")
+
+[node name="Scroll" type="ScrollContainer" parent="."]
+layout_mode = 2
+offset_left = 10.0
+offset_top = 10.0
+offset_right = 310.0
+offset_bottom = 310.0
+grow_horizontal = 2
+grow_vertical = 2
+theme_override_styles/panel = ExtResource("2_rkypo")
+follow_focus = true
+horizontal_scroll_mode = 3
+vertical_scroll_mode = 3
+
+[node name="V" type="VBoxContainer" parent="Scroll"]
+show_behind_parent = true
+layout_mode = 2
+offset_left = 15.0
+offset_top = 15.0
+offset_right = 285.0
+offset_bottom = 285.0
+grow_horizontal = 2
+grow_vertical = 2
+size_flags_horizontal = 3
+size_flags_vertical = 3
+script = SubResource("GDScript_gnxo1")
+font_size = 15
+
+[node name="bbar" type="HBoxContainer" parent="Scroll/V"]
+show_behind_parent = true
+layout_mode = 2
+offset_right = 270.0
+offset_bottom = 36.0
+
+[node name="space3" type="Control" parent="Scroll/V/bbar"]
+custom_minimum_size = Vector2(20, 0)
+layout_mode = 2
+anchors_preset = 0
+offset_right = 20.0
+offset_bottom = 36.0
+
+[node name="reset" type="Button" parent="Scroll/V/bbar"]
+show_behind_parent = true
+layout_mode = 2
+offset_left = 24.0
+offset_right = 79.0
+offset_bottom = 36.0
+size_flags_horizontal = 4
+focus_neighbor_left = NodePath("../exit")
+focus_neighbor_right = NodePath("../exit")
+theme_override_font_sizes/font_size = 12
+text = "reset"
+script = SubResource("GDScript_dodrb")
+
+[node name="space" type="Control" parent="Scroll/V/bbar"]
+layout_mode = 2
+anchors_preset = 0
+offset_left = 83.0
+offset_right = 190.0
+offset_bottom = 36.0
+size_flags_horizontal = 3
+
+[node name="exit" parent="Scroll/V/bbar" instance=ExtResource("5_w2is5")]
+layout_mode = 2
+focus_neighbor_left = NodePath("../reset")
+focus_neighbor_right = NodePath("../reset")
+
+[node name="space2" type="Control" parent="Scroll/V/bbar"]
+custom_minimum_size = Vector2(40, 0)
+layout_mode = 2
+anchors_preset = 0
+offset_left = 230.0
+offset_right = 270.0
+offset_bottom = 36.0
+
+[node name="left" type="HBoxContainer" parent="Scroll/V"]
+show_behind_parent = true
+custom_minimum_size = Vector2(42, 42)
+layout_mode = 2
+offset_top = 40.0
+offset_right = 270.0
+offset_bottom = 82.0
+script = ExtResource("6_s2rfm")
+prompt_text = "[push button]"
+_name = "left"
+action = "left"
+
+[node name="right" type="HBoxContainer" parent="Scroll/V"]
+show_behind_parent = true
+custom_minimum_size = Vector2(42, 42)
+layout_mode = 2
+offset_top = 86.0
+offset_right = 270.0
+offset_bottom = 128.0
+script = ExtResource("6_s2rfm")
+prompt_text = "[push button]"
+_name = "right"
+action = "right"
+
+[node name="up" type="HBoxContainer" parent="Scroll/V"]
+show_behind_parent = true
+custom_minimum_size = Vector2(42, 42)
+layout_mode = 2
+offset_top = 132.0
+offset_right = 270.0
+offset_bottom = 174.0
+script = ExtResource("6_s2rfm")
+prompt_text = "[push button]"
+_name = "jump"
+action = "jump"
+
+[node name="down" type="HBoxContainer" parent="Scroll/V"]
+show_behind_parent = true
+custom_minimum_size = Vector2(42, 42)
+layout_mode = 2
+offset_top = 178.0
+offset_right = 270.0
+offset_bottom = 220.0
+script = ExtResource("6_s2rfm")
+prompt_text = "[push button]"
+_name = "fall"
+action = "down"
+
+[node name="shoot" type="HBoxContainer" parent="Scroll/V"]
+show_behind_parent = true
+custom_minimum_size = Vector2(42, 42)
+layout_mode = 2
+offset_top = 224.0
+offset_right = 270.0
+offset_bottom = 266.0
+script = ExtResource("6_s2rfm")
+prompt_text = "[push button]"
+_name = "shoot"
+action = "shoot"
+
+[connection signal="pressed" from="Scroll/V/bbar/reset" to="Scroll/V" method="_on_reset_pressed"]
+[connection signal="pressed" from="Scroll/V/bbar/exit" to="." method="exit"]
diff --git a/ui/main.theme.tres b/ui/main.theme.tres
index 751298f..b021ba2 100644
--- a/ui/main.theme.tres
+++ b/ui/main.theme.tres
@@ -1,16 +1,18 @@
-[gd_resource type="Theme" load_steps=8 format=3 uid="uid://b5sr8elfovyw3"]
+[gd_resource type="Theme" load_steps=10 format=3 uid="uid://b5sr8elfovyw3"]
[ext_resource type="StyleBox" uid="uid://caxtg2fj6ffqx" path="res://ui/button/button_focus.tres" id="1_8x0ae"]
[ext_resource type="StyleBox" uid="uid://483vjasgeg6x" path="res://ui/button/button_normal.tres" id="1_e241j"]
[ext_resource type="StyleBox" uid="uid://cuwclicw8mxmg" path="res://ui/button/button_disabled.tres" id="1_kdwa2"]
[ext_resource type="StyleBox" uid="uid://5c652jqp6x8q" path="res://ui/button/button_hover.tres" id="3_kg542"]
[ext_resource type="StyleBox" uid="uid://kccji4f3l86p" path="res://ui/button/button_pressed.tres" id="5_fceyb"]
-[ext_resource type="FontFile" uid="uid://w8xa1kya7ls5" path="res://assets/ui/04B_19.ttf" id="6_ibow1"]
+[ext_resource type="Texture2D" uid="uid://bkajml7tkyfcl" path="res://assets/ui/boxchecked.png" id="6_4s2vy"]
+[ext_resource type="FontFile" uid="uid://b71ec3fvrtl4w" path="res://assets/ui/04B_19.ttf" id="6_ibow1"]
[ext_resource type="StyleBox" uid="uid://c7plpsmtwl2tj" path="res://ui/panel.tres" id="6_s8neq"]
+[ext_resource type="Texture2D" uid="uid://d00nnr4kk16bd" path="res://assets/ui/boxunchecked.png" id="7_4dnid"]
[resource]
default_font = ExtResource("6_ibow1")
-default_font_size = 28
+default_font_size = 22
Button/colors/font_color = Color(0.933333, 0.909804, 0.835294, 1)
Button/colors/font_disabled_color = Color(0.513726, 0.580392, 0.588235, 1)
Button/colors/font_focus_color = Color(0.992157, 0.964706, 0.890196, 1)
@@ -18,10 +20,12 @@ Button/colors/font_hover_color = Color(0.992157, 0.964706, 0.890196, 1)
Button/colors/font_hover_pressed_color = Color(0.992157, 0.964706, 0.890196, 1)
Button/colors/font_outline_color = Color(0.992157, 0.964706, 0.890196, 1)
Button/colors/font_pressed_color = Color(0.992157, 0.964706, 0.890196, 1)
-Button/font_sizes/font_size = 28
+Button/font_sizes/font_size = 22
Button/styles/disabled = ExtResource("1_kdwa2")
Button/styles/focus = ExtResource("1_8x0ae")
Button/styles/hover = ExtResource("3_kg542")
Button/styles/normal = ExtResource("1_e241j")
Button/styles/pressed = ExtResource("5_fceyb")
+CheckBox/icons/checked = ExtResource("6_4s2vy")
+CheckBox/icons/unchecked = ExtResource("7_4dnid")
PanelContainer/styles/panel = ExtResource("6_s8neq")
diff --git a/ui/popup.gd b/ui/popup.gd
new file mode 100644
index 0000000..4fc583f
--- /dev/null
+++ b/ui/popup.gd
@@ -0,0 +1,24 @@
+extends Control
+class_name Popuppable
+
+const RemapButton := preload("res://addons/remap/RemapButton.gd")
+
+signal close
+
+@export var focus: Control
+
+func open() -> void:
+ show()
+ if focus is RemapButton:
+ focus.button.grab_focus()
+ else:
+ focus.grab_focus()
+
+func _unhandled_key_input(event: InputEvent) -> void:
+ if visible and event is InputEventKey and event.keycode == KEY_ESCAPE:
+ accept_event()
+ exit()
+
+func exit() -> void:
+ close.emit()
+ hide()
diff --git a/ui/start.gd b/ui/start.gd
index fcee719..4ace680 100644
--- a/ui/start.gd
+++ b/ui/start.gd
@@ -1,10 +1,7 @@
-extends Control
-
-@export var focus: Control
+extends Popuppable
func _ready() -> void:
- focus.grab_focus()
-
+ open()
-func _on_cfg_close() -> void:
- focus.grab_focus()
+func exit() -> void:
+ pass
diff --git a/ui/start.tscn b/ui/start.tscn
index fc9bfd4..24d556e 100644
--- a/ui/start.tscn
+++ b/ui/start.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=7 format=3 uid="uid://bkyf7pxcw2ks3"]
+[gd_scene load_steps=6 format=3 uid="uid://bkyf7pxcw2ks3"]
[ext_resource type="Theme" uid="uid://b5sr8elfovyw3" path="res://ui/main.theme.tres" id="1_gj4yg"]
[ext_resource type="Script" path="res://ui/start.gd" id="2_iv77f"]
@@ -12,16 +12,6 @@ func _pressed() -> void:
get_tree().change_scene_to_file(\"res://Main.tscn\")
"
-[sub_resource type="GDScript" id="GDScript_a3v0r"]
-resource_name = "cfg"
-script/source = "extends Button
-
-@onready var cfg := $\"%cfg\"
-
-func _pressed() -> void:
- cfg.open()
-"
-
[sub_resource type="GDScript" id="GDScript_vtoxm"]
resource_name = "exit"
script/source = "extends Button
@@ -43,7 +33,6 @@ focus = NodePath("VBox/StartButton")
metadata/_edit_vertical_guides_ = []
[node name="VBox" type="VBoxContainer" parent="."]
-layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
@@ -57,31 +46,27 @@ grow_horizontal = 2
grow_vertical = 2
[node name="StartButton" type="Button" parent="VBox"]
-layout_mode = 2
offset_right = 172.0
-offset_bottom = 48.0
+offset_bottom = 43.0
text = "start"
script = SubResource("GDScript_52jbq")
[node name="CfgButtton" type="Button" parent="VBox"]
-layout_mode = 2
-offset_top = 52.0
+offset_top = 47.0
offset_right = 172.0
-offset_bottom = 100.0
+offset_bottom = 90.0
text = "configure"
-script = SubResource("GDScript_a3v0r")
[node name="ExitButton" type="Button" parent="VBox"]
-layout_mode = 2
-offset_top = 104.0
+offset_top = 94.0
offset_right = 172.0
-offset_bottom = 152.0
+offset_bottom = 137.0
text = "<!) exit (!>"
script = SubResource("GDScript_vtoxm")
[node name="cfg" parent="." instance=ExtResource("2_sqamp")]
unique_name_in_owner = true
visible = false
-layout_mode = 1
-[connection signal="close" from="cfg" to="." method="_on_cfg_close"]
+[connection signal="pressed" from="VBox/CfgButtton" to="cfg" method="open"]
+[connection signal="close" from="cfg" to="." method="open"]