From df0a182a7827dafe29c0d656957d03de8d776fc8 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Fri, 26 May 2023 13:27:12 -0500 Subject: [PATCH 01/10] Audio volume direction settings --- NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs | 6 ++++++ .../Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs index 6b961a79..9b742f83 100644 --- a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs @@ -3,6 +3,7 @@ using NewHorizons.External.Modules.Volumes.VolumeInfos; using NewHorizons.Utility; using NewHorizons.Utility.Files; using NewHorizons.Utility.OuterWilds; +using NewHorizons.Utility.OWML; using OWML.Common; using UnityEngine; @@ -24,6 +25,11 @@ namespace NewHorizons.Builder.Volumes owAudioSource.SetClipSelectionType(info.clipSelection.ConvertToOW()); owAudioSource.SetTrack(info.track.ConvertToOW()); AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod); + Delay.FireOnNextUpdate(() => + { + owAudioSource.spatialBlend = info.spatialBlend ? 1 : 0; + owAudioSource.spread = info.spread; + }); var audioVolume = go.AddComponent(); audioVolume._layer = info.layer; diff --git a/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs b/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs index 6334ace0..42347ef2 100644 --- a/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs +++ b/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs @@ -52,6 +52,18 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos /// Pause the music when exiting the volume. /// public bool pauseOnFadeOut; + + /// + /// Whether the audio sounds like it emits from the center of the volume. + /// + public bool spatialBlend; + + /// + /// If spatialBlend is true, how much does the direction of audio "spread" out from facing the center, between 0 and 180 degrees. + /// + [Range(0f, 180f)] + [DefaultValue(180f)] + public float spread = 180f; } } From a6e47607324d162dd5aeaadb57275ac5c2ce330b Mon Sep 17 00:00:00 2001 From: Ben C Date: Fri, 26 May 2023 18:30:04 +0000 Subject: [PATCH 02/10] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index ce24bb0f..53c1fca0 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -3457,6 +3457,18 @@ "pauseOnFadeOut": { "type": "boolean", "description": "Pause the music when exiting the volume." + }, + "spatialBlend": { + "type": "boolean", + "description": "Whether the audio sounds like it emits from the center of the volume." + }, + "spread": { + "type": "number", + "description": "If spatialBlend is true, how much does the direction of audio \"spread\" out from facing the center, between 0 and 180 degrees.", + "format": "float", + "default": 180.0, + "maximum": 180.0, + "minimum": 0.0 } } }, From 6382aed77c84f11ac0a284c7474a89598807a499 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 5 Jun 2023 17:53:34 -0700 Subject: [PATCH 03/10] Revert "Audio volume direction settings" This reverts commit df0a182a7827dafe29c0d656957d03de8d776fc8. --- NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs | 6 ------ .../Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs | 12 ------------ 2 files changed, 18 deletions(-) diff --git a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs index 9b742f83..6b961a79 100644 --- a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs @@ -3,7 +3,6 @@ using NewHorizons.External.Modules.Volumes.VolumeInfos; using NewHorizons.Utility; using NewHorizons.Utility.Files; using NewHorizons.Utility.OuterWilds; -using NewHorizons.Utility.OWML; using OWML.Common; using UnityEngine; @@ -25,11 +24,6 @@ namespace NewHorizons.Builder.Volumes owAudioSource.SetClipSelectionType(info.clipSelection.ConvertToOW()); owAudioSource.SetTrack(info.track.ConvertToOW()); AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod); - Delay.FireOnNextUpdate(() => - { - owAudioSource.spatialBlend = info.spatialBlend ? 1 : 0; - owAudioSource.spread = info.spread; - }); var audioVolume = go.AddComponent(); audioVolume._layer = info.layer; diff --git a/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs b/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs index 42347ef2..6334ace0 100644 --- a/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs +++ b/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs @@ -52,18 +52,6 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos /// Pause the music when exiting the volume. /// public bool pauseOnFadeOut; - - /// - /// Whether the audio sounds like it emits from the center of the volume. - /// - public bool spatialBlend; - - /// - /// If spatialBlend is true, how much does the direction of audio "spread" out from facing the center, between 0 and 180 degrees. - /// - [Range(0f, 180f)] - [DefaultValue(180f)] - public float spread = 180f; } } From 3377a45a2c7470f89896d9ff4864b323561ae2a4 Mon Sep 17 00:00:00 2001 From: Ben C Date: Tue, 6 Jun 2023 00:57:02 +0000 Subject: [PATCH 04/10] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 9a86f173..cbcb608a 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -3458,18 +3458,6 @@ "pauseOnFadeOut": { "type": "boolean", "description": "Pause the music when exiting the volume." - }, - "spatialBlend": { - "type": "boolean", - "description": "Whether the audio sounds like it emits from the center of the volume." - }, - "spread": { - "type": "number", - "description": "If spatialBlend is true, how much does the direction of audio \"spread\" out from facing the center, between 0 and 180 degrees.", - "format": "float", - "default": 180.0, - "maximum": 180.0, - "minimum": 0.0 } } }, From 19a53a3f7a533d03deafabb956f8bd8926785a6b Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 5 Jun 2023 17:58:35 -0700 Subject: [PATCH 05/10] bump manifest version --- NewHorizons/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index a295d1da..3154f875 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.11.0", + "version": "1.11.1", "owmlVersion": "2.9.0", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ], From bdac8c8924dea6f44ac5b1daa53915c0d9f06970 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 5 Jun 2023 18:11:54 -0700 Subject: [PATCH 06/10] fix ConvertToOW for enums --- NewHorizons/External/SerializableEnums/NHFluidType.cs | 10 +++++----- NewHorizons/Utility/NewHorizonExtensions.cs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/NewHorizons/External/SerializableEnums/NHFluidType.cs b/NewHorizons/External/SerializableEnums/NHFluidType.cs index f9eb0c83..f7b406f9 100644 --- a/NewHorizons/External/SerializableEnums/NHFluidType.cs +++ b/NewHorizons/External/SerializableEnums/NHFluidType.cs @@ -7,14 +7,14 @@ namespace NewHorizons.External.SerializableEnums [JsonConverter(typeof(StringEnumConverter))] public enum NHFluidType { - [EnumMember(Value = @"none")] None = 0, + [EnumMember(Value = @"none")] NONE = 0, - [EnumMember(Value = @"water")] Water = 1, + [EnumMember(Value = @"water")] WATER = 1, - [EnumMember(Value = @"cloud")] Cloud = 2, + [EnumMember(Value = @"cloud")] CLOUD = 2, - [EnumMember(Value = @"sand")] Sand = 3, + [EnumMember(Value = @"sand")] SAND = 3, - [EnumMember(Value = @"plasma")] Plasma = 4 + [EnumMember(Value = @"plasma")] PLASMA = 4 } } diff --git a/NewHorizons/Utility/NewHorizonExtensions.cs b/NewHorizons/Utility/NewHorizonExtensions.cs index a0a5303b..e8e2222c 100644 --- a/NewHorizons/Utility/NewHorizonExtensions.cs +++ b/NewHorizons/Utility/NewHorizonExtensions.cs @@ -255,13 +255,13 @@ namespace NewHorizons.Utility } public static FluidVolume.Type ConvertToOW(this NHFluidType fluidType, FluidVolume.Type @default = FluidVolume.Type.NONE) - => EnumUtils.Parse(fluidType.ToString().ToUpper(), @default); + => EnumUtils.Parse(fluidType.ToString(), @default); public static OWAudioMixer.TrackName ConvertToOW(this NHAudioMixerTrackName trackName, OWAudioMixer.TrackName @default = OWAudioMixer.TrackName.Environment) - => EnumUtils.Parse(trackName.ToString().ToUpper(), @default); + => EnumUtils.Parse(trackName.ToString(), @default); public static OWAudioSource.ClipSelectionOnPlay ConvertToOW(this NHClipSelectionType clipSelection, OWAudioSource.ClipSelectionOnPlay @default = OWAudioSource.ClipSelectionOnPlay.RANDOM) - => EnumUtils.Parse(clipSelection.ToString().ToUpper(), @default); + => EnumUtils.Parse(clipSelection.ToString(), @default); public static void SmoothLookDir(this GameObject go, Vector3 direction, float dt, float angularVelocity) { From 5ecaf5fa75efda89f21cb953602eecce2d6a29b8 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 5 Jun 2023 18:12:36 -0700 Subject: [PATCH 07/10] typo --- NewHorizons/External/Modules/AtmosphereModule.cs | 2 +- NewHorizons/External/Modules/Props/TornadoInfo.cs | 2 +- NewHorizons/External/Modules/RingModule.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NewHorizons/External/Modules/AtmosphereModule.cs b/NewHorizons/External/Modules/AtmosphereModule.cs index b93fbb65..b1f563ac 100644 --- a/NewHorizons/External/Modules/AtmosphereModule.cs +++ b/NewHorizons/External/Modules/AtmosphereModule.cs @@ -120,7 +120,7 @@ namespace NewHorizons.External.Modules /// /// Fluid type for sounds/effects when colliding with this cloud. /// - [DefaultValue("cloud")] public NHFluidType fluidType = NHFluidType.Cloud; + [DefaultValue("cloud")] public NHFluidType fluidType = NHFluidType.CLOUD; /// /// Add lightning to this planet like on Giant's Deep. diff --git a/NewHorizons/External/Modules/Props/TornadoInfo.cs b/NewHorizons/External/Modules/Props/TornadoInfo.cs index 60e9cbda..6ec121c4 100644 --- a/NewHorizons/External/Modules/Props/TornadoInfo.cs +++ b/NewHorizons/External/Modules/Props/TornadoInfo.cs @@ -68,7 +68,7 @@ namespace NewHorizons.External.Modules.Props /// /// Fluid type for sounds/effects when colliding with this tornado. /// - [DefaultValue("cloud")] public NHFluidType fluidType = NHFluidType.Cloud; + [DefaultValue("cloud")] public NHFluidType fluidType = NHFluidType.CLOUD; } } diff --git a/NewHorizons/External/Modules/RingModule.cs b/NewHorizons/External/Modules/RingModule.cs index 3fa16675..ab4dac2c 100644 --- a/NewHorizons/External/Modules/RingModule.cs +++ b/NewHorizons/External/Modules/RingModule.cs @@ -12,7 +12,7 @@ namespace NewHorizons.External.Modules /// /// Fluid type for sounds/effects when colliding with this ring. /// - public NHFluidType fluidType = NHFluidType.None; + public NHFluidType fluidType = NHFluidType.NONE; /// /// Angle between the rings and the equatorial plane of the planet. From 60e1c22372e77e351a6816973494faeeda8e11d5 Mon Sep 17 00:00:00 2001 From: Ben C Date: Tue, 6 Jun 2023 01:14:53 +0000 Subject: [PATCH 08/10] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index cbcb608a..2715e81b 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -484,11 +484,11 @@ "type": "string", "description": "", "x-enumNames": [ - "None", - "Water", - "Cloud", - "Sand", - "Plasma" + "NONE", + "WATER", + "CLOUD", + "SAND", + "PLASMA" ], "enum": [ "none", From 114bb35cdc61ba5ebb5d1bf5d2b21764b2695c52 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 5 Jun 2023 18:35:11 -0700 Subject: [PATCH 09/10] doc --- NewHorizons/External/Modules/Props/Audio/AudioSourceInfo.cs | 3 ++- .../External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NewHorizons/External/Modules/Props/Audio/AudioSourceInfo.cs b/NewHorizons/External/Modules/Props/Audio/AudioSourceInfo.cs index d2579780..09bff572 100644 --- a/NewHorizons/External/Modules/Props/Audio/AudioSourceInfo.cs +++ b/NewHorizons/External/Modules/Props/Audio/AudioSourceInfo.cs @@ -8,7 +8,8 @@ namespace NewHorizons.External.Modules.Props.Audio public class AudioSourceInfo : BaseAudioInfo { /// - /// The audio track of this audio source + /// The audio track of this audio source. + /// Most of the time you'll use environment (the default) for sound effects and music for music. /// [DefaultValue("environment")] public NHAudioMixerTrackName track = NHAudioMixerTrackName.Environment; } diff --git a/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs b/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs index 6334ace0..2d302218 100644 --- a/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs +++ b/NewHorizons/External/Modules/Volumes/VolumeInfos/AudioVolumeInfo.cs @@ -16,7 +16,8 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos [DefaultValue("random")] public NHClipSelectionType clipSelection = NHClipSelectionType.RANDOM; /// - /// The audio track of this audio volume + /// The audio track of this audio volume. + /// Most of the time you'll use environment (the default) for sound effects and music for music. /// [DefaultValue("environment")] public NHAudioMixerTrackName track = NHAudioMixerTrackName.Environment; From 23690130506b0f2acba7fe65bdec54f819b3e6c9 Mon Sep 17 00:00:00 2001 From: Ben C Date: Tue, 6 Jun 2023 01:38:05 +0000 Subject: [PATCH 10/10] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 2715e81b..e6a1e5be 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2690,7 +2690,7 @@ "description": "An optional rename of this object" }, "track": { - "description": "The audio track of this audio source", + "description": "The audio track of this audio source.\nMost of the time you'll use environment (the default) for sound effects and music for music. ", "default": "environment", "$ref": "#/definitions/NHAudioMixerTrackName" } @@ -3424,7 +3424,7 @@ "$ref": "#/definitions/NHClipSelectionType" }, "track": { - "description": "The audio track of this audio volume", + "description": "The audio track of this audio volume.\nMost of the time you'll use environment (the default) for sound effects and music for music. ", "default": "environment", "$ref": "#/definitions/NHAudioMixerTrackName" },