diff --git a/src/CreativeBuilding.cs b/src/CreativeBuilding.cs index 1228331..2cd2d78 100644 --- a/src/CreativeBuilding.cs +++ b/src/CreativeBuilding.cs @@ -13,7 +13,9 @@ public class CreativeBuilding : Node2D [Export] public int MaxLength { get; set; } = 6; + private Player _player; private Texture _blockTex; + private BlockPos _startPos; private Facing _direction; private int _length; @@ -23,13 +25,15 @@ public class CreativeBuilding : Node2D public override void _Ready() { + _player = GetParent(); _blockTex = GD.Load("res://gfx/block.png"); } public override void _PhysicsProcess(float delta) { - if (!(this.GetGame() is Client client)) return; - Update(); + if (!_player.IsLocal) return; + var client = this.GetClient(); + Update(); // Make sure _Draw is being called. if (EscapeMenu.Instance.Visible || !client.Cursor.Visible) { _currentMode = null; return; } diff --git a/src/Cursor.cs b/src/Cursor.cs index 4181010..48214b4 100644 --- a/src/Cursor.cs +++ b/src/Cursor.cs @@ -9,6 +9,8 @@ public class Cursor : Node2D public override void _Notification(int what) { + // TODO: Keep mouse visible when it was pressed down in the game window. + // Meaning the game will continue to receive mouse move updates. switch (what) { case MainLoop.NotificationWmMouseEnter: Visible = true; break; case MainLoop.NotificationWmMouseExit: Visible = false; break;