Made quest visuals

This commit is contained in:
cblech
2025-07-07 04:41:14 +02:00
parent 27e137bc02
commit 32249fde86
15 changed files with 359 additions and 45 deletions
+26
View File
@@ -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;
}