refactorisation du QuestSystem
This commit is contained in:
parent
2370cb670d
commit
5fa20c954c
11 changed files with 128 additions and 39 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue