Made quest usable
This commit is contained in:
@@ -5,13 +5,29 @@ using Babushka.scripts.CSharp.Common.Quest;
|
||||
public partial class QuestTrigger : Node
|
||||
{
|
||||
[Export]
|
||||
public QuestResource questResource;
|
||||
public QuestResource? questResource;
|
||||
|
||||
[Export]
|
||||
public QuestStatus.Status toStatus;
|
||||
|
||||
[Export]
|
||||
private bool makeCurrent = false;
|
||||
|
||||
public void Trigger()
|
||||
{
|
||||
GD.Print("trigger");
|
||||
|
||||
if(questResource== null)
|
||||
throw new Exception("QuestResource is not set on QuestTrigger node.");
|
||||
|
||||
if(QuestManager.Instance == null)
|
||||
throw new Exception("QuestManager instance is not available. Make sure it is initialized before calling Trigger.");
|
||||
|
||||
QuestManager.Instance.ChangeQuestStatus(questResource, toStatus);
|
||||
|
||||
if (makeCurrent)
|
||||
{
|
||||
QuestManager.Instance.SetFollowQuest(questResource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user