Completed first demo quest line
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.Util;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class QuestDescriptionUi : RichTextLabel
|
||||
{
|
||||
@@ -8,4 +8,4 @@ public partial class QuestDescriptionUi : RichTextLabel
|
||||
{
|
||||
Text = questLog.currentDetailQuest?.description ?? "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,9 +26,8 @@ public partial class QuestListItemUi : Control
|
||||
|
||||
UpdateCircled(questResource == QuestManager.Instance.GetFollowQuest());
|
||||
ShowName(name);
|
||||
TitleButton.Pressed += ClickedTitleButton;
|
||||
|
||||
}
|
||||
|
||||
private void UpdateCircled(bool value)
|
||||
{
|
||||
CircleTexture.Visible = value;
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
#nullable enable
|
||||
using Godot;
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class QuestLog : Control
|
||||
{
|
||||
[Signal]
|
||||
public delegate void DetailQuestChangedEventHandler(QuestLog questLog);
|
||||
|
||||
[Export]
|
||||
private Vector2 _closedPos;
|
||||
|
||||
[Export]
|
||||
private Vector2 _openedPos;
|
||||
[Export] private Vector2 _closedPos;
|
||||
|
||||
[Export] private Vector2 _openedPos;
|
||||
|
||||
private bool _isClosed = true;
|
||||
private Tween? _closeOpenTween;
|
||||
@@ -29,16 +27,26 @@ public partial class QuestLog : Control
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
QuestManager.Instance!.QuestsChanged += () => EmitSignalDetailQuestChanged(this);
|
||||
QuestManager.Instance!.QuestsChanged += OnQuestsChanged;
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
QuestManager.Instance!.QuestsChanged -= OnQuestsChanged;
|
||||
}
|
||||
|
||||
private void OnQuestsChanged()
|
||||
{
|
||||
EmitSignalDetailQuestChanged(this);
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent inputEvent)
|
||||
{
|
||||
if (inputEvent.IsActionPressed("ui_inventory_journal_open_close"))
|
||||
{
|
||||
if(_closeOpenTween != null)
|
||||
if (_closeOpenTween != null)
|
||||
_closeOpenTween.Kill();
|
||||
|
||||
|
||||
_isClosed = !_isClosed;
|
||||
|
||||
_closeOpenTween = GetTree().CreateTween();
|
||||
@@ -48,6 +56,4 @@ public partial class QuestLog : Control
|
||||
.SetTrans(Tween.TransitionType.Cubic);
|
||||
}
|
||||
}
|
||||
|
||||
//private QuestResource? _currentDetailQuestBacking;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public partial class QuestMessagePopup : Control
|
||||
public override void _EnterTree()
|
||||
{
|
||||
QuestManager.Instance!.QuestsChanged += NewActiveQuest;
|
||||
NewActiveQuest();
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
|
||||
Reference in New Issue
Block a user