More inventory menu improvements
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using GameJamDungeon;
|
||||
using Godot;
|
||||
|
||||
public interface IPauseMenu : IControl
|
||||
{
|
||||
void FadeIn();
|
||||
void FadeOut();
|
||||
|
||||
event PauseMenu.UnpauseButtonPressedEventHandler UnpauseButtonPressed;
|
||||
event PauseMenu.TransitionCompletedEventHandler TransitionCompleted;
|
||||
}
|
||||
|
||||
@@ -18,10 +19,12 @@ public partial class PauseMenu : Control, IPauseMenu
|
||||
|
||||
[Signal]
|
||||
public delegate void TransitionCompletedEventHandler();
|
||||
[Signal]
|
||||
public delegate void UnpauseButtonPressedEventHandler();
|
||||
|
||||
[Node] public IAnimationPlayer AnimationPlayer { get; set; } = default!;
|
||||
|
||||
public void OnReady()
|
||||
public void OnResolved()
|
||||
{
|
||||
AnimationPlayer.AnimationFinished += OnAnimationFinished;
|
||||
}
|
||||
@@ -30,6 +33,13 @@ public partial class PauseMenu : Control, IPauseMenu
|
||||
|
||||
public void FadeOut() => AnimationPlayer.Play("fade_out");
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed(GameInputs.Pause))
|
||||
EmitSignal(SignalName.UnpauseButtonPressed);
|
||||
}
|
||||
|
||||
public void OnAnimationFinished(StringName name)
|
||||
=> EmitSignal(SignalName.TransitionCompleted);
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user