summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-11-28 23:06:46 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-11-28 23:06:46 +0200
commit121c3ca9c0080005bdeebc6827aecf2b36721286 (patch)
tree9c50cafc539c54949be708d8afbc9a3960dfff0a
parent63e638242316ed011bea9c6defea81a68062e8fc (diff)
Add action button to ts ui
-rw-r--r--docs/index.html2
-rw-r--r--docs/index.pckbin3853448 -> 3865528 bytes
-rw-r--r--docs/index.service.worker.js2
-rw-r--r--pause_menu.gd2
-rw-r--r--project.godot1
-rw-r--r--top.gd2
-rw-r--r--top.tscn4
-rw-r--r--touch_screen_ui.tscn28
8 files changed, 30 insertions, 11 deletions
diff --git a/docs/index.html b/docs/index.html
index 18e3b24..3aca742 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -112,7 +112,7 @@ body {
<script src="index.js"></script>
<script>
-const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":3853448,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4,"serviceWorker":"index.service.worker.js"};
+const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":3865528,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4,"serviceWorker":"index.service.worker.js"};
const GODOT_THREADS_ENABLED = false;
const engine = new Engine(GODOT_CONFIG);
diff --git a/docs/index.pck b/docs/index.pck
index f2d8692..c669e15 100644
--- a/docs/index.pck
+++ b/docs/index.pck
Binary files differ
diff --git a/docs/index.service.worker.js b/docs/index.service.worker.js
index 3ef8c73..c2f5364 100644
--- a/docs/index.service.worker.js
+++ b/docs/index.service.worker.js
@@ -4,7 +4,7 @@
// Incrementing CACHE_VERSION will kick off the install event and force
// previously cached resources to be updated from the network.
/** @type {string} */
-const CACHE_VERSION = '1764276298|14106419829';
+const CACHE_VERSION = '1764363858|27701075135';
/** @type {string} */
const CACHE_PREFIX = 'MobileMetroidvan-sw-cache-';
const CACHE_NAME = CACHE_PREFIX + CACHE_VERSION;
diff --git a/pause_menu.gd b/pause_menu.gd
index 6079519..e13d6d6 100644
--- a/pause_menu.gd
+++ b/pause_menu.gd
@@ -11,7 +11,7 @@ func _ready():
$System/QuitButton.connect("pressed", _on_quit_button_pressed)
func _process(_delta: float):
- if visible and Input.is_action_just_pressed("jump"):
+ if visible and Input.is_action_just_pressed("action"):
active_page_index = (active_page_index + 1) % pages.size()
refresh_page()
diff --git a/project.godot b/project.godot
index 8155a63..03a6f5b 100644
--- a/project.godot
+++ b/project.godot
@@ -31,6 +31,7 @@ window/stretch/scale_mode="integer"
ui_movement=""
ui_menu=""
hook_hanging=""
+ui_action=""
[input]
diff --git a/top.gd b/top.gd
index 951ed1f..9875eab 100644
--- a/top.gd
+++ b/top.gd
@@ -14,6 +14,7 @@ func _ready() -> void:
$PauseMenu.deactivate()
get_tree().call_group("ui_movement", "set_visible", false)
get_tree().call_group("ui_menu", "set_visible", false)
+ get_tree().call_group("ui_action", "set_visible", false)
var room = preload(ROOM_MAIN_MENU).instantiate()
active_room_name = room.name
@@ -36,6 +37,7 @@ func replace_active_room(new_room: Node, on_changed: Callable):
var show_touchscreen_ui = (new_room.name != "MainMenu")
get_tree().call_group("ui_movement", "set_visible", show_touchscreen_ui)
get_tree().call_group("ui_menu", "set_visible", show_touchscreen_ui)
+ get_tree().call_group("ui_action", "set_visible", show_touchscreen_ui)
active_room_name = new_room.name
new_room.name = "ActiveRoom"
diff --git a/top.tscn b/top.tscn
index f35b2ed..17ab08d 100644
--- a/top.tscn
+++ b/top.tscn
@@ -148,8 +148,6 @@ process_mode = 3
material = ExtResource("1_edsjh")
script = ExtResource("1_on2c2")
-[node name="TouchScreenUI" parent="." instance=ExtResource("5_edsjh")]
-
[node name="TransitionPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_2exal")
@@ -224,6 +222,8 @@ offset_right = 460.0
offset_bottom = 231.0
text = "Autosaved TODO ago"
+[node name="TouchScreenUI" parent="." instance=ExtResource("5_edsjh")]
+
[node name="PaletteShader" type="CanvasLayer" parent="."]
layer = 10
script = ExtResource("5_ch5ua")
diff --git a/touch_screen_ui.tscn b/touch_screen_ui.tscn
index 6239410..7ea90fa 100644
--- a/touch_screen_ui.tscn
+++ b/touch_screen_ui.tscn
@@ -1,10 +1,11 @@
-[gd_scene load_steps=8 format=3 uid="uid://cciwccvljuuyq"]
+[gd_scene load_steps=11 format=3 uid="uid://cciwccvljuuyq"]
[ext_resource type="PackedScene" uid="uid://dwl0fylftkrn7" path="res://touch_screen_button.tscn" id="1_e48dh"]
-[ext_resource type="Texture2D" uid="uid://80qwkqluar71" path="res://assets.bak/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0758.png" id="2_e48dh"]
-[ext_resource type="Texture2D" uid="uid://dcmysr8ayphbq" path="res://assets.bak/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0760.png" id="3_e48dh"]
-[ext_resource type="Texture2D" uid="uid://dubf0an7e4r8q" path="res://assets.bak/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0757.png" id="4_e48dh"]
-[ext_resource type="Texture2D" uid="uid://jc43kdg6konu" path="res://assets.bak/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0769.png" id="5_e48dh"]
+[ext_resource type="Texture2D" uid="uid://80qwkqluar71" path="res://assets.untracked/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0758.png" id="2_e48dh"]
+[ext_resource type="Texture2D" uid="uid://dcmysr8ayphbq" path="res://assets.untracked/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0760.png" id="3_e48dh"]
+[ext_resource type="Texture2D" uid="uid://dubf0an7e4r8q" path="res://assets.untracked/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0757.png" id="4_e48dh"]
+[ext_resource type="Texture2D" uid="uid://jc43kdg6konu" path="res://assets.untracked/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0769.png" id="5_e48dh"]
+[ext_resource type="Texture2D" uid="uid://dindlpuux8i18" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (White)/tile_0506.png" id="5_v5djr"]
[sub_resource type="GDScript" id="GDScript_e48dh"]
script/source = "extends CanvasLayer
@@ -17,6 +18,12 @@ func _ready() -> void:
visible = visible_on_desktop
"
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_e48dh"]
+size = Vector2(40, 30)
+
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_v5djr"]
+size = Vector2(40, 30)
+
[sub_resource type="RectangleShape2D" id="RectangleShape2D_k6i1l"]
size = Vector2(40, 26)
@@ -38,12 +45,21 @@ inactive_color = Color(0.54509807, 0.6666667, 1, 0.5019608)
active_color = Color(0, 0.77254903, 0.7764706, 0.5019608)
[node name="TouchScreenButtonJump" parent="." groups=["ui_movement"] instance=ExtResource("1_e48dh")]
-position = Vector2(172, 88)
+position = Vector2(172, 93)
+shape = SubResource("RectangleShape2D_e48dh")
action = "jump"
texture = ExtResource("4_e48dh")
inactive_color = Color(0.54509807, 0.6666667, 1, 0.5019608)
active_color = Color(0, 0.77254903, 0.7764706, 0.5019608)
+[node name="TouchScreenButtonAction" parent="." groups=["ui_action"] instance=ExtResource("1_e48dh")]
+position = Vector2(172, 63)
+shape = SubResource("RectangleShape2D_v5djr")
+action = "action"
+texture = ExtResource("5_v5djr")
+inactive_color = Color(0.54509807, 0.6666667, 1, 0.5019608)
+active_color = Color(0, 0.77254903, 0.7764706, 0.5019608)
+
[node name="TouchScreenButtonMenu" parent="." groups=["ui_menu"] instance=ExtResource("1_e48dh")]
position = Vector2(172, 13)
shape = SubResource("RectangleShape2D_k6i1l")