Big project cleanup with overhaul of file responsibilities (KISS) and code (DRY, YAGNI)
This commit is contained in:
@@ -17,8 +17,7 @@ public partial class Camera3d : Camera3D
|
||||
{
|
||||
Control focused = GetViewport().GuiGetFocusOwner();
|
||||
|
||||
if (focused is LineEdit || focused is TextEdit)
|
||||
return;
|
||||
if (focused is LineEdit || focused is TextEdit) return;
|
||||
if (canMove) MoveCamera(delta);
|
||||
}
|
||||
|
||||
@@ -38,17 +37,13 @@ public partial class Camera3d : Camera3D
|
||||
|
||||
if (direction != Vector3.Zero)
|
||||
{
|
||||
if(robot != null) robot = null;
|
||||
robot = null;
|
||||
direction = direction.Normalized() * Speed * (Input.IsActionPressed("sprint") ? 2.5f : 1) * d;
|
||||
Translate(direction);
|
||||
}
|
||||
else
|
||||
else if (robot != null)
|
||||
{
|
||||
if(robot != null)
|
||||
{
|
||||
Position = new Vector3(robot.Position.X, 10 - visibleLayer * 4, robot.Position.Z + 4f);
|
||||
}
|
||||
|
||||
Position = new Vector3(robot.Position.X, 10 - visibleLayer * 4, robot.Position.Z + 4f);
|
||||
}
|
||||
|
||||
if (Position.Y != 10 - visibleLayer * 4)
|
||||
|
||||
Reference in New Issue
Block a user