Add retry quest option
This commit is contained in:
@@ -95,6 +95,16 @@ public class Journal : MonoBehaviour
|
|||||||
bool success = QuestManager.Instance.RunQuestWithAdventurer(m_availableAdventurers[m_selectedAdventurer], activeQuest);
|
bool success = QuestManager.Instance.RunQuestWithAdventurer(m_availableAdventurers[m_selectedAdventurer], activeQuest);
|
||||||
Debug.Log("THE QUESTR ESULT WAS: " + success);
|
Debug.Log("THE QUESTR ESULT WAS: " + success);
|
||||||
adventurerPage.gameObject.SetActive(false);
|
adventurerPage.gameObject.SetActive(false);
|
||||||
|
if(success)
|
||||||
|
{
|
||||||
|
questPage.Find("QuestResult/NextQuest").gameObject.SetActive(true);
|
||||||
|
questPage.Find("QuestResult/RetryQuest").gameObject.SetActive(false);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
questPage.Find("QuestResult/NextQuest").gameObject.SetActive(false);
|
||||||
|
questPage.Find("QuestResult/RetryQuest").gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
questPage.Find("QuestResult/QuestResultText").gameObject.GetComponent<TMP_Text>().text = success ? activeQuest.successStr : activeQuest.failedStr;
|
questPage.Find("QuestResult/QuestResultText").gameObject.GetComponent<TMP_Text>().text = success ? activeQuest.successStr : activeQuest.failedStr;
|
||||||
questPage.Find("QuestResult").gameObject.SetActive(true);
|
questPage.Find("QuestResult").gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
@@ -107,4 +117,12 @@ public class Journal : MonoBehaviour
|
|||||||
CloseJournal();
|
CloseJournal();
|
||||||
Debug.Log("Started next quest");
|
Debug.Log("Started next quest");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RetryQuest()
|
||||||
|
{
|
||||||
|
Debug.Log("Retrying quest");
|
||||||
|
questPage.Find("QuestResult").gameObject.SetActive(false);
|
||||||
|
QuestManager.Instance.RetryQuest();
|
||||||
|
CloseJournal();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user