diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 660956b6..6cb415a2 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -1,3 +1,4 @@ +using NewHorizons.Builder.General; using NewHorizons.External.Configs; using NewHorizons.External.Modules; using NewHorizons.Handlers; @@ -98,8 +99,9 @@ namespace NewHorizons.Builder.Props prop.transform.rotation = go.transform.TransformRotation(rot); } - prop.transform.localScale = 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; diff --git a/NewHorizons/Builder/Props/RemoteBuilder.cs b/NewHorizons/Builder/Props/RemoteBuilder.cs index 21f5d4b7..51e04bb0 100644 --- a/NewHorizons/Builder/Props/RemoteBuilder.cs +++ b/NewHorizons/Builder/Props/RemoteBuilder.cs @@ -116,7 +116,9 @@ namespace NewHorizons.Builder.Props var id = RemoteHandler.GetPlatformID(info.id); - var decal = ImageUtilities.GetTexture(mod, info.decalPath, false, false); + Texture2D decal = Texture2D.whiteTexture; + if (!string.IsNullOrWhiteSpace(info.decalPath)) decal = ImageUtilities.GetTexture(mod, info.decalPath, false, false); + else Logger.LogError($"Missing decal path on [{info.id}] for [{go.name}]"); if (info.platform != null) { diff --git a/NewHorizons/Builder/Props/ScatterBuilder.cs b/NewHorizons/Builder/Props/ScatterBuilder.cs index a92ebd9b..dffcc47a 100644 --- a/NewHorizons/Builder/Props/ScatterBuilder.cs +++ b/NewHorizons/Builder/Props/ScatterBuilder.cs @@ -69,6 +69,7 @@ namespace NewHorizons.Builder.Props var detailInfo = new PropModule.DetailInfo() { scale = propInfo.scale, + stretch = propInfo.stretch, keepLoaded = propInfo.keepLoaded }; var scatterPrefab = DetailBuilder.Make(go, sector, prefab, detailInfo); diff --git a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs index bbb201d8..c85f2e74 100644 --- a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs @@ -46,6 +46,7 @@ namespace NewHorizons.Builder.Volumes var owAudioSource = go.AddComponent(); owAudioSource._audioSource = audioSource; owAudioSource.loop = info.loop; + owAudioSource.SetMaxVolume(info.volume); owAudioSource.SetTrack((OWAudioMixer.TrackName)Enum.Parse(typeof(OWAudioMixer.TrackName), Enum.GetName(typeof(AudioMixerTrackName), info.track))); AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod); diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 1644192d..807aa9d6 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -123,7 +123,12 @@ namespace NewHorizons.External.Modules /// /// Scale this prop once it is placed /// - public float scale = 1f; + [DefaultValue(1f)] public float scale = 1f; + + /// + /// Scale each axis of the prop. Overrides `scale`. + /// + public MVector3 stretch; /// /// The number used as entropy for scattering the props @@ -200,6 +205,11 @@ namespace NewHorizons.External.Modules /// [DefaultValue(1f)] public float scale = 1f; + /// + /// Scale each axis of the prop. Overrides `scale`. + /// + public MVector3 stretch; + /// /// If this value is not null, this prop will be quantum. Assign this field to the id of the quantum group it should be a part of. The group it is assigned to determines what kind of quantum object it is /// diff --git a/NewHorizons/External/Modules/VolumesModule.cs b/NewHorizons/External/Modules/VolumesModule.cs index 49bbc542..9211f495 100644 --- a/NewHorizons/External/Modules/VolumesModule.cs +++ b/NewHorizons/External/Modules/VolumesModule.cs @@ -4,6 +4,7 @@ using Newtonsoft.Json.Converters; using System; using System.Collections.Generic; using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.Text; @@ -134,6 +135,13 @@ namespace NewHorizons.External.Modules /// Whether to loop this audio while in this audio volume or just play it once /// [DefaultValue(true)] public bool loop = true; + + /// + /// The loudness of the audio + /// + [Range(0f, 1f)] + [DefaultValue(1f)] + public float volume = 1f; } [JsonObject] diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index a3d243d1..75424b21 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1049,6 +1049,10 @@ "format": "float", "default": 1.0 }, + "stretch": { + "description": "Scale each axis of the prop. Overrides `scale`.", + "$ref": "#/definitions/MVector3" + }, "quantumGroupID": { "type": "string", "description": "If this value is not null, this prop will be quantum. Assign this field to the id of the quantum group it should be a part of. The group it is assigned to determines what kind of quantum object it is" @@ -1372,7 +1376,12 @@ "scale": { "type": "number", "description": "Scale this prop once it is placed", - "format": "float" + "format": "float", + "default": 1.0 + }, + "stretch": { + "description": "Scale each axis of the prop. Overrides `scale`.", + "$ref": "#/definitions/MVector3" }, "seed": { "type": "integer", @@ -2501,6 +2510,14 @@ "type": "boolean", "description": "Whether to loop this audio while in this audio volume or just play it once", "default": true + }, + "volume": { + "type": "number", + "description": "The loudness of the audio", + "format": "float", + "default": 1.0, + "maximum": 1.0, + "minimum": 0.0 } } }, diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 015d57e4..6fb4c0d4 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.6.0", + "version": "1.6.1", "owmlVersion": "2.6.0", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],