Use the image keys and update API

This commit is contained in:
Nick 2022-08-21 19:37:55 -04:00
parent 27dee5867b
commit 7228b1a248
5 changed files with 8 additions and 9 deletions

View File

@ -12,7 +12,7 @@
"FREQ_UNKNOWN": "???",
"ENGAGE_WARP_PROMPT": "Engage Warp To {0}",
"WARP_LOCKED": "AUTOPILOT LOCKED TO:\n{0}",
"OWRP_EXPLORING": "Exploring {0}"
"RICH_PRESENCE_EXPLORING": "Exploring {0}"
},
"AchievementTranslations": {
"NH_EATEN_OUTSIDE_BRAMBLE": {

View File

@ -10,6 +10,6 @@
"FREQ_STATUE": "Statue Nomaï",
"FREQ_WARP_CORE": "Flux Anti-Gravitonique",
"FREQ_UNKNOWN": "???",
"OWRP_EXPLORING": "En train d'explorer {0}"
"RICH_PRESENCE_EXPLORING": "En train d'explorer {0}"
}
}

View File

@ -55,7 +55,6 @@ namespace NewHorizons.Handlers
// Try to default to English
if (dictionary.TryGetValue(TextTranslation.Language.ENGLISH, out var englishTable))
{
if (englishTable.TryGetValue(text, out var englishText))
{
translatedLanguage = TextTranslation.Language.ENGLISH;

View File

@ -5,8 +5,10 @@ namespace NewHorizons.OtherMods.OWRichPresence
public interface IRichPresenceAPI
{
public void SetRichPresence(string message, int imageKey);
public void SetRichPresence(string message, string imageKey);
public void SetTriggerActivation(bool active);
public void CreateTrigger(GameObject parent, Sector sector, string details, string imageKey);
public GameObject CreateTrigger(GameObject parent, string message, string imageKey);
public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey);
public void SetCurrentRootPresence(string message, string imageKey);
}
}

View File

@ -35,10 +35,9 @@ namespace NewHorizons.OtherMods.OWRichPresence
Logger.LogVerbose($"Registering {go.name} to OWRichPresence");
var localizedName = TranslationHandler.GetTranslation(name, TranslationHandler.TextType.UI);
var localizedMessage = TranslationHandler.GetTranslation("OWRP_EXPLORING", TranslationHandler.TextType.UI);
var message = localizedMessage.Replace("{0}", localizedName);
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
API.CreateTrigger(go, sector, message, "sun");
API.CreateTrigger(go, sector, message, name.Replace(" ", "").ToLowerInvariant());
}
public static void SetUpSolarSystem(string name)
@ -46,8 +45,7 @@ namespace NewHorizons.OtherMods.OWRichPresence
if (name == "SolarSystem") return;
var localizedName = ShipLogStarChartMode.UniqueIDToName(name);
var localizedMessage = TranslationHandler.GetTranslation("OWRP_EXPLORING", TranslationHandler.TextType.UI);
var message = localizedMessage.Replace("{0}", localizedName);
var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName);
API.SetCurrentRootPresence(message, "sun");
}