diff --git a/NewHorizons/Assets/translations/chinese_simple.json b/NewHorizons/Assets/translations/chinese_simple.json index f541e484..9d7d0560 100644 --- a/NewHorizons/Assets/translations/chinese_simple.json +++ b/NewHorizons/Assets/translations/chinese_simple.json @@ -6,6 +6,7 @@ "NEW_HORIZONS_WARP_DRIVE_DIALOGUE_3": "之后只需要系好安全带并启动自动驾驶即可进行跃迁!" }, "UIDictionary": { + "INSTALL_OUTER_WILDS_CHINESE_FONT_FIX": "在享受故事之前,建议安装Outer Wilds Chinese Fix这个Mod来解决缺字问题。", "INTERSTELLAR_MODE": "恒星际模式", "FREQ_STATUE": "挪麦雕像", "FREQ_WARP_CORE": "反引力推进", diff --git a/NewHorizons/Assets/translations/english.json b/NewHorizons/Assets/translations/english.json index 6eed88c3..30857f54 100644 --- a/NewHorizons/Assets/translations/english.json +++ b/NewHorizons/Assets/translations/english.json @@ -6,6 +6,7 @@ "NEW_HORIZONS_WARP_DRIVE_DIALOGUE_3": "Then just buckle up and engage the autopilot to warp there!" }, "UIDictionary": { + "INSTALL_OUTER_WILDS_CHINESE_FONT_FIX": "What why is this message being shown when the language is not set to Chinese go report this bug!", "INTERSTELLAR_MODE": "Interstellar Mode", "FREQ_STATUE": "Nomai Statue", "FREQ_WARP_CORE": "Anti-Graviton Flux", diff --git a/NewHorizons/External/NewHorizonsData.cs b/NewHorizons/External/NewHorizonsData.cs index cedb624a..199ec3ec 100644 --- a/NewHorizons/External/NewHorizonsData.cs +++ b/NewHorizons/External/NewHorizonsData.cs @@ -191,6 +191,7 @@ namespace NewHorizons.External if (_activeProfile != null && !_activeProfile.PopupsRead.Contains(id)) { _activeProfile.PopupsRead.Add(id); + Save(); } } diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index f391baaf..15bb0769 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -35,6 +35,8 @@ using System.Reflection; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; +using static TextTranslation; +using static UnityEngine.InputSystem.InputRemoting; namespace NewHorizons { @@ -439,6 +441,11 @@ namespace NewHorizons TitleSceneHandler.Init(); } + if (isTitleScreen) + { + MenuHandler.TitleScreen(); + } + // EOTU fixes if (isEyeOfTheUniverse) { diff --git a/NewHorizons/OtherMods/MenuFramework/MenuHandler.cs b/NewHorizons/OtherMods/MenuFramework/MenuHandler.cs index 1a54fc46..4a3228ff 100644 --- a/NewHorizons/OtherMods/MenuFramework/MenuHandler.cs +++ b/NewHorizons/OtherMods/MenuFramework/MenuHandler.cs @@ -3,9 +3,11 @@ using NewHorizons.Handlers; using NewHorizons.Utility; using NewHorizons.Utility.OWML; using OWML.Common; +using OWML.ModHelper; using System.Collections.Generic; using System.Linq; using UnityEngine; +using static TextTranslation; namespace NewHorizons.OtherMods.MenuFramework { @@ -61,5 +63,18 @@ namespace NewHorizons.OtherMods.MenuFramework public static void RegisterFailedConfig(string filename) => _failedFiles.Add(filename); public static void RegisterOneTimePopup(IModBehaviour mod, string message, bool repeat) => _registeredPopups.Add((mod, message, repeat)); + + public static void TitleScreen() + { + // Custom popup for recommending the Chinese Outer Wilds Font Fix mod if they are playing in chinese + // Only shows once per profile + if (TextTranslation.Get().m_language == Language.CHINESE_SIMPLE + && !Main.Instance.ModHelper.Interaction.ModExists("nice2cu1.OuterWildFixFont") + && !NewHorizonsData.HasReadOneTimePopup("INSTALL_OUTER_WILDS_CHINESE_FONT_FIX")) + { + Main.Instance.ModHelper.MenuHelper.PopupMenuManager.RegisterStartupPopup(TranslationHandler.GetTranslation("INSTALL_OUTER_WILDS_CHINESE_FONT_FIX", TranslationHandler.TextType.UI)); + NewHorizonsData.ReadOneTimePopup("INSTALL_OUTER_WILDS_CHINESE_FONT_FIX"); + } + } } }