mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' into eye-of-the-universe
This commit is contained in:
commit
f8f0ae92cb
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/addon_manifest_schema.json",
|
||||||
"credits": [
|
"credits": [
|
||||||
"xen#Mod Director\n#Programmer",
|
"xen#Mod Director\n#Programmer",
|
||||||
"Bwc9876#Mod Manager\n#Programmer\n#Dev Ops",
|
"Bwc9876#Mod Manager\n#Programmer\n#Dev Ops",
|
||||||
|
|||||||
@ -101,11 +101,6 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
prop.transform.localScale = detail.stretch ?? (detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale);
|
prop.transform.localScale = detail.stretch ?? (detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale);
|
||||||
|
|
||||||
if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector);
|
|
||||||
prop.SetActive(true);
|
|
||||||
|
|
||||||
if (prop == null) return null;
|
|
||||||
|
|
||||||
if (detail.removeChildren != null)
|
if (detail.removeChildren != null)
|
||||||
{
|
{
|
||||||
var detailPath = prop.transform.GetPath();
|
var detailPath = prop.transform.GetPath();
|
||||||
@ -161,6 +156,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector);
|
||||||
|
prop.SetActive(true);
|
||||||
|
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,10 +53,14 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
_isInit = true;
|
_isInit = true;
|
||||||
|
|
||||||
// Just take every scroll and get the first arc
|
|
||||||
if (_arcPrefabs == null || _childArcPrefabs == null)
|
if (_arcPrefabs == null || _childArcPrefabs == null)
|
||||||
{
|
{
|
||||||
var existingArcs = GameObject.FindObjectsOfType<ScrollItem>().Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject).Where(x => x != null).ToArray();
|
// Just take every scroll and get the first arc
|
||||||
|
var existingArcs = GameObject.FindObjectsOfType<ScrollItem>()
|
||||||
|
.Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject)
|
||||||
|
.Where(x => x != null)
|
||||||
|
.OrderBy(x => x.transform.GetPath()) // order by path so game updates dont break things
|
||||||
|
.ToArray();
|
||||||
_arcPrefabs = new List<GameObject>();
|
_arcPrefabs = new List<GameObject>();
|
||||||
_childArcPrefabs = new List<GameObject>();
|
_childArcPrefabs = new List<GameObject>();
|
||||||
foreach (var existingArc in existingArcs)
|
foreach (var existingArc in existingArcs)
|
||||||
@ -74,7 +78,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
if (_ghostArcPrefabs == null)
|
if (_ghostArcPrefabs == null)
|
||||||
{
|
{
|
||||||
var existingGhostArcs = GameObject.FindObjectsOfType<GhostWallText>().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray();
|
var existingGhostArcs = GameObject.FindObjectsOfType<GhostWallText>()
|
||||||
|
.Select(x => x?._textLine?.gameObject)
|
||||||
|
.Where(x => x != null)
|
||||||
|
.OrderBy(x => x.transform.GetPath()) // order by path so game updates dont break things
|
||||||
|
.ToArray();
|
||||||
_ghostArcPrefabs = new List<GameObject>();
|
_ghostArcPrefabs = new List<GameObject>();
|
||||||
foreach (var existingArc in existingGhostArcs)
|
foreach (var existingArc in existingGhostArcs)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -206,7 +206,7 @@ namespace NewHorizons.Builder.ShipLog
|
|||||||
|
|
||||||
private static Sprite GetEntrySprite(string entryId, NewHorizonsBody body, bool logError)
|
private static Sprite GetEntrySprite(string entryId, NewHorizonsBody body, bool logError)
|
||||||
{
|
{
|
||||||
string relativePath = body.Config.ShipLog.spriteFolder + "/" + entryId + ".png";
|
string relativePath = Path.Combine(body.Config.ShipLog.spriteFolder, entryId + ".png");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Texture2D newTexture = ImageUtilities.GetTexture(body.Mod, relativePath);
|
Texture2D newTexture = ImageUtilities.GetTexture(body.Mod, relativePath);
|
||||||
|
|||||||
@ -655,11 +655,11 @@ namespace NewHorizons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Has to go before translations for achievements
|
// Has to go before translations for achievements
|
||||||
if (File.Exists(folder + "addon-manifest.json"))
|
if (File.Exists(Path.Combine(folder, "addon-manifest.json")))
|
||||||
{
|
{
|
||||||
LoadAddonManifest("addon-manifest.json", mod);
|
LoadAddonManifest("addon-manifest.json", mod);
|
||||||
}
|
}
|
||||||
if (Directory.Exists(folder + @"translations\"))
|
if (Directory.Exists(Path.Combine(folder, "translations")))
|
||||||
{
|
{
|
||||||
LoadTranslations(folder, mod);
|
LoadTranslations(folder, mod);
|
||||||
}
|
}
|
||||||
@ -677,9 +677,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)
|
||||||
@ -687,15 +697,15 @@ namespace NewHorizons
|
|||||||
var foundFile = false;
|
var foundFile = false;
|
||||||
foreach (TextTranslation.Language language in Enum.GetValues(typeof(TextTranslation.Language)))
|
foreach (TextTranslation.Language language in Enum.GetValues(typeof(TextTranslation.Language)))
|
||||||
{
|
{
|
||||||
if (language == TextTranslation.Language.UNKNOWN || language == TextTranslation.Language.TOTAL) continue;
|
if (language is TextTranslation.Language.UNKNOWN or TextTranslation.Language.TOTAL) continue;
|
||||||
|
|
||||||
var relativeFile = $"translations/{language.ToString().ToLower()}.json";
|
var relativeFile = Path.Combine("translations", language.ToString().ToLower() + ".json");
|
||||||
|
|
||||||
if (File.Exists($"{folder}{relativeFile}"))
|
if (File.Exists(Path.Combine(folder, relativeFile)))
|
||||||
{
|
{
|
||||||
Logger.LogVerbose($"Registering {language} translation from {mod.ModHelper.Manifest.Name} from {relativeFile}");
|
Logger.LogVerbose($"Registering {language} translation from {mod.ModHelper.Manifest.Name} from {relativeFile}");
|
||||||
|
|
||||||
var config = new TranslationConfig($"{folder}{relativeFile}");
|
var config = new TranslationConfig(Path.Combine(folder, relativeFile));
|
||||||
|
|
||||||
foundFile = true;
|
foundFile = true;
|
||||||
|
|
||||||
|
|||||||
@ -15,8 +15,7 @@
|
|||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="HarmonyX" Version="2.10.0" />
|
<PackageReference Include="OWML" Version="2.7.2" />
|
||||||
<PackageReference Include="OWML" Version="2.6.0" />
|
|
||||||
<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>
|
||||||
|
|||||||
@ -19,24 +19,31 @@ namespace NewHorizons.Utility.DebugUtilities
|
|||||||
|
|
||||||
private ScreenPrompt _raycastPrompt;
|
private ScreenPrompt _raycastPrompt;
|
||||||
|
|
||||||
private void Awake()
|
private void Start()
|
||||||
{
|
{
|
||||||
_rb = this.GetRequiredComponent<OWRigidbody>();
|
_rb = this.GetRequiredComponent<OWRigidbody>();
|
||||||
|
|
||||||
|
if (_raycastPrompt == null)
|
||||||
|
{
|
||||||
_raycastPrompt = new ScreenPrompt(TranslationHandler.GetTranslation("DEBUG_RAYCAST", TranslationHandler.TextType.UI) + " <CMD>", ImageUtilities.GetButtonSprite(KeyCode.P));
|
_raycastPrompt = new ScreenPrompt(TranslationHandler.GetTranslation("DEBUG_RAYCAST", TranslationHandler.TextType.UI) + " <CMD>", ImageUtilities.GetButtonSprite(KeyCode.P));
|
||||||
|
|
||||||
Locator.GetPromptManager().AddScreenPrompt(_raycastPrompt, PromptPosition.UpperRight, false);
|
Locator.GetPromptManager().AddScreenPrompt(_raycastPrompt, PromptPosition.UpperRight, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
if (_raycastPrompt != null)
|
||||||
{
|
{
|
||||||
Locator.GetPromptManager()?.RemoveScreenPrompt(_raycastPrompt, PromptPosition.UpperRight);
|
Locator.GetPromptManager()?.RemoveScreenPrompt(_raycastPrompt, PromptPosition.UpperRight);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
UpdatePromptVisibility();
|
UpdatePromptVisibility();
|
||||||
|
|
||||||
if (!Main.Debug) return;
|
if (!Main.Debug) return;
|
||||||
|
|
||||||
if (Keyboard.current == null) return;
|
if (Keyboard.current == null) return;
|
||||||
|
|
||||||
if (Keyboard.current[Key.P].wasReleasedThisFrame)
|
if (Keyboard.current[Key.P].wasReleasedThisFrame)
|
||||||
@ -47,9 +54,12 @@ namespace NewHorizons.Utility.DebugUtilities
|
|||||||
|
|
||||||
|
|
||||||
public void UpdatePromptVisibility()
|
public void UpdatePromptVisibility()
|
||||||
|
{
|
||||||
|
if (_raycastPrompt != null)
|
||||||
{
|
{
|
||||||
_raycastPrompt.SetVisibility(!OWTime.IsPaused() && Main.Debug);
|
_raycastPrompt.SetVisibility(!OWTime.IsPaused() && Main.Debug);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
internal void PrintRaycast()
|
internal void PrintRaycast()
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
namespace NewHorizons.Utility
|
namespace NewHorizons.Utility
|
||||||
{
|
{
|
||||||
@ -10,6 +11,8 @@ namespace NewHorizons.Utility
|
|||||||
Config = config;
|
Config = config;
|
||||||
Mod = mod;
|
Mod = mod;
|
||||||
RelativePath = relativePath;
|
RelativePath = relativePath;
|
||||||
|
|
||||||
|
Migrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlanetConfig Config;
|
public PlanetConfig Config;
|
||||||
@ -17,5 +20,31 @@ namespace NewHorizons.Utility
|
|||||||
public string RelativePath;
|
public string RelativePath;
|
||||||
|
|
||||||
public GameObject Object;
|
public GameObject Object;
|
||||||
|
|
||||||
|
#region Migration
|
||||||
|
private static readonly string[] _keepLoadedModsList = new string[]
|
||||||
|
{
|
||||||
|
"CreativeNameTxt.theirhomeworld",
|
||||||
|
"Roggsy.enterthewarioverse",
|
||||||
|
"Jammer.jammerlore",
|
||||||
|
"ErroneousCreationist.solarneighbourhood",
|
||||||
|
"ErroneousCreationist.incursionfinaldawn"
|
||||||
|
};
|
||||||
|
|
||||||
|
private void Migrate()
|
||||||
|
{
|
||||||
|
// Some old mods get really broken by this change in 1.6.1
|
||||||
|
if (_keepLoadedModsList.Contains(Mod.ModHelper.Manifest.UniqueName))
|
||||||
|
{
|
||||||
|
if (Config?.Props?.details != null)
|
||||||
|
{
|
||||||
|
foreach (var detail in Config.Props.details)
|
||||||
|
{
|
||||||
|
detail.keepLoaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,7 +119,7 @@ namespace NewHorizons.Utility
|
|||||||
|
|
||||||
var name = names.Last();
|
var name = names.Last();
|
||||||
if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}");
|
if (warn) Logger.LogWarning($"Couldn't find object in path {path}, will look for potential matches for name {name}");
|
||||||
// 3: find resource to include inactive objects (but skip prefabs
|
// 3: find resource to include inactive objects (but skip prefabs)
|
||||||
go = Resources.FindObjectsOfTypeAll<GameObject>()
|
go = Resources.FindObjectsOfTypeAll<GameObject>()
|
||||||
.FirstOrDefault(x => x.name == name && x.scene.name != null);
|
.FirstOrDefault(x => x.name == name && x.scene.name != null);
|
||||||
if (go)
|
if (go)
|
||||||
|
|||||||
@ -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" ]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user