Sun, Shovel, Fastforward, GUI Improvements
This commit is contained in:
parent
26c3aeb7e9
commit
63935d5978
28 changed files with 546 additions and 45 deletions
|
|
@ -8,11 +8,21 @@ public partial class PlantSlot : TextureButton
|
|||
[Export] private TextureRect _icon;
|
||||
[Export] private Timer _timer;
|
||||
|
||||
private bool _recharging;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (_resource != null)
|
||||
UpdateContents();
|
||||
}
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (_resource != null)
|
||||
{
|
||||
Disabled = _recharging || LevelController.Instance.LevelData.SunCount < _resource.Cost;
|
||||
FocusMode = Disabled ? FocusModeEnum.None : FocusModeEnum.All;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPlantResource( PlantResource resource )
|
||||
{
|
||||
|
|
@ -43,8 +53,7 @@ public partial class PlantSlot : TextureButton
|
|||
|
||||
public void Recharge()
|
||||
{
|
||||
Disabled = true;
|
||||
FocusMode = FocusModeEnum.None;
|
||||
_recharging = true;
|
||||
|
||||
ReleaseFocus();
|
||||
|
||||
|
|
@ -53,7 +62,6 @@ public partial class PlantSlot : TextureButton
|
|||
|
||||
private void Timeout()
|
||||
{
|
||||
Disabled = false;
|
||||
FocusMode = FocusModeEnum.All;
|
||||
_recharging = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue