shorcuts
This commit is contained in:
parent
4f74636ce9
commit
175d813230
3 changed files with 79 additions and 12 deletions
|
|
@ -4,9 +4,9 @@ namespace Newlon.Components.GUI.Seedpackets;
|
|||
|
||||
public partial class Seedpacket : TextureButton
|
||||
{
|
||||
public static AudioStream TapStream;
|
||||
public static AudioStream UntapStream;
|
||||
public static AudioStream LiftStream;
|
||||
public static AudioStream TapStream = ResourceLoader.Load<AudioStream>("res://assets/audio/gui/tap.mp3");
|
||||
public static AudioStream UntapStream = ResourceLoader.Load<AudioStream>("res://assets/audio/gui/tap2.mp3");
|
||||
public static AudioStream LiftStream = ResourceLoader.Load<AudioStream>("res://assets/audio/gui/seedlift.mp3");
|
||||
private const string PATH_TO_PACKED_SCENE = "res://scenes/gui/seedpacket.tscn";
|
||||
private DisplayResource _resource;
|
||||
private Label _cost;
|
||||
|
|
@ -21,12 +21,6 @@ public partial class Seedpacket : TextureButton
|
|||
// Node overrides
|
||||
public override void _Ready()
|
||||
{
|
||||
if (TapStream == null)
|
||||
{
|
||||
TapStream = ResourceLoader.Load<AudioStream>("res://assets/audio/gui/tap.mp3");
|
||||
UntapStream = ResourceLoader.Load<AudioStream>("res://assets/audio/gui/tap2.mp3");
|
||||
LiftStream = ResourceLoader.Load<AudioStream>("res://assets/audio/gui/seedlift.mp3");
|
||||
}
|
||||
if (_resource != null)
|
||||
UpdateContents();
|
||||
if (Prefab == null)
|
||||
|
|
@ -79,11 +73,12 @@ public partial class Seedpacket : TextureButton
|
|||
_cost.LabelSettings = _resource.customFrame.font;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void _Pressed()
|
||||
{
|
||||
if (_handler is ISeedpacketPress pressHandler)
|
||||
pressHandler.Pressed();
|
||||
GrabFocus();
|
||||
}
|
||||
|
||||
public void Recharge()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue