public string GetEncounterName(IEncounterData encounterData, GameLanguage logLanguage) { string name = null; // Get encounter name in the game language if names are available if (EncounterNames.TryGetNamesForLanguage(logLanguage, out var names)) { names.TryGetValue(encounterData.Encounter, out name); } // If a translation is not available, try the default language if (name == null) { if (EncounterNames.TryGetNamesForLanguage(DefaultLanguage, out var englishNames)) { englishNames.TryGetValue(encounterData.Encounter, out name); } } // If no translated name is available, default to using the name of the agent name ??= new BossEncounterNameProvider().GetEncounterName(encounterData, logLanguage); // If a name is still unavailable, fall back to a default name name ??= UnknownName; return(name); }
public string GetName(LogData logData) { if (logData.Encounter != Encounter.Other) { if (EncounterNames.TryGetNamesForLanguage(language, out var names)) { if (names.TryGetValue(logData.Encounter, out string name)) { return(name); } } } // We default to the name of the main target in case a translated name // for the encounter is not available or we don't know the encounter. return(logData.MainTargetName); }