diff --git a/project.godot b/project.godot index cfc6c25..2a1fec4 100644 --- a/project.godot +++ b/project.godot @@ -185,7 +185,6 @@ Steam="*res://addons/steam_api/steam.gd" window/size/width=1280 window/size/height=720 -window/size/fullscreen=true window/size/test_width=1920 window/size/test_height=1080 window/stretch/mode="2d" diff --git a/src/autoload/touch_screen.gd b/src/autoload/touch_screen.gd index 28108e2..630ac64 100644 --- a/src/autoload/touch_screen.gd +++ b/src/autoload/touch_screen.gd @@ -22,6 +22,12 @@ func _ready(): yield(Shared, "scene_changed") visible = Shared.is_touch or ((OS.has_touchscreen_ui_hint() and OS.get_name() == "HTML5") or OS.get_name() == "Android") +func _input(event): + if event is InputEventScreenTouch or event is InputEventScreenDrag: + visible = true + elif event is InputEventKey or event is InputEventJoypadButton or event is InputEventJoypadMotion: + visible = Shared.is_touch + func show_keys(arg_arrows := true, arg_c := true, arg_x := true, arg_pause := false, arg_passby := false): right.visible = arg_arrows keys[0].visible = arg_c diff --git a/src/menu/options/MenuOptions.gd b/src/menu/options/MenuOptions.gd index e35bf9b..e0492fd 100644 --- a/src/menu/options/MenuOptions.gd +++ b/src/menu/options/MenuOptions.gd @@ -12,8 +12,6 @@ func fill_items(): i.visible = Shared.light_enabled > 0 if i.is_in_group("shadow") and i.visible: i.visible = Shared.shadow_enabled > 0 - if i.is_in_group("touch"): - i.visible = TouchScreen.visible .fill_items() diff --git a/src/menu/options/MenuOptions.tscn b/src/menu/options/MenuOptions.tscn index 802e65d..a60f1fd 100644 --- a/src/menu/options/MenuOptions.tscn +++ b/src/menu/options/MenuOptions.tscn @@ -256,6 +256,7 @@ script = ExtResource( 24 ) __meta__ = { "_edit_use_anchors_": false } +list = PoolStringArray( "TOGGLE", "ALWAYS" ) is_refill = true var_name = "is_touch" @@ -274,11 +275,11 @@ anchor_bottom = 1.0 margin_left = 25.0 size_flags_vertical = 6 custom_fonts/font = ExtResource( 2 ) -text = "< OFF >" +text = "< TOGGLE >" align = 2 valign = 1 -[node name="X" type="Control" parent="Control/Menu/List" groups=["touch"]] +[node name="X" type="Control" parent="Control/Menu/List"] margin_top = 510.0 margin_right = 640.0 margin_bottom = 580.0 @@ -311,7 +312,7 @@ text = "< 2 >" align = 2 valign = 1 -[node name="Y" type="Control" parent="Control/Menu/List" groups=["touch"]] +[node name="Y" type="Control" parent="Control/Menu/List"] margin_top = 580.0 margin_right = 640.0 margin_bottom = 650.0