Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions scenes/menus/title/components/touchscreen_warning.gd

This file was deleted.

1 change: 0 additions & 1 deletion scenes/menus/title/components/touchscreen_warning.gd.uid

This file was deleted.

31 changes: 29 additions & 2 deletions scenes/menus/title/components/touchscreen_warning.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
[gd_scene format=3 uid="uid://cbf7ft3j4hemp"]

[ext_resource type="Script" uid="uid://dx4alphqyxbwv" path="res://scenes/menus/title/components/touchscreen_warning.gd" id="1_smfbs"]
[sub_resource type="GDScript" id="GDScript_4hx3q"]
script/source = "# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends Control

signal dismissed


func _ready() -> void:
if _should_show_touchscreen_warning():
show()


func _should_show_touchscreen_warning() -> bool:
var has_touch: bool = DisplayServer.is_touchscreen_available()
var has_keyboard: bool
if OS.has_feature(\"web_android\") or OS.has_feature(\"web_ios\"):
# DisplayServer.has_hardware_keyboard() is not implemented on the web.
# Assuming mobile web browsers don't have a hardware keyboard.
has_keyboard = false
else:
has_keyboard = DisplayServer.has_hardware_keyboard()
return has_touch and not has_keyboard


func _on_dismiss_button_pressed() -> void:
dismissed.emit()
"

[node name="TouchscreenWarning" type="Control" unique_id=2046863085]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_smfbs")
script = SubResource("GDScript_4hx3q")
metadata/_tab_index = 0

[node name="PanelContainer" type="PanelContainer" parent="." unique_id=479124586]
Expand Down
7 changes: 0 additions & 7 deletions scenes/menus/title/title_screen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[ext_resource type="AudioStream" uid="uid://kc657macgib4" path="res://assets/first_party/music/Threadbare_Main_Loud.ogg" id="5_5uobg"]
[ext_resource type="Texture2D" uid="uid://lg5dl13njsg3" path="res://assets/first_party/tiles/Grass_And_Sand_Tiles.png" id="5_c6kyi"]
[ext_resource type="PackedScene" uid="uid://6s70kur03rjk" path="res://scenes/menus/title/components/credits.tscn" id="6_2ijyo"]
[ext_resource type="PackedScene" uid="uid://cbf7ft3j4hemp" path="res://scenes/menus/title/components/touchscreen_warning.tscn" id="6_5uobg"]
[ext_resource type="PackedScene" uid="uid://dkeb0yjgcfi86" path="res://scenes/menus/options/options.tscn" id="8_5uobg"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2ijyo"]
Expand Down Expand Up @@ -64,15 +63,9 @@ layout_mode = 2
size_flags_vertical = 3
metadata/_tab_index = 2

[node name="TouchscreenWarning" parent="Pages" unique_id=2046863085 instance=ExtResource("6_5uobg")]
visible = false
layout_mode = 2
metadata/_tab_index = 3

[connection signal="continue_pressed" from="Pages/MainMenu" to="." method="_on_main_menu_continue_pressed"]
[connection signal="credits_pressed" from="Pages/MainMenu" to="." method="_on_main_menu_credits_pressed"]
[connection signal="options_pressed" from="Pages/MainMenu" to="." method="_on_main_menu_options_pressed"]
[connection signal="start_pressed" from="Pages/MainMenu" to="." method="_on_start_pressed"]
[connection signal="back" from="Pages/Credits" to="." method="_on_credits_back"]
[connection signal="back" from="Pages/Options" to="." method="_on_options_back"]
[connection signal="dismissed" from="Pages/TouchscreenWarning" to="Pages/MainMenu" method="show"]
Loading