Updated Popup UI and robot generation
This commit is contained in:
@@ -23,11 +23,11 @@ public partial class UIHandler : Control
|
||||
|
||||
public void ShowNamingPopup(Robot robot)
|
||||
{
|
||||
VBoxContainer namingContainer = GetNode<VBoxContainer>("./Popup/RobotNaming");
|
||||
PanelContainer namingContainer = GetNode<PanelContainer>("../Popup/RobotNaming");
|
||||
namingContainer.Visible = true;
|
||||
GameData.canMove = false;
|
||||
LineEdit name = namingContainer.GetNode<LineEdit>("./LineEdit");
|
||||
Button button = namingContainer.GetNode<Button>("./Button");
|
||||
LineEdit name = namingContainer.GetNode<LineEdit>("./VBoxContainer/LineEdit");
|
||||
Button button = namingContainer.GetNode<Button>("./VBoxContainer/Button");
|
||||
|
||||
Action handler = null;
|
||||
handler = () =>
|
||||
|
||||
@@ -88,6 +88,7 @@ public partial class World : Node3D
|
||||
if (Input.IsActionJustPressed("spawn_robot") && robots.Count < maxRobotCount)
|
||||
{
|
||||
Robot robot = ResourceLoader.LoadRobotPrefab().Instantiate<Robot>();
|
||||
robot.Name = $"Robot #{robots.Count + 1}";
|
||||
robot.Position = map[0].tiles[rand.Next(layerSize), rand.Next(layerSize)].Position;
|
||||
AddChild(robot);
|
||||
robots.Add(robot);
|
||||
|
||||
Reference in New Issue
Block a user