refactorisation du QuestSystem

This commit is contained in:
mrtoine 2025-10-10 10:46:01 +02:00
parent 2370cb670d
commit 5fa20c954c
11 changed files with 128 additions and 39 deletions

View file

@ -45,10 +45,19 @@ namespace Core.Runtime
public string GetLocalizedText(string key)
{
if (GameManager.Instance.GetLocalTexts.TryGetValue(key, out var value))
// Guard against null or empty keys
if (string.IsNullOrEmpty(key))
{
return string.Empty;
}
// Guard against missing dictionary
var dict = GameManager.Instance?.GetLocalTexts;
if (dict != null && dict.TryGetValue(key, out var value))
return value;
return $"{key}";
// Fallback: return the key itself so UI shows something meaningful
return key;
}
public void SaveLanguage(string newLanguage)