migration from new repo

This commit is contained in:
mrtoine 2025-09-06 23:56:47 +02:00
commit 423134a840
26930 changed files with 3458568 additions and 0 deletions

View file

@ -0,0 +1,69 @@
using System;
using Core.Runtime;
using Quests.Runtime;
using TMPro;
using UnityEngine;
namespace GameUI.Runtime.Events
{
public class EventsDisplayUI : BaseMonobehaviour
{
#region Publics
public TextMeshProUGUI m_questNameText;
public TextMeshProUGUI m_questDescriptionText;
#endregion
#region Unity API
void Start()
{
QuestManager.OnEventReceived += ShowEvent;
QuestManager.OnEventFromQuest += ShowQuestName;
m_questNameText.text = "";
m_questDescriptionText.text = "";
}
void OnDestroy()
{
QuestManager.OnEventReceived -= ShowEvent;
QuestManager.OnEventFromQuest -= ShowQuestName;
}
#endregion
#region Main Methods
//
#endregion
#region Utils
/* Fonctions privées utiles */
void ShowQuestName(QuestClass quest)
{
m_questNameText.text = LocalizationSystem.Instance.GetLocalizedText(quest.Name);
}
void ShowEvent(QuestEvent questEvent)
{
m_questDescriptionText.text = LocalizationSystem.Instance.GetLocalizedText(questEvent.DescriptionKey);
}
#endregion
#region Privates and Protected
// Variables privées
#endregion
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5849cda3e5bb40ba805ebf198aa1465e
timeCreated: 1754590246

View file

@ -0,0 +1,53 @@
using Codice.CM.Common;
using Core.Runtime;
using TMPro;
using UnityEngine;
namespace GameUI.Runtime.Events
{
public class QuestLogUI : BaseMonobehaviour
{
#region Publics
//
#endregion
#region Unity API
//
#endregion
#region Main Methods
public void setDatas(int time, string description)
{
_timeLogLabel.text = $"{time.ToString()} secs.";
description = $"{LocalizationSystem.Instance.GetLocalizedText(description)}";
_descriptionLogLabel.text = description;
}
#endregion
#region Utils
/* Fonctions privées utiles */
#endregion
#region Privates and Protected
// Variables privées
[SerializeField] TMP_Text _timeLogLabel;
[SerializeField] TMP_Text _descriptionLogLabel;
#endregion
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5eca0fd92d064a449b71fe52ae375cd8
timeCreated: 1754762284

View file

@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Core.Runtime;
using Quests.Runtime;
using UnityEngine;
namespace GameUI.Runtime.Events
{
public class QuestLogsListUI : BaseMonobehaviour
{
#region Publics
//
#endregion
#region Unity API
//
#endregion
#region Main Methods
public void Refresh(Guid questId)
{
for (int i = _logPanel.transform.childCount - 1; i >= 0; i--)
{
Destroy(_logPanel.transform.GetChild(i).gameObject);
}
var logs = GetQuestEventsLogList(questId);
foreach (var log in logs.OrderBy(l => l.Time))
{
QuestEvent questEvent = QuestManager.Instance.GetEventById(log.EventId);
GenerateLog(log.Time, questEvent);
}
}
public void ShowFor(Guid questId)
{
gameObject.SetActive(true);
Refresh(questId);
}
public void GenerateList(Guid questId)
{
Refresh(questId);
}
#endregion
#region Utils
/* Fonctions privées utiles */
List<QuestEventLog> GetQuestEventsLogList(Guid questId)
{
Dictionary<Guid, List<QuestEventLog>> eventsDict = GetFact<Dictionary<Guid, List<QuestEventLog>>>("events_quests_history");
if (eventsDict != null && eventsDict.TryGetValue(questId, out var logs))
return logs;
return new List<QuestEventLog>();
}
void GenerateLog(int time, QuestEvent questEvent)
{
GameObject logGO = Instantiate(_questLogPrefab, _logPanel.transform);
QuestLogUI logUI = logGO.GetComponent<QuestLogUI>();
logUI.setDatas(time, questEvent.DescriptionKey);
}
#endregion
#region Privates and Protected
// Variables privées
[SerializeField] GameObject _questLogPrefab;
[SerializeField] GameObject _logPanel;
#endregion
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 599b7d2c983c43beb15f0242026c5c98
timeCreated: 1754762587