gui updated

This commit is contained in:
Фёдор Веселов 2024-09-16 19:03:32 +05:00
commit 0c9ea6ed0f
14 changed files with 124 additions and 24 deletions

View file

@ -1,12 +1,14 @@
using Godot;
using System;
public partial class FastForwardButton : TextureButton
public partial class FastForwardButton : Button
{
[Export] private Texture2D firstSpeed;
[Export] private Texture2D secondSpeed;
[Export] private Texture2D thirdSpeed;
[Export] private AnimationPlayer flashAnimator;
private int speed = 1;
public void OnPressed()
@ -16,16 +18,18 @@ public partial class FastForwardButton : TextureButton
switch (speed)
{
case 1:
TextureNormal = firstSpeed;
Icon = firstSpeed;
break;
case 2:
TextureNormal = secondSpeed;
Icon = secondSpeed;
break;
case 3:
TextureNormal = thirdSpeed;
Icon = thirdSpeed;
break;
}
flashAnimator.Play("flash");
Engine.TimeScale = speed;
}
}

View file

@ -37,7 +37,7 @@ public partial class ShovelButton : TextureButton
{
if (LevelController.Instance.Pools.EntityField[i].TryGetValue(checkedPosition, out var entity) && entity is RuntimePlantData plantData)
{
plantData.Kill();
plantData.Kill();
break;
}
}