diff --git a/NewHorizons/Assets/translations/english.json b/NewHorizons/Assets/translations/english.json index 146c7fec..fcaf37dc 100644 --- a/NewHorizons/Assets/translations/english.json +++ b/NewHorizons/Assets/translations/english.json @@ -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": { diff --git a/NewHorizons/Assets/translations/french.json b/NewHorizons/Assets/translations/french.json index f9d17824..b735b808 100644 --- a/NewHorizons/Assets/translations/french.json +++ b/NewHorizons/Assets/translations/french.json @@ -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}" } } \ No newline at end of file diff --git a/NewHorizons/Handlers/TranslationHandler.cs b/NewHorizons/Handlers/TranslationHandler.cs index 634bbe4d..d682f578 100644 --- a/NewHorizons/Handlers/TranslationHandler.cs +++ b/NewHorizons/Handlers/TranslationHandler.cs @@ -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; diff --git a/NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs b/NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs index 0aeb4d6d..e2132b89 100644 --- a/NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs +++ b/NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs @@ -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); } } diff --git a/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs b/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs index 4535bb7b..7df501c7 100644 --- a/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs +++ b/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs @@ -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"); }