Les Icônes se mettent correctement à jour durant la partie. Update de BaseMonoBehaviour, on peux maintenant ajouter une couleur a Info().
This commit is contained in:
parent
aac376670c
commit
2b5a227237
10 changed files with 142 additions and 1163 deletions
|
|
@ -94,7 +94,6 @@ namespace GameUI.Runtime
|
|||
|
||||
void ConfigureUIForQuestState(QuestStateEnum state)
|
||||
{
|
||||
Info($"<color=orange>Etat de la quête : {state}</color>");
|
||||
switch (state)
|
||||
{
|
||||
case QuestStateEnum.Disponible:
|
||||
|
|
@ -139,7 +138,6 @@ namespace GameUI.Runtime
|
|||
quest = FindMatchingActiveQuest(quest);
|
||||
QuestManager.Instance.CurrentQuest = quest;
|
||||
|
||||
Info($"<color=green><InfoQuestPanel.cs:143></color><color=orange>{quest.Name}</color>");
|
||||
UpdateQuestInfoDisplay(quest);
|
||||
ConfigureUIForQuestState(quest.State);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ namespace GameUI.Runtime
|
|||
if (_quest != null)
|
||||
{
|
||||
QuestManager.Instance.CurrentQuest = _quest;
|
||||
Info($"⏱️MAJ de la current quest {QuestManager.Instance.CurrentQuest.Name}");
|
||||
QuestSignals.RaiseInfoQuestPanel(_quest);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,14 +18,21 @@ namespace GameUI.Runtime
|
|||
|
||||
#region Unity API
|
||||
|
||||
void Start()
|
||||
void OnEnable()
|
||||
{
|
||||
QuestManager.OnQuestCompleted += HandleQuestCompleted;
|
||||
QuestManager.OnQuestCompleted += HandleQuestState;
|
||||
QuestManager.OnCheckStateQuest += HandleQuestState;
|
||||
// Re-synchroniser l'état quand l'UI s'active
|
||||
if (QuestManager.Instance != null)
|
||||
{
|
||||
QuestManager.Instance.CheckStateQuest();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
void OnDisable()
|
||||
{
|
||||
QuestManager.OnQuestCompleted -= HandleQuestCompleted;
|
||||
QuestManager.OnQuestCompleted -= HandleQuestState;
|
||||
QuestManager.OnCheckStateQuest -= HandleQuestState;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -49,9 +56,10 @@ namespace GameUI.Runtime
|
|||
#region Utils
|
||||
|
||||
/* Fonctions privées utiles */
|
||||
void HandleQuestCompleted(QuestClass quest)
|
||||
void HandleQuestState(QuestClass quest)
|
||||
{
|
||||
if (!MatchesQuest(quest.Name)) return;
|
||||
Info($"Etat de la quete {quest.Name} : {quest.State}", Color.burlywood);
|
||||
switch (quest.State)
|
||||
{
|
||||
case QuestStateEnum.Disponible:
|
||||
|
|
@ -63,6 +71,7 @@ namespace GameUI.Runtime
|
|||
m_hourglass.SetActive(true);
|
||||
break;
|
||||
case QuestStateEnum.Completed:
|
||||
Info("Completed !!", Color.green);
|
||||
m_check.SetActive(true);
|
||||
m_hourglass.SetActive(false);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ namespace GameUI.Runtime
|
|||
questMini.SetQuestName(quest.Name);
|
||||
bool isCompleted = QuestManager.Instance?.IsQuestCompleted(quest.Name) == true;
|
||||
questMini.m_check?.SetActive(isCompleted);
|
||||
questMini.m_hourglass?.SetActive(quest.State == QuestStateEnum.InProgress);
|
||||
}
|
||||
|
||||
questGO.GetComponent<InteractionQuestCard>().SetQuest(quest);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue