Gamepad support
This commit is contained in:
parent
87f841e8e1
commit
ed369cf718
24 changed files with 240 additions and 78 deletions
|
|
@ -29,7 +29,6 @@ public partial class ShovelButton : TextureButton
|
|||
public override void _Toggled(bool toggledOn)
|
||||
{
|
||||
Cursor.Instance.shovel = toggledOn;
|
||||
Cursor.Instance.UpdateCursor();
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
|
|
@ -68,7 +67,7 @@ public partial class ShovelButton : TextureButton
|
|||
|
||||
if (ButtonPressed)
|
||||
{
|
||||
var gridEntity = GetTile(PoolContainer.Instance.Plants.GetGlobalMousePosition());
|
||||
var gridEntity = GetTile(Cursor.GetCursorPosition());
|
||||
if (TrySetGridEntity(gridEntity)) return;
|
||||
if (TrySetDynEntity()) return;
|
||||
|
||||
|
|
@ -129,7 +128,7 @@ public partial class ShovelButton : TextureButton
|
|||
}
|
||||
private bool TrySetDynEntity()
|
||||
{
|
||||
raycast.GlobalPosition = PoolContainer.Instance.GetGlobalMousePosition();
|
||||
raycast.GlobalPosition = Cursor.GetCursorPosition();
|
||||
|
||||
if (raycast.IsColliding())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue