Made quest visuals
This commit is contained in:
@@ -8,6 +8,15 @@ public partial class QuestLog : Control
|
||||
[Signal]
|
||||
public delegate void DetailQuestChangedEventHandler(QuestLog questLog);
|
||||
|
||||
[Export]
|
||||
private Vector2 _closedPos;
|
||||
|
||||
[Export]
|
||||
private Vector2 _openedPos;
|
||||
|
||||
private bool _isClosed = true;
|
||||
private Tween? _closeOpenTween;
|
||||
|
||||
public QuestResource? currentDetailQuest
|
||||
{
|
||||
get => QuestManager.Instance!.GetFollowQuest();
|
||||
@@ -23,5 +32,22 @@ public partial class QuestLog : Control
|
||||
QuestManager.Instance!.QuestsChanged += () => EmitSignalDetailQuestChanged(this);
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent inputEvent)
|
||||
{
|
||||
if (inputEvent.IsActionPressed("ui_inventory_journal_open_close"))
|
||||
{
|
||||
if(_closeOpenTween != null)
|
||||
_closeOpenTween.Kill();
|
||||
|
||||
_isClosed = !_isClosed;
|
||||
|
||||
_closeOpenTween = GetTree().CreateTween();
|
||||
_closeOpenTween
|
||||
.TweenProperty(this, "position", _isClosed ? _closedPos : _openedPos, 0.5)
|
||||
.SetEase(Tween.EaseType.Out)
|
||||
.SetTrans(Tween.TransitionType.Cubic);
|
||||
}
|
||||
}
|
||||
|
||||
//private QuestResource? _currentDetailQuestBacking;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user