diff --git a/NewHorizons/Builder/Props/Audio/SignalBuilder.cs b/NewHorizons/Builder/Props/Audio/SignalBuilder.cs index 9fd8617c..07ffafd8 100644 --- a/NewHorizons/Builder/Props/Audio/SignalBuilder.cs +++ b/NewHorizons/Builder/Props/Audio/SignalBuilder.cs @@ -171,7 +171,15 @@ namespace NewHorizons.Builder.Props.Audio audioSignal._onlyAudibleToScope = info.onlyAudibleToScope; audioSignal._identificationDistance = info.identificationRadius; audioSignal._canBePickedUpByScope = true; - audioSignal._outerFogWarpVolume = planetGO.GetComponentInChildren(); // shouldn't break non-bramble signals + // The outsider adds outer fog warp volumes to Bramble which break any signals NH places there + if (Main.Instance.ModHelper.Interaction.ModExists("SBtT.TheOutsider") && planetGO.GetComponent()._name == AstroObject.Name.DarkBramble) + { + audioSignal._outerFogWarpVolume = null; + } + else + { + audioSignal._outerFogWarpVolume = planetGO.GetComponentInChildren(); // shouldn't break non-bramble signals + } // If it can be heard regularly then we play it immediately owAudioSource.playOnAwake = !info.onlyAudibleToScope; diff --git a/NewHorizons/Builder/Props/TornadoBuilder.cs b/NewHorizons/Builder/Props/TornadoBuilder.cs index c2d29093..098bf466 100644 --- a/NewHorizons/Builder/Props/TornadoBuilder.cs +++ b/NewHorizons/Builder/Props/TornadoBuilder.cs @@ -158,7 +158,7 @@ namespace NewHorizons.Builder.Props // Resize it so the force volume goes all the way up var fluidGO = tornadoGO.transform.Find(downwards ? "MockDownTornado_FluidCenter" : "MockUpTornado_FluidCenter"); fluidGO.GetComponent()._fluidType = info.fluidType.ConvertToOW(FluidVolume.Type.CLOUD); - fluidGO.localScale = new Vector3(1, 2f, 1); + fluidGO.localPosition = Vector3.up * 4.8f; if (info.tint != null) { diff --git a/NewHorizons/External/Modules/AtmosphereModule.cs b/NewHorizons/External/Modules/AtmosphereModule.cs index eb31dac2..5aba48a5 100644 --- a/NewHorizons/External/Modules/AtmosphereModule.cs +++ b/NewHorizons/External/Modules/AtmosphereModule.cs @@ -61,6 +61,7 @@ namespace NewHorizons.External.Modules /// /// Relative filepath to the fog color ramp texture, if you put fog. /// x axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top). + /// Optional. If you set fogTint, a default fog ramp will be tinted for you. /// public string fogRampPath; diff --git a/NewHorizons/Handlers/HeldItemHandler.cs b/NewHorizons/Handlers/HeldItemHandler.cs index 14ee0814..80c2f695 100644 --- a/NewHorizons/Handlers/HeldItemHandler.cs +++ b/NewHorizons/Handlers/HeldItemHandler.cs @@ -91,6 +91,9 @@ public static class HeldItemHandler private static void OnStarSystemChanging(string _) { + // Double check we're still holding it + _currentlyHeldItem = Locator.GetToolModeSwapper().GetItemCarryTool().GetHeldItem()?.gameObject; + if (_currentlyHeldItem != null) { // Track it so that when we return to this system we can delete the original diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 201def01..f0001677 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -848,6 +848,8 @@ namespace NewHorizons.Handlers // Get ready to move all the satellites var relativeMoonPositions = children.Select(x => x.transform.position - go.transform.position).ToArray(); + var relativeMoonMoonPositions = children.Select(x => AstroObjectLocator.GetChildren(x.GetComponent()) + .Select(childchild => (childchild?.transform?.position ?? Vector3.zero) - go.transform.position)).ToArray(); // If its tidally locked change the alignment var alignment = go.GetComponent(); @@ -874,11 +876,15 @@ namespace NewHorizons.Handlers } else { + var j = 0; foreach (var childChild in AstroObjectLocator.GetChildren(childAO)) { - if (childChild == null) continue; - var dPos = childChild.transform.position - child.transform.position; - childChild.transform.position = go.transform.position + relativeMoonPositions[i] + dPos; + if (childChild != null) + { + var dPos = relativeMoonMoonPositions[i].ElementAt(j); + childChild.transform.position = go.transform.position + dPos; + } + j++; } // Make sure the moons get updated to the new AO childAO._primaryBody = newAO; diff --git a/NewHorizons/INewHorizons.cs b/NewHorizons/INewHorizons.cs index 12002b1e..350d0e2b 100644 --- a/NewHorizons/INewHorizons.cs +++ b/NewHorizons/INewHorizons.cs @@ -146,7 +146,8 @@ namespace NewHorizons void DefineStarSystem(string name, string config, IModBehaviour mod); /// - /// Allows creation of dialogue by directly passing the xml and dialogueInfo json contents as strings + /// Allows creation of dialogue by directly passing the xml and dialogueInfo json contents as strings. + /// Must be called at least 2 frames before entering dialogue if you're using ReuseDialogueOptionsFrom /// /// TextAsset name used for compatibility with voice mod. Just has to be a unique identifier. /// The contents of the dialogue xml file as a string diff --git a/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs b/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs index e4f993a3..e62d1d75 100644 --- a/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs +++ b/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs @@ -23,7 +23,10 @@ namespace NewHorizons.Patches.WarpPatches if (!Main.Instance.IsWarpingFromVessel) PlayerData.SaveWarpedToTheEye(TimeLoopUtilities.GetVanillaSecondsRemaining()); + // This is totally letting us see the interior of bramble when warping Locator.GetPlayerSectorDetector().RemoveFromAllSectors(); + // This is a very jank workaround to stop us seeing all that #957 + Locator.GetPlayerCamera().farClipPlane = 0; LoadManager.EnableAsyncLoadTransition(); return false; diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 100d8d92..f218990e 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -370,7 +370,7 @@ }, "fogRampPath": { "type": "string", - "description": "Relative filepath to the fog color ramp texture, if you put fog.\nx axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top)." + "description": "Relative filepath to the fog color ramp texture, if you put fog.\nx axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top).\nOptional. If you set fogTint, a default fog ramp will be tinted for you." }, "hasOxygen": { "type": "boolean", diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 2581a2bb..3e3e060f 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, JohnCorby, MegaPiggy, Trifid, and friends", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.23.2", + "version": "1.23.3", "owmlVersion": "2.12.1", "dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "PacificEngine.OW_CommonResources" ], diff --git a/docs/src/content/docs/guides/dialogue.md b/docs/src/content/docs/guides/dialogue.md index 77d8631d..1f7edac7 100644 --- a/docs/src/content/docs/guides/dialogue.md +++ b/docs/src/content/docs/guides/dialogue.md @@ -27,6 +27,26 @@ A persistent condition is similar to a condition, except it _persists_ through l A remote trigger is used to have an NPC talk to you from a distance; ex: Slate stopping you for the umpteenth time to tell you information you already knew. +### ReuseDialogueOptionsListFrom + +This is a custom XML node introduced by New Horizons. Use it when adding new dialogue to existing characters, to repeat the dialogue options list from another node. + +For example, Slate's first dialogue with options is named `Scientist5`. To make a custom DialogueNode using these dialogue options (meaning new dialogue said by Slate, but reusing the possible player responses) you can write: + +```xml + + ... + + NEW DIALOGUE FOR SLATE HERE. + + + Scientist5 + + +``` + +Note: If you're loading dialogue in code, 2 frames must pass before entering the conversation in order for ReuseDialogueOptionsListFrom to take effect. + ## Example XML Here's an example dialogue XML: