diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f91d0729..6daf72c8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,13 +1,15 @@ - -# My Changes + +## Major features +- - -Fixes # . + +## Minor features +- - -## What's new? -- . -- . -- . + +## Improvements +- - + +## Bug fixes +- diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 631a7b42..57060b79 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -13,6 +13,7 @@ on: branches: [main] types: - synchronize + - labeled paths-ignore: - "docs/**" - "*.md" diff --git a/NewHorizons/Builder/Props/DialogueBuilder.cs b/NewHorizons/Builder/Props/DialogueBuilder.cs index 39712108..b20a57d5 100644 --- a/NewHorizons/Builder/Props/DialogueBuilder.cs +++ b/NewHorizons/Builder/Props/DialogueBuilder.cs @@ -87,7 +87,7 @@ namespace NewHorizons.Builder.Props var dialogueTree = conversationZone.AddComponent(); - var xml = File.ReadAllText(mod.Manifest.ModFolderPath + info.xmlFile); + var xml = File.ReadAllText(Path.Combine(mod.Manifest.ModFolderPath, info.xmlFile)); var text = new TextAsset(xml); // Text assets need a name to be used with VoiceMod diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index b2856f53..91f40d97 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -2,12 +2,12 @@ using NewHorizons.External.Modules; using NewHorizons.Handlers; using NewHorizons.Utility; using OWML.Common; -using Enum = System.Enum; using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml; using UnityEngine; +using Enum = System.Enum; using Logger = NewHorizons.Utility.Logger; using Random = UnityEngine.Random; namespace NewHorizons.Builder.Props @@ -119,7 +119,7 @@ namespace NewHorizons.Builder.Props { InitPrefabs(); - var xmlPath = File.ReadAllText(mod.ModHelper.Manifest.ModFolderPath + info.xmlFile); + var xmlPath = File.ReadAllText(Path.Combine(mod.ModHelper.Manifest.ModFolderPath, info.xmlFile)); switch (info.type) { diff --git a/NewHorizons/Builder/Props/ProjectionBuilder.cs b/NewHorizons/Builder/Props/ProjectionBuilder.cs index fe403f8b..f531c2f2 100644 --- a/NewHorizons/Builder/Props/ProjectionBuilder.cs +++ b/NewHorizons/Builder/Props/ProjectionBuilder.cs @@ -4,6 +4,7 @@ using NewHorizons.Utility; using OWML.Common; using System; using System.Collections.Generic; +using System.IO; using System.Threading; using UnityEngine; using static NewHorizons.External.Modules.PropModule; @@ -385,8 +386,7 @@ namespace NewHorizons.Builder.Props } else { - // Don't use Path.Combine here else you break the Vision - imageLoader.PathsToLoad.Add((i, mod.ModHelper.Manifest.ModFolderPath + slideInfo.imagePath)); + imageLoader.PathsToLoad.Add((i, Path.Combine(mod.ModHelper.Manifest.ModFolderPath, slideInfo.imagePath))); } AddModules(slideInfo, ref slide, mod); diff --git a/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs b/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs index a5c18d78..9e82ae8b 100644 --- a/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/RumorModeBuilder.cs @@ -4,6 +4,7 @@ using NewHorizons.Handlers; using NewHorizons.Utility; using System; using System.Collections.Generic; +using System.IO; using System.Xml.Linq; using UnityEngine; using Logger = NewHorizons.Utility.Logger; @@ -53,7 +54,7 @@ namespace NewHorizons.Builder.ShipLog public static void AddBodyToShipLog(ShipLogManager manager, NewHorizonsBody body) { string systemName = body.Config.starSystem; - XElement astroBodyFile = XElement.Load(body.Mod.ModHelper.Manifest.ModFolderPath + "/" + body.Config.ShipLog.xmlFile); + XElement astroBodyFile = XElement.Load(Path.Combine(body.Mod.ModHelper.Manifest.ModFolderPath, body.Config.ShipLog.xmlFile)); XElement astroBodyId = astroBodyFile.Element("ID"); if (astroBodyId == null) { diff --git a/NewHorizons/Handlers/AudioTypeHandler.cs b/NewHorizons/Handlers/AudioTypeHandler.cs index 698514c8..70878ae3 100644 --- a/NewHorizons/Handlers/AudioTypeHandler.cs +++ b/NewHorizons/Handlers/AudioTypeHandler.cs @@ -2,6 +2,7 @@ using NewHorizons.Utility; using OWML.Common; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using UnityEngine; using Logger = NewHorizons.Utility.Logger; @@ -65,7 +66,7 @@ namespace NewHorizons.Handlers var id = mod.ModHelper.Manifest.UniqueName + "_" + audioPath; if (_customAudioTypes.TryGetValue(id, out audioType)) return audioType; - var audioClip = AudioUtilities.LoadAudio(mod.ModHelper.Manifest.ModFolderPath + "/" + audioPath); + var audioClip = AudioUtilities.LoadAudio(Path.Combine(mod.ModHelper.Manifest.ModFolderPath, audioPath)); if (audioClip == null) { diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 6d38e97b..001a647f 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -173,7 +173,7 @@ namespace NewHorizons TextTranslation.Get().SetLanguage(TextTranslation.Get().GetLanguage()); } - LoadTranslations(Instance.ModHelper.Manifest.ModFolderPath + "Assets/", this); + LoadTranslations(Path.Combine(Instance.ModHelper.Manifest.ModFolderPath, "Assets/"), this); } public void Awake() diff --git a/NewHorizons/NewHorizonsApi.cs b/NewHorizons/NewHorizonsApi.cs index 4924834f..a4da089f 100644 --- a/NewHorizons/NewHorizonsApi.cs +++ b/NewHorizons/NewHorizonsApi.cs @@ -36,10 +36,10 @@ namespace NewHorizons if (name == null) return; var relativePath = $"temp/{name}.json"; - var fullPath = Main.Instance.ModHelper.Manifest.ModFolderPath + relativePath; - if (!Directory.Exists(Main.Instance.ModHelper.Manifest.ModFolderPath + "temp")) + var fullPath = Path.Combine(Main.Instance.ModHelper.Manifest.ModFolderPath, relativePath); + if (!Directory.Exists(Path.Combine(Main.Instance.ModHelper.Manifest.ModFolderPath, "temp"))) { - Directory.CreateDirectory(Main.Instance.ModHelper.Manifest.ModFolderPath + "temp"); + Directory.CreateDirectory(Path.Combine(Main.Instance.ModHelper.Manifest.ModFolderPath, "temp")); } JsonHelper.SaveJsonObject(fullPath, config); var body = Main.Instance.LoadConfig(Main.Instance, relativePath); @@ -126,7 +126,7 @@ namespace NewHorizons var planet = Main.BodyDict[Main.Instance.CurrentStarSystem].Find((b) => b.Config.name == bodyName); return planet == null ? null - : QueryJson(outType, planet.Mod.ModHelper.Manifest.ModFolderPath + planet.RelativePath, jsonPath); + : QueryJson(outType, Path.Combine(planet.Mod.ModHelper.Manifest.ModFolderPath, planet.RelativePath), jsonPath); } public object QuerySystem(Type outType, string jsonPath) @@ -134,7 +134,7 @@ namespace NewHorizons var system = Main.SystemDict[Main.Instance.CurrentStarSystem]; return system == null ? null - : QueryJson(outType, system.Mod.ModHelper.Manifest.ModFolderPath + system.RelativePath, jsonPath); + : QueryJson(outType, Path.Combine(system.Mod.ModHelper.Manifest.ModFolderPath, system.RelativePath), jsonPath); } public GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, diff --git a/NewHorizons/OtherMods/VoiceActing/VoiceHandler.cs b/NewHorizons/OtherMods/VoiceActing/VoiceHandler.cs index 65f66b79..ed7142de 100644 --- a/NewHorizons/OtherMods/VoiceActing/VoiceHandler.cs +++ b/NewHorizons/OtherMods/VoiceActing/VoiceHandler.cs @@ -38,10 +38,10 @@ namespace NewHorizons.OtherMods.VoiceActing { foreach (var mod in Main.Instance.GetDependants().Append(Main.Instance)) { - var folder = $"{mod.ModHelper.Manifest.ModFolderPath}voicemod"; + var folder = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, "voicemod"); if (!Directory.Exists(folder)) { // Fallback to PascalCase bc it used to be like that - folder = $"{mod.ModHelper.Manifest.ModFolderPath}VoiceMod"; + folder = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, "VoiceMod"); } if (Directory.Exists(folder)) { diff --git a/NewHorizons/Patches/ProxyBodyPatches.cs b/NewHorizons/Patches/ProxyBodyPatches.cs index 6b7eb183..8040d805 100644 --- a/NewHorizons/Patches/ProxyBodyPatches.cs +++ b/NewHorizons/Patches/ProxyBodyPatches.cs @@ -32,6 +32,7 @@ namespace NewHorizons.Patches ProxyPlanet_Initialize(__instance); __instance._moon.SetOriginalBodies(Locator.GetAstroObject(AstroObject.Name.VolcanicMoon).transform, Locator.GetAstroObject(AstroObject.Name.BrittleHollow).transform); if (!__instance._fragmentsResolved) __instance.ResolveFragments(); + __instance.AssignBrittleHollowReference(); __instance._blackHoleMaterial = new Material(__instance._blackHoleRenderer.sharedMaterial); __instance._blackHoleRenderer.sharedMaterial = __instance._blackHoleMaterial; } diff --git a/NewHorizons/Utility/AssetBundleUtilities.cs b/NewHorizons/Utility/AssetBundleUtilities.cs index 29841acd..263e08bb 100644 --- a/NewHorizons/Utility/AssetBundleUtilities.cs +++ b/NewHorizons/Utility/AssetBundleUtilities.cs @@ -1,4 +1,4 @@ -using OWML.Common; +using OWML.Common; using System; using System.Collections.Generic; using System.IO; @@ -34,7 +34,7 @@ namespace NewHorizons.Utility } else { - var completePath = mod.ModHelper.Manifest.ModFolderPath + assetBundleRelativeDir; + var completePath = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, assetBundleRelativeDir); bundle = AssetBundle.LoadFromFile(completePath); if (bundle == null) { diff --git a/NewHorizons/Utility/AudioUtilities.cs b/NewHorizons/Utility/AudioUtilities.cs index d78e5b53..4a6801b7 100644 --- a/NewHorizons/Utility/AudioUtilities.cs +++ b/NewHorizons/Utility/AudioUtilities.cs @@ -1,6 +1,7 @@ using OWML.Common; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using UnityEngine; @@ -19,7 +20,7 @@ namespace NewHorizons.Utility { try { - var clip = LoadAudio(mod.ModHelper.Manifest.ModFolderPath + "/" + audio); + var clip = LoadAudio(Path.Combine(mod.ModHelper.Manifest.ModFolderPath, audio)); source._audioLibraryClip = AudioType.None; source._clipArrayIndex = 0; source._clipArrayLength = 0; diff --git a/NewHorizons/Utility/DebugMenu/DebugMenu.cs b/NewHorizons/Utility/DebugMenu/DebugMenu.cs index be19c867..ca54f738 100644 --- a/NewHorizons/Utility/DebugMenu/DebugMenu.cs +++ b/NewHorizons/Utility/DebugMenu/DebugMenu.cs @@ -210,7 +210,7 @@ namespace NewHorizons.Utility.DebugMenu continue; } - loadedConfigFiles[folder + body.RelativePath] = body.Config; + loadedConfigFiles[Path.Combine(folder, body.RelativePath)] = body.Config; submenus.ForEach(submenu => submenu.LoadConfigFile(this, body.Config)); } } @@ -235,9 +235,9 @@ namespace NewHorizons.Utility.DebugMenu try { - var path = loadedMod.ModHelper.Manifest.ModFolderPath + backupFolderName + relativePath; + var path = Path.Combine(loadedMod.ModHelper.Manifest.ModFolderPath, backupFolderName, relativePath); Logger.LogVerbose($"Backing up... {relativePath} to {path}"); - var oldPath = loadedMod.ModHelper.Manifest.ModFolderPath + relativePath; + var oldPath = Path.Combine(loadedMod.ModHelper.Manifest.ModFolderPath, relativePath); var directoryName = Path.GetDirectoryName(path); Directory.CreateDirectory(directoryName); @@ -254,7 +254,7 @@ namespace NewHorizons.Utility.DebugMenu try { Logger.Log($"Saving... {relativePath} to {filePath}"); - var path = loadedMod.ModHelper.Manifest.ModFolderPath + relativePath; + var path = Path.Combine(loadedMod.ModHelper.Manifest.ModFolderPath, relativePath); var directoryName = Path.GetDirectoryName(path); Directory.CreateDirectory(directoryName); diff --git a/NewHorizons/Utility/ImageUtilities.cs b/NewHorizons/Utility/ImageUtilities.cs index cf884938..db33fd99 100644 --- a/NewHorizons/Utility/ImageUtilities.cs +++ b/NewHorizons/Utility/ImageUtilities.cs @@ -17,14 +17,14 @@ namespace NewHorizons.Utility public static bool IsTextureLoaded(IModBehaviour mod, string filename) { - var path = mod.ModHelper.Manifest.ModFolderPath + filename; + var path = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, filename); return _loadedTextures.ContainsKey(path); } public static Texture2D GetTexture(IModBehaviour mod, string filename, bool useMipmaps = true, bool wrap = false) { // Copied from OWML but without the print statement lol - var path = mod.ModHelper.Manifest.ModFolderPath + filename; + var path = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, filename); if (_loadedTextures.ContainsKey(path)) { Logger.LogVerbose($"Already loaded image at path: {path}"); @@ -53,7 +53,7 @@ namespace NewHorizons.Utility public static void DeleteTexture(IModBehaviour mod, string filename, Texture2D texture) { - var path = mod.ModHelper.Manifest.ModFolderPath + filename; + var path = Path.Combine(mod.ModHelper.Manifest.ModFolderPath, filename); if (_loadedTextures.ContainsKey(path)) { if (_loadedTextures[path] == texture) diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 8403c18f..015d57e4 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.5.1", + "version": "1.6.0", "owmlVersion": "2.6.0", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ], diff --git a/README.md b/README.md index c0bbfc0c..4e447dcc 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Check the ship's log for how to use your warp drive to travel between star syste - [Incompatible mods](#incompatible-mods) +- [Supported mods](#supported-mods) - [Development](#development) - [Contact](#contact) - [Credits](#credits) @@ -28,6 +29,12 @@ Check the ship's log for how to use your warp drive to travel between star syste - Quantum Space Buddies. - OW Randomizer. +## Supported Mods +New Horizons has optional support for a few other mods: +- [Discord Rich Presence](https://outerwildsmods.com/mods/discordrichpresence/): Showcase what New Horizons worlds you're exploring in your Discord status! +- [Voice Acting Mod](https://outerwildsmods.com/mods/voiceactingmod/): Characters in NH can be given voice lines which will work with this mod installed. Try it out by downloading NH Examples and talking to Ernesto! +- [Achievements+](https://outerwildsmods.com/mods/achievements/): New Horizons and its addons have achievements you can unlock with this mod installed! + ## Features - Load planet meshes or details from asset bundles - Use our [template Unity project](https://github.com/xen-42/outer-wilds-unity-template) to create assets for use in NH, including all game scripts recovered using UtinyRipper diff --git a/docs/content/pages/secret.md b/docs/content/pages/secret.md index d5d0a562..335f5f3b 100644 --- a/docs/content/pages/secret.md +++ b/docs/content/pages/secret.md @@ -17,3 +17,7 @@ Uh idk what to put here thought it would be funny haha ## Test aaaaaaaaaaaaaaaaaaaaaaaaa + +## 9/2/22 + +Where were you when new horizons docs died, im going gorbo mode