WIP Wasserstand UI
This commit is contained in:
@@ -15,6 +15,8 @@ public partial class VesnaBehaviour2D : Node
|
||||
|
||||
[Signal] public delegate void PickedUpToolEventHandler(bool success, int toolId);
|
||||
[Signal] public delegate void FilledWateringCanEventHandler();
|
||||
|
||||
[Signal] public delegate void InventorySelectionChangedEventHandler(int toolId);
|
||||
|
||||
private InventoryManager _inventoryManager;
|
||||
private InventoryInstance _inventoryInstance;
|
||||
@@ -44,20 +46,21 @@ public partial class VesnaBehaviour2D : Node
|
||||
|
||||
if (currentItem == null)
|
||||
return;
|
||||
|
||||
int toolId = -1;
|
||||
|
||||
if (currentItem.blueprint == _hoe)
|
||||
{
|
||||
ActivateTool(0);
|
||||
return;
|
||||
toolId = 0;
|
||||
}
|
||||
|
||||
if (currentItem.blueprint == _wateringCan)
|
||||
{
|
||||
ActivateTool(1);
|
||||
return;
|
||||
toolId = 1;
|
||||
}
|
||||
|
||||
ActivateTool(-1);
|
||||
ActivateTool(toolId);
|
||||
EmitSignal(SignalName.InventorySelectionChanged, toolId);
|
||||
|
||||
}
|
||||
|
||||
@@ -73,7 +76,7 @@ public partial class VesnaBehaviour2D : Node
|
||||
{
|
||||
if (toolId == 1)
|
||||
{
|
||||
_farmingControls.FillWateringCan(true);
|
||||
_farmingControls.FillWateringCan();
|
||||
_player2d.PlayWateringCanFillupAnimation();
|
||||
EmitSignal(SignalName.FilledWateringCan);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user