Reworked DSL for better architecture, implemented wall-phasing movement.
This commit is contained in:
@@ -6,7 +6,6 @@ public partial class UIHandler : Control
|
||||
{
|
||||
[Export] CodingWindow codingWindow;
|
||||
[Export] RobotList robotList;
|
||||
[Export] PanelContainer robotNaming;
|
||||
[Export] Information information;
|
||||
[Export] Camera3D mainCam;
|
||||
public override void _Ready()
|
||||
@@ -19,7 +18,8 @@ public partial class UIHandler : Control
|
||||
{
|
||||
robotList.OnRobotJumpTo += (robot) =>
|
||||
{
|
||||
mainCam.Position = new Vector3(robot.Position.X, mainCam.Position.Y, robot.Position.Z);
|
||||
mainCam.Position = new Vector3(robot.Position.X, mainCam.Position.Y, robot.Position.Z + 3f);
|
||||
ShowCodingWindow(robot);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -29,25 +29,8 @@ public partial class UIHandler : Control
|
||||
LightHandler.RedrawLights(color);
|
||||
}
|
||||
|
||||
public void ShowNamingPopup(Robot robot)
|
||||
public void ShowCodingWindow(Robot robot)
|
||||
{
|
||||
robotNaming.Visible = true;
|
||||
GameData.canMove = false;
|
||||
LineEdit name = robotNaming.GetNode<LineEdit>("./VBoxContainer/LineEdit");
|
||||
name.Text = robot.Name;
|
||||
Button button = robotNaming.GetNode<Button>("./VBoxContainer/Button");
|
||||
|
||||
Action handler = null;
|
||||
handler = () =>
|
||||
{
|
||||
robot.Name = name.Text;
|
||||
name.Text = "";
|
||||
robotNaming.Visible = false;
|
||||
GameData.canMove = true;
|
||||
button.ButtonUp -= handler;
|
||||
};
|
||||
|
||||
button.ButtonUp += handler;
|
||||
codingWindow.ShowWindow(robot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user