Moved Action UI

main
Martin Felis 2024-02-28 21:47:40 +01:00
parent 0a46a5fc10
commit a74145fc57
2 changed files with 10 additions and 13 deletions

View File

@ -67,9 +67,9 @@ public class Game : Spatial {
Debug.Assert(_woodCountLabel != null);
_goldCountLabel = _gameUi.GetNode<Label>("TopRight/GoldCount");
Debug.Assert(_goldCountLabel != null);
_walkActionButton = _gameUi.GetNode<Button>("BottomCenter/WalkActionButton");
_walkActionButton = _gameUi.GetNode<Button>("Actions/WalkActionButton");
Debug.Assert(_walkActionButton != null);
_buildActionButton = _gameUi.GetNode<Button>("BottomCenter/BuildActionButton");
_buildActionButton = _gameUi.GetNode<Button>("Actions/BuildActionButton");
Debug.Assert(_buildActionButton != null);
// scene nodes
@ -216,7 +216,9 @@ public class Game : Spatial {
if (_actionMode == ActionMode.Building) {
Workbench workbench = (Workbench)_workbenchScene.Instance();
workbench.Connect("EntityClicked", this, nameof(OnEntityClicked));
workbench.Transform = tile.GlobalTransform;
AddChild(workbench);
_world.MarkCellUnwalkable(tile.Cell);

View File

@ -135,17 +135,12 @@ align = 1
root_node = NodePath("../..")
anims/FlashLabel = SubResource( 25 )
[node name="BottomCenter" type="HBoxContainer" parent="GameUI"]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -61.0
margin_top = -46.0
margin_right = 59.0
margin_bottom = -6.0
[node name="Actions" type="HBoxContainer" parent="GameUI"]
margin_left = 10.0
margin_top = 10.0
margin_bottom = 40.0
[node name="WalkActionButton" type="Button" parent="GameUI/BottomCenter"]
[node name="WalkActionButton" type="Button" parent="GameUI/Actions"]
margin_right = 58.0
margin_bottom = 40.0
rect_min_size = Vector2( 40, 40 )
@ -154,7 +149,7 @@ pressed = true
group = ExtResource( 13 )
text = "Walk"
[node name="BuildActionButton" type="Button" parent="GameUI/BottomCenter"]
[node name="BuildActionButton" type="Button" parent="GameUI/Actions"]
margin_left = 62.0
margin_right = 120.0
margin_bottom = 40.0