Add popup recommending chinese font fix if its not installed and the … (#1092)

## Improvements

- NH will now recommend users installed the Chinese Font Fix mod if they
do not have it and the language is set to Simplified Chinese.
This commit is contained in:
xen-42 2025-05-12 17:33:28 -04:00 committed by GitHub
commit 59261eae5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 25 additions and 0 deletions

View File

@ -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": "反引力推进",

View File

@ -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",

View File

@ -191,6 +191,7 @@ namespace NewHorizons.External
if (_activeProfile != null && !_activeProfile.PopupsRead.Contains(id))
{
_activeProfile.PopupsRead.Add(id);
Save();
}
}

View File

@ -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)
{

View File

@ -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");
}
}
}
}