Translate credits, popups, update OWML version

This commit is contained in:
Nick 2022-10-01 00:50:31 -04:00
parent 12d0d102f9
commit 8c62b56bc0
3 changed files with 16 additions and 6 deletions

View File

@ -593,9 +593,19 @@ namespace NewHorizons
var addonConfig = mod.ModHelper.Storage.Load<AddonConfig>(file); var addonConfig = mod.ModHelper.Storage.Load<AddonConfig>(file);
if (addonConfig.achievements != null) AchievementHandler.RegisterAddon(addonConfig, mod as ModBehaviour); if (addonConfig.achievements != null)
if (addonConfig.credits != null) CreditsHandler.RegisterCredits(mod.ModHelper.Manifest.Name, addonConfig.credits); {
if (!string.IsNullOrEmpty(addonConfig.popupMessage)) MenuHandler.RegisterOneTimePopup(mod, addonConfig.popupMessage); AchievementHandler.RegisterAddon(addonConfig, mod as ModBehaviour);
}
if (addonConfig.credits != null)
{
var translatedCredits = addonConfig.credits.Select(x => TranslationHandler.GetTranslation(x, TranslationHandler.TextType.UI)).ToArray();
CreditsHandler.RegisterCredits(mod.ModHelper.Manifest.Name, translatedCredits);
}
if (!string.IsNullOrEmpty(addonConfig.popupMessage))
{
MenuHandler.RegisterOneTimePopup(mod, TranslationHandler.GetTranslation(addonConfig.popupMessage, TranslationHandler.TextType.UI));
}
} }
private void LoadTranslations(string folder, IModBehaviour mod) private void LoadTranslations(string folder, IModBehaviour mod)

View File

@ -16,7 +16,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="HarmonyX" Version="2.10.0" /> <PackageReference Include="HarmonyX" Version="2.10.0" />
<PackageReference Include="OWML" Version="2.6.0" /> <PackageReference Include="OWML" Version="2.7.2" />
<PackageReference Include="OuterWildsGameLibs" Version="1.1.13.393" /> <PackageReference Include="OuterWildsGameLibs" Version="1.1.13.393" />
<Reference Include="../Lib/System.ComponentModel.Annotations.dll" /> <Reference Include="../Lib/System.ComponentModel.Annotations.dll" />
</ItemGroup> </ItemGroup>

View File

@ -4,8 +4,8 @@
"author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book", "author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book",
"name": "New Horizons", "name": "New Horizons",
"uniqueName": "xen.NewHorizons", "uniqueName": "xen.NewHorizons",
"version": "1.6.1", "version": "1.6.2",
"owmlVersion": "2.6.0", "owmlVersion": "2.7.2",
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility" ], "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],
"pathsToPreserve": [ "planets", "systems", "translations" ] "pathsToPreserve": [ "planets", "systems", "translations" ]