From 2e18d7bca61c45d9493aae42469373dd67587a8e Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 9 Apr 2024 10:14:16 -0400 Subject: [PATCH 1/7] Prepend new dialogue options to top of list --- NewHorizons/Builder/Props/DialogueBuilder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/DialogueBuilder.cs b/NewHorizons/Builder/Props/DialogueBuilder.cs index 4daabe4a..429626e5 100644 --- a/NewHorizons/Builder/Props/DialogueBuilder.cs +++ b/NewHorizons/Builder/Props/DialogueBuilder.cs @@ -102,10 +102,12 @@ namespace NewHorizons.Builder.Props // We just have to merge the dialogue options var dialogueOptions = newDialogueNode.GetChildNode("DialogueOptionsList").GetChildNodes("DialogueOption"); var existingDialogueOptionsList = existingNode.GetChildNode("DialogueOptionsList"); + var firstNode = existingDialogueOptionsList.ChildNodes[0]; foreach (XmlNode node in dialogueOptions) { var importedNode = existingDialogueOptionsList.OwnerDocument.ImportNode(node, true); - existingDialogueOptionsList.AppendChild(importedNode); + // We add them to the start because normally the last option is to return to menu or exit + existingDialogueOptionsList.PrependChild(importedNode); } } else From 8230427e53e0c20792d813e92052bca2c8717fae Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 9 Apr 2024 10:24:01 -0400 Subject: [PATCH 2/7] Add some more people to the credits --- NewHorizons/Assets/addon-manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Assets/addon-manifest.json b/NewHorizons/Assets/addon-manifest.json index 363bc1bb..b5a71ba2 100644 --- a/NewHorizons/Assets/addon-manifest.json +++ b/NewHorizons/Assets/addon-manifest.json @@ -10,7 +10,7 @@ "Trifid#Tester\n#Programmer", "Nageld#Programmer", "Ernesto#Fish", - "With help from#Raicuparta\n#dgarroDC\n#jtsalomo\n#and the modding community", + "With help from#Raicuparta\n#dgarroDC\n#jtsalomo\n#coderCleric\n#TRSasasusu\n#and the modding community", " ", "Based off Marshmallow made by#_nebula", "With help from#AmazingAlek\n#Raicuparta\n#and the Outer Wilds discord server", From b3da6970e15b657b21ef4a1cfcdf164f3e0a6fa8 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 10 Apr 2024 10:22:49 -0400 Subject: [PATCH 3/7] Update INewHorizons.cs --- NewHorizons/INewHorizons.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/NewHorizons/INewHorizons.cs b/NewHorizons/INewHorizons.cs index 4dfd2d1f..71337802 100644 --- a/NewHorizons/INewHorizons.cs +++ b/NewHorizons/INewHorizons.cs @@ -1,4 +1,3 @@ -using NewHorizons.Handlers; using OWML.Common; using System; using System.Collections.Generic; From 0a1e5428e849ed94c29ca3ba2552e4c319694d4c Mon Sep 17 00:00:00 2001 From: Joshua Thome Date: Thu, 11 Apr 2024 10:34:58 -0500 Subject: [PATCH 4/7] Position and rotation offsets for custom item holding and socketing --- NewHorizons/Builder/Props/ItemBuilder.cs | 4 ++++ NewHorizons/Components/Props/NHItem.cs | 8 ++++++++ .../External/Modules/Props/Item/ItemInfo.cs | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/NewHorizons/Builder/Props/ItemBuilder.cs b/NewHorizons/Builder/Props/ItemBuilder.cs index 78a866be..2a678d58 100644 --- a/NewHorizons/Builder/Props/ItemBuilder.cs +++ b/NewHorizons/Builder/Props/ItemBuilder.cs @@ -51,6 +51,10 @@ namespace NewHorizons.Builder.Props item.DisplayName = itemName; item.ItemType = itemType; item.Droppable = info.droppable; + item.HoldOffset = info.holdOffset ?? Vector3.zero; + item.HoldRotation = info.holdRotation ?? Vector3.zero; + item.SocketOffset = info.socketOffset ?? Vector3.zero; + item.SocketRotation = info.socketRotation ?? Vector3.zero; if (!string.IsNullOrEmpty(info.pickupAudio)) { item.PickupAudio = AudioTypeHandler.GetAudioType(info.pickupAudio, mod); diff --git a/NewHorizons/Components/Props/NHItem.cs b/NewHorizons/Components/Props/NHItem.cs index b21db7ea..bdf3e388 100644 --- a/NewHorizons/Components/Props/NHItem.cs +++ b/NewHorizons/Components/Props/NHItem.cs @@ -19,6 +19,10 @@ namespace NewHorizons.Components.Props public AudioType DropAudio; public AudioType SocketAudio; public AudioType UnsocketAudio; + public Vector3 HoldOffset; + public Vector3 HoldRotation; + public Vector3 SocketOffset; + public Vector3 SocketRotation; public string PickupCondition; public bool ClearPickupConditionOnDrop; public string PickupFact; @@ -42,6 +46,8 @@ namespace NewHorizons.Components.Props public override void PickUpItem(Transform holdTranform) { base.PickUpItem(holdTranform); + transform.localPosition = HoldOffset; + transform.localEulerAngles = HoldRotation; TriggerPickupConditions(); PlayCustomSound(PickupAudio); } @@ -56,6 +62,8 @@ namespace NewHorizons.Components.Props public override void SocketItem(Transform socketTransform, Sector sector) { base.SocketItem(socketTransform, sector); + transform.localPosition = SocketOffset; + transform.localEulerAngles = SocketRotation; TriggerDropConditions(); PlayCustomSound(SocketAudio); } diff --git a/NewHorizons/External/Modules/Props/Item/ItemInfo.cs b/NewHorizons/External/Modules/Props/Item/ItemInfo.cs index 6307db11..23253119 100644 --- a/NewHorizons/External/Modules/Props/Item/ItemInfo.cs +++ b/NewHorizons/External/Modules/Props/Item/ItemInfo.cs @@ -44,6 +44,22 @@ namespace NewHorizons.External.Modules.Props.Item /// public MVector3 dropNormal; /// + /// A relative offset to apply to the item's position when holding it. The initial position varies for vanilla item types. + /// + public MVector3 holdOffset; + /// + /// A relative offset to apply to the item's rotation when holding it. + /// + public MVector3 holdRotation; + /// + /// A relative offset to apply to the item's position when placing it into a socket. + /// + public MVector3 socketOffset; + /// + /// A relative offset to apply to the item's rotation when placing it into a socket. + /// + public MVector3 socketRotation; + /// /// The audio to play when this item is picked up. Only applies to custom/non-vanilla item types. /// Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. /// From 811897279cce59c58e103ff84dfa3605008b0f15 Mon Sep 17 00:00:00 2001 From: Ben C Date: Thu, 11 Apr 2024 15:36:32 +0000 Subject: [PATCH 5/7] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index d6356f75..3e9321e8 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1429,6 +1429,22 @@ "description": "The direction the item will be oriented when dropping it on the ground. Defaults to up (0, 1, 0).", "$ref": "#/definitions/MVector3" }, + "holdOffset": { + "description": "A relative offset to apply to the item's position when holding it. The initial position varies for vanilla item types.", + "$ref": "#/definitions/MVector3" + }, + "holdRotation": { + "description": "A relative offset to apply to the item's rotation when holding it.", + "$ref": "#/definitions/MVector3" + }, + "socketOffset": { + "description": "A relative offset to apply to the item's position when placing it into a socket.", + "$ref": "#/definitions/MVector3" + }, + "socketRotation": { + "description": "A relative offset to apply to the item's rotation when placing it into a socket.", + "$ref": "#/definitions/MVector3" + }, "pickupAudio": { "type": "string", "description": "The audio to play when this item is picked up. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." From 183db0aa6883ad1744cad53e876b3082b0b58f72 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 11 Apr 2024 20:34:38 -0400 Subject: [PATCH 6/7] Fix using API to make nomai text always NREing --- .../Builder/Props/TranslatorText/TranslatorTextBuilder.cs | 2 +- NewHorizons/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs index 9ad3ba5c..89b4249b 100644 --- a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs +++ b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs @@ -476,7 +476,7 @@ namespace NewHorizons.Builder.Props.TranslatorText } ArcCacheData[] cachedData = null; - if (nhBody.Cache?.ContainsKey(cacheKey) ?? false) + if (nhBody?.Cache?.ContainsKey(cacheKey) ?? false) cachedData = nhBody.Cache.Get(cacheKey); var arranger = nomaiWallText.gameObject.AddComponent(); diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index db6a90ba..224a5735 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, JohnCorby, MegaPiggy, Clay, Trifid, and friends", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.19.8", + "version": "1.19.9", "owmlVersion": "2.10.3", "dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ], From 0d99669f814972f59ada4fa3ccaaa4014caaef8e Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 11 Apr 2024 23:50:27 -0400 Subject: [PATCH 7/7] Add mod unique id to NHAstroObject --- NewHorizons/Builder/General/AstroObjectBuilder.cs | 8 ++++++-- NewHorizons/Components/Orbital/NHAstroObject.cs | 5 +++++ NewHorizons/Handlers/PlanetCreationHandler.cs | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Builder/General/AstroObjectBuilder.cs b/NewHorizons/Builder/General/AstroObjectBuilder.cs index 45966762..a2fc1410 100644 --- a/NewHorizons/Builder/General/AstroObjectBuilder.cs +++ b/NewHorizons/Builder/General/AstroObjectBuilder.cs @@ -1,6 +1,6 @@ using NewHorizons.Components; using NewHorizons.Components.Orbital; -using NewHorizons.External.Configs; +using NewHorizons.External; using NewHorizons.Utility.OWML; using UnityEngine; @@ -8,9 +8,13 @@ namespace NewHorizons.Builder.General { public static class AstroObjectBuilder { - public static NHAstroObject Make(GameObject body, AstroObject primaryBody, PlanetConfig config, bool isVanilla) + public static NHAstroObject Make(GameObject body, AstroObject primaryBody, NewHorizonsBody nhBody, bool isVanilla) { NHAstroObject astroObject = body.AddComponent(); + astroObject.modUniqueName = nhBody.Mod.ModHelper.Manifest.UniqueName; + + var config = nhBody.Config; + astroObject.isVanilla = isVanilla; astroObject.HideDisplayName = !config.Base.hasMapMarker; astroObject.invulnerableToSun = config.Base.invulnerableToSun; diff --git a/NewHorizons/Components/Orbital/NHAstroObject.cs b/NewHorizons/Components/Orbital/NHAstroObject.cs index ed51060c..cb35f059 100644 --- a/NewHorizons/Components/Orbital/NHAstroObject.cs +++ b/NewHorizons/Components/Orbital/NHAstroObject.cs @@ -14,6 +14,11 @@ namespace NewHorizons.Components.Orbital public bool invulnerableToSun; public bool isVanilla; + /// + /// The unique name of the mod that created this body or, if it is an existing body being edited, the last mod to edit it + /// + public string modUniqueName; + public void SetOrbitalParametersFromConfig(OrbitModule orbit) { SetOrbitalParametersFromTrueAnomaly(orbit.eccentricity, orbit.semiMajorAxis, orbit.inclination, orbit.argumentOfPeriapsis, orbit.longitudeOfAscendingNode, orbit.trueAnomaly); diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index a778b8ad..75edb30a 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -371,7 +371,7 @@ namespace NewHorizons.Handlers const float sphereOfInfluence = 2000f; var owRigidBody = RigidBodyBuilder.Make(go, sphereOfInfluence, body.Config); - var ao = AstroObjectBuilder.Make(go, null, body.Config, false); + var ao = AstroObjectBuilder.Make(go, null, body, false); var sector = SectorBuilder.Make(go, owRigidBody, sphereOfInfluence); ao._rootSector = sector; @@ -447,7 +447,7 @@ namespace NewHorizons.Handlers var sphereOfInfluence = GetSphereOfInfluence(body); var owRigidBody = RigidBodyBuilder.Make(go, sphereOfInfluence, body.Config); - var ao = AstroObjectBuilder.Make(go, primaryBody, body.Config, false); + var ao = AstroObjectBuilder.Make(go, primaryBody, body, false); var sector = SectorBuilder.Make(go, owRigidBody, sphereOfInfluence * 2f); ao._rootSector = sector; @@ -788,7 +788,7 @@ namespace NewHorizons.Handlers } // Just destroy the existing AO after copying everything over - var newAO = AstroObjectBuilder.Make(go, primary, body.Config, true); + var newAO = AstroObjectBuilder.Make(go, primary, body, true); newAO._gravityVolume = ao._gravityVolume; newAO._moon = ao._moon; newAO._name = ao._name;