From 0e453670ffe8bc3ca696e2535d960bebe8e5aee7 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 25 Mar 2020 00:53:53 +0100 Subject: [PATCH] Now the TurnPanel and TouchPad's size is a lot smaller, this makes tap targeting a lot simpler, and more intuitive. (Eventually I will probably go back to the original plan, revert the size but add clickthrough support.) --- game/player/Player.tscn | 1 - game/ui/player_ui/player_ui.tscn | 52 +++++++++++++++++++++++++------- game/ui/touch_pad/TurnPanel.gd | 2 +- game/ui/touch_pad/analog.gd | 2 +- 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/game/player/Player.tscn b/game/player/Player.tscn index 26d3178d..e1e853c6 100644 --- a/game/player/Player.tscn +++ b/game/player/Player.tscn @@ -47,7 +47,6 @@ transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 [node name="Model" type="Spatial" parent="Body/Rotation_Helper"] [node name="character" parent="Body/Rotation_Helper/Model" instance=ExtResource( 1 )] -refresh_in_editor = false [node name="GUILayer" parent="." instance=ExtResource( 3 )] [connection signal="onc_open_loot_winow_request" from="." to="GUILayer" method="_on_Player_onc_open_loot_winow_request"] diff --git a/game/ui/player_ui/player_ui.tscn b/game/ui/player_ui/player_ui.tscn index 00458d4f..7996fbdc 100644 --- a/game/ui/player_ui/player_ui.tscn +++ b/game/ui/player_ui/player_ui.tscn @@ -90,7 +90,6 @@ __meta__ = { [node name="Analog" parent="GUI/TouchTargetControls/HBoxContainer/TargetPad" instance=ExtResource( 13 )] position = Vector2( 40, 30 ) -listenerNodePath = NodePath("../../../../../..") padname = "TargetPad" [node name="TouchMovementControls" type="MarginContainer" parent="GUI"] @@ -115,39 +114,70 @@ mouse_filter = 2 size_flags_horizontal = 7 size_flags_vertical = 7 -[node name="TouchPad" type="Control" parent="GUI/TouchMovementControls/HBoxContainer"] -margin_right = 203.0 +[node name="VBoxContainer" type="VBoxContainer" parent="GUI/TouchMovementControls/HBoxContainer"] +margin_right = 244.0 +margin_bottom = 350.0 +mouse_filter = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Control" type="Control" parent="GUI/TouchMovementControls/HBoxContainer/VBoxContainer"] +margin_right = 244.0 +margin_bottom = 171.0 +mouse_filter = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="TouchPad" type="Control" parent="GUI/TouchMovementControls/HBoxContainer/VBoxContainer"] +margin_top = 179.0 +margin_right = 244.0 margin_bottom = 350.0 mouse_filter = 2 size_flags_horizontal = 15 size_flags_vertical = 15 -[node name="Analog" parent="GUI/TouchMovementControls/HBoxContainer/TouchPad" instance=ExtResource( 13 )] +[node name="Analog" parent="GUI/TouchMovementControls/HBoxContainer/VBoxContainer/TouchPad" instance=ExtResource( 13 )] position = Vector2( 100, 290 ) -listenerNodePath = NodePath("../../../../../..") padname = "TouchPad" [node name="Control" type="Control" parent="GUI/TouchMovementControls/HBoxContainer"] -margin_left = 207.0 -margin_right = 533.0 +anchor_left = -0.00231481 +anchor_right = -0.00231481 +margin_left = 248.0 +margin_right = 614.0 margin_bottom = 350.0 mouse_filter = 2 size_flags_horizontal = 15 size_flags_vertical = 15 -size_flags_stretch_ratio = 1.6 +size_flags_stretch_ratio = 1.5 -[node name="TurnPanel" type="Control" parent="GUI/TouchMovementControls/HBoxContainer"] -margin_left = 537.0 +[node name="VBoxContainer2" type="VBoxContainer" parent="GUI/TouchMovementControls/HBoxContainer"] +margin_left = 618.0 margin_right = 864.0 margin_bottom = 350.0 mouse_filter = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Control" type="Control" parent="GUI/TouchMovementControls/HBoxContainer/VBoxContainer2"] +margin_right = 246.0 +margin_bottom = 131.0 +mouse_filter = 2 +size_flags_vertical = 3 + +[node name="TurnPanel" type="Control" parent="GUI/TouchMovementControls/HBoxContainer/VBoxContainer2"] +margin_top = 139.0 +margin_right = 246.0 +margin_bottom = 350.0 +mouse_filter = 2 size_flags_horizontal = 15 size_flags_vertical = 15 size_flags_stretch_ratio = 1.6 -[node name="Node2D" type="Node2D" parent="GUI/TouchMovementControls/HBoxContainer/TurnPanel"] +[node name="Node2D" type="Node2D" parent="GUI/TouchMovementControls/HBoxContainer/VBoxContainer2/TurnPanel"] position = Vector2( -600, -200 ) script = ExtResource( 7 ) +listenerNodePath = "../../../../../../.." [node name="Buttons" type="Control" parent="GUI"] anchor_left = 0.5 diff --git a/game/ui/touch_pad/TurnPanel.gd b/game/ui/touch_pad/TurnPanel.gd index 1859357f..021047d8 100644 --- a/game/ui/touch_pad/TurnPanel.gd +++ b/game/ui/touch_pad/TurnPanel.gd @@ -2,7 +2,7 @@ extends Node2D const INACTIVE_IDX = -1; -export (NodePath) var listenerNodePath : NodePath = "../../../../../.." +export (String) var listenerNodePath : String = "../../../../../.." export (String) var padname : String = "" var parent : Control diff --git a/game/ui/touch_pad/analog.gd b/game/ui/touch_pad/analog.gd index d48122cf..2d8f5f14 100644 --- a/game/ui/touch_pad/analog.gd +++ b/game/ui/touch_pad/analog.gd @@ -4,7 +4,7 @@ extends Node2D const INACTIVE_IDX = -1; export var isDynamicallyShowing = false -export (NodePath) var listenerNodePath : NodePath = "/root/game/player" +export (String) var listenerNodePath : String = "../../../../../../.." export var padname = "" var ball