diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index 02f32731..4501dce3 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -10,6 +10,7 @@ using System.Linq; using UnityEngine; using Logger = NewHorizons.Utility.Logger; using static NewHorizons.Main; +using NewHorizons.External.Props; namespace NewHorizons.Builder.Body { @@ -103,7 +104,7 @@ namespace NewHorizons.Builder.Body default: geometryPrefab = _hubGeometry; break; } - var detailInfo = new PropModule.DetailInfo(); + var detailInfo = new DetailInfo(); var geometry = DetailBuilder.Make(go, sector, geometryPrefab, detailInfo); var exitWarps = _exitWarps.InstantiateInactive(); diff --git a/NewHorizons/Builder/Body/ProxyBuilder.cs b/NewHorizons/Builder/Body/ProxyBuilder.cs index f2a76bce..6b085aff 100644 --- a/NewHorizons/Builder/Body/ProxyBuilder.cs +++ b/NewHorizons/Builder/Body/ProxyBuilder.cs @@ -2,7 +2,7 @@ using NewHorizons.Builder.Atmosphere; using NewHorizons.Builder.Props; using NewHorizons.Components; using NewHorizons.Components.SizeControllers; -using NewHorizons.External.Modules.VariableSize; +using NewHorizons.External.Props; using NewHorizons.Handlers; using NewHorizons.Utility; using System; @@ -187,7 +187,7 @@ namespace NewHorizons.Builder.Body { foreach (var singularity in body.Config.Props.singularities) { - var polarity = singularity.type == SingularityModule.SingularityType.BlackHole; + var polarity = singularity.type == SingularityInfo.SingularityType.BlackHole; SingularityBuilder.MakeSingularityProxy(proxy, singularity.position, polarity, singularity.horizonRadius, singularity.distortRadius, singularity.curve, singularity.renderQueueOverride); if (realSize < singularity.distortRadius) realSize = singularity.distortRadius; } diff --git a/NewHorizons/Builder/Body/SingularityBuilder.cs b/NewHorizons/Builder/Body/SingularityBuilder.cs index 97c53010..0c2e4df2 100644 --- a/NewHorizons/Builder/Body/SingularityBuilder.cs +++ b/NewHorizons/Builder/Body/SingularityBuilder.cs @@ -1,7 +1,6 @@ using NewHorizons.External.Configs; using NewHorizons.Utility; using System; -using NewHorizons.External.Modules.VariableSize; using UnityEngine; using Logger = NewHorizons.Utility.Logger; using System.Collections.Generic; @@ -11,6 +10,7 @@ using System.Drawing; using Color = UnityEngine.Color; using NewHorizons.Components.Volumes; using NewHorizons.Builder.Props; +using NewHorizons.External.Props; namespace NewHorizons.Builder.Body { @@ -70,7 +70,7 @@ namespace NewHorizons.Builder.Body if (_whiteHoleVolume == null) _whiteHoleVolume = SearchUtilities.Find("WhiteHole_Body/WhiteHoleVolume").InstantiateInactive().Rename("WhiteHoleVolume").DontDestroyOnLoad(); } - public static void Make(GameObject go, Sector sector, OWRigidbody OWRB, PlanetConfig config, SingularityModule singularity) + public static void Make(GameObject go, Sector sector, OWRigidbody OWRB, PlanetConfig config, SingularityInfo singularity) { InitPrefabs(); @@ -81,7 +81,7 @@ namespace NewHorizons.Builder.Body var distortRadius = singularity.distortRadius != 0f ? singularity.distortRadius : horizonRadius * 2.5f; var pairedSingularity = singularity.pairedSingularity; - bool polarity = singularity.type == SingularityModule.SingularityType.BlackHole; + bool polarity = singularity.type == SingularityInfo.SingularityType.BlackHole; bool isWormHole = singularity?.targetStarSystem != null; bool hasHazardVolume = !isWormHole && (pairedSingularity == null); @@ -140,7 +140,7 @@ namespace NewHorizons.Builder.Body // polarity true = black, false = white - var info = new SingularityModule + var info = new SingularityInfo { position = position, rotation = rotation, diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index 4a836fb4..8996604e 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -1,6 +1,7 @@ using NewHorizons.Builder.Body; using NewHorizons.Components; using NewHorizons.External.Configs; +using NewHorizons.External.Props; using NewHorizons.Handlers; using NewHorizons.Utility; using OWML.Common; diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 88aa7db5..00d7888a 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -1,6 +1,7 @@ using NewHorizons.Builder.General; using NewHorizons.Components; using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Handlers; using NewHorizons.Utility; using OWML.Common; @@ -15,7 +16,7 @@ namespace NewHorizons.Builder.Props { public static class DetailBuilder { - private static readonly Dictionary _detailInfoToCorrespondingSpawnedGameObject = new(); + private static readonly Dictionary _detailInfoToCorrespondingSpawnedGameObject = new(); private static readonly Dictionary<(Sector, string), (GameObject prefab, bool isItem)> _fixedPrefabCache = new(); static DetailBuilder() @@ -33,7 +34,7 @@ namespace NewHorizons.Builder.Props _detailInfoToCorrespondingSpawnedGameObject.Clear(); } - public static GameObject GetSpawnedGameObjectByDetailInfo(PropModule.DetailInfo detail) + public static GameObject GetSpawnedGameObjectByDetailInfo(DetailInfo detail) { if (!_detailInfoToCorrespondingSpawnedGameObject.ContainsKey(detail)) { @@ -48,7 +49,7 @@ namespace NewHorizons.Builder.Props /// /// Create a detail using an asset bundle or a path in the scene hierarchy of the item to copy. /// - public static GameObject Make(GameObject go, Sector sector, IModBehaviour mod, PropModule.DetailInfo detail) + public static GameObject Make(GameObject go, Sector sector, IModBehaviour mod, DetailInfo detail) { if (detail.assetBundle != null) { @@ -64,7 +65,7 @@ namespace NewHorizons.Builder.Props /// /// Create a detail using a path in the scene hierarchy of the item to copy. /// - public static GameObject Make(GameObject planetGO, Sector sector, PropModule.DetailInfo info) + public static GameObject Make(GameObject planetGO, Sector sector, DetailInfo info) { var prefab = SearchUtilities.Find(info.path); if (prefab == null) @@ -79,7 +80,7 @@ namespace NewHorizons.Builder.Props /// /// Create a detail using a prefab. /// - public static GameObject Make(GameObject go, Sector sector, GameObject prefab, PropModule.DetailInfo detail) + public static GameObject Make(GameObject go, Sector sector, GameObject prefab, DetailInfo detail) { if (prefab == null) return null; diff --git a/NewHorizons/Builder/Props/DialogueBuilder.cs b/NewHorizons/Builder/Props/DialogueBuilder.cs index f81d8ac2..028cbc9d 100644 --- a/NewHorizons/Builder/Props/DialogueBuilder.cs +++ b/NewHorizons/Builder/Props/DialogueBuilder.cs @@ -7,13 +7,14 @@ using UnityEngine; using NewHorizons.Utility; using Logger = NewHorizons.Utility.Logger; using NewHorizons.Components; +using NewHorizons.External.Props; namespace NewHorizons.Builder.Props { public static class DialogueBuilder { // Returns the character dialogue tree and remote dialogue trigger, if applicable. - public static (CharacterDialogueTree, RemoteDialogueTrigger) Make(GameObject go, Sector sector, PropModule.DialogueInfo info, IModBehaviour mod) + public static (CharacterDialogueTree, RemoteDialogueTrigger) Make(GameObject go, Sector sector, DialogueInfo info, IModBehaviour mod) { // In stock I think they disable dialogue stuff with conditions // Here we just don't make it at all @@ -38,7 +39,7 @@ namespace NewHorizons.Builder.Props return (dialogue, remoteTrigger); } - private static RemoteDialogueTrigger MakeRemoteDialogueTrigger(GameObject planetGO, Sector sector, PropModule.DialogueInfo info, CharacterDialogueTree dialogue) + private static RemoteDialogueTrigger MakeRemoteDialogueTrigger(GameObject planetGO, Sector sector, DialogueInfo info, CharacterDialogueTree dialogue) { var conversationTrigger = GeneralPropBuilder.MakeNew("ConversationTrigger", sector?.transform ?? planetGO.transform, info.remoteTrigger, defaultPosition: info.position, defaultParentPath: info.pathToAnimController); @@ -69,7 +70,7 @@ namespace NewHorizons.Builder.Props return remoteDialogueTrigger; } - private static CharacterDialogueTree MakeConversationZone(GameObject planetGO, Sector sector, PropModule.DialogueInfo info, IModHelper mod) + private static CharacterDialogueTree MakeConversationZone(GameObject planetGO, Sector sector, DialogueInfo info, IModHelper mod) { var conversationZone = GeneralPropBuilder.MakeNew("ConversationZone", sector?.transform ?? planetGO.transform, info, defaultParentPath: info.pathToAnimController); @@ -105,15 +106,15 @@ namespace NewHorizons.Builder.Props switch (info.flashlightToggle) { - case PropModule.DialogueInfo.FlashlightToggle.TurnOff: + case DialogueInfo.FlashlightToggle.TurnOff: dialogueTree._turnOffFlashlight = true; dialogueTree._turnOnFlashlight = false; break; - case PropModule.DialogueInfo.FlashlightToggle.TurnOffThenOn: + case DialogueInfo.FlashlightToggle.TurnOffThenOn: dialogueTree._turnOffFlashlight = true; dialogueTree._turnOnFlashlight = true; break; - case PropModule.DialogueInfo.FlashlightToggle.None: + case DialogueInfo.FlashlightToggle.None: default: dialogueTree._turnOffFlashlight = false; dialogueTree._turnOnFlashlight = false; @@ -125,7 +126,7 @@ namespace NewHorizons.Builder.Props return dialogueTree; } - private static void MakePlayerTrackingZone(GameObject go, CharacterDialogueTree dialogue, PropModule.DialogueInfo info) + private static void MakePlayerTrackingZone(GameObject go, CharacterDialogueTree dialogue, DialogueInfo info) { var character = go.transform.Find(info.pathToAnimController); diff --git a/NewHorizons/Builder/Props/GeneralPropBuilder.cs b/NewHorizons/Builder/Props/GeneralPropBuilder.cs index 691f1083..5b822842 100644 --- a/NewHorizons/Builder/Props/GeneralPropBuilder.cs +++ b/NewHorizons/Builder/Props/GeneralPropBuilder.cs @@ -1,4 +1,5 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Utility; using System; using System.Collections.Generic; @@ -12,11 +13,11 @@ namespace NewHorizons.Builder.Props { public static class GeneralPropBuilder { - public static GameObject MakeFromExisting(GameObject go, Transform parent, PropModule.GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null) + public static GameObject MakeFromExisting(GameObject go, Transform parent, GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null) { if (info == null) return go; - if (info is PropModule.GeneralSolarSystemPropInfo solarSystemInfo && !string.IsNullOrEmpty(solarSystemInfo.parentBody)) + if (info is GeneralSolarSystemPropInfo solarSystemInfo && !string.IsNullOrEmpty(solarSystemInfo.parentBody)) { var targetPlanet = AstroObjectLocator.GetAstroObject(solarSystemInfo.parentBody); if (targetPlanet != null) @@ -52,7 +53,7 @@ namespace NewHorizons.Builder.Props var pos = (Vector3)(info.position ?? defaultPosition ?? Vector3.zero); var rot = Quaternion.identity; - if (info is PropModule.GeneralPropInfo rotInfo) + if (info is GeneralPropInfo rotInfo) { rot = rotInfo.rotation != null ? Quaternion.Euler(rotInfo.rotation) : Quaternion.identity; } @@ -79,14 +80,14 @@ namespace NewHorizons.Builder.Props return go; } - public static GameObject MakeNew(string defaultName, Transform parent, PropModule.GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null) + public static GameObject MakeNew(string defaultName, Transform parent, GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null) { var go = new GameObject(defaultName); go.SetActive(false); return MakeFromExisting(go, parent, info, alignToBody, normal, defaultPosition, defaultParentPath); } - public static GameObject MakeFromPrefab(GameObject prefab, string defaultName, Transform parent, PropModule.GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null) + public static GameObject MakeFromPrefab(GameObject prefab, string defaultName, Transform parent, GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null) { var go = prefab.InstantiateInactive(); go.name = defaultName; diff --git a/NewHorizons/Builder/Props/GeyserBuilder.cs b/NewHorizons/Builder/Props/GeyserBuilder.cs index 2b4819fd..eb1f1c99 100644 --- a/NewHorizons/Builder/Props/GeyserBuilder.cs +++ b/NewHorizons/Builder/Props/GeyserBuilder.cs @@ -1,4 +1,5 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Utility; using UnityEngine; using Logger = NewHorizons.Utility.Logger; @@ -14,7 +15,7 @@ namespace NewHorizons.Builder.Props if (_geyserPrefab == null) _geyserPrefab = SearchUtilities.Find("TimberHearth_Body/Sector_TH/Interactables_TH/Geysers/Geyser_Village").InstantiateInactive().Rename("Prefab_TH_Geyser").DontDestroyOnLoad(); } - public static void Make(GameObject planetGO, Sector sector, PropModule.GeyserInfo info) + public static void Make(GameObject planetGO, Sector sector, GeyserInfo info) { InitPrefab(); diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index 5e630fec..571e58ac 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -1,4 +1,5 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Handlers; using NewHorizons.Utility; using OWML.Common; @@ -32,16 +33,16 @@ namespace NewHorizons.Builder.Props private static GameObject _preCrashRecorderPrefab; private static GameObject _trailmarkerPrefab; - private static Dictionary arcInfoToCorrespondingSpawnedGameObject = new Dictionary(); - public static GameObject GetSpawnedGameObjectByNomaiTextArcInfo(PropModule.NomaiTextArcInfo arc) + private static Dictionary arcInfoToCorrespondingSpawnedGameObject = new Dictionary(); + public static GameObject GetSpawnedGameObjectByNomaiTextArcInfo(NomaiTextArcInfo arc) { if (!arcInfoToCorrespondingSpawnedGameObject.ContainsKey(arc)) return null; return arcInfoToCorrespondingSpawnedGameObject[arc]; } - private static Dictionary conversationInfoToCorrespondingSpawnedGameObject = new Dictionary(); + private static Dictionary conversationInfoToCorrespondingSpawnedGameObject = new Dictionary(); - public static GameObject GetSpawnedGameObjectByNomaiTextInfo(PropModule.NomaiTextInfo convo) + public static GameObject GetSpawnedGameObjectByNomaiTextInfo(NomaiTextInfo convo) { Logger.LogVerbose("Retrieving wall text obj for " + convo); if (!conversationInfoToCorrespondingSpawnedGameObject.ContainsKey(convo)) return null; @@ -142,7 +143,7 @@ namespace NewHorizons.Builder.Props } } - public static GameObject Make(GameObject planetGO, Sector sector, PropModule.NomaiTextInfo info, IModBehaviour mod) + public static GameObject Make(GameObject planetGO, Sector sector, NomaiTextInfo info, IModBehaviour mod) { InitPrefabs(); @@ -150,7 +151,7 @@ namespace NewHorizons.Builder.Props switch (info.type) { - case PropModule.NomaiTextInfo.NomaiTextType.Wall: + case NomaiTextInfo.NomaiTextType.Wall: { var nomaiWallTextObj = MakeWallText(planetGO, sector, info, xmlPath).gameObject; @@ -215,7 +216,7 @@ namespace NewHorizons.Builder.Props return nomaiWallTextObj; } - case PropModule.NomaiTextInfo.NomaiTextType.Scroll: + case NomaiTextInfo.NomaiTextType.Scroll: { var customScroll = _scrollPrefab.InstantiateInactive(); @@ -304,7 +305,7 @@ namespace NewHorizons.Builder.Props return customScroll; } - case PropModule.NomaiTextInfo.NomaiTextType.Computer: + case NomaiTextInfo.NomaiTextType.Computer: { var computerObject = _computerPrefab.InstantiateInactive(); @@ -357,9 +358,9 @@ namespace NewHorizons.Builder.Props return computerObject; } - case PropModule.NomaiTextInfo.NomaiTextType.PreCrashComputer: + case NomaiTextInfo.NomaiTextType.PreCrashComputer: { - var detailInfo = new PropModule.DetailInfo() + var detailInfo = new DetailInfo() { position = info.position, parentPath = info.parentPath, @@ -407,10 +408,10 @@ namespace NewHorizons.Builder.Props return computerObject; } - case PropModule.NomaiTextInfo.NomaiTextType.Cairn: - case PropModule.NomaiTextInfo.NomaiTextType.CairnVariant: + case NomaiTextInfo.NomaiTextType.Cairn: + case NomaiTextInfo.NomaiTextType.CairnVariant: { - var cairnObject = (info.type == PropModule.NomaiTextInfo.NomaiTextType.CairnVariant ? _cairnVariantPrefab : _cairnPrefab).InstantiateInactive(); + var cairnObject = (info.type == NomaiTextInfo.NomaiTextType.CairnVariant ? _cairnVariantPrefab : _cairnPrefab).InstantiateInactive(); if (!string.IsNullOrEmpty(info.rename)) { @@ -482,11 +483,11 @@ namespace NewHorizons.Builder.Props return cairnObject; } - case PropModule.NomaiTextInfo.NomaiTextType.PreCrashRecorder: - case PropModule.NomaiTextInfo.NomaiTextType.Recorder: + case NomaiTextInfo.NomaiTextType.PreCrashRecorder: + case NomaiTextInfo.NomaiTextType.Recorder: { - var prefab = (info.type == PropModule.NomaiTextInfo.NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab); - var detailInfo = new PropModule.DetailInfo { + var prefab = (info.type == NomaiTextInfo.NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab); + var detailInfo = new DetailInfo { parentPath = info.parentPath, rotation = info.rotation, position = info.position, @@ -517,7 +518,7 @@ namespace NewHorizons.Builder.Props conversationInfoToCorrespondingSpawnedGameObject[info] = recorderObject; return recorderObject; } - case PropModule.NomaiTextInfo.NomaiTextType.Trailmarker: + case NomaiTextInfo.NomaiTextType.Trailmarker: { var trailmarkerObject = _trailmarkerPrefab.InstantiateInactive(); @@ -589,7 +590,7 @@ namespace NewHorizons.Builder.Props } } - private static NomaiWallText MakeWallText(GameObject go, Sector sector, PropModule.NomaiTextInfo info, string xmlPath) + private static NomaiWallText MakeWallText(GameObject go, Sector sector, NomaiTextInfo info, string xmlPath) { GameObject nomaiWallTextObj = new GameObject("NomaiWallText"); nomaiWallTextObj.SetActive(false); @@ -618,7 +619,7 @@ namespace NewHorizons.Builder.Props nomaiWallText.SetTextAsset(text); // #433 fuzzy stranger text - if (info.arcInfo != null && info.arcInfo.Any(x => x.type == PropModule.NomaiTextArcInfo.NomaiTextArcType.Stranger)) + if (info.arcInfo != null && info.arcInfo.Any(x => x.type == NomaiTextArcInfo.NomaiTextArcType.Stranger)) { StreamingHandler.SetUpStreaming(AstroObject.Name.RingWorld, sector); } @@ -626,7 +627,7 @@ namespace NewHorizons.Builder.Props return nomaiWallText; } - internal static void BuildArcs(string xml, NomaiWallText nomaiWallText, GameObject conversationZone, PropModule.NomaiTextInfo info) + internal static void BuildArcs(string xml, NomaiWallText nomaiWallText, GameObject conversationZone, NomaiTextInfo info) { var dict = MakeNomaiTextDict(xml); @@ -635,7 +636,7 @@ namespace NewHorizons.Builder.Props RefreshArcs(nomaiWallText, conversationZone, info); } - internal static void RefreshArcs(NomaiWallText nomaiWallText, GameObject conversationZone, PropModule.NomaiTextInfo info) + internal static void RefreshArcs(NomaiWallText nomaiWallText, GameObject conversationZone, NomaiTextInfo info) { var dict = nomaiWallText._dictNomaiTextData; Random.InitState(info.seed); @@ -666,26 +667,26 @@ namespace NewHorizons.Builder.Props } } - internal static GameObject MakeArc(PropModule.NomaiTextArcInfo arcInfo, GameObject conversationZone, GameObject parent, int textEntryID) + internal static GameObject MakeArc(NomaiTextArcInfo arcInfo, GameObject conversationZone, GameObject parent, int textEntryID) { GameObject arc; - var type = arcInfo != null ? arcInfo.type : PropModule.NomaiTextArcInfo.NomaiTextArcType.Adult; + var type = arcInfo != null ? arcInfo.type : NomaiTextArcInfo.NomaiTextArcType.Adult; var variation = arcInfo != null ? arcInfo.variation : -1; switch (type) { - case PropModule.NomaiTextArcInfo.NomaiTextArcType.Child: + case NomaiTextArcInfo.NomaiTextArcType.Child: variation = variation < 0 ? Random.Range(0, _childArcPrefabs.Count()) : (variation % _childArcPrefabs.Count()); arc = _childArcPrefabs[variation].InstantiateInactive(); break; - case PropModule.NomaiTextArcInfo.NomaiTextArcType.Stranger when _ghostArcPrefabs.Any(): + case NomaiTextArcInfo.NomaiTextArcType.Stranger when _ghostArcPrefabs.Any(): variation = variation < 0 ? Random.Range(0, _ghostArcPrefabs.Count()) : (variation % _ghostArcPrefabs.Count()); arc = _ghostArcPrefabs[variation].InstantiateInactive(); break; - case PropModule.NomaiTextArcInfo.NomaiTextArcType.Adult: + case NomaiTextArcInfo.NomaiTextArcType.Adult: default: variation = variation < 0 ? Random.Range(0, _arcPrefabs.Count()) diff --git a/NewHorizons/Builder/Props/ProjectionBuilder.cs b/NewHorizons/Builder/Props/ProjectionBuilder.cs index d7fd2668..73738729 100644 --- a/NewHorizons/Builder/Props/ProjectionBuilder.cs +++ b/NewHorizons/Builder/Props/ProjectionBuilder.cs @@ -1,4 +1,5 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Handlers; using NewHorizons.Utility; using OWML.Common; @@ -65,20 +66,20 @@ namespace NewHorizons.Builder.Props } } - public static void Make(GameObject go, Sector sector, PropModule.ProjectionInfo info, IModBehaviour mod) + public static void Make(GameObject go, Sector sector, ProjectionInfo info, IModBehaviour mod) { switch (info.type) { - case PropModule.ProjectionInfo.SlideShowType.AutoProjector: + case ProjectionInfo.SlideShowType.AutoProjector: MakeAutoProjector(go, sector, info, mod); break; - case PropModule.ProjectionInfo.SlideShowType.SlideReel: + case ProjectionInfo.SlideShowType.SlideReel: MakeSlideReel(go, sector, info, mod); break; - case PropModule.ProjectionInfo.SlideShowType.VisionTorchTarget: + case ProjectionInfo.SlideShowType.VisionTorchTarget: MakeMindSlidesTarget(go, sector, info, mod); break; - case PropModule.ProjectionInfo.SlideShowType.StandingVisionTorch: + case ProjectionInfo.SlideShowType.StandingVisionTorch: MakeStandingVisionTorch(go, sector, info, mod); break; default: @@ -87,7 +88,7 @@ namespace NewHorizons.Builder.Props } } - private static GameObject MakeSlideReel(GameObject planetGO, Sector sector, PropModule.ProjectionInfo info, IModBehaviour mod) + private static GameObject MakeSlideReel(GameObject planetGO, Sector sector, ProjectionInfo info, IModBehaviour mod) { InitPrefabs(); @@ -160,7 +161,7 @@ namespace NewHorizons.Builder.Props return slideReelObj; } - public static GameObject MakeAutoProjector(GameObject planetGO, Sector sector, PropModule.ProjectionInfo info, IModBehaviour mod) + public static GameObject MakeAutoProjector(GameObject planetGO, Sector sector, ProjectionInfo info, IModBehaviour mod) { InitPrefabs(); @@ -195,14 +196,14 @@ namespace NewHorizons.Builder.Props } // Makes a target for a vision torch to scan - public static GameObject MakeMindSlidesTarget(GameObject planetGO, Sector sector, PropModule.ProjectionInfo info, IModBehaviour mod) + public static GameObject MakeMindSlidesTarget(GameObject planetGO, Sector sector, ProjectionInfo info, IModBehaviour mod) { InitPrefabs(); if (_visionTorchDetectorPrefab == null) return null; // spawn a trigger for the vision torch - var detailInfo = new PropModule.DetailInfo() + var detailInfo = new DetailInfo() { position = info.position, rotation = info.rotation, @@ -241,14 +242,14 @@ namespace NewHorizons.Builder.Props return g; } - public static GameObject MakeStandingVisionTorch(GameObject planetGO, Sector sector, PropModule.ProjectionInfo info, IModBehaviour mod) + public static GameObject MakeStandingVisionTorch(GameObject planetGO, Sector sector, ProjectionInfo info, IModBehaviour mod) { InitPrefabs(); if (_standingVisionTorchPrefab == null) return null; // Spawn the torch itself - var detailInfo = new PropModule.DetailInfo() + var detailInfo = new DetailInfo() { position = info.position, rotation = info.rotation, @@ -344,7 +345,7 @@ namespace NewHorizons.Builder.Props return imageLoader; } - private static void AddModules(PropModule.SlideInfo slideInfo, ref Slide slide, IModBehaviour mod) + private static void AddModules(SlideInfo slideInfo, ref Slide slide, IModBehaviour mod) { var modules = new List(); if (!String.IsNullOrEmpty(slideInfo.beatAudio)) diff --git a/NewHorizons/Builder/Props/QuantumBuilder.cs b/NewHorizons/Builder/Props/QuantumBuilder.cs index 0697c5a0..8db6f2fd 100644 --- a/NewHorizons/Builder/Props/QuantumBuilder.cs +++ b/NewHorizons/Builder/Props/QuantumBuilder.cs @@ -2,6 +2,7 @@ using HarmonyLib; using NewHorizons.Components.Quantum; using NewHorizons.External.Configs; using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Utility; using OWML.Common; using System; @@ -28,17 +29,17 @@ namespace NewHorizons.Builder.Props public static class QuantumBuilder { - public static void Make(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, PropModule.QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) + public static void Make(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) { switch(quantumGroup.type) { - case PropModule.QuantumGroupType.Sockets: MakeSocketGroup (go, sector, config, mod, quantumGroup, propsInGroup); return; - case PropModule.QuantumGroupType.States: MakeStateGroup (go, sector, config, mod, quantumGroup, propsInGroup); return; - // case PropModule.QuantumGroupType.Shuffle: MakeShuffleGroup(go, sector, config, mod, quantumGroup, propsInGroup); return; + case QuantumGroupType.Sockets: MakeSocketGroup (go, sector, config, mod, quantumGroup, propsInGroup); return; + case QuantumGroupType.States: MakeStateGroup (go, sector, config, mod, quantumGroup, propsInGroup); return; + // case QuantumGroupType.Shuffle: MakeShuffleGroup(go, sector, config, mod, quantumGroup, propsInGroup); return; } } - public static void MakeSocketGroup(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, PropModule.QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) + public static void MakeSocketGroup(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) { var groupRoot = new GameObject("Quantum Sockets - " + quantumGroup.id); groupRoot.transform.parent = sector?.transform ?? go.transform; @@ -72,7 +73,7 @@ namespace NewHorizons.Builder.Props } } - public static void MakeStateGroup(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, PropModule.QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) + public static void MakeStateGroup(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) { var groupRoot = new GameObject("Quantum States - " + quantumGroup.id); groupRoot.transform.parent = sector?.transform ?? go.transform; @@ -119,7 +120,7 @@ namespace NewHorizons.Builder.Props groupRoot.SetActive(true); } - public static void MakeShuffleGroup(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, PropModule.QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) + public static void MakeShuffleGroup(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) { //var averagePosition = propsInGroup.Aggregate(Vector3.zero, (avg, prop) => avg + prop.transform.position) / propsInGroup.Count(); GameObject shuffleParent = new GameObject("Quantum Shuffle - " + quantumGroup.id); diff --git a/NewHorizons/Builder/Props/RaftBuilder.cs b/NewHorizons/Builder/Props/RaftBuilder.cs index 663fa27e..587ab464 100644 --- a/NewHorizons/Builder/Props/RaftBuilder.cs +++ b/NewHorizons/Builder/Props/RaftBuilder.cs @@ -2,6 +2,7 @@ using NewHorizons.Components; using NewHorizons.Components.Achievement; using NewHorizons.Components.Volumes; using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Handlers; using NewHorizons.Utility; using UnityEngine; @@ -46,7 +47,7 @@ namespace NewHorizons.Builder.Props } } - public static GameObject Make(GameObject planetGO, Sector sector, PropModule.RaftInfo info, OWRigidbody planetBody) + public static GameObject Make(GameObject planetGO, Sector sector, RaftInfo info, OWRigidbody planetBody) { InitPrefab(); diff --git a/NewHorizons/Builder/Props/RemoteBuilder.cs b/NewHorizons/Builder/Props/RemoteBuilder.cs index 75e27374..e0c3801b 100644 --- a/NewHorizons/Builder/Props/RemoteBuilder.cs +++ b/NewHorizons/Builder/Props/RemoteBuilder.cs @@ -1,4 +1,5 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Handlers; using NewHorizons.Utility; using OWML.Common; @@ -116,7 +117,7 @@ namespace NewHorizons.Builder.Props } } - public static void Make(GameObject go, Sector sector, PropModule.RemoteInfo info, NewHorizonsBody nhBody) + public static void Make(GameObject go, Sector sector, RemoteInfo info, NewHorizonsBody nhBody) { InitPrefabs(); @@ -167,9 +168,9 @@ namespace NewHorizons.Builder.Props } } - public static void MakeWhiteboard(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, PropModule.RemoteInfo.WhiteboardInfo info, NewHorizonsBody nhBody) + public static void MakeWhiteboard(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, RemoteInfo.WhiteboardInfo info, NewHorizonsBody nhBody) { - var detailInfo = new PropModule.DetailInfo() + var detailInfo = new DetailInfo() { position = info.position, rotation = info.rotation, @@ -194,7 +195,7 @@ namespace NewHorizons.Builder.Props { var textInfo = info.nomaiText[i]; component._remoteIDs[i] = RemoteHandler.GetPlatformID(textInfo.id); - var wallText = TranslatorTextBuilder.Make(whiteboard, sector, new PropModule.NomaiTextInfo + var wallText = TranslatorTextBuilder.Make(whiteboard, sector, new NomaiTextInfo { arcInfo = textInfo.arcInfo, location = textInfo.location, @@ -203,7 +204,7 @@ namespace NewHorizons.Builder.Props rename = textInfo.rename, rotation = Vector3.zero, seed = textInfo.seed, - type = PropModule.NomaiTextInfo.NomaiTextType.Wall, + type = NomaiTextInfo.NomaiTextType.Wall, xmlFile = textInfo.xmlFile }, nhBody).GetComponent(); wallText._showTextOnStart = false; @@ -215,9 +216,9 @@ namespace NewHorizons.Builder.Props whiteboard.SetActive(true); } - public static void MakePlatform(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, PropModule.RemoteInfo.PlatformInfo info, IModBehaviour mod) + public static void MakePlatform(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, RemoteInfo.PlatformInfo info, IModBehaviour mod) { - var detailInfo = new PropModule.DetailInfo() + var detailInfo = new DetailInfo() { position = info.position, rotation = info.rotation, @@ -249,7 +250,7 @@ namespace NewHorizons.Builder.Props platform.SetActive(true); } - public static void MakeStone(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, PropModule.RemoteInfo.StoneInfo info, IModBehaviour mod) + public static void MakeStone(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, RemoteInfo.StoneInfo info, IModBehaviour mod) { var shareStone = GeneralPropBuilder.MakeFromPrefab(_shareStonePrefab, "ShareStone_" + id.ToString(), sector?.transform ?? go.transform, info); diff --git a/NewHorizons/Builder/Props/ScatterBuilder.cs b/NewHorizons/Builder/Props/ScatterBuilder.cs index f6583c4d..be162319 100644 --- a/NewHorizons/Builder/Props/ScatterBuilder.cs +++ b/NewHorizons/Builder/Props/ScatterBuilder.cs @@ -1,5 +1,6 @@ using NewHorizons.External.Configs; using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Utility; using OWML.Common; using System; @@ -17,7 +18,7 @@ namespace NewHorizons.Builder.Props MakeScatter(go, config.Props.scatter, config.Base.surfaceSize, sector, mod, config); } - private static void MakeScatter(GameObject go, PropModule.ScatterInfo[] scatterInfo, float radius, Sector sector, IModBehaviour mod, PlanetConfig config) + private static void MakeScatter(GameObject go, ScatterInfo[] scatterInfo, float radius, Sector sector, IModBehaviour mod, PlanetConfig config) { var heightMap = config.HeightMap; @@ -69,7 +70,7 @@ namespace NewHorizons.Builder.Props else prefab = SearchUtilities.Find(propInfo.path); // Run all the make detail stuff on it early and just copy it over and over instead - var detailInfo = new PropModule.DetailInfo() + var detailInfo = new DetailInfo() { scale = propInfo.scale, stretch = propInfo.stretch, diff --git a/NewHorizons/Builder/Props/SignalBuilder.cs b/NewHorizons/Builder/Props/SignalBuilder.cs index 1665c33c..f51bfce0 100644 --- a/NewHorizons/Builder/Props/SignalBuilder.cs +++ b/NewHorizons/Builder/Props/SignalBuilder.cs @@ -1,4 +1,5 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Utility; using OWML.Common; using OWML.Utils; @@ -107,7 +108,7 @@ namespace NewHorizons.Builder.Props return name; } - public static GameObject Make(GameObject planetGO, Sector sector, SignalModule.SignalInfo info, IModBehaviour mod) + public static GameObject Make(GameObject planetGO, Sector sector, SignalInfo info, IModBehaviour mod) { var signalGO = GeneralPropBuilder.MakeNew($"Signal_{info.name}", sector?.transform ?? planetGO.transform, info); signalGO.layer = LayerMask.NameToLayer("AdvancedEffectVolume"); diff --git a/NewHorizons/Builder/Props/TornadoBuilder.cs b/NewHorizons/Builder/Props/TornadoBuilder.cs index 1aad9a6e..5a6fae48 100644 --- a/NewHorizons/Builder/Props/TornadoBuilder.cs +++ b/NewHorizons/Builder/Props/TornadoBuilder.cs @@ -1,5 +1,6 @@ using NewHorizons.Components; using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Handlers; using NewHorizons.Utility; using System; @@ -73,7 +74,7 @@ namespace NewHorizons.Builder.Props if (_soundPrefab == null) _soundPrefab = SearchUtilities.Find("GiantsDeep_Body/Sector_GD/Sector_GDInterior/Tornadoes_GDInterior/SouthernTornadoes/DownTornado_Pivot/DownTornado/AudioRail").InstantiateInactive().Rename("AudioRail_Prefab").DontDestroyOnLoad(); } - public static void Make(GameObject planetGO, Sector sector, PropModule.TornadoInfo info, bool hasClouds) + public static void Make(GameObject planetGO, Sector sector, TornadoInfo info, bool hasClouds) { InitPrefabs(); @@ -92,11 +93,11 @@ namespace NewHorizons.Builder.Props return; } - if (info.type == PropModule.TornadoInfo.TornadoType.Hurricane) MakeHurricane(planetGO, sector, info, position, hasClouds); - else MakeTornado(planetGO, sector, info, position, info.type == PropModule.TornadoInfo.TornadoType.Downwards); + if (info.type == TornadoInfo.TornadoType.Hurricane) MakeHurricane(planetGO, sector, info, position, hasClouds); + else MakeTornado(planetGO, sector, info, position, info.type == TornadoInfo.TornadoType.Downwards); } - private static void MakeTornado(GameObject planetGO, Sector sector, PropModule.TornadoInfo info, Vector3 position, bool downwards) + private static void MakeTornado(GameObject planetGO, Sector sector, TornadoInfo info, Vector3 position, bool downwards) { var prefab = downwards ? _downPrefab.InstantiateInactive() : _upPrefab.InstantiateInactive(); var tornadoGO = GeneralPropBuilder.MakeFromPrefab(prefab, downwards ? "Tornado_Down" : "Tornado_Up", sector?.transform ?? planetGO.transform, info, true, defaultPosition: position); @@ -172,7 +173,7 @@ namespace NewHorizons.Builder.Props tornadoGO.SetActive(true); } - private static void MakeHurricane(GameObject planetGO, Sector sector, PropModule.TornadoInfo info, Vector3 position, bool hasClouds) + private static void MakeHurricane(GameObject planetGO, Sector sector, TornadoInfo info, Vector3 position, bool hasClouds) { var hurricaneGO = _hurricanePrefab.InstantiateInactive(); hurricaneGO.name = "Hurricane"; @@ -260,7 +261,7 @@ namespace NewHorizons.Builder.Props } } - private static void ApplyWanderer(GameObject go, GameObject planetGO, PropModule.TornadoInfo info) + private static void ApplyWanderer(GameObject go, GameObject planetGO, TornadoInfo info) { var wanderer = go.AddComponent(); wanderer.wanderRate = info.wanderRate; diff --git a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs index 1d4a29fc..9dff7d38 100644 --- a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs +++ b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs @@ -13,6 +13,7 @@ using Random = UnityEngine.Random; using OWML.Utils; using Newtonsoft.Json; using System; +using NewHorizons.External.Props; namespace NewHorizons.Builder.Props { @@ -30,16 +31,16 @@ namespace NewHorizons.Builder.Props private static GameObject _preCrashRecorderPrefab; private static GameObject _trailmarkerPrefab; - private static Dictionary arcInfoToCorrespondingSpawnedGameObject = new Dictionary(); - public static GameObject GetSpawnedGameObjectByNomaiTextArcInfo(PropModule.NomaiTextArcInfo arc) + private static Dictionary arcInfoToCorrespondingSpawnedGameObject = new Dictionary(); + public static GameObject GetSpawnedGameObjectByNomaiTextArcInfo(NomaiTextArcInfo arc) { if (!arcInfoToCorrespondingSpawnedGameObject.ContainsKey(arc)) return null; return arcInfoToCorrespondingSpawnedGameObject[arc]; } - private static Dictionary conversationInfoToCorrespondingSpawnedGameObject = new Dictionary(); + private static Dictionary conversationInfoToCorrespondingSpawnedGameObject = new Dictionary(); - public static GameObject GetSpawnedGameObjectByNomaiTextInfo(PropModule.NomaiTextInfo convo) + public static GameObject GetSpawnedGameObjectByNomaiTextInfo(NomaiTextInfo convo) { Logger.LogVerbose("Retrieving wall text obj for " + convo); if (!conversationInfoToCorrespondingSpawnedGameObject.ContainsKey(convo)) return null; @@ -120,7 +121,7 @@ namespace NewHorizons.Builder.Props } } - public static GameObject Make(GameObject planetGO, Sector sector, PropModule.NomaiTextInfo info, NewHorizonsBody nhBody) + public static GameObject Make(GameObject planetGO, Sector sector, NomaiTextInfo info, NewHorizonsBody nhBody) { InitPrefabs(); @@ -128,7 +129,7 @@ namespace NewHorizons.Builder.Props switch (info.type) { - case PropModule.NomaiTextInfo.NomaiTextType.Wall: + case NomaiTextInfo.NomaiTextType.Wall: { var nomaiWallTextObj = MakeWallText(planetGO, sector, info, xmlPath, nhBody).gameObject; @@ -159,7 +160,7 @@ namespace NewHorizons.Builder.Props return nomaiWallTextObj; } - case PropModule.NomaiTextInfo.NomaiTextType.Scroll: + case NomaiTextInfo.NomaiTextType.Scroll: { var customScroll = GeneralPropBuilder.MakeFromPrefab(_scrollPrefab, _scrollPrefab.name, sector?.transform ?? planetGO.transform, info); @@ -211,7 +212,7 @@ namespace NewHorizons.Builder.Props return customScroll; } - case PropModule.NomaiTextInfo.NomaiTextType.Computer: + case NomaiTextInfo.NomaiTextType.Computer: { var computerObject = GeneralPropBuilder.MakeFromPrefab(_computerPrefab, _computerPrefab.name, sector?.transform ?? planetGO.transform, info, true, info.normal); @@ -232,9 +233,9 @@ namespace NewHorizons.Builder.Props return computerObject; } - case PropModule.NomaiTextInfo.NomaiTextType.PreCrashComputer: + case NomaiTextInfo.NomaiTextType.PreCrashComputer: { - var detailInfo = new PropModule.DetailInfo() + var detailInfo = new DetailInfo() { position = info.position, parentPath = info.parentPath, @@ -282,10 +283,10 @@ namespace NewHorizons.Builder.Props return computerObject; } - case PropModule.NomaiTextInfo.NomaiTextType.Cairn: - case PropModule.NomaiTextInfo.NomaiTextType.CairnVariant: + case NomaiTextInfo.NomaiTextType.Cairn: + case NomaiTextInfo.NomaiTextType.CairnVariant: { - var cairnPrefab = info.type == PropModule.NomaiTextInfo.NomaiTextType.CairnVariant ? _cairnVariantPrefab : _cairnPrefab; + var cairnPrefab = info.type == NomaiTextInfo.NomaiTextType.CairnVariant ? _cairnVariantPrefab : _cairnPrefab; var cairnObject = GeneralPropBuilder.MakeFromPrefab(cairnPrefab, _cairnPrefab.name, sector?.transform ?? planetGO.transform, info, info.rotation == null); // Idk do we have to set it active before finding things? @@ -317,11 +318,11 @@ namespace NewHorizons.Builder.Props return cairnObject; } - case PropModule.NomaiTextInfo.NomaiTextType.PreCrashRecorder: - case PropModule.NomaiTextInfo.NomaiTextType.Recorder: + case NomaiTextInfo.NomaiTextType.PreCrashRecorder: + case NomaiTextInfo.NomaiTextType.Recorder: { - var prefab = (info.type == PropModule.NomaiTextInfo.NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab); - var detailInfo = new PropModule.DetailInfo { + var prefab = (info.type == NomaiTextInfo.NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab); + var detailInfo = new DetailInfo { parentPath = info.parentPath, rotation = info.rotation, position = info.position, @@ -347,7 +348,7 @@ namespace NewHorizons.Builder.Props conversationInfoToCorrespondingSpawnedGameObject[info] = recorderObject; return recorderObject; } - case PropModule.NomaiTextInfo.NomaiTextType.Trailmarker: + case NomaiTextInfo.NomaiTextType.Trailmarker: { var trailmarkerObject = GeneralPropBuilder.MakeFromPrefab(_trailmarkerPrefab, _trailmarkerPrefab.name, sector?.transform ?? planetGO.transform, info, info.rotation == null); @@ -378,7 +379,7 @@ namespace NewHorizons.Builder.Props } } - private static NomaiWallText MakeWallText(GameObject go, Sector sector, PropModule.NomaiTextInfo info, string xmlPath, NewHorizonsBody nhBody) + private static NomaiWallText MakeWallText(GameObject go, Sector sector, NomaiTextInfo info, string xmlPath, NewHorizonsBody nhBody) { GameObject nomaiWallTextObj = GeneralPropBuilder.MakeNew("NomaiWallText", sector?.transform ?? go.transform, info); @@ -406,7 +407,7 @@ namespace NewHorizons.Builder.Props nomaiWallText.SetTextAsset(text); // #433 fuzzy stranger text - if (info.arcInfo != null && info.arcInfo.Any(x => x.type == PropModule.NomaiTextArcInfo.NomaiTextArcType.Stranger)) + if (info.arcInfo != null && info.arcInfo.Any(x => x.type == NomaiTextArcInfo.NomaiTextArcType.Stranger)) { StreamingHandler.SetUpStreaming(AstroObject.Name.RingWorld, sector); } @@ -414,7 +415,7 @@ namespace NewHorizons.Builder.Props return nomaiWallText; } - internal static void BuildArcs(string xml, NomaiWallText nomaiWallText, GameObject conversationZone, PropModule.NomaiTextInfo info, NewHorizonsBody nhBody) + internal static void BuildArcs(string xml, NomaiWallText nomaiWallText, GameObject conversationZone, NomaiTextInfo info, NewHorizonsBody nhBody) { var dict = MakeNomaiTextDict(xml); @@ -434,7 +435,7 @@ namespace NewHorizons.Builder.Props public bool mirrored; } - internal static void RefreshArcs(NomaiWallText nomaiWallText, GameObject conversationZone, PropModule.NomaiTextInfo info, NewHorizonsBody nhBody, string cacheKey) + internal static void RefreshArcs(NomaiWallText nomaiWallText, GameObject conversationZone, NomaiTextInfo info, NewHorizonsBody nhBody, string cacheKey) { var dict = nomaiWallText._dictNomaiTextData; Random.InitState(info.seed == 0 ? info.xmlFile.GetHashCode() : info.seed); @@ -536,27 +537,27 @@ namespace NewHorizons.Builder.Props } } - internal static GameObject MakeArc(PropModule.NomaiTextArcInfo arcInfo, GameObject conversationZone, GameObject parent, int textEntryID, GameObject prebuiltArc = null) + internal static GameObject MakeArc(NomaiTextArcInfo arcInfo, GameObject conversationZone, GameObject parent, int textEntryID, GameObject prebuiltArc = null) { GameObject arc; - var type = arcInfo != null ? arcInfo.type : PropModule.NomaiTextArcInfo.NomaiTextArcType.Adult; + var type = arcInfo != null ? arcInfo.type : NomaiTextArcInfo.NomaiTextArcType.Adult; NomaiTextArcBuilder.SpiralProfile profile; Material mat; Mesh overrideMesh = null; Color? overrideColor = null; switch (type) { - case PropModule.NomaiTextArcInfo.NomaiTextArcType.Child: + case NomaiTextArcInfo.NomaiTextArcType.Child: profile = NomaiTextArcBuilder.childSpiralProfile; mat = _childArcMaterial; break; - case PropModule.NomaiTextArcInfo.NomaiTextArcType.Stranger when _ghostArcMaterial != null: + case NomaiTextArcInfo.NomaiTextArcType.Stranger when _ghostArcMaterial != null: profile = NomaiTextArcBuilder.strangerSpiralProfile; mat = _ghostArcMaterial; overrideMesh = MeshUtilities.RectangleMeshFromCorners(new Vector3[]{ new Vector3(-0.9f, 0.0f, 0.0f), new Vector3(0.9f, 0.0f, 0.0f), new Vector3(-0.9f, 2.0f, 0.0f), new Vector3(0.9f, 2.0f, 0.0f) }); overrideColor = new Color(0.0158f, 1.0f, 0.5601f, 1f); break; - case PropModule.NomaiTextArcInfo.NomaiTextArcType.Adult: + case NomaiTextArcInfo.NomaiTextArcType.Adult: default: profile = NomaiTextArcBuilder.adultSpiralProfile; mat = _adultArcMaterial; diff --git a/NewHorizons/Builder/Props/VolcanoBuilder.cs b/NewHorizons/Builder/Props/VolcanoBuilder.cs index ced0ad9c..770ef488 100644 --- a/NewHorizons/Builder/Props/VolcanoBuilder.cs +++ b/NewHorizons/Builder/Props/VolcanoBuilder.cs @@ -1,4 +1,5 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Utility; using UnityEngine; using Logger = NewHorizons.Utility.Logger; @@ -41,7 +42,7 @@ namespace NewHorizons.Builder.Props } } - public static void Make(GameObject planetGO, Sector sector, PropModule.VolcanoInfo info) + public static void Make(GameObject planetGO, Sector sector, VolcanoInfo info) { InitPrefab(); @@ -72,7 +73,7 @@ namespace NewHorizons.Builder.Props }); } - private static void FixMeteor(MeteorController meteor, PropModule.VolcanoInfo info) + private static void FixMeteor(MeteorController meteor, VolcanoInfo info) { meteor.transform.localScale = Vector3.one * info.scale; diff --git a/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs b/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs index 7f6d591f..29181df0 100644 --- a/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs +++ b/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs @@ -1,5 +1,6 @@ using NewHorizons.Builder.Props; using NewHorizons.External.Modules; +using NewHorizons.External.Props; using OWML.Common; using System.Collections.Generic; using UnityEngine; @@ -10,7 +11,7 @@ namespace NewHorizons.Builder.ShipLog public static class EntryLocationBuilder { private static readonly List _locationsToInitialize = new List(); - public static void Make(GameObject go, Sector sector, PropModule.EntryLocationInfo info, IModBehaviour mod) + public static void Make(GameObject go, Sector sector, EntryLocationInfo info, IModBehaviour mod) { GameObject entryLocationGameObject = GeneralPropBuilder.MakeNew("Entry Location (" + info.id + ")", sector?.transform ?? go.transform, info); diff --git a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs index 0eaf91aa..5731a6ac 100644 --- a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs @@ -4,11 +4,11 @@ using NewHorizons.Utility; using System; using System.Collections.Generic; using System.Linq; -using NewHorizons.External.Modules.VariableSize; using UnityEngine; using UnityEngine.UI; using Logger = NewHorizons.Utility.Logger; using NewHorizons.Components.ShipLog; +using NewHorizons.External.Props; namespace NewHorizons.Builder.ShipLog { @@ -552,9 +552,9 @@ namespace NewHorizons.Builder.ShipLog switch (body.Config?.Props?.singularities?.FirstOrDefault()?.type) { - case SingularityModule.SingularityType.BlackHole: + case SingularityInfo.SingularityType.BlackHole: return Color.black; - case SingularityModule.SingularityType.WhiteHole: + case SingularityInfo.SingularityType.WhiteHole: return Color.white; } } diff --git a/NewHorizons/Builder/ShipLog/RevealBuilder.cs b/NewHorizons/Builder/ShipLog/RevealBuilder.cs index 349c3649..66ab3837 100644 --- a/NewHorizons/Builder/ShipLog/RevealBuilder.cs +++ b/NewHorizons/Builder/ShipLog/RevealBuilder.cs @@ -1,6 +1,7 @@ using NewHorizons.Builder.Props; using NewHorizons.Components.Achievement; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using OWML.Common; using UnityEngine; using Logger = NewHorizons.Utility.Logger; @@ -8,18 +9,18 @@ namespace NewHorizons.Builder.ShipLog { public static class RevealBuilder { - public static void Make(GameObject go, Sector sector, VolumesModule.RevealVolumeInfo info, IModBehaviour mod) + public static void Make(GameObject go, Sector sector, RevealVolumeInfo info, IModBehaviour mod) { var newRevealGO = GeneralPropBuilder.MakeNew("Reveal Volume (" + info.revealOn + ")", sector?.transform ?? go.transform, info); switch (info.revealOn) { - case VolumesModule.RevealVolumeInfo.RevealVolumeType.Enter: + case RevealVolumeInfo.RevealVolumeType.Enter: MakeTrigger(newRevealGO, sector, info, mod); break; - case VolumesModule.RevealVolumeInfo.RevealVolumeType.Observe: + case RevealVolumeInfo.RevealVolumeType.Observe: MakeObservable(newRevealGO, sector, info, mod); break; - case VolumesModule.RevealVolumeInfo.RevealVolumeType.Snapshot: + case RevealVolumeInfo.RevealVolumeType.Snapshot: MakeSnapshot(newRevealGO, sector, info, mod); break; default: @@ -29,7 +30,7 @@ namespace NewHorizons.Builder.ShipLog newRevealGO.SetActive(true); } - private static SphereShape MakeShape(GameObject go, VolumesModule.RevealVolumeInfo info, Shape.CollisionMode collisionMode) + private static SphereShape MakeShape(GameObject go, RevealVolumeInfo info, Shape.CollisionMode collisionMode) { SphereShape newShape = go.AddComponent(); newShape.radius = info.radius; @@ -37,7 +38,7 @@ namespace NewHorizons.Builder.ShipLog return newShape; } - private static void MakeTrigger(GameObject go, Sector sector, VolumesModule.RevealVolumeInfo info, IModBehaviour mod) + private static void MakeTrigger(GameObject go, Sector sector, RevealVolumeInfo info, IModBehaviour mod) { var shape = MakeShape(go, info, Shape.CollisionMode.Volume); @@ -50,15 +51,15 @@ namespace NewHorizons.Builder.ShipLog factRevealVolume._factIDs = info.reveals; switch (info.revealFor) { - case VolumesModule.RevealVolumeInfo.EnterType.Player: + case RevealVolumeInfo.EnterType.Player: factRevealVolume._player = true; factRevealVolume._probe = false; break; - case VolumesModule.RevealVolumeInfo.EnterType.Probe: + case RevealVolumeInfo.EnterType.Probe: factRevealVolume._player = false; factRevealVolume._probe = true; break; - case VolumesModule.RevealVolumeInfo.EnterType.Both: + case RevealVolumeInfo.EnterType.Both: default: // if you want both player and probe to able to trigger the thing you have to set both player and probe to false. setting both to true will make nothing trigger it factRevealVolume._player = false; @@ -73,15 +74,15 @@ namespace NewHorizons.Builder.ShipLog achievementVolume.achievementID = info.achievementID; switch (info.revealFor) { - case VolumesModule.RevealVolumeInfo.EnterType.Player: + case RevealVolumeInfo.EnterType.Player: achievementVolume.player = true; achievementVolume.probe = false; break; - case VolumesModule.RevealVolumeInfo.EnterType.Probe: + case RevealVolumeInfo.EnterType.Probe: achievementVolume.player = false; achievementVolume.probe = true; break; - case VolumesModule.RevealVolumeInfo.EnterType.Both: + case RevealVolumeInfo.EnterType.Both: default: achievementVolume.player = true; achievementVolume.probe = true; @@ -90,7 +91,7 @@ namespace NewHorizons.Builder.ShipLog } } - private static void MakeObservable(GameObject go, Sector sector, VolumesModule.RevealVolumeInfo info, IModBehaviour mod) + private static void MakeObservable(GameObject go, Sector sector, RevealVolumeInfo info, IModBehaviour mod) { go.layer = LayerMask.NameToLayer("Interactible"); @@ -121,7 +122,7 @@ namespace NewHorizons.Builder.ShipLog } } - private static void MakeSnapshot(GameObject go, Sector sector, VolumesModule.RevealVolumeInfo info, IModBehaviour mod) + private static void MakeSnapshot(GameObject go, Sector sector, RevealVolumeInfo info, IModBehaviour mod) { var shape = MakeShape(go, info, Shape.CollisionMode.Manual); diff --git a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs index 34269fe6..8303d3fa 100644 --- a/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/AudioVolumeBuilder.cs @@ -1,5 +1,6 @@ using NewHorizons.Builder.Props; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using NewHorizons.Utility; using OWML.Common; using OWML.Utils; @@ -15,7 +16,7 @@ namespace NewHorizons.Builder.Volumes { public static class AudioVolumeBuilder { - public static AudioVolume Make(GameObject planetGO, Sector sector, VolumesModule.AudioVolumeInfo info, IModBehaviour mod) + public static AudioVolume Make(GameObject planetGO, Sector sector, AudioVolumeInfo info, IModBehaviour mod) { var go = GeneralPropBuilder.MakeNew("AudioVolume", sector?.transform ?? planetGO.transform, info); go.layer = LayerMask.NameToLayer("AdvancedEffectVolume"); diff --git a/NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs b/NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs index 2d97bbd3..c66742fc 100644 --- a/NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs @@ -1,12 +1,13 @@ using NewHorizons.Components.Volumes; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; namespace NewHorizons.Builder.Volumes { internal static class ChangeStarSystemVolumeBuilder { - public static WarpVolume Make(GameObject planetGO, Sector sector, VolumesModule.ChangeStarSystemVolumeInfo info) + public static WarpVolume Make(GameObject planetGO, Sector sector, ChangeStarSystemVolumeInfo info) { var volume = VolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs b/NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs index c34745c1..1fa4f985 100644 --- a/NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs @@ -1,12 +1,13 @@ using NewHorizons.Components.Volumes; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; namespace NewHorizons.Builder.Volumes { internal static class CreditsVolumeBuilder { - public static LoadCreditsVolume Make(GameObject planetGO, Sector sector, VolumesModule.LoadCreditsVolumeInfo info) + public static LoadCreditsVolume Make(GameObject planetGO, Sector sector, LoadCreditsVolumeInfo info) { var volume = VolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/DestructionVolumeBuilder.cs b/NewHorizons/Builder/Volumes/DestructionVolumeBuilder.cs index b657cce0..9305af6f 100644 --- a/NewHorizons/Builder/Volumes/DestructionVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/DestructionVolumeBuilder.cs @@ -1,4 +1,5 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using OWML.Utils; using UnityEngine; @@ -6,7 +7,7 @@ namespace NewHorizons.Builder.Volumes { public static class DestructionVolumeBuilder { - public static DestructionVolume Make(GameObject planetGO, Sector sector, VolumesModule.DestructionVolumeInfo info) + public static DestructionVolume Make(GameObject planetGO, Sector sector, DestructionVolumeInfo info) { var volume = VanishVolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/FluidVolumeBuilder.cs b/NewHorizons/Builder/Volumes/FluidVolumeBuilder.cs index 623a561a..83ea1fa9 100644 --- a/NewHorizons/Builder/Volumes/FluidVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/FluidVolumeBuilder.cs @@ -1,5 +1,6 @@ using NewHorizons.Components.Volumes; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using OWML.Utils; using UnityEngine; @@ -7,7 +8,7 @@ namespace NewHorizons.Builder.Volumes { public static class FluidVolumeBuilder { - public static FluidVolume Make(GameObject planetGO, Sector sector, VolumesModule.FluidVolumeInfo info) + public static FluidVolume Make(GameObject planetGO, Sector sector, FluidVolumeInfo info) { var type = EnumUtils.Parse(info.type.ToString(), FluidVolume.Type.NONE); FluidVolume volume = null; diff --git a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs index bb82013c..2485613a 100644 --- a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs @@ -1,5 +1,6 @@ using NewHorizons.Builder.Props; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using OWML.Common; using OWML.Utils; using System; @@ -12,7 +13,7 @@ namespace NewHorizons.Builder.Volumes { public static class HazardVolumeBuilder { - public static HazardVolume Make(GameObject planetGO, Sector sector, OWRigidbody owrb, VolumesModule.HazardVolumeInfo info, IModBehaviour mod) + public static HazardVolume Make(GameObject planetGO, Sector sector, OWRigidbody owrb, HazardVolumeInfo info, IModBehaviour mod) { var go = GeneralPropBuilder.MakeNew("HazardVolume", sector?.transform ?? planetGO.transform, info); go.layer = LayerMask.NameToLayer("BasicEffectVolume"); @@ -24,15 +25,15 @@ namespace NewHorizons.Builder.Volumes owTriggerVolume._shape = shape; HazardVolume hazardVolume = null; - if (info.type == VolumesModule.HazardVolumeInfo.HazardType.RIVERHEAT) + if (info.type == HazardVolumeInfo.HazardType.RIVERHEAT) { hazardVolume = go.AddComponent(); } - else if (info.type == VolumesModule.HazardVolumeInfo.HazardType.HEAT) + else if (info.type == HazardVolumeInfo.HazardType.HEAT) { hazardVolume = go.AddComponent(); } - else if (info.type == VolumesModule.HazardVolumeInfo.HazardType.DARKMATTER) + else if (info.type == HazardVolumeInfo.HazardType.DARKMATTER) { hazardVolume = go.AddComponent(); var visorFrostEffectVolume = go.AddComponent(); @@ -60,7 +61,7 @@ namespace NewHorizons.Builder.Volumes submerge._fluidDetector = detector; } } - else if (info.type == VolumesModule.HazardVolumeInfo.HazardType.ELECTRICITY) + else if (info.type == HazardVolumeInfo.HazardType.ELECTRICITY) { var electricityVolume = go.AddComponent(); electricityVolume._shockAudioPool = new OWAudioSource[0]; diff --git a/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs b/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs index 574aa6da..7cf56bcc 100644 --- a/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/NotificationVolumeBuilder.cs @@ -1,5 +1,6 @@ using NewHorizons.Builder.Props; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using NewHorizons.Utility; using OWML.Common; using System; @@ -15,7 +16,7 @@ namespace NewHorizons.Builder.Volumes { public static class NotificationVolumeBuilder { - public static NHNotificationVolume Make(GameObject planetGO, Sector sector, VolumesModule.NotificationVolumeInfo info, IModBehaviour mod) + public static NHNotificationVolume Make(GameObject planetGO, Sector sector, NotificationVolumeInfo info, IModBehaviour mod) { var go = GeneralPropBuilder.MakeNew("NotificationVolume", sector?.transform ?? planetGO.transform, info); go.layer = LayerMask.NameToLayer("BasicEffectVolume"); diff --git a/NewHorizons/Builder/Volumes/OxygenVolumeBuilder.cs b/NewHorizons/Builder/Volumes/OxygenVolumeBuilder.cs index 0722fbaf..bcf1f406 100644 --- a/NewHorizons/Builder/Volumes/OxygenVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/OxygenVolumeBuilder.cs @@ -1,11 +1,12 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; namespace NewHorizons.Builder.Volumes { public static class OxygenVolumeBuilder { - public static OxygenVolume Make(GameObject planetGO, Sector sector, VolumesModule.OxygenVolumeInfo info) + public static OxygenVolume Make(GameObject planetGO, Sector sector, OxygenVolumeInfo info) { var volume = VolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/PriorityVolumeBuilder.cs b/NewHorizons/Builder/Volumes/PriorityVolumeBuilder.cs index 994b1c91..b38c966e 100644 --- a/NewHorizons/Builder/Volumes/PriorityVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/PriorityVolumeBuilder.cs @@ -1,11 +1,12 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; namespace NewHorizons.Builder.Volumes { public static class PriorityVolumeBuilder { - public static TVolume Make(GameObject planetGO, Sector sector, VolumesModule.PriorityVolumeInfo info) where TVolume : PriorityVolume + public static TVolume Make(GameObject planetGO, Sector sector, PriorityVolumeInfo info) where TVolume : PriorityVolume { var volume = VolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/Rulesets/PlayerImpactRulesetBuilder.cs b/NewHorizons/Builder/Volumes/Rulesets/PlayerImpactRulesetBuilder.cs index 9ef330de..db1c8e3a 100644 --- a/NewHorizons/Builder/Volumes/Rulesets/PlayerImpactRulesetBuilder.cs +++ b/NewHorizons/Builder/Volumes/Rulesets/PlayerImpactRulesetBuilder.cs @@ -5,7 +5,7 @@ namespace NewHorizons.Builder.Volumes { public static class PlayerImpactRulesetBuilder { - public static PlayerImpactRuleset Make(GameObject planetGO, Sector sector, VolumesModule.RulesetModule.PlayerImpactRulesetInfo info) + public static PlayerImpactRuleset Make(GameObject planetGO, Sector sector, RulesetModule.PlayerImpactRulesetInfo info) { var volume = VolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/Rulesets/ProbeRulesetBuilder.cs b/NewHorizons/Builder/Volumes/Rulesets/ProbeRulesetBuilder.cs index b8293d94..1b17d62f 100644 --- a/NewHorizons/Builder/Volumes/Rulesets/ProbeRulesetBuilder.cs +++ b/NewHorizons/Builder/Volumes/Rulesets/ProbeRulesetBuilder.cs @@ -5,7 +5,7 @@ namespace NewHorizons.Builder.Volumes { public static class ProbeRulesetBuilder { - public static ProbeRuleset Make(GameObject planetGO, Sector sector, VolumesModule.RulesetModule.ProbeRulesetInfo info) + public static ProbeRuleset Make(GameObject planetGO, Sector sector, RulesetModule.ProbeRulesetInfo info) { var volume = VolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/Rulesets/ThrustRulesetBuilder.cs b/NewHorizons/Builder/Volumes/Rulesets/ThrustRulesetBuilder.cs index 8541f516..9543fad9 100644 --- a/NewHorizons/Builder/Volumes/Rulesets/ThrustRulesetBuilder.cs +++ b/NewHorizons/Builder/Volumes/Rulesets/ThrustRulesetBuilder.cs @@ -5,7 +5,7 @@ namespace NewHorizons.Builder.Volumes { public static class ThrustRulesetBuilder { - public static ThrustRuleset Make(GameObject planetGO, Sector sector, VolumesModule.RulesetModule.ThrustRulesetInfo info) + public static ThrustRuleset Make(GameObject planetGO, Sector sector, RulesetModule.ThrustRulesetInfo info) { var volume = VolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/SpeedTrapVolumeBuilder.cs b/NewHorizons/Builder/Volumes/SpeedTrapVolumeBuilder.cs index 3e264604..d9ae1893 100644 --- a/NewHorizons/Builder/Volumes/SpeedTrapVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/SpeedTrapVolumeBuilder.cs @@ -1,11 +1,12 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; namespace NewHorizons.Builder.Volumes { public static class SpeedTrapVolumeBuilder { - public static SpeedTrapVolume Make(GameObject planetGO, Sector sector, VolumesModule.SpeedTrapVolumeInfo info) + public static SpeedTrapVolume Make(GameObject planetGO, Sector sector, SpeedTrapVolumeInfo info) { var volume = VolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs b/NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs index 23628b12..8cda0d15 100644 --- a/NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs @@ -1,6 +1,7 @@ using NewHorizons.Builder.Props; using NewHorizons.Components; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; using Logger = NewHorizons.Utility.Logger; @@ -8,7 +9,7 @@ namespace NewHorizons.Builder.Volumes { public static class VanishVolumeBuilder { - public static TVolume Make(GameObject planetGO, Sector sector, VolumesModule.VanishVolumeInfo info) where TVolume : VanishVolume + public static TVolume Make(GameObject planetGO, Sector sector, VanishVolumeInfo info) where TVolume : VanishVolume { var go = GeneralPropBuilder.MakeNew(typeof(TVolume).Name, sector?.transform ?? planetGO.transform, info); go.layer = LayerMask.NameToLayer("BasicEffectVolume"); diff --git a/NewHorizons/Builder/Volumes/VisorEffects/VisorFrostEffectVolumeBuilder.cs b/NewHorizons/Builder/Volumes/VisorEffects/VisorFrostEffectVolumeBuilder.cs index 139e09f9..c38e0a80 100644 --- a/NewHorizons/Builder/Volumes/VisorEffects/VisorFrostEffectVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/VisorEffects/VisorFrostEffectVolumeBuilder.cs @@ -5,7 +5,7 @@ namespace NewHorizons.Builder.Volumes { public static class VisorFrostEffectVolumeBuilder { - public static VisorFrostEffectVolume Make(GameObject planetGO, Sector sector, VolumesModule.VisorEffectModule.FrostEffectVolumeInfo info) + public static VisorFrostEffectVolume Make(GameObject planetGO, Sector sector, VisorEffectModule.FrostEffectVolumeInfo info) { var volume = PriorityVolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/VisorEffects/VisorRainEffectVolumeBuilder.cs b/NewHorizons/Builder/Volumes/VisorEffects/VisorRainEffectVolumeBuilder.cs index bf268c8e..cf7d66e9 100644 --- a/NewHorizons/Builder/Volumes/VisorEffects/VisorRainEffectVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/VisorEffects/VisorRainEffectVolumeBuilder.cs @@ -5,7 +5,7 @@ namespace NewHorizons.Builder.Volumes { public static class VisorRainEffectVolumeBuilder { - public static VisorRainEffectVolume Make(GameObject planetGO, Sector sector, VolumesModule.VisorEffectModule.RainEffectVolumeInfo info) + public static VisorRainEffectVolume Make(GameObject planetGO, Sector sector, VisorEffectModule.RainEffectVolumeInfo info) { var volume = PriorityVolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Builder/Volumes/VolumeBuilder.cs b/NewHorizons/Builder/Volumes/VolumeBuilder.cs index 8d29c9a9..ca273c99 100644 --- a/NewHorizons/Builder/Volumes/VolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/VolumeBuilder.cs @@ -1,6 +1,7 @@ using NewHorizons.Builder.Props; using NewHorizons.Components; using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; using Logger = NewHorizons.Utility.Logger; @@ -8,7 +9,7 @@ namespace NewHorizons.Builder.Volumes { public static class VolumeBuilder { - public static TVolume Make(GameObject planetGO, Sector sector, VolumesModule.VolumeInfo info) where TVolume : MonoBehaviour //Could be BaseVolume but I need to create vanilla volumes too. + public static TVolume Make(GameObject planetGO, Sector sector, VolumeInfo info) where TVolume : MonoBehaviour //Could be BaseVolume but I need to create vanilla volumes too. { var go = GeneralPropBuilder.MakeNew(typeof(TVolume).Name, sector?.transform ?? planetGO.transform, info); go.layer = LayerMask.NameToLayer("BasicEffectVolume"); diff --git a/NewHorizons/Builder/Volumes/ZeroGVolumeBuilder.cs b/NewHorizons/Builder/Volumes/ZeroGVolumeBuilder.cs index 931d1608..da50d8c9 100644 --- a/NewHorizons/Builder/Volumes/ZeroGVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/ZeroGVolumeBuilder.cs @@ -1,11 +1,12 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; namespace NewHorizons.Builder.Volumes { public static class ZeroGVolumeBuilder { - public static ZeroGVolume Make(GameObject planetGO, Sector sector, VolumesModule.PriorityVolumeInfo info) + public static ZeroGVolume Make(GameObject planetGO, Sector sector, PriorityVolumeInfo info) { var volume = PriorityVolumeBuilder.Make(planetGO, sector, info); diff --git a/NewHorizons/Components/Volumes/LoadCreditsVolume.cs b/NewHorizons/Components/Volumes/LoadCreditsVolume.cs index 11990840..f852917f 100644 --- a/NewHorizons/Components/Volumes/LoadCreditsVolume.cs +++ b/NewHorizons/Components/Volumes/LoadCreditsVolume.cs @@ -1,11 +1,12 @@ using NewHorizons.External.Modules; +using NewHorizons.External.Volumes; using UnityEngine; namespace NewHorizons.Components.Volumes { internal class LoadCreditsVolume : BaseVolume { - public VolumesModule.LoadCreditsVolumeInfo.CreditsType creditsType = VolumesModule.LoadCreditsVolumeInfo.CreditsType.Fast; + public LoadCreditsVolumeInfo.CreditsType creditsType = LoadCreditsVolumeInfo.CreditsType.Fast; public override void OnTriggerVolumeEntry(GameObject hitObj) { @@ -13,13 +14,13 @@ namespace NewHorizons.Components.Volumes { switch(creditsType) { - case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Fast: + case LoadCreditsVolumeInfo.CreditsType.Fast: LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack); break; - case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Final: + case LoadCreditsVolumeInfo.CreditsType.Final: LoadManager.LoadScene(OWScene.Credits_Final, LoadManager.FadeType.ToBlack); break; - case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Kazoo: + case LoadCreditsVolumeInfo.CreditsType.Kazoo: TimelineObliterationController.s_hasRealityEnded = true; LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack); break; diff --git a/NewHorizons/Components/Volumes/NotificationVolume.cs b/NewHorizons/Components/Volumes/NotificationVolume.cs index 70543449..9aa4f3f8 100644 --- a/NewHorizons/Components/Volumes/NotificationVolume.cs +++ b/NewHorizons/Components/Volumes/NotificationVolume.cs @@ -1,3 +1,4 @@ +using NewHorizons.External.Volumes; using NewHorizons.Handlers; using OWML.Utils; using System; @@ -16,7 +17,7 @@ namespace NewHorizons.Components.Volumes public void SetPinned(bool pin) => _pin = pin; - public void SetTarget(External.Modules.VolumesModule.NotificationVolumeInfo.NotificationTarget target) => SetTarget(EnumUtils.Parse(target.ToString(), NotificationTarget.All)); + public void SetTarget(NotificationVolumeInfo.NotificationTarget target) => SetTarget(EnumUtils.Parse(target.ToString(), NotificationTarget.All)); public void SetTarget(NotificationTarget target) => _target = target; diff --git a/NewHorizons/External/Configs/PlanetConfig.cs b/NewHorizons/External/Configs/PlanetConfig.cs index 3330a4ad..6de974db 100644 --- a/NewHorizons/External/Configs/PlanetConfig.cs +++ b/NewHorizons/External/Configs/PlanetConfig.cs @@ -1,6 +1,8 @@ using Epic.OnlineServices.Presence; using NewHorizons.External.Modules; using NewHorizons.External.Modules.VariableSize; +using NewHorizons.External.Props; +using NewHorizons.External.Volumes; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -64,7 +66,7 @@ namespace NewHorizons.External.Configs public string[] childrenToDestroy; [Obsolete("Singularity is deprecated, please use Props->singularities")] - public SingularityModule Singularity; + public SingularityInfo Singularity; [Obsolete("Signal is deprecated, please use Props->signals")] public SignalModule Signal; @@ -213,21 +215,21 @@ namespace NewHorizons.External.Configs // if detail.quantumGroupID != null, there exists a quantum group with that id if (Props?.quantumGroups != null && Props?.details != null) { - Dictionary existingGroups = new Dictionary(); + Dictionary existingGroups = new Dictionary(); foreach (var quantumGroup in Props.quantumGroups) { - if (existingGroups.ContainsKey(quantumGroup.id)) { Logger.LogWarning($"Duplicate quantumGroup id found: {quantumGroup.id}"); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } + if (existingGroups.ContainsKey(quantumGroup.id)) { Logger.LogWarning($"Duplicate quantumGroup id found: {quantumGroup.id}"); quantumGroup.type = QuantumGroupType.FailedValidation; } existingGroups[quantumGroup.id] = quantumGroup; - if (quantumGroup.type == PropModule.QuantumGroupType.Sockets) + if (quantumGroup.type == QuantumGroupType.Sockets) { - if (quantumGroup.sockets?.Length == 0) { Logger.LogError($"quantumGroup {quantumGroup.id} is of type \"sockets\" but has no defined sockets."); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } + if (quantumGroup.sockets?.Length == 0) { Logger.LogError($"quantumGroup {quantumGroup.id} is of type \"sockets\" but has no defined sockets."); quantumGroup.type = QuantumGroupType.FailedValidation; } else { foreach (var socket in quantumGroup.sockets) { if (socket.rotation == null) socket.rotation = UnityEngine.Vector3.zero; - if (socket.position == null) { Logger.LogError($"quantumGroup {quantumGroup.id} has a socket without a position."); quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; } + if (socket.position == null) { Logger.LogError($"quantumGroup {quantumGroup.id} has a socket without a position."); quantumGroup.type = QuantumGroupType.FailedValidation; } } } } @@ -243,10 +245,10 @@ namespace NewHorizons.External.Configs foreach (var quantumGroup in Props.quantumGroups) { - if (quantumGroup.type == PropModule.QuantumGroupType.Sockets && existingGroupsPropCounts.GetValueOrDefault(quantumGroup.id) >= quantumGroup.sockets?.Length) + if (quantumGroup.type == QuantumGroupType.Sockets && existingGroupsPropCounts.GetValueOrDefault(quantumGroup.id) >= quantumGroup.sockets?.Length) { Logger.LogError($"quantumGroup {quantumGroup.id} is of type \"sockets\" and has more props than sockets."); - quantumGroup.type = PropModule.QuantumGroupType.FailedValidation; + quantumGroup.type = QuantumGroupType.FailedValidation; } } } @@ -274,9 +276,9 @@ namespace NewHorizons.External.Configs }; if (Base.blackHoleSize != 0) - Singularity = new SingularityModule + Singularity = new SingularityInfo { - type = SingularityModule.SingularityType.BlackHole, + type = SingularityInfo.SingularityType.BlackHole, size = Base.blackHoleSize }; @@ -329,19 +331,19 @@ namespace NewHorizons.External.Configs if (Props?.tornados != null) foreach (var tornado in Props.tornados) if (tornado.downwards) - tornado.type = PropModule.TornadoInfo.TornadoType.Downwards; + tornado.type = TornadoInfo.TornadoType.Downwards; if (Props?.audioVolumes != null) { if (Volumes == null) Volumes = new VolumesModule(); - if (Volumes.audioVolumes == null) Volumes.audioVolumes = new VolumesModule.AudioVolumeInfo[0]; + if (Volumes.audioVolumes == null) Volumes.audioVolumes = new AudioVolumeInfo[0]; Volumes.audioVolumes = Volumes.audioVolumes.Concat(Props.audioVolumes).ToArray(); } if (Props?.reveal != null) { if (Volumes == null) Volumes = new VolumesModule(); - if (Volumes.revealVolumes == null) Volumes.revealVolumes = new VolumesModule.RevealVolumeInfo[0]; + if (Volumes.revealVolumes == null) Volumes.revealVolumes = new RevealVolumeInfo[0]; Volumes.revealVolumes = Volumes.revealVolumes.Concat(Props.reveal).ToArray(); } @@ -375,7 +377,7 @@ namespace NewHorizons.External.Configs if (Singularity != null) { if (Props == null) Props = new PropModule(); - if (Props.singularities == null) Props.singularities = new SingularityModule[0]; + if (Props.singularities == null) Props.singularities = new SingularityInfo[0]; Props.singularities = Props.singularities.Append(Singularity).ToArray(); } @@ -389,10 +391,10 @@ namespace NewHorizons.External.Configs singularity.horizonRadius = singularity.size * 0.4f; switch (singularity.type) { - case SingularityModule.SingularityType.BlackHole: + case SingularityInfo.SingularityType.BlackHole: singularity.distortRadius = singularity.size * 0.95f; break; - case SingularityModule.SingularityType.WhiteHole: + case SingularityInfo.SingularityType.WhiteHole: singularity.distortRadius = singularity.size * 2.8f; break; } @@ -404,7 +406,7 @@ namespace NewHorizons.External.Configs if (Signal?.signals != null) { if (Props == null) Props = new PropModule(); - if (Props.signals == null) Props.signals = new SignalModule.SignalInfo[0]; + if (Props.signals == null) Props.signals = new SignalInfo[0]; Props.signals = Props.signals.Concat(Signal.signals).ToArray(); } @@ -450,9 +452,9 @@ namespace NewHorizons.External.Configs if (Base.zeroGravityRadius != 0f) { Volumes ??= new VolumesModule(); - Volumes.zeroGravityVolumes ??= new VolumesModule.PriorityVolumeInfo[0]; + Volumes.zeroGravityVolumes ??= new PriorityVolumeInfo[0]; - Volumes.zeroGravityVolumes = Volumes.zeroGravityVolumes.Append(new VolumesModule.PriorityVolumeInfo() + Volumes.zeroGravityVolumes = Volumes.zeroGravityVolumes.Append(new PriorityVolumeInfo() { priority = 1, rename = "ZeroGVolume", @@ -493,7 +495,7 @@ namespace NewHorizons.External.Configs { if (dialogue.remoteTrigger == null && (dialogue.remoteTriggerPosition != null || dialogue.remoteTriggerRadius != 0)) { - dialogue.remoteTrigger = new PropModule.DialogueInfo.RemoteTriggerInfo + dialogue.remoteTrigger = new DialogueInfo.RemoteTriggerInfo { position = dialogue.remoteTriggerPosition, radius = dialogue.remoteTriggerRadius, diff --git a/NewHorizons/External/Configs/StarSystemConfig.cs b/NewHorizons/External/Configs/StarSystemConfig.cs index 58794403..b5a4dff8 100644 --- a/NewHorizons/External/Configs/StarSystemConfig.cs +++ b/NewHorizons/External/Configs/StarSystemConfig.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Utility; using Newtonsoft.Json; using static NewHorizons.External.Modules.ShipLogModule; @@ -206,7 +207,7 @@ namespace NewHorizons.External.Configs [Obsolete("warpExitRotation is deprecated, use vesselSpawn.rotation instead")] public MVector3 warpExitRotation; [JsonObject] - public class VesselInfo : PropModule.GeneralSolarSystemPropInfo + public class VesselInfo : GeneralSolarSystemPropInfo { /// /// Whether the vessel should have physics enabled. This must be set to false for the vessel to stay attached to a parent body. @@ -215,7 +216,7 @@ namespace NewHorizons.External.Configs } [JsonObject] - public class WarpExitInfo : PropModule.GeneralSolarSystemPropInfo + public class WarpExitInfo : GeneralSolarSystemPropInfo { /// /// If set, keeps the warp exit attached to the vessel. Overrides `parentPath`. diff --git a/NewHorizons/External/Modules/BrambleModule.cs b/NewHorizons/External/Modules/BrambleModule.cs index 7fec298b..64207cbc 100644 --- a/NewHorizons/External/Modules/BrambleModule.cs +++ b/NewHorizons/External/Modules/BrambleModule.cs @@ -8,6 +8,7 @@ using System.Runtime.Serialization; using System.Linq; using System.Text; using System.Threading.Tasks; +using NewHorizons.External.Props; namespace NewHorizons.External.Modules { @@ -76,66 +77,5 @@ namespace NewHorizons.External.Modules public int[] allowedEntrances; } - - [JsonObject] - public class BrambleNodeInfo : PropModule.GeneralPropInfo - { - /// - /// The physical scale of the node, as a multiplier of the original size. - /// Nodes are 150m across, seeds are 10m across. - /// - [DefaultValue(1f)] public float scale = 1f; - - /// - /// The name of the planet that hosts the dimension this node links to - /// - public string linksTo; - - /// - /// The name of this node. Only required if this node should serve as an exit. - /// - public string name; - - /// - /// Set this to true to make this node a seed instead of a node the player can enter - /// - [DefaultValue(false)] public bool isSeed = false; - - /// - /// The color of the fog inside the node. - /// Leave blank for the default yellowish white color: (255, 245, 217, 255) - /// - public MColor fogTint; - - /// - /// The color of the light from the node. Alpha controls brightness. - /// Leave blank for the default white color. - /// - public MColor lightTint; - - /// - /// Should this node have a point of light from afar? - /// By default, nodes will have a foglight, while seeds won't, and neither will if not in a dimension. - /// - public bool? hasFogLight; - - /// - /// An array of integers from 0-5. By default, all exits are allowed. To force this node to warp players out from only one hole set this value to [3], [5], or similar. Values of 0-5 only. - /// - public int[] possibleExits; - - /// - /// If your game hard crashes upon entering bramble, it's most likely because you have indirectly recursive dimensions, i.e. one leads to another that leads back to the first one. - /// Set this to true for one of the nodes in the recursion to fix this, at the cost of it no longer showing markers for the scout, ship, etc. - /// - [DefaultValue(false)] public bool preventRecursionCrash = false; - - #region Obsolete - - [Obsolete("farFogTint is deprecated, please use fogTint instead")] - public MColor farFogTint; - - #endregion Obsolete - } } } diff --git a/NewHorizons/External/Modules/ProbeModule.cs b/NewHorizons/External/Modules/ProbeModule.cs new file mode 100644 index 00000000..79384968 --- /dev/null +++ b/NewHorizons/External/Modules/ProbeModule.cs @@ -0,0 +1,20 @@ +using NewHorizons.External.Volumes; +using Newtonsoft.Json; + +namespace NewHorizons.External.Modules +{ + [JsonObject] + public class ProbeModule + { + /// + /// Add probe destruction volumes to this planet. These will delete your probe. + /// + public VolumeInfo[] destructionVolumes; + + /// + /// Add probe safety volumes to this planet. These will stop the probe destruction volumes from working. + /// + public VolumeInfo[] safetyVolumes; + } + } + diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 9c21b454..301c88f7 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -1,12 +1,7 @@ - -using NewHorizons.Utility; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; using System; -using NewHorizons.External.Modules.VariableSize; +using NewHorizons.External.Props; +using NewHorizons.External.Volumes; namespace NewHorizons.External.Modules { @@ -82,831 +77,20 @@ namespace NewHorizons.External.Modules /// /// Add black/white-holes to this planet /// - public SingularityModule[] singularities; + public SingularityInfo[] singularities; /// /// Add signalscope signals to this planet /// - public SignalModule.SignalInfo[] signals; + public SignalInfo[] signals; /// /// Add projection pools/platforms, whiteboards, and stones to this planet /// public RemoteInfo[] remotes; - [Obsolete("reveal is deprecated. Use Volumes->revealVolumes instead.")] public VolumesModule.RevealVolumeInfo[] reveal; + [Obsolete("reveal is deprecated. Use Volumes->revealVolumes instead.")] public RevealVolumeInfo[] reveal; - [Obsolete("audioVolumes is deprecated. Use Volumes->audioVolumes instead.")] public VolumesModule.AudioVolumeInfo[] audioVolumes; - - [JsonObject] - public abstract class GeneralPointPropInfo - { - /// - /// Position of the object - /// - public MVector3 position; - - /// - /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). - /// - public string parentPath; - - /// - /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. - /// - public bool isRelativeToParent; - - /// - /// An optional rename of this object - /// - public string rename; - } - - [JsonObject] - public abstract class GeneralPropInfo : GeneralPointPropInfo - { - /// - /// Rotation of the object - /// - public MVector3 rotation; - } - - [JsonObject] - public abstract class GeneralSolarSystemPropInfo : GeneralPropInfo - { - /// - /// The name of the planet that will be used with `parentPath`. Must be set if `parentPath` is set. - /// - public string parentBody; - } - - [JsonObject] - public class ScatterInfo - { - /// - /// Relative filepath to an asset-bundle - /// - public string assetBundle; - - /// - /// Number of props to scatter - /// - public int count; - - /// - /// Offset this prop once it is placed - /// - public MVector3 offset; - - /// - /// Either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle - /// - public string path; - - /// - /// Rotate this prop once it is placed - /// - public MVector3 rotation; - - /// - /// Scale this prop once it is placed - /// - [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 - /// - public int seed; - - /// - /// The lowest height that these object will be placed at (only relevant if there's a heightmap) - /// - public float? minHeight; - - /// - /// The highest height that these objects will be placed at (only relevant if there's a heightmap) - /// - public float? maxHeight; - - /// - /// Should we try to prevent overlap between the scattered details? True by default. If it's affecting load times turn it off. - /// - [DefaultValue(true)] public bool preventOverlap = true; - - /// - /// Should this detail stay loaded even if you're outside the sector (good for very large props) - /// - public bool keepLoaded; - } - - [JsonObject] - public class DetailInfo : GeneralPropInfo - { - - /// - /// Do we override rotation and try to automatically align this object to stand upright on the body's surface? - /// - public bool alignToNormal; - - /// - /// Relative filepath to an asset-bundle to load the prefab defined in `path` from - /// - public string assetBundle; - - /// - /// Either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle - /// - public string path; - - /// - /// A list of children to remove from this detail - /// - public string[] removeChildren; - - /// - /// Do we reset all the components on this object? Useful for certain props that have dialogue components attached to - /// them. - /// - public bool removeComponents; - - /// - /// Scale the prop - /// - [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 - /// - public string quantumGroupID; - - /// - /// Should this detail stay loaded even if you're outside the sector (good for very large props) - /// - public bool keepLoaded; - - /// - /// Should this object dynamically move around? - /// This tries to make all mesh colliders convex, as well as adding a sphere collider in case the detail has no others. - /// - public bool hasPhysics; - - /// - /// The mass of the physics object. - /// Most pushable props use the default value, which matches the player mass. - /// - [DefaultValue(0.001f)] public float physicsMass = 0.001f; - - /// - /// The radius that the added sphere collider will use for physics collision. - /// If there's already good colliders on the detail, you can make this 0. - /// - [DefaultValue(1f)] public float physicsRadius = 1f; - } - - [JsonObject] - public class RaftInfo : GeneralPointPropInfo - { - /// - /// Acceleration of the raft. Default acceleration is 5. - /// - [DefaultValue(5f)] public float acceleration = 5f; - } - - [JsonObject] - public class GeyserInfo : GeneralPointPropInfo - { - /// - /// Vertical offset of the geyser. From 0, the bubbles start at a height of 10, the shaft at 67, and the spout at 97.5. - /// - [DefaultValue(-97.5f)] public float offset = -97.5f; - - /// - /// Force of the geyser on objects - /// - [DefaultValue(55f)] public float force = 55f; - - /// - /// Time in seconds eruptions last for - /// - [DefaultValue(10f)] public float activeDuration = 10f; - - /// - /// Time in seconds between eruptions - /// - [DefaultValue(19f)] public float inactiveDuration = 19f; - - /// - /// Color of the geyser. Alpha sets the particle density. - /// - public MColor tint; - - /// - /// Disable the individual particle systems of the geyser - /// - public bool disableBubbles, disableShaft, disableSpout; - - /// - /// Loudness of the geyser - /// - [DefaultValue(0.7f)] public float volume = 0.7f; - } - - [JsonObject] - public class TornadoInfo : GeneralPointPropInfo - { - [JsonConverter(typeof(StringEnumConverter))] - public enum TornadoType - { - [EnumMember(Value = @"upwards")] Upwards = 0, - - [EnumMember(Value = @"downwards")] Downwards = 1, - - [EnumMember(Value = @"hurricane")] Hurricane = 2 - } - - [Obsolete("Downwards is deprecated. Use Type instead.")] public bool downwards; - - /// - /// Alternative to setting the position. Will choose a random place at this elevation. - /// - public float elevation; - - /// - /// The height of this tornado. - /// - [DefaultValue(30f)] public float height = 30f; - - /// - /// The colour of the tornado. - /// - public MColor tint; - - /// - /// What type of cyclone should this be? Upwards and downwards are both tornados and will push in that direction. - /// - [DefaultValue("upwards")] public TornadoType type = TornadoType.Upwards; - - /// - /// Angular distance from the starting position that it will wander, in terms of the angle around the x-axis. - /// - [DefaultValue(45f)] public float wanderDegreesX = 45f; - - /// - /// Angular distance from the starting position that it will wander, in terms of the angle around the z-axis. - /// - [DefaultValue(45f)] public float wanderDegreesZ = 45f; - - /// - /// The rate at which the tornado will wander around the planet. Set to 0 for it to be stationary. Should be around - /// 0.1. - /// - public float wanderRate; - - /// - /// The maximum distance at which you'll hear the sounds of the cyclone. If not set it will scale relative to the size of the cyclone. - /// - public float audioDistance; - - /// - /// Fluid type for sounds/effects when colliding with this tornado. - /// - [DefaultValue("cloud")] public FluidType fluidType = FluidType.Cloud; - } - - [JsonObject] - public class VolcanoInfo : GeneralPointPropInfo - { - /// - /// The colour of the meteor's lava. - /// - public MColor lavaTint; - - /// - /// Maximum time between meteor launches. - /// - [DefaultValue(20f)] - public float maxInterval = 20f; - - /// - /// Maximum random speed at which meteors are launched. - /// - [DefaultValue(150f)] - public float maxLaunchSpeed = 150f; - - /// - /// Minimum time between meteor launches. - /// - [DefaultValue(5f)] - public float minInterval = 5f; - - /// - /// Minimum random speed at which meteors are launched. - /// - [DefaultValue(50f)] - public float minLaunchSpeed = 50f; - - /// - /// Scale of the meteors. - /// - public float scale = 1; - - /// - /// The colour of the meteor's stone. - /// - public MColor stoneTint; - } - - [JsonObject] - public class DialogueInfo : GeneralPointPropInfo - { - /// - /// Prevents the dialogue from being created after a specific persistent condition is set. Useful for remote dialogue - /// triggers that you want to have happen only once. - /// - public string blockAfterPersistentCondition; - - /// - /// If a pathToAnimController is supplied, if you are within this distance the character will look at you. If it is set - /// to 0, they will only look at you when spoken to. - /// - public float lookAtRadius; - - /// - /// If this dialogue is meant for a character, this is the relative path from the planet to that character's - /// CharacterAnimController, TravelerController, TravelerEyeController (eye of the universe), FacePlayerWhenTalking, or SolanumAnimController. - /// - /// If none of those components are present it will add a FacePlayerWhenTalking component. - /// - public string pathToAnimController; - - /// - /// Radius of the spherical collision volume where you get the "talk to" prompt when looking at. If you use a - /// remoteTrigger, you can set this to 0 to make the dialogue only trigger remotely. - /// - public float radius = 1f; - - /// - /// Distance from radius the prompt appears - /// - [DefaultValue(2f)] public float range = 2f; - - /// - /// Allows you to trigger dialogue from a distance when you walk into an area. - /// - public RemoteTriggerInfo remoteTrigger; - - [Obsolete("remoteTriggerPosition is deprecated. Use remoteTrigger.position instead")] public MVector3 remoteTriggerPosition; - [Obsolete("remoteTriggerRadius is deprecated. Use remoteTrigger.radius instead")] public float remoteTriggerRadius; - [Obsolete("remoteTriggerPrereqCondition is deprecated. Use remoteTrigger.prereqCondition instead")] public string remoteTriggerPrereqCondition; - - /// - /// Relative path to the xml file defining the dialogue. - /// - public string xmlFile; - - /// - /// What type of flashlight toggle to do when dialogue is interacted with - /// - [DefaultValue("none")] public FlashlightToggle flashlightToggle = FlashlightToggle.None; - - [JsonConverter(typeof(StringEnumConverter))] - public enum FlashlightToggle - { - [EnumMember(Value = @"none")] None = -1, - [EnumMember(Value = @"turnOff")] TurnOff = 0, - [EnumMember(Value = @"turnOffThenOn")] TurnOffThenOn = 1, - } - - [JsonObject] - public class RemoteTriggerInfo : GeneralPointPropInfo - { - /// - /// The radius of the remote trigger volume. - /// - public float radius; - /// - /// This condition must be met for the remote trigger volume to trigger. - /// - public string prereqCondition; - } - } - - [JsonObject] - public class EntryLocationInfo : GeneralPointPropInfo - { - /// - /// Whether this location is cloaked - /// - public bool cloaked; - - /// - /// ID of the entry this location relates to - /// - public string id; - } - - [JsonObject] - public class NomaiTextInfo : GeneralPointPropInfo - { - [JsonConverter(typeof(StringEnumConverter))] - public enum NomaiTextType - { - [EnumMember(Value = @"wall")] Wall = 0, - - [EnumMember(Value = @"scroll")] Scroll = 1, - - [EnumMember(Value = @"computer")] Computer = 2, - - [EnumMember(Value = @"cairn")] Cairn = 3, - - [EnumMember(Value = @"recorder")] Recorder = 4, - - [EnumMember(Value = @"preCrashRecorder")] PreCrashRecorder = 5, - - [EnumMember(Value = @"preCrashComputer")] PreCrashComputer = 6, - - [EnumMember(Value = @"trailmarker")] Trailmarker = 7, - - [EnumMember(Value = @"cairnVariant")] CairnVariant = 8, - } - - [JsonConverter(typeof(StringEnumConverter))] - public enum NomaiTextLocation - { - [EnumMember(Value = @"unspecified")] UNSPECIFIED = 0, - - [EnumMember(Value = @"a")] A = 1, - - [EnumMember(Value = @"b")] B = 2 - } - - /// - /// Additional information about each arc in the text - /// - public NomaiTextArcInfo[] arcInfo; - - /// - /// The normal vector for this object. Used for writing on walls and positioning computers. - /// - public MVector3 normal; - - /// - /// The euler angle rotation of this object. Not required if setting the normal. Computers and cairns will orient - /// themselves to the surface of the planet automatically. - /// - public MVector3 rotation; - - /// - /// The random seed used to pick what the text arcs will look like. - /// - public int seed; // For randomizing arcs - - /// - /// The type of object this is. - /// - [DefaultValue("wall")] public NomaiTextType type = NomaiTextType.Wall; - - /// - /// The location of this object. - /// - [DefaultValue("unspecified")] public NomaiTextLocation location = NomaiTextLocation.UNSPECIFIED; - - /// - /// The relative path to the xml file for this object. - /// - public string xmlFile; - } - - [JsonObject] - public class NomaiTextArcInfo - { - [JsonConverter(typeof(StringEnumConverter))] - public enum NomaiTextArcType - { - [EnumMember(Value = @"adult")] Adult = 0, - - [EnumMember(Value = @"child")] Child = 1, - - [EnumMember(Value = @"stranger")] Stranger = 2 - } - - /// - /// Whether to skip modifying this spiral's placement, and instead keep the automatically determined placement. - /// - public bool keepAutoPlacement; - - /// - /// Whether to flip the spiral from left-curling to right-curling or vice versa. - /// - public bool mirror; - - /// - /// The local position of this object on the wall. - /// - public MVector2 position; - - /// - /// The type of text to display. - /// - [DefaultValue("adult")] public NomaiTextArcType type = NomaiTextArcType.Adult; - - /// - /// Which variation of the chosen type to place. If not specified, a random variation will be selected based on the seed provided in the parent module. - /// - [DefaultValue(-1)] public int variation = -1; - - /// - /// The z euler angle for this arc. - /// - [Range(0f, 360f)] public float zRotation; - } - - [JsonObject] - public class ProjectionInfo : GeneralPropInfo - { - [JsonConverter(typeof(StringEnumConverter))] - public enum SlideShowType - { - [EnumMember(Value = @"slideReel")] SlideReel = 0, - - [EnumMember(Value = @"autoProjector")] AutoProjector = 1, - - [EnumMember(Value = @"visionTorchTarget")] VisionTorchTarget = 2, - - [EnumMember(Value = @"standingVisionTorch")] StandingVisionTorch = 3, - - } - - /// - /// The ship log facts revealed after finishing this slide reel. - /// - public string[] reveals; - - /// - /// The ship log facts that make the reel play when they are displayed in the computer (by selecting entries or arrows). - /// You should probably include facts from `reveals` here. - /// If you only specify a rumor fact, then it would only play in its ship log entry if this has revealed only - /// rumor facts because an entry with revealed explore facts doesn't display rumor facts. - /// - public string[] playWithShipLogFacts; - - /// - /// The list of slides for this object. - /// - public SlideInfo[] slides; - - /// - /// The type of object this is. - /// - [DefaultValue("slideReel")] public SlideShowType type = SlideShowType.SlideReel; - } - - [JsonObject] - public class SlideInfo - { - /// - /// Ambient light colour when viewing this slide. - /// - public MColor ambientLightColor; - - - // SlideAmbientLightModule - - /// - /// Ambient light intensity when viewing this slide. - /// - public float ambientLightIntensity; - - /// - /// Ambient light range when viewing this slide. - /// - public float ambientLightRange; - - // SlideBackdropAudioModule - - /// - /// The name of the AudioClip that will continuously play while watching these slides - /// - public string backdropAudio; - - /// - /// The time to fade into the backdrop audio - /// - public float backdropFadeTime; - - // SlideBeatAudioModule - - /// - /// The name of the AudioClip for a one-shot sound when opening the slide. - /// - public string beatAudio; - - /// - /// The time delay until the one-shot audio - /// - public float beatDelay; - - - // SlideBlackFrameModule - - /// - /// Before viewing this slide, there will be a black frame for this many seconds. - /// - public float blackFrameDuration; - - /// - /// The path to the image file for this slide. - /// - public string imagePath; - - - // SlidePlayTimeModule - - /// - /// Play-time duration for auto-projector slides. - /// - public float playTimeDuration; - - - // SlideShipLogEntryModule - - /// - /// Ship log fact revealed when viewing this slide - /// - public string reveal; - - /// - /// Spotlight intensity modifier when viewing this slide. - /// - public float spotIntensityMod; - } - - - - - [JsonConverter(typeof(StringEnumConverter))] - public enum QuantumGroupType - { - [EnumMember(Value = @"sockets")] Sockets = 0, - - [EnumMember(Value = @"states")] States = 1, - - FailedValidation = 10 - } - - [JsonObject] - public class QuantumGroupInfo - { - /// - /// What type of group this is: does it define a list of states a single quantum object could take or a list of sockets one or more quantum objects could share? - /// - public QuantumGroupType type; - - /// - /// A unique string used by props (that are marked as quantum) use to refer back to this group - /// - public string id; - - /// - /// Only required if type is `sockets`. This lists all the possible locations for any props assigned to this group. - /// - public QuantumSocketInfo[] sockets; - - /// - /// Optional. Only used if type is `states`. If this is true, then the first prop made part of this group will be used to construct a visibility box for an empty game object, which will be considered one of the states. - /// - public bool hasEmptyState; - - /// - /// Optional. Only used if type is `states`. If this is true, then the states will be presented in order, rather than in a random order - /// - public bool sequential; - - /// - /// Optional. Only used if type is `states` and `sequential` is true. If this is false, then after the last state has appeared, the object will no longer change state - /// - [DefaultValue(true)] public bool loop = true; - } - - [JsonObject] - public class QuantumSocketInfo : GeneralPropInfo - { - /// - /// The probability any props that are part of this group will occupy this socket - /// - [DefaultValue(1f)] public float probability = 1f; - } - - [JsonObject] - public class RemoteInfo - { - /// - /// The unique remote id - /// - public string id; - - /// - /// Icon that the will show on the stone, pedastal of the whiteboard, and pedastal of the platform. - /// - public string decalPath; - - /// - /// Whiteboard that the stones can put text onto - /// - public WhiteboardInfo whiteboard; - - /// - /// Camera platform that the stones can project to and from - /// - public PlatformInfo platform; - - /// - /// Projection stones - /// - public StoneInfo[] stones; - - [JsonObject] - public class WhiteboardInfo : GeneralPropInfo - { - /// - /// The text for each stone - /// - public SharedNomaiTextInfo[] nomaiText; - - /// - /// Disable the wall, leaving only the pedestal and text. - /// - public bool disableWall; - - [JsonObject] - public class SharedNomaiTextInfo - { - /// - /// The id of the stone this text will appear for - /// - public string id; - - /// - /// Additional information about each arc in the text - /// - public NomaiTextArcInfo[] arcInfo; - - /// - /// The random seed used to pick what the text arcs will look like. - /// - public int seed; // For randomizing arcs - - /// - /// The location of this object. - /// - [DefaultValue("unspecified")] public NomaiTextInfo.NomaiTextLocation location = NomaiTextInfo.NomaiTextLocation.UNSPECIFIED; - - /// - /// The relative path to the xml file for this object. - /// - public string xmlFile; - - /// - /// An optional rename of this object - /// - public string rename; - } - } - - [JsonObject] - public class PlatformInfo : GeneralPropInfo - { - /// - /// A ship log fact to reveal when the platform is connected to. - /// - [DefaultValue("")] public string reveals = ""; - - /// - /// Disable the structure, leaving only the pedestal. - /// - public bool disableStructure; - - /// - /// Disable the pool that rises when you place a stone. - /// - public bool disablePool; - } - - [JsonObject] - public class StoneInfo : GeneralPropInfo - { - - } - } + [Obsolete("audioVolumes is deprecated. Use Volumes->audioVolumes instead.")] public AudioVolumeInfo[] audioVolumes; } } diff --git a/NewHorizons/External/Modules/RulesetModule.cs b/NewHorizons/External/Modules/RulesetModule.cs new file mode 100644 index 00000000..4b35e44f --- /dev/null +++ b/NewHorizons/External/Modules/RulesetModule.cs @@ -0,0 +1,90 @@ +using NewHorizons.External.Volumes; +using Newtonsoft.Json; +using System.ComponentModel; + +namespace NewHorizons.External.Modules +{ + [JsonObject] + public class RulesetModule + { + /// + /// Add anti travel music rulesets to this planet. + /// + public VolumeInfo[] antiTravelMusicRulesets; + /// + /// Add player impact rulesets to this planet. + /// + public PlayerImpactRulesetInfo[] playerImpactRulesets; + /// + /// Add probe rulesets to this planet. + /// + public ProbeRulesetInfo[] probeRulesets; + /// + /// Add thrust rulesets to this planet. + /// + public ThrustRulesetInfo[] thrustRulesets; + + [JsonObject] + public class PlayerImpactRulesetInfo : VolumeInfo + { + /// + /// Minimum player impact speed. Player will take the minimum amount of damage if they impact something at this speed. + /// + [DefaultValue(20f)] public float minImpactSpeed = 20f; + + /// + /// Maximum player impact speed. Players will die if they impact something at this speed. + /// + [DefaultValue(40f)] public float maxImpactSpeed = 40f; + } + + [JsonObject] + public class ProbeRulesetInfo : VolumeInfo + { + /// + /// Should this ruleset override the probe's speed? + /// + public bool overrideProbeSpeed; + + /// + /// The speed of the probe while in this ruleset volume. + /// + public float probeSpeed; + + /// + /// Should this ruleset override the range of probe's light? + /// + public bool overrideLanternRange; + + /// + /// The range of probe's light while in this ruleset volume. + /// + public float lanternRange; + + /// + /// Stop the probe from attaching to anything while in this ruleset volume. + /// + public bool ignoreAnchor; + } + + [JsonObject] + public class ThrustRulesetInfo : VolumeInfo + { + /// + /// Limit how fast you can fly with your ship while in this ruleset volume. + /// + [DefaultValue(float.PositiveInfinity)] public float thrustLimit = float.PositiveInfinity; + + /// + /// Nerf the jetpack booster. + /// + public bool nerfJetpackBooster; + + /// + /// How long the jetpack booster will be nerfed. + /// + [DefaultValue(0.5f)] public float nerfDuration = 0.5f; + } + } + } + diff --git a/NewHorizons/External/Modules/SignalModule.cs b/NewHorizons/External/Modules/SignalModule.cs index cfa66a16..337258cb 100644 --- a/NewHorizons/External/Modules/SignalModule.cs +++ b/NewHorizons/External/Modules/SignalModule.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; +using NewHorizons.External.Props; using NewHorizons.Utility; using Newtonsoft.Json; @@ -13,63 +14,5 @@ namespace NewHorizons.External.Modules /// List of signals to add (Why did xen do it like this) /// public SignalInfo[] signals; - - [JsonObject] - public class SignalInfo : PropModule.GeneralPointPropInfo - { - [Obsolete("audioClip is deprecated, please use audio instead")] - public string audioClip; - - [Obsolete("audioFilePath is deprecated, please use audio instead")] - public string audioFilePath; - - /// - /// The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. - /// - public string audio; - - /// - /// How close the player must get to the signal to detect it. This is when you get the "Unknown Signal Detected" - /// notification. - /// - [Range(0f, double.MaxValue)] public float detectionRadius; - - /// - /// The frequency ID of the signal. The built-in game values are `Default`, `Traveler`, `Quantum`, `EscapePod`, - /// `Statue`, `WarpCore`, `HideAndSeek`, and `Radio`. You can also put a custom value. - /// - public string frequency; - - /// - /// How close the player must get to the signal to identify it. This is when you learn its name. - /// - [DefaultValue(10f)] [Range(0f, double.MaxValue)] - public float identificationRadius = 10f; - - /// - /// Only set to `true` if you are putting this signal inside a cloaking field. - /// - public bool insideCloak; - - /// - /// The unique ID of the signal. - /// - public string name; - - /// - /// `false` if the player can hear the signal without equipping the signal-scope. - /// - [DefaultValue(true)] public bool onlyAudibleToScope = true; - - /// - /// A ship log fact to reveal when the signal is identified. - /// - [DefaultValue("")] public string reveals = ""; - - /// - /// Radius of the sphere giving off the signal. - /// - [DefaultValue(1f)] public float sourceRadius = 1f; - } } } \ No newline at end of file diff --git a/NewHorizons/External/Modules/SpawnModule.cs b/NewHorizons/External/Modules/SpawnModule.cs index ea8067c1..5ab6bf71 100644 --- a/NewHorizons/External/Modules/SpawnModule.cs +++ b/NewHorizons/External/Modules/SpawnModule.cs @@ -1,3 +1,4 @@ +using NewHorizons.External.Props; using NewHorizons.Utility; using Newtonsoft.Json; using System; @@ -24,7 +25,7 @@ namespace NewHorizons.External.Modules [Obsolete("startWithSuit is deprecated. Use playerSpawn.startWithSuit instead")] public bool startWithSuit; [JsonObject] - public class PlayerSpawnPoint : PropModule.GeneralPropInfo { + public class PlayerSpawnPoint : GeneralPropInfo { /// /// If you spawn on a planet with no oxygen, you probably want to set this to true ;;) /// @@ -32,7 +33,7 @@ namespace NewHorizons.External.Modules } [JsonObject] - public class ShipSpawnPoint : PropModule.GeneralPropInfo { + public class ShipSpawnPoint : GeneralPropInfo { } } diff --git a/NewHorizons/External/Modules/VisorEffectModule.cs b/NewHorizons/External/Modules/VisorEffectModule.cs new file mode 100644 index 00000000..fa1fd6ce --- /dev/null +++ b/NewHorizons/External/Modules/VisorEffectModule.cs @@ -0,0 +1,55 @@ +using NewHorizons.External.Volumes; +using Newtonsoft.Json; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace NewHorizons.External.Modules +{ + [JsonObject] + public class VisorEffectModule + { + /// + /// Add visor frost effect volumes to this planet. This is the ghost matter effect. + /// + public FrostEffectVolumeInfo[] frostEffectVolumes; + + /// + /// Add visor rain effect volumes to this planet. You can see this on Giant's Deep. + /// + public RainEffectVolumeInfo[] rainEffectVolumes; + + [JsonObject] + public class FrostEffectVolumeInfo : PriorityVolumeInfo + { + /// + /// The rate at which the frost effect will get stronger + /// + [DefaultValue(0.5f)] + public float frostRate = 0.5f; + + /// + /// The maximum strength of frost this volume can give + /// + [Range(0f, 1f)] + [DefaultValue(0.91f)] + public float maxFrost = 0.91f; + } + + [JsonObject] + public class RainEffectVolumeInfo : PriorityVolumeInfo + { + /// + /// The rate at which the rain droplet effect will happen + /// + [DefaultValue(0.1f)] + public float dropletRate = 10f; + + /// + /// The rate at which the rain streak effect will happen + /// + [DefaultValue(1f)] + public float streakRate = 1f; + } + } + } + diff --git a/NewHorizons/External/Modules/VolumesModule.cs b/NewHorizons/External/Modules/VolumesModule.cs index 8b60df6e..5118db0c 100644 --- a/NewHorizons/External/Modules/VolumesModule.cs +++ b/NewHorizons/External/Modules/VolumesModule.cs @@ -1,3 +1,5 @@ +using NewHorizons.External.Props; +using NewHorizons.External.Volumes; using NewHorizons.Utility; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -115,539 +117,5 @@ namespace NewHorizons.External.Modules /// Enter this volume to be sent to the end credits scene /// public LoadCreditsVolumeInfo[] creditsVolume; - - [JsonObject] - public class VolumeInfo : PropModule.GeneralPointPropInfo - { - /// - /// The radius of this volume. - /// - [DefaultValue(1f)] - public float radius = 1f; - } - - [JsonObject] - public class ChangeStarSystemVolumeInfo : VolumeInfo - { - /// - /// The star system that entering this volume will send you to. - /// - [DefaultValue("SolarSystem")] - public string targetStarSystem; - } - - [JsonObject] - public class LoadCreditsVolumeInfo : VolumeInfo - { - [JsonConverter(typeof(StringEnumConverter))] - public enum CreditsType - { - [EnumMember(Value = @"fast")] Fast = 0, - - [EnumMember(Value = @"final")] Final = 1, - - [EnumMember(Value = @"kazoo")] Kazoo = 2 - } - - [DefaultValue("fast")] - public CreditsType creditsType = CreditsType.Fast; - } - - [JsonObject] - public class PriorityVolumeInfo : VolumeInfo - { - /// - /// The layer of this volume. - /// - [DefaultValue(0)] - public int layer = 0; - - /// - /// The priority for this volume's effects to be applied. - /// Ex, a player in a gravity volume with priority 0, and zero-gravity volume with priority 1, will feel zero gravity. - /// - [DefaultValue(1)] - public int priority = 1; - } - - [JsonObject] - public class RevealVolumeInfo : VolumeInfo - { - [JsonConverter(typeof(StringEnumConverter))] - public enum RevealVolumeType - { - [EnumMember(Value = @"enter")] Enter = 0, - - [EnumMember(Value = @"observe")] Observe = 1, - - [EnumMember(Value = @"snapshot")] Snapshot = 2 - } - - [JsonConverter(typeof(StringEnumConverter))] - public enum EnterType - { - [EnumMember(Value = @"both")] Both = 0, - - [EnumMember(Value = @"player")] Player = 1, - - [EnumMember(Value = @"probe")] Probe = 2 - } - - /// - /// The max view angle (in degrees) the player can see the volume with to unlock the fact (`observe` only) - /// - [DefaultValue(180f)] - public float maxAngle = 180f; // Observe Only - - /// - /// The max distance the user can be away from the volume to reveal the fact (`snapshot` and `observe` only) - /// - [DefaultValue(-1f)] - public float maxDistance = -1f; // Snapshot & Observe Only - - /// - /// What needs to be done to the volume to unlock the facts - /// - [DefaultValue("enter")] public RevealVolumeType revealOn = RevealVolumeType.Enter; - - /// - /// What can enter the volume to unlock the facts (`enter` only) - /// - [DefaultValue("both")] public EnterType revealFor = EnterType.Both; - - /// - /// A list of facts to reveal - /// - public string[] reveals; - - /// - /// An achievement to unlock. Optional. - /// - public string achievementID; - } - - [JsonObject] - public class AudioVolumeInfo : PriorityVolumeInfo - { - /// - /// The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. - /// - public string audio; - - [DefaultValue("random")] public ClipSelectionType clipSelection = ClipSelectionType.RANDOM; - - /// - /// The audio track of this audio volume - /// - [DefaultValue("environment")] public AudioMixerTrackName track = AudioMixerTrackName.Environment; - - /// - /// 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; - - /// - /// How long it will take to fade this sound in and out when entering/exiting this volume. - /// - [DefaultValue(2f)] - public float fadeSeconds = 2f; - - /// - /// Play the sound instantly without any fading. - /// - public bool noFadeFromBeginning; - - /// - /// Randomize what time the audio starts at. - /// - public bool randomizePlayhead; - - /// - /// Pause the music when exiting the volume. - /// - public bool pauseOnFadeOut; - } - - [JsonObject] - public class NotificationVolumeInfo : VolumeInfo - { - /// - /// What the notification will show for. - /// - [DefaultValue("all")] public NotificationTarget target = NotificationTarget.All; - - /// - /// The notification that will play when you enter this volume. - /// - public NotificationInfo entryNotification; - - /// - /// The notification that will play when you exit this volume. - /// - public NotificationInfo exitNotification; - - - [JsonObject] - public class NotificationInfo - { - /// - /// The message that will be displayed. - /// - public string displayMessage; - - /// - /// The duration this notification will be displayed. - /// - [DefaultValue(5f)] public float duration = 5f; - } - - [JsonConverter(typeof(StringEnumConverter))] - public enum NotificationTarget - { - [EnumMember(Value = @"all")] All = 0, - [EnumMember(Value = @"ship")] Ship = 1, - [EnumMember(Value = @"player")] Player = 2, - } - } - - [JsonObject] - public class HazardVolumeInfo : VolumeInfo - { - /// - /// The type of hazard for this volume. - /// - [DefaultValue("general")] public HazardType type = HazardType.GENERAL; - - /// - /// The amount of damage you will take per second while inside this volume. - /// - [DefaultValue(10f)] public float damagePerSecond = 10f; - - /// - /// The type of damage you will take when you first touch this volume. - /// - [DefaultValue("impact")] public InstantDamageType firstContactDamageType = InstantDamageType.Impact; - - /// - /// The amount of damage you will take when you first touch this volume. - /// - public float firstContactDamage; - - [JsonConverter(typeof(StringEnumConverter))] - public enum HazardType - { - [EnumMember(Value = @"none")] NONE = 0, - [EnumMember(Value = @"general")] GENERAL = 1, - [EnumMember(Value = @"ghostMatter")] DARKMATTER = 2, - [EnumMember(Value = @"heat")] HEAT = 4, - [EnumMember(Value = @"fire")] FIRE = 8, - [EnumMember(Value = @"sandfall")] SANDFALL = 16, - [EnumMember(Value = @"electricity")] ELECTRICITY = 32, - [EnumMember(Value = @"rapids")] RAPIDS = 64, - [EnumMember(Value = @"riverHeat")] RIVERHEAT = 128, - } - - [JsonConverter(typeof(StringEnumConverter))] - public enum InstantDamageType - { - [EnumMember(Value = @"impact")] Impact, - [EnumMember(Value = @"puncture")] Puncture, - [EnumMember(Value = @"electrical")] Electrical - } - } - - [JsonObject] - public class VanishVolumeInfo : VolumeInfo - { - /// - /// Whether the bodies will shrink when they enter this volume or just disappear instantly. - /// - [DefaultValue(true)] public bool shrinkBodies = true; - - /// - /// Whether this volume only affects the player and ship. - /// - public bool onlyAffectsPlayerAndShip; - } - - [JsonObject] - public class DestructionVolumeInfo : VanishVolumeInfo - { - /// - /// The type of death the player will have if they enter this volume. - /// - [DefaultValue("default")] public DeathType deathType = DeathType.Default; - - [JsonConverter(typeof(StringEnumConverter))] - public enum DeathType - { - [EnumMember(Value = @"default")] Default, - [EnumMember(Value = @"impact")] Impact, - [EnumMember(Value = @"asphyxiation")] Asphyxiation, - [EnumMember(Value = @"energy")] Energy, - [EnumMember(Value = @"supernova")] Supernova, - [EnumMember(Value = @"digestion")] Digestion, - [EnumMember(Value = @"bigBang")] BigBang, - [EnumMember(Value = @"crushed")] Crushed, - [EnumMember(Value = @"meditation")] Meditation, - [EnumMember(Value = @"timeLoop")] TimeLoop, - [EnumMember(Value = @"lava")] Lava, - [EnumMember(Value = @"blackHole")] BlackHole, - [EnumMember(Value = @"dream")] Dream, - [EnumMember(Value = @"dreamExplosion")] DreamExplosion, - [EnumMember(Value = @"crushedByElevator")] CrushedByElevator - } - } - - [JsonObject] - public class OxygenVolumeInfo : VolumeInfo - { - /// - /// Does this volume contain trees? This will change the notification from "Oxygen tank refilled" to "Trees detected, oxygen tank refilled". - /// - public bool treeVolume; - - /// - /// Whether to play the oxygen tank refill sound or just fill quietly. - /// - [DefaultValue(true)] public bool playRefillAudio = true; - } - - [JsonObject] - public class FluidVolumeInfo : PriorityVolumeInfo - { - /// - /// Density of the fluid. The higher the density, the harder it is to go through this fluid. - /// - [DefaultValue(1.2f)] public float density = 1.2f; - - /// - /// The type of fluid for this volume. - /// - public FluidType type; - - /// - /// Should the player and rafts align to this fluid. - /// - [DefaultValue(true)] public bool alignmentFluid = true; - - /// - /// Should the ship align to the fluid by rolling. - /// - public bool allowShipAutoroll; - - /// - /// Disable this fluid volume immediately? - /// - public bool disableOnStart; - - [JsonConverter(typeof(StringEnumConverter))] - public enum FluidType - { - [EnumMember(Value = @"none")] NONE = 0, - [EnumMember(Value = @"air")] AIR, - [EnumMember(Value = @"water")] WATER, - [EnumMember(Value = @"cloud")] CLOUD, - [EnumMember(Value = @"sand")] SAND, - [EnumMember(Value = @"plasma")] PLASMA, - [EnumMember(Value = @"fog")] FOG - } - } - - [JsonObject] - public class ProbeModule - { - /// - /// Add probe destruction volumes to this planet. These will delete your probe. - /// - public VolumeInfo[] destructionVolumes; - - /// - /// Add probe safety volumes to this planet. These will stop the probe destruction volumes from working. - /// - public VolumeInfo[] safetyVolumes; - } - - [JsonObject] - public class VisorEffectModule - { - /// - /// Add visor frost effect volumes to this planet. This is the ghost matter effect. - /// - public FrostEffectVolumeInfo[] frostEffectVolumes; - - /// - /// Add visor rain effect volumes to this planet. You can see this on Giant's Deep. - /// - public RainEffectVolumeInfo[] rainEffectVolumes; - - [JsonObject] - public class FrostEffectVolumeInfo : PriorityVolumeInfo - { - /// - /// The rate at which the frost effect will get stronger - /// - [DefaultValue(0.5f)] - public float frostRate = 0.5f; - - /// - /// The maximum strength of frost this volume can give - /// - [Range(0f, 1f)] - [DefaultValue(0.91f)] - public float maxFrost = 0.91f; - } - - [JsonObject] - public class RainEffectVolumeInfo : PriorityVolumeInfo - { - /// - /// The rate at which the rain droplet effect will happen - /// - [DefaultValue(0.1f)] - public float dropletRate = 10f; - - /// - /// The rate at which the rain streak effect will happen - /// - [DefaultValue(1f)] - public float streakRate = 1f; - } - } - - [JsonObject] - public class RulesetModule - { - /// - /// Add anti travel music rulesets to this planet. - /// - public VolumeInfo[] antiTravelMusicRulesets; - /// - /// Add player impact rulesets to this planet. - /// - public PlayerImpactRulesetInfo[] playerImpactRulesets; - /// - /// Add probe rulesets to this planet. - /// - public ProbeRulesetInfo[] probeRulesets; - /// - /// Add thrust rulesets to this planet. - /// - public ThrustRulesetInfo[] thrustRulesets; - - [JsonObject] - public class PlayerImpactRulesetInfo : VolumeInfo - { - /// - /// Minimum player impact speed. Player will take the minimum amount of damage if they impact something at this speed. - /// - [DefaultValue(20f)] public float minImpactSpeed = 20f; - - /// - /// Maximum player impact speed. Players will die if they impact something at this speed. - /// - [DefaultValue(40f)] public float maxImpactSpeed = 40f; - } - - [JsonObject] - public class ProbeRulesetInfo : VolumeInfo - { - /// - /// Should this ruleset override the probe's speed? - /// - public bool overrideProbeSpeed; - - /// - /// The speed of the probe while in this ruleset volume. - /// - public float probeSpeed; - - /// - /// Should this ruleset override the range of probe's light? - /// - public bool overrideLanternRange; - - /// - /// The range of probe's light while in this ruleset volume. - /// - public float lanternRange; - - /// - /// Stop the probe from attaching to anything while in this ruleset volume. - /// - public bool ignoreAnchor; - } - - [JsonObject] - public class ThrustRulesetInfo : VolumeInfo - { - /// - /// Limit how fast you can fly with your ship while in this ruleset volume. - /// - [DefaultValue(float.PositiveInfinity)] public float thrustLimit = float.PositiveInfinity; - - /// - /// Nerf the jetpack booster. - /// - public bool nerfJetpackBooster; - - /// - /// How long the jetpack booster will be nerfed. - /// - [DefaultValue(0.5f)] public float nerfDuration = 0.5f; - } - } - - [JsonObject] - public class SpeedTrapVolumeInfo : VolumeInfo - { - /// - /// The speed the volume will slow you down to when you enter it. - /// - [DefaultValue(10f)] - public float speedLimit = 10f; - - /// - /// How fast it will slow down the player to the speed limit. - /// - [DefaultValue(3f)] - public float acceleration = 3f; - } - } - - [JsonConverter(typeof(StringEnumConverter))] - public enum ClipSelectionType - { - [EnumMember(Value = @"random")] RANDOM, - [EnumMember(Value = @"sequential")] SEQUENTIAL, - [EnumMember(Value = @"manual")] MANUAL - } - - [JsonConverter(typeof(StringEnumConverter))] - public enum AudioMixerTrackName - { - [EnumMember(Value = @"undefined")] Undefined = 0, - [EnumMember(Value = @"menu")] Menu = 1, - [EnumMember(Value = @"music")] Music = 2, - [EnumMember(Value = @"environment")] Environment = 4, - [EnumMember(Value = @"environmentUnfiltered")] Environment_Unfiltered = 5, - [EnumMember(Value = @"endTimesSfx")] EndTimes_SFX = 8, - [EnumMember(Value = @"signal")] Signal = 16, - [EnumMember(Value = @"death")] Death = 32, - [EnumMember(Value = @"player")] Player = 64, - [EnumMember(Value = @"playerExternal")] Player_External = 65, - [EnumMember(Value = @"ship")] Ship = 128, - [EnumMember(Value = @"map")] Map = 256, - [EnumMember(Value = @"endTimesMusic")] EndTimes_Music = 512, - [EnumMember(Value = @"muffleWhileRafting")] MuffleWhileRafting = 1024, - [EnumMember(Value = @"muffleIndoors")] MuffleIndoors = 2048, - [EnumMember(Value = @"slideReelMusic")] SlideReelMusic = 4096, } } diff --git a/NewHorizons/External/Props/BrambleNodeInfo.cs b/NewHorizons/External/Props/BrambleNodeInfo.cs new file mode 100644 index 00000000..18d9f298 --- /dev/null +++ b/NewHorizons/External/Props/BrambleNodeInfo.cs @@ -0,0 +1,73 @@ +using NewHorizons.Utility; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.External.Props +{ + + [JsonObject] + public class BrambleNodeInfo : GeneralPropInfo + { + /// + /// The physical scale of the node, as a multiplier of the original size. + /// Nodes are 150m across, seeds are 10m across. + /// + [DefaultValue(1f)] public float scale = 1f; + + /// + /// The name of the planet that hosts the dimension this node links to + /// + public string linksTo; + + /// + /// The name of this node. Only required if this node should serve as an exit. + /// + public string name; + + /// + /// Set this to true to make this node a seed instead of a node the player can enter + /// + [DefaultValue(false)] public bool isSeed = false; + + /// + /// The color of the fog inside the node. + /// Leave blank for the default yellowish white color: (255, 245, 217, 255) + /// + public MColor fogTint; + + /// + /// The color of the light from the node. Alpha controls brightness. + /// Leave blank for the default white color. + /// + public MColor lightTint; + + /// + /// Should this node have a point of light from afar? + /// By default, nodes will have a foglight, while seeds won't, and neither will if not in a dimension. + /// + public bool? hasFogLight; + + /// + /// An array of integers from 0-5. By default, all exits are allowed. To force this node to warp players out from only one hole set this value to [3], [5], or similar. Values of 0-5 only. + /// + public int[] possibleExits; + + /// + /// If your game hard crashes upon entering bramble, it's most likely because you have indirectly recursive dimensions, i.e. one leads to another that leads back to the first one. + /// Set this to true for one of the nodes in the recursion to fix this, at the cost of it no longer showing markers for the scout, ship, etc. + /// + [DefaultValue(false)] public bool preventRecursionCrash = false; + + #region Obsolete + + [Obsolete("farFogTint is deprecated, please use fogTint instead")] + public MColor farFogTint; + + #endregion Obsolete + } +} diff --git a/NewHorizons/External/Props/DetailInfo.cs b/NewHorizons/External/Props/DetailInfo.cs new file mode 100644 index 00000000..f68977b9 --- /dev/null +++ b/NewHorizons/External/Props/DetailInfo.cs @@ -0,0 +1,76 @@ + +using NewHorizons.Utility; +using System.ComponentModel; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class DetailInfo : GeneralPropInfo + { + + /// + /// Do we override rotation and try to automatically align this object to stand upright on the body's surface? + /// + public bool alignToNormal; + + /// + /// Relative filepath to an asset-bundle to load the prefab defined in `path` from + /// + public string assetBundle; + + /// + /// Either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle + /// + public string path; + + /// + /// A list of children to remove from this detail + /// + public string[] removeChildren; + + /// + /// Do we reset all the components on this object? Useful for certain props that have dialogue components attached to + /// them. + /// + public bool removeComponents; + + /// + /// Scale the prop + /// + [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 + /// + public string quantumGroupID; + + /// + /// Should this detail stay loaded even if you're outside the sector (good for very large props) + /// + public bool keepLoaded; + + /// + /// Should this object dynamically move around? + /// This tries to make all mesh colliders convex, as well as adding a sphere collider in case the detail has no others. + /// + public bool hasPhysics; + + /// + /// The mass of the physics object. + /// Most pushable props use the default value, which matches the player mass. + /// + [DefaultValue(0.001f)] public float physicsMass = 0.001f; + + /// + /// The radius that the added sphere collider will use for physics collision. + /// If there's already good colliders on the detail, you can make this 0. + /// + [DefaultValue(1f)] public float physicsRadius = 1f; + } +} diff --git a/NewHorizons/External/Props/DialogueInfo.cs b/NewHorizons/External/Props/DialogueInfo.cs new file mode 100644 index 00000000..e3e7dc1f --- /dev/null +++ b/NewHorizons/External/Props/DialogueInfo.cs @@ -0,0 +1,85 @@ + +using NewHorizons.Utility; +using System.ComponentModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class DialogueInfo : GeneralPointPropInfo + { + /// + /// Prevents the dialogue from being created after a specific persistent condition is set. Useful for remote dialogue + /// triggers that you want to have happen only once. + /// + public string blockAfterPersistentCondition; + + /// + /// If a pathToAnimController is supplied, if you are within this distance the character will look at you. If it is set + /// to 0, they will only look at you when spoken to. + /// + public float lookAtRadius; + + /// + /// If this dialogue is meant for a character, this is the relative path from the planet to that character's + /// CharacterAnimController, TravelerController, TravelerEyeController (eye of the universe), FacePlayerWhenTalking, or SolanumAnimController. + /// + /// If none of those components are present it will add a FacePlayerWhenTalking component. + /// + public string pathToAnimController; + + /// + /// Radius of the spherical collision volume where you get the "talk to" prompt when looking at. If you use a + /// remoteTrigger, you can set this to 0 to make the dialogue only trigger remotely. + /// + public float radius = 1f; + + /// + /// Distance from radius the prompt appears + /// + [DefaultValue(2f)] public float range = 2f; + + /// + /// Allows you to trigger dialogue from a distance when you walk into an area. + /// + public RemoteTriggerInfo remoteTrigger; + + [Obsolete("remoteTriggerPosition is deprecated. Use remoteTrigger.position instead")] public MVector3 remoteTriggerPosition; + [Obsolete("remoteTriggerRadius is deprecated. Use remoteTrigger.radius instead")] public float remoteTriggerRadius; + [Obsolete("remoteTriggerPrereqCondition is deprecated. Use remoteTrigger.prereqCondition instead")] public string remoteTriggerPrereqCondition; + + /// + /// Relative path to the xml file defining the dialogue. + /// + public string xmlFile; + + /// + /// What type of flashlight toggle to do when dialogue is interacted with + /// + [DefaultValue("none")] public FlashlightToggle flashlightToggle = FlashlightToggle.None; + + [JsonConverter(typeof(StringEnumConverter))] + public enum FlashlightToggle + { + [EnumMember(Value = @"none")] None = -1, + [EnumMember(Value = @"turnOff")] TurnOff = 0, + [EnumMember(Value = @"turnOffThenOn")] TurnOffThenOn = 1, + } + + [JsonObject] + public class RemoteTriggerInfo : GeneralPointPropInfo + { + /// + /// The radius of the remote trigger volume. + /// + public float radius; + /// + /// This condition must be met for the remote trigger volume to trigger. + /// + public string prereqCondition; + } + } +} diff --git a/NewHorizons/External/Props/EntryLocationInfo.cs b/NewHorizons/External/Props/EntryLocationInfo.cs new file mode 100644 index 00000000..f0791b74 --- /dev/null +++ b/NewHorizons/External/Props/EntryLocationInfo.cs @@ -0,0 +1,18 @@ +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class EntryLocationInfo : GeneralPointPropInfo + { + /// + /// Whether this location is cloaked + /// + public bool cloaked; + + /// + /// ID of the entry this location relates to + /// + public string id; + } +} diff --git a/NewHorizons/External/Props/GeneralPointPropInfo.cs b/NewHorizons/External/Props/GeneralPointPropInfo.cs new file mode 100644 index 00000000..ddb428e2 --- /dev/null +++ b/NewHorizons/External/Props/GeneralPointPropInfo.cs @@ -0,0 +1,29 @@ +using NewHorizons.Utility; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public abstract class GeneralPointPropInfo + { + /// + /// Position of the object + /// + public MVector3 position; + + /// + /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). + /// + public string parentPath; + + /// + /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. + /// + public bool isRelativeToParent; + + /// + /// An optional rename of this object + /// + public string rename; + } +} diff --git a/NewHorizons/External/Props/GeneralPropInfo.cs b/NewHorizons/External/Props/GeneralPropInfo.cs new file mode 100644 index 00000000..7f339711 --- /dev/null +++ b/NewHorizons/External/Props/GeneralPropInfo.cs @@ -0,0 +1,14 @@ +using NewHorizons.Utility; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public abstract class GeneralPropInfo : GeneralPointPropInfo + { + /// + /// Rotation of the object + /// + public MVector3 rotation; + } +} diff --git a/NewHorizons/External/Props/GeneralSolarSystemPropInfo.cs b/NewHorizons/External/Props/GeneralSolarSystemPropInfo.cs new file mode 100644 index 00000000..bd435611 --- /dev/null +++ b/NewHorizons/External/Props/GeneralSolarSystemPropInfo.cs @@ -0,0 +1,13 @@ +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public abstract class GeneralSolarSystemPropInfo : GeneralPropInfo + { + /// + /// The name of the planet that will be used with `parentPath`. Must be set if `parentPath` is set. + /// + public string parentBody; + } +} diff --git a/NewHorizons/External/Props/GeyserInfo.cs b/NewHorizons/External/Props/GeyserInfo.cs new file mode 100644 index 00000000..eb64d207 --- /dev/null +++ b/NewHorizons/External/Props/GeyserInfo.cs @@ -0,0 +1,46 @@ + +using NewHorizons.Utility; +using System.ComponentModel; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class GeyserInfo : GeneralPointPropInfo + { + /// + /// Vertical offset of the geyser. From 0, the bubbles start at a height of 10, the shaft at 67, and the spout at 97.5. + /// + [DefaultValue(-97.5f)] public float offset = -97.5f; + + /// + /// Force of the geyser on objects + /// + [DefaultValue(55f)] public float force = 55f; + + /// + /// Time in seconds eruptions last for + /// + [DefaultValue(10f)] public float activeDuration = 10f; + + /// + /// Time in seconds between eruptions + /// + [DefaultValue(19f)] public float inactiveDuration = 19f; + + /// + /// Color of the geyser. Alpha sets the particle density. + /// + public MColor tint; + + /// + /// Disable the individual particle systems of the geyser + /// + public bool disableBubbles, disableShaft, disableSpout; + + /// + /// Loudness of the geyser + /// + [DefaultValue(0.7f)] public float volume = 0.7f; + } +} diff --git a/NewHorizons/External/Props/NomaiTextArcInfo.cs b/NewHorizons/External/Props/NomaiTextArcInfo.cs new file mode 100644 index 00000000..b11a38df --- /dev/null +++ b/NewHorizons/External/Props/NomaiTextArcInfo.cs @@ -0,0 +1,54 @@ + +using NewHorizons.Utility; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class NomaiTextArcInfo + { + [JsonConverter(typeof(StringEnumConverter))] + public enum NomaiTextArcType + { + [EnumMember(Value = @"adult")] Adult = 0, + + [EnumMember(Value = @"child")] Child = 1, + + [EnumMember(Value = @"stranger")] Stranger = 2 + } + + /// + /// Whether to skip modifying this spiral's placement, and instead keep the automatically determined placement. + /// + public bool keepAutoPlacement; + + /// + /// Whether to flip the spiral from left-curling to right-curling or vice versa. + /// + public bool mirror; + + /// + /// The local position of this object on the wall. + /// + public MVector2 position; + + /// + /// The type of text to display. + /// + [DefaultValue("adult")] public NomaiTextArcType type = NomaiTextArcType.Adult; + + /// + /// Which variation of the chosen type to place. If not specified, a random variation will be selected based on the seed provided in the parent module. + /// + [DefaultValue(-1)] public int variation = -1; + + /// + /// The z euler angle for this arc. + /// + [Range(0f, 360f)] public float zRotation; + } +} diff --git a/NewHorizons/External/Props/NomaiTextInfo.cs b/NewHorizons/External/Props/NomaiTextInfo.cs new file mode 100644 index 00000000..9819edb3 --- /dev/null +++ b/NewHorizons/External/Props/NomaiTextInfo.cs @@ -0,0 +1,81 @@ + +using NewHorizons.Utility; +using System.ComponentModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class NomaiTextInfo : GeneralPointPropInfo + { + [JsonConverter(typeof(StringEnumConverter))] + public enum NomaiTextType + { + [EnumMember(Value = @"wall")] Wall = 0, + + [EnumMember(Value = @"scroll")] Scroll = 1, + + [EnumMember(Value = @"computer")] Computer = 2, + + [EnumMember(Value = @"cairn")] Cairn = 3, + + [EnumMember(Value = @"recorder")] Recorder = 4, + + [EnumMember(Value = @"preCrashRecorder")] PreCrashRecorder = 5, + + [EnumMember(Value = @"preCrashComputer")] PreCrashComputer = 6, + + [EnumMember(Value = @"trailmarker")] Trailmarker = 7, + + [EnumMember(Value = @"cairnVariant")] CairnVariant = 8, + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum NomaiTextLocation + { + [EnumMember(Value = @"unspecified")] UNSPECIFIED = 0, + + [EnumMember(Value = @"a")] A = 1, + + [EnumMember(Value = @"b")] B = 2 + } + + /// + /// Additional information about each arc in the text + /// + public NomaiTextArcInfo[] arcInfo; + + /// + /// The normal vector for this object. Used for writing on walls and positioning computers. + /// + public MVector3 normal; + + /// + /// The euler angle rotation of this object. Not required if setting the normal. Computers and cairns will orient + /// themselves to the surface of the planet automatically. + /// + public MVector3 rotation; + + /// + /// The random seed used to pick what the text arcs will look like. + /// + public int seed; // For randomizing arcs + + /// + /// The type of object this is. + /// + [DefaultValue("wall")] public NomaiTextType type = NomaiTextType.Wall; + + /// + /// The location of this object. + /// + [DefaultValue("unspecified")] public NomaiTextLocation location = NomaiTextLocation.UNSPECIFIED; + + /// + /// The relative path to the xml file for this object. + /// + public string xmlFile; + } +} diff --git a/NewHorizons/External/Props/ProjectionInfo.cs b/NewHorizons/External/Props/ProjectionInfo.cs new file mode 100644 index 00000000..c05950eb --- /dev/null +++ b/NewHorizons/External/Props/ProjectionInfo.cs @@ -0,0 +1,47 @@ +using System.ComponentModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class ProjectionInfo : GeneralPropInfo + { + [JsonConverter(typeof(StringEnumConverter))] + public enum SlideShowType + { + [EnumMember(Value = @"slideReel")] SlideReel = 0, + + [EnumMember(Value = @"autoProjector")] AutoProjector = 1, + + [EnumMember(Value = @"visionTorchTarget")] VisionTorchTarget = 2, + + [EnumMember(Value = @"standingVisionTorch")] StandingVisionTorch = 3, + + } + + /// + /// The ship log facts revealed after finishing this slide reel. + /// + public string[] reveals; + + /// + /// The ship log facts that make the reel play when they are displayed in the computer (by selecting entries or arrows). + /// You should probably include facts from `reveals` here. + /// If you only specify a rumor fact, then it would only play in its ship log entry if this has revealed only + /// rumor facts because an entry with revealed explore facts doesn't display rumor facts. + /// + public string[] playWithShipLogFacts; + + /// + /// The list of slides for this object. + /// + public SlideInfo[] slides; + + /// + /// The type of object this is. + /// + [DefaultValue("slideReel")] public SlideShowType type = SlideShowType.SlideReel; + } +} diff --git a/NewHorizons/External/Props/QuantumGroupInfo.cs b/NewHorizons/External/Props/QuantumGroupInfo.cs new file mode 100644 index 00000000..21e40449 --- /dev/null +++ b/NewHorizons/External/Props/QuantumGroupInfo.cs @@ -0,0 +1,51 @@ +using System.ComponentModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class QuantumGroupInfo + { + /// + /// What type of group this is: does it define a list of states a single quantum object could take or a list of sockets one or more quantum objects could share? + /// + public QuantumGroupType type; + + /// + /// A unique string used by props (that are marked as quantum) use to refer back to this group + /// + public string id; + + /// + /// Only required if type is `sockets`. This lists all the possible locations for any props assigned to this group. + /// + public QuantumSocketInfo[] sockets; + + /// + /// Optional. Only used if type is `states`. If this is true, then the first prop made part of this group will be used to construct a visibility box for an empty game object, which will be considered one of the states. + /// + public bool hasEmptyState; + + /// + /// Optional. Only used if type is `states`. If this is true, then the states will be presented in order, rather than in a random order + /// + public bool sequential; + + /// + /// Optional. Only used if type is `states` and `sequential` is true. If this is false, then after the last state has appeared, the object will no longer change state + /// + [DefaultValue(true)] public bool loop = true; + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum QuantumGroupType + { + [EnumMember(Value = @"sockets")] Sockets = 0, + + [EnumMember(Value = @"states")] States = 1, + + FailedValidation = 10 + } +} diff --git a/NewHorizons/External/Props/QuantumSocketInfo.cs b/NewHorizons/External/Props/QuantumSocketInfo.cs new file mode 100644 index 00000000..39e2431a --- /dev/null +++ b/NewHorizons/External/Props/QuantumSocketInfo.cs @@ -0,0 +1,14 @@ +using System.ComponentModel; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class QuantumSocketInfo : GeneralPropInfo + { + /// + /// The probability any props that are part of this group will occupy this socket + /// + [DefaultValue(1f)] public float probability = 1f; + } +} diff --git a/NewHorizons/External/Props/RaftInfo.cs b/NewHorizons/External/Props/RaftInfo.cs new file mode 100644 index 00000000..811de16f --- /dev/null +++ b/NewHorizons/External/Props/RaftInfo.cs @@ -0,0 +1,14 @@ +using System.ComponentModel; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class RaftInfo : GeneralPointPropInfo + { + /// + /// Acceleration of the raft. Default acceleration is 5. + /// + [DefaultValue(5f)] public float acceleration = 5f; + } +} diff --git a/NewHorizons/External/Props/RemoteInfo.cs b/NewHorizons/External/Props/RemoteInfo.cs new file mode 100644 index 00000000..941087b4 --- /dev/null +++ b/NewHorizons/External/Props/RemoteInfo.cs @@ -0,0 +1,107 @@ +using System.ComponentModel; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class RemoteInfo + { + /// + /// The unique remote id + /// + public string id; + + /// + /// Icon that the will show on the stone, pedastal of the whiteboard, and pedastal of the platform. + /// + public string decalPath; + + /// + /// Whiteboard that the stones can put text onto + /// + public WhiteboardInfo whiteboard; + + /// + /// Camera platform that the stones can project to and from + /// + public PlatformInfo platform; + + /// + /// Projection stones + /// + public StoneInfo[] stones; + + [JsonObject] + public class WhiteboardInfo : GeneralPropInfo + { + /// + /// The text for each stone + /// + public SharedNomaiTextInfo[] nomaiText; + + /// + /// Disable the wall, leaving only the pedestal and text. + /// + public bool disableWall; + + [JsonObject] + public class SharedNomaiTextInfo + { + /// + /// The id of the stone this text will appear for + /// + public string id; + + /// + /// Additional information about each arc in the text + /// + public NomaiTextArcInfo[] arcInfo; + + /// + /// The random seed used to pick what the text arcs will look like. + /// + public int seed; // For randomizing arcs + + /// + /// The location of this object. + /// + [DefaultValue("unspecified")] public NomaiTextInfo.NomaiTextLocation location = NomaiTextInfo.NomaiTextLocation.UNSPECIFIED; + + /// + /// The relative path to the xml file for this object. + /// + public string xmlFile; + + /// + /// An optional rename of this object + /// + public string rename; + } + } + + [JsonObject] + public class PlatformInfo : GeneralPropInfo + { + /// + /// A ship log fact to reveal when the platform is connected to. + /// + [DefaultValue("")] public string reveals = ""; + + /// + /// Disable the structure, leaving only the pedestal. + /// + public bool disableStructure; + + /// + /// Disable the pool that rises when you place a stone. + /// + public bool disablePool; + } + + [JsonObject] + public class StoneInfo : GeneralPropInfo + { + + } + } +} diff --git a/NewHorizons/External/Props/ScatterInfo.cs b/NewHorizons/External/Props/ScatterInfo.cs new file mode 100644 index 00000000..5e48db01 --- /dev/null +++ b/NewHorizons/External/Props/ScatterInfo.cs @@ -0,0 +1,71 @@ + +using NewHorizons.Utility; +using System.ComponentModel; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class ScatterInfo + { + /// + /// Relative filepath to an asset-bundle + /// + public string assetBundle; + + /// + /// Number of props to scatter + /// + public int count; + + /// + /// Offset this prop once it is placed + /// + public MVector3 offset; + + /// + /// Either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle + /// + public string path; + + /// + /// Rotate this prop once it is placed + /// + public MVector3 rotation; + + /// + /// Scale this prop once it is placed + /// + [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 + /// + public int seed; + + /// + /// The lowest height that these object will be placed at (only relevant if there's a heightmap) + /// + public float? minHeight; + + /// + /// The highest height that these objects will be placed at (only relevant if there's a heightmap) + /// + public float? maxHeight; + + /// + /// Should we try to prevent overlap between the scattered details? True by default. If it's affecting load times turn it off. + /// + [DefaultValue(true)] public bool preventOverlap = true; + + /// + /// Should this detail stay loaded even if you're outside the sector (good for very large props) + /// + public bool keepLoaded; + } +} diff --git a/NewHorizons/External/Props/SignalInfo.cs b/NewHorizons/External/Props/SignalInfo.cs new file mode 100644 index 00000000..a9803029 --- /dev/null +++ b/NewHorizons/External/Props/SignalInfo.cs @@ -0,0 +1,71 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.External.Props +{ + + [JsonObject] + public class SignalInfo : GeneralPointPropInfo + { + [Obsolete("audioClip is deprecated, please use audio instead")] + public string audioClip; + + [Obsolete("audioFilePath is deprecated, please use audio instead")] + public string audioFilePath; + + /// + /// The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. + /// + public string audio; + + /// + /// How close the player must get to the signal to detect it. This is when you get the "Unknown Signal Detected" + /// notification. + /// + [Range(0f, double.MaxValue)] public float detectionRadius; + + /// + /// The frequency ID of the signal. The built-in game values are `Default`, `Traveler`, `Quantum`, `EscapePod`, + /// `Statue`, `WarpCore`, `HideAndSeek`, and `Radio`. You can also put a custom value. + /// + public string frequency; + + /// + /// How close the player must get to the signal to identify it. This is when you learn its name. + /// + [DefaultValue(10f)] + [Range(0f, double.MaxValue)] + public float identificationRadius = 10f; + + /// + /// Only set to `true` if you are putting this signal inside a cloaking field. + /// + public bool insideCloak; + + /// + /// The unique ID of the signal. + /// + public string name; + + /// + /// `false` if the player can hear the signal without equipping the signal-scope. + /// + [DefaultValue(true)] public bool onlyAudibleToScope = true; + + /// + /// A ship log fact to reveal when the signal is identified. + /// + [DefaultValue("")] public string reveals = ""; + + /// + /// Radius of the sphere giving off the signal. + /// + [DefaultValue(1f)] public float sourceRadius = 1f; + } +} diff --git a/NewHorizons/External/Modules/VariableSize/SingularityModule.cs b/NewHorizons/External/Props/SingularityInfo.cs similarity index 92% rename from NewHorizons/External/Modules/VariableSize/SingularityModule.cs rename to NewHorizons/External/Props/SingularityInfo.cs index 58b35b9a..6b617588 100644 --- a/NewHorizons/External/Modules/VariableSize/SingularityModule.cs +++ b/NewHorizons/External/Props/SingularityInfo.cs @@ -6,10 +6,10 @@ using NewHorizons.Utility; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace NewHorizons.External.Modules.VariableSize +namespace NewHorizons.External.Props { [JsonObject] - public class SingularityModule : PropModule.GeneralPropInfo + public class SingularityInfo : GeneralPropInfo { [JsonConverter(typeof(StringEnumConverter))] public enum SingularityType @@ -39,7 +39,7 @@ namespace NewHorizons.External.Modules.VariableSize /// Radius of the singularity. Note that this isn't the same as the event horizon, but includes the entire volume that /// has warped effects in it. /// - [Obsolete("size is deprecated, please use horizonRadius and distortRadius instead")] [Range(0f, double.MaxValue)] public float size; + [Obsolete("size is deprecated, please use horizonRadius and distortRadius instead")][Range(0f, double.MaxValue)] public float size; /// /// Radius of the event horizon (solid part) diff --git a/NewHorizons/External/Props/SlideInfo.cs b/NewHorizons/External/Props/SlideInfo.cs new file mode 100644 index 00000000..10c6fceb --- /dev/null +++ b/NewHorizons/External/Props/SlideInfo.cs @@ -0,0 +1,85 @@ +using NewHorizons.Utility; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class SlideInfo + { + /// + /// Ambient light colour when viewing this slide. + /// + public MColor ambientLightColor; + + + // SlideAmbientLightModule + + /// + /// Ambient light intensity when viewing this slide. + /// + public float ambientLightIntensity; + + /// + /// Ambient light range when viewing this slide. + /// + public float ambientLightRange; + + // SlideBackdropAudioModule + + /// + /// The name of the AudioClip that will continuously play while watching these slides + /// + public string backdropAudio; + + /// + /// The time to fade into the backdrop audio + /// + public float backdropFadeTime; + + // SlideBeatAudioModule + + /// + /// The name of the AudioClip for a one-shot sound when opening the slide. + /// + public string beatAudio; + + /// + /// The time delay until the one-shot audio + /// + public float beatDelay; + + + // SlideBlackFrameModule + + /// + /// Before viewing this slide, there will be a black frame for this many seconds. + /// + public float blackFrameDuration; + + /// + /// The path to the image file for this slide. + /// + public string imagePath; + + + // SlidePlayTimeModule + + /// + /// Play-time duration for auto-projector slides. + /// + public float playTimeDuration; + + + // SlideShipLogEntryModule + + /// + /// Ship log fact revealed when viewing this slide + /// + public string reveal; + + /// + /// Spotlight intensity modifier when viewing this slide. + /// + public float spotIntensityMod; + } +} diff --git a/NewHorizons/External/Props/TornadoInfo.cs b/NewHorizons/External/Props/TornadoInfo.cs new file mode 100644 index 00000000..dbf8affa --- /dev/null +++ b/NewHorizons/External/Props/TornadoInfo.cs @@ -0,0 +1,73 @@ + +using NewHorizons.Utility; +using System.ComponentModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; +using NewHorizons.External.Modules; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class TornadoInfo : GeneralPointPropInfo + { + [JsonConverter(typeof(StringEnumConverter))] + public enum TornadoType + { + [EnumMember(Value = @"upwards")] Upwards = 0, + + [EnumMember(Value = @"downwards")] Downwards = 1, + + [EnumMember(Value = @"hurricane")] Hurricane = 2 + } + + [Obsolete("Downwards is deprecated. Use Type instead.")] public bool downwards; + + /// + /// Alternative to setting the position. Will choose a random place at this elevation. + /// + public float elevation; + + /// + /// The height of this tornado. + /// + [DefaultValue(30f)] public float height = 30f; + + /// + /// The colour of the tornado. + /// + public MColor tint; + + /// + /// What type of cyclone should this be? Upwards and downwards are both tornados and will push in that direction. + /// + [DefaultValue("upwards")] public TornadoType type = TornadoType.Upwards; + + /// + /// Angular distance from the starting position that it will wander, in terms of the angle around the x-axis. + /// + [DefaultValue(45f)] public float wanderDegreesX = 45f; + + /// + /// Angular distance from the starting position that it will wander, in terms of the angle around the z-axis. + /// + [DefaultValue(45f)] public float wanderDegreesZ = 45f; + + /// + /// The rate at which the tornado will wander around the planet. Set to 0 for it to be stationary. Should be around + /// 0.1. + /// + public float wanderRate; + + /// + /// The maximum distance at which you'll hear the sounds of the cyclone. If not set it will scale relative to the size of the cyclone. + /// + public float audioDistance; + + /// + /// Fluid type for sounds/effects when colliding with this tornado. + /// + [DefaultValue("cloud")] public FluidType fluidType = FluidType.Cloud; + } +} diff --git a/NewHorizons/External/Props/VolcanoInfo.cs b/NewHorizons/External/Props/VolcanoInfo.cs new file mode 100644 index 00000000..9c891aa6 --- /dev/null +++ b/NewHorizons/External/Props/VolcanoInfo.cs @@ -0,0 +1,50 @@ + +using NewHorizons.Utility; +using System.ComponentModel; +using Newtonsoft.Json; + +namespace NewHorizons.External.Props +{ + [JsonObject] + public class VolcanoInfo : GeneralPointPropInfo + { + /// + /// The colour of the meteor's lava. + /// + public MColor lavaTint; + + /// + /// Maximum time between meteor launches. + /// + [DefaultValue(20f)] + public float maxInterval = 20f; + + /// + /// Maximum random speed at which meteors are launched. + /// + [DefaultValue(150f)] + public float maxLaunchSpeed = 150f; + + /// + /// Minimum time between meteor launches. + /// + [DefaultValue(5f)] + public float minInterval = 5f; + + /// + /// Minimum random speed at which meteors are launched. + /// + [DefaultValue(50f)] + public float minLaunchSpeed = 50f; + + /// + /// Scale of the meteors. + /// + public float scale = 1; + + /// + /// The colour of the meteor's stone. + /// + public MColor stoneTint; + } +} diff --git a/NewHorizons/External/Volumes/AudioVolumeInfo.cs b/NewHorizons/External/Volumes/AudioVolumeInfo.cs new file mode 100644 index 00000000..e5a90b88 --- /dev/null +++ b/NewHorizons/External/Volumes/AudioVolumeInfo.cs @@ -0,0 +1,88 @@ +using NewHorizons.External.Modules; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class AudioVolumeInfo : PriorityVolumeInfo + { + /// + /// The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. + /// + public string audio; + + [DefaultValue("random")] public ClipSelectionType clipSelection = ClipSelectionType.RANDOM; + + /// + /// The audio track of this audio volume + /// + [DefaultValue("environment")] public AudioMixerTrackName track = AudioMixerTrackName.Environment; + + /// + /// 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; + + /// + /// How long it will take to fade this sound in and out when entering/exiting this volume. + /// + [DefaultValue(2f)] + public float fadeSeconds = 2f; + + /// + /// Play the sound instantly without any fading. + /// + public bool noFadeFromBeginning; + + /// + /// Randomize what time the audio starts at. + /// + public bool randomizePlayhead; + + /// + /// Pause the music when exiting the volume. + /// + public bool pauseOnFadeOut; + + + [JsonConverter(typeof(StringEnumConverter))] + public enum ClipSelectionType + { + [EnumMember(Value = @"random")] RANDOM, + [EnumMember(Value = @"sequential")] SEQUENTIAL, + [EnumMember(Value = @"manual")] MANUAL + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum AudioMixerTrackName + { + [EnumMember(Value = @"undefined")] Undefined = 0, + [EnumMember(Value = @"menu")] Menu = 1, + [EnumMember(Value = @"music")] Music = 2, + [EnumMember(Value = @"environment")] Environment = 4, + [EnumMember(Value = @"environmentUnfiltered")] Environment_Unfiltered = 5, + [EnumMember(Value = @"endTimesSfx")] EndTimes_SFX = 8, + [EnumMember(Value = @"signal")] Signal = 16, + [EnumMember(Value = @"death")] Death = 32, + [EnumMember(Value = @"player")] Player = 64, + [EnumMember(Value = @"playerExternal")] Player_External = 65, + [EnumMember(Value = @"ship")] Ship = 128, + [EnumMember(Value = @"map")] Map = 256, + [EnumMember(Value = @"endTimesMusic")] EndTimes_Music = 512, + [EnumMember(Value = @"muffleWhileRafting")] MuffleWhileRafting = 1024, + [EnumMember(Value = @"muffleIndoors")] MuffleIndoors = 2048, + [EnumMember(Value = @"slideReelMusic")] SlideReelMusic = 4096, + } + } +} diff --git a/NewHorizons/External/Volumes/ChangeStarSystemVolumeInfo.cs b/NewHorizons/External/Volumes/ChangeStarSystemVolumeInfo.cs new file mode 100644 index 00000000..a6840540 --- /dev/null +++ b/NewHorizons/External/Volumes/ChangeStarSystemVolumeInfo.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; +using System.ComponentModel; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class ChangeStarSystemVolumeInfo : VolumeInfo + { + /// + /// The star system that entering this volume will send you to. + /// + [DefaultValue("SolarSystem")] + public string targetStarSystem; + } +} + diff --git a/NewHorizons/External/Volumes/DestructionVolumeInfo.cs b/NewHorizons/External/Volumes/DestructionVolumeInfo.cs new file mode 100644 index 00000000..27359f0f --- /dev/null +++ b/NewHorizons/External/Volumes/DestructionVolumeInfo.cs @@ -0,0 +1,37 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel; +using System.Runtime.Serialization; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class DestructionVolumeInfo : VanishVolumeInfo + { + /// + /// The type of death the player will have if they enter this volume. + /// + [DefaultValue("default")] public DeathType deathType = DeathType.Default; + + [JsonConverter(typeof(StringEnumConverter))] + public enum DeathType + { + [EnumMember(Value = @"default")] Default, + [EnumMember(Value = @"impact")] Impact, + [EnumMember(Value = @"asphyxiation")] Asphyxiation, + [EnumMember(Value = @"energy")] Energy, + [EnumMember(Value = @"supernova")] Supernova, + [EnumMember(Value = @"digestion")] Digestion, + [EnumMember(Value = @"bigBang")] BigBang, + [EnumMember(Value = @"crushed")] Crushed, + [EnumMember(Value = @"meditation")] Meditation, + [EnumMember(Value = @"timeLoop")] TimeLoop, + [EnumMember(Value = @"lava")] Lava, + [EnumMember(Value = @"blackHole")] BlackHole, + [EnumMember(Value = @"dream")] Dream, + [EnumMember(Value = @"dreamExplosion")] DreamExplosion, + [EnumMember(Value = @"crushedByElevator")] CrushedByElevator + } + } +} + diff --git a/NewHorizons/External/Volumes/FluidVolumeInfo.cs b/NewHorizons/External/Volumes/FluidVolumeInfo.cs new file mode 100644 index 00000000..fe931541 --- /dev/null +++ b/NewHorizons/External/Volumes/FluidVolumeInfo.cs @@ -0,0 +1,49 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel; +using System.Runtime.Serialization; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class FluidVolumeInfo : PriorityVolumeInfo + { + /// + /// Density of the fluid. The higher the density, the harder it is to go through this fluid. + /// + [DefaultValue(1.2f)] public float density = 1.2f; + + /// + /// The type of fluid for this volume. + /// + public FluidType type; + + /// + /// Should the player and rafts align to this fluid. + /// + [DefaultValue(true)] public bool alignmentFluid = true; + + /// + /// Should the ship align to the fluid by rolling. + /// + public bool allowShipAutoroll; + + /// + /// Disable this fluid volume immediately? + /// + public bool disableOnStart; + + [JsonConverter(typeof(StringEnumConverter))] + public enum FluidType + { + [EnumMember(Value = @"none")] NONE = 0, + [EnumMember(Value = @"air")] AIR, + [EnumMember(Value = @"water")] WATER, + [EnumMember(Value = @"cloud")] CLOUD, + [EnumMember(Value = @"sand")] SAND, + [EnumMember(Value = @"plasma")] PLASMA, + [EnumMember(Value = @"fog")] FOG + } + } +} + diff --git a/NewHorizons/External/Volumes/HazardVolumeInfo.cs b/NewHorizons/External/Volumes/HazardVolumeInfo.cs new file mode 100644 index 00000000..8d81a50a --- /dev/null +++ b/NewHorizons/External/Volumes/HazardVolumeInfo.cs @@ -0,0 +1,54 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel; +using System.Runtime.Serialization; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class HazardVolumeInfo : VolumeInfo + { + /// + /// The type of hazard for this volume. + /// + [DefaultValue("general")] public HazardType type = HazardType.GENERAL; + + /// + /// The amount of damage you will take per second while inside this volume. + /// + [DefaultValue(10f)] public float damagePerSecond = 10f; + + /// + /// The type of damage you will take when you first touch this volume. + /// + [DefaultValue("impact")] public InstantDamageType firstContactDamageType = InstantDamageType.Impact; + + /// + /// The amount of damage you will take when you first touch this volume. + /// + public float firstContactDamage; + + [JsonConverter(typeof(StringEnumConverter))] + public enum HazardType + { + [EnumMember(Value = @"none")] NONE = 0, + [EnumMember(Value = @"general")] GENERAL = 1, + [EnumMember(Value = @"ghostMatter")] DARKMATTER = 2, + [EnumMember(Value = @"heat")] HEAT = 4, + [EnumMember(Value = @"fire")] FIRE = 8, + [EnumMember(Value = @"sandfall")] SANDFALL = 16, + [EnumMember(Value = @"electricity")] ELECTRICITY = 32, + [EnumMember(Value = @"rapids")] RAPIDS = 64, + [EnumMember(Value = @"riverHeat")] RIVERHEAT = 128, + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum InstantDamageType + { + [EnumMember(Value = @"impact")] Impact, + [EnumMember(Value = @"puncture")] Puncture, + [EnumMember(Value = @"electrical")] Electrical + } + } +} + diff --git a/NewHorizons/External/Volumes/LoadCreditsVolumeInfo.cs b/NewHorizons/External/Volumes/LoadCreditsVolumeInfo.cs new file mode 100644 index 00000000..b69c9f2d --- /dev/null +++ b/NewHorizons/External/Volumes/LoadCreditsVolumeInfo.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel; +using System.Runtime.Serialization; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class LoadCreditsVolumeInfo : VolumeInfo + { + [JsonConverter(typeof(StringEnumConverter))] + public enum CreditsType + { + [EnumMember(Value = @"fast")] Fast = 0, + + [EnumMember(Value = @"final")] Final = 1, + + [EnumMember(Value = @"kazoo")] Kazoo = 2 + } + + [DefaultValue("fast")] + public CreditsType creditsType = CreditsType.Fast; + } +} + diff --git a/NewHorizons/External/Volumes/NotificationVolumeInfo.cs b/NewHorizons/External/Volumes/NotificationVolumeInfo.cs new file mode 100644 index 00000000..ac6439b7 --- /dev/null +++ b/NewHorizons/External/Volumes/NotificationVolumeInfo.cs @@ -0,0 +1,50 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel; +using System.Runtime.Serialization; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class NotificationVolumeInfo : VolumeInfo + { + /// + /// What the notification will show for. + /// + [DefaultValue("all")] public NotificationTarget target = NotificationTarget.All; + + /// + /// The notification that will play when you enter this volume. + /// + public NotificationInfo entryNotification; + + /// + /// The notification that will play when you exit this volume. + /// + public NotificationInfo exitNotification; + + + [JsonObject] + public class NotificationInfo + { + /// + /// The message that will be displayed. + /// + public string displayMessage; + + /// + /// The duration this notification will be displayed. + /// + [DefaultValue(5f)] public float duration = 5f; + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum NotificationTarget + { + [EnumMember(Value = @"all")] All = 0, + [EnumMember(Value = @"ship")] Ship = 1, + [EnumMember(Value = @"player")] Player = 2, + } + } +} + diff --git a/NewHorizons/External/Volumes/OxygenVolumeInfo.cs b/NewHorizons/External/Volumes/OxygenVolumeInfo.cs new file mode 100644 index 00000000..abb08782 --- /dev/null +++ b/NewHorizons/External/Volumes/OxygenVolumeInfo.cs @@ -0,0 +1,20 @@ +using Newtonsoft.Json; +using System.ComponentModel; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class OxygenVolumeInfo : VolumeInfo + { + /// + /// Does this volume contain trees? This will change the notification from "Oxygen tank refilled" to "Trees detected, oxygen tank refilled". + /// + public bool treeVolume; + + /// + /// Whether to play the oxygen tank refill sound or just fill quietly. + /// + [DefaultValue(true)] public bool playRefillAudio = true; + } +} + diff --git a/NewHorizons/External/Volumes/PriorityVolumeInfo.cs b/NewHorizons/External/Volumes/PriorityVolumeInfo.cs new file mode 100644 index 00000000..b514e817 --- /dev/null +++ b/NewHorizons/External/Volumes/PriorityVolumeInfo.cs @@ -0,0 +1,23 @@ +using Newtonsoft.Json; +using System.ComponentModel; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class PriorityVolumeInfo : VolumeInfo + { + /// + /// The layer of this volume. + /// + [DefaultValue(0)] + public int layer = 0; + + /// + /// The priority for this volume's effects to be applied. + /// Ex, a player in a gravity volume with priority 0, and zero-gravity volume with priority 1, will feel zero gravity. + /// + [DefaultValue(1)] + public int priority = 1; + } +} + diff --git a/NewHorizons/External/Volumes/RevealVolumeInfo.cs b/NewHorizons/External/Volumes/RevealVolumeInfo.cs new file mode 100644 index 00000000..f74be55f --- /dev/null +++ b/NewHorizons/External/Volumes/RevealVolumeInfo.cs @@ -0,0 +1,64 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel; +using System.Runtime.Serialization; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class RevealVolumeInfo : VolumeInfo + { + [JsonConverter(typeof(StringEnumConverter))] + public enum RevealVolumeType + { + [EnumMember(Value = @"enter")] Enter = 0, + + [EnumMember(Value = @"observe")] Observe = 1, + + [EnumMember(Value = @"snapshot")] Snapshot = 2 + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum EnterType + { + [EnumMember(Value = @"both")] Both = 0, + + [EnumMember(Value = @"player")] Player = 1, + + [EnumMember(Value = @"probe")] Probe = 2 + } + + /// + /// The max view angle (in degrees) the player can see the volume with to unlock the fact (`observe` only) + /// + [DefaultValue(180f)] + public float maxAngle = 180f; // Observe Only + + /// + /// The max distance the user can be away from the volume to reveal the fact (`snapshot` and `observe` only) + /// + [DefaultValue(-1f)] + public float maxDistance = -1f; // Snapshot & Observe Only + + /// + /// What needs to be done to the volume to unlock the facts + /// + [DefaultValue("enter")] public RevealVolumeType revealOn = RevealVolumeType.Enter; + + /// + /// What can enter the volume to unlock the facts (`enter` only) + /// + [DefaultValue("both")] public EnterType revealFor = EnterType.Both; + + /// + /// A list of facts to reveal + /// + public string[] reveals; + + /// + /// An achievement to unlock. Optional. + /// + public string achievementID; + } +} + diff --git a/NewHorizons/External/Volumes/SpeedTrapVolumeInfo.cs b/NewHorizons/External/Volumes/SpeedTrapVolumeInfo.cs new file mode 100644 index 00000000..3e641637 --- /dev/null +++ b/NewHorizons/External/Volumes/SpeedTrapVolumeInfo.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; +using System.ComponentModel; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class SpeedTrapVolumeInfo : VolumeInfo + { + /// + /// The speed the volume will slow you down to when you enter it. + /// + [DefaultValue(10f)] + public float speedLimit = 10f; + + /// + /// How fast it will slow down the player to the speed limit. + /// + [DefaultValue(3f)] + public float acceleration = 3f; + } +} + diff --git a/NewHorizons/External/Volumes/VanishVolumeInfo.cs b/NewHorizons/External/Volumes/VanishVolumeInfo.cs new file mode 100644 index 00000000..6b592ce8 --- /dev/null +++ b/NewHorizons/External/Volumes/VanishVolumeInfo.cs @@ -0,0 +1,20 @@ +using Newtonsoft.Json; +using System.ComponentModel; + +namespace NewHorizons.External.Volumes +{ + [JsonObject] + public class VanishVolumeInfo : VolumeInfo + { + /// + /// Whether the bodies will shrink when they enter this volume or just disappear instantly. + /// + [DefaultValue(true)] public bool shrinkBodies = true; + + /// + /// Whether this volume only affects the player and ship. + /// + public bool onlyAffectsPlayerAndShip; + } +} + diff --git a/NewHorizons/External/Volumes/VolumeInfo.cs b/NewHorizons/External/Volumes/VolumeInfo.cs new file mode 100644 index 00000000..645bf267 --- /dev/null +++ b/NewHorizons/External/Volumes/VolumeInfo.cs @@ -0,0 +1,121 @@ +using NewHorizons.External.Props; +using Newtonsoft.Json; +using System.ComponentModel; + +namespace NewHorizons.External.Volumes +{ + /*[JsonObject] + public class VolumesModule + { + /// + /// Add audio volumes to this planet. + /// + public AudioVolumeInfo[] audioVolumes; + + /// + /// Add destruction volumes to this planet. + /// + public DestructionVolumeInfo[] destructionVolumes; + + /// + /// Add fluid volumes to this planet. + /// + public FluidVolumeInfo[] fluidVolumes; + + /// + /// Add hazard volumes to this planet. + /// + public HazardVolumeInfo[] hazardVolumes; + + /// + /// Add interference volumes to this planet. + /// + public VolumeInfo[] interferenceVolumes; + + /// + /// Add insulating volumes to this planet. These will stop electricty hazard volumes from affecting you (just like the jellyfish). + /// + public VolumeInfo[] insulatingVolumes; + + /// + /// Add light source volumes to this planet. These will activate rafts and other light detectors. + /// + public VolumeInfo[] lightSourceVolumes; + + /// + /// Add map restriction volumes to this planet. + /// + public VolumeInfo[] mapRestrictionVolumes; + + /// + /// Add notification volumes to this planet. + /// + public NotificationVolumeInfo[] notificationVolumes; + + /// + /// Add oxygen volumes to this planet. + /// + public OxygenVolumeInfo[] oxygenVolumes; + + /// + /// Add probe-specific volumes to this planet. + /// + public ProbeModule probe; + + /// + /// Add reference frame blocker volumes to this planet. These will stop the player from seeing/targeting any reference frames. + /// + public VolumeInfo[] referenceFrameBlockerVolumes; + + /// + /// Add triggers that reveal parts of the ship log on this planet. + /// + public RevealVolumeInfo[] revealVolumes; + + /// + /// Add reverb volumes to this planet. Great for echoes in caves. + /// + public VolumeInfo[] reverbVolumes; + + /// + /// Add ruleset volumes to this planet. + /// + public RulesetModule rulesets; + + /// + /// Add speed trap volumes to this planet. Slows down the player when they enter this volume. + /// + public SpeedTrapVolumeInfo[] speedTrapVolumes; + + /// + /// Add visor effect volumes to this planet. + /// + public VisorEffectModule visorEffects; + + /// + /// Add zero-gravity volumes to this planet. + /// Good for surrounding planets which are using a static position to stop the player being pulled away. + /// + public PriorityVolumeInfo[] zeroGravityVolumes; + + /// + /// Entering this volume will load a new solar system. + /// + public ChangeStarSystemVolumeInfo[] solarSystemVolume; + + /// + /// Enter this volume to be sent to the end credits scene + /// + public LoadCreditsVolumeInfo[] creditsVolume;*/ + + [JsonObject] + public class VolumeInfo : GeneralPointPropInfo + { + /// + /// The radius of this volume. + /// + [DefaultValue(1f)] + public float radius = 1f; + } +} + diff --git a/NewHorizons/NewHorizonsApi.cs b/NewHorizons/NewHorizonsApi.cs index ce358343..b276bf68 100644 --- a/NewHorizons/NewHorizonsApi.cs +++ b/NewHorizons/NewHorizonsApi.cs @@ -12,6 +12,7 @@ using Newtonsoft.Json.Linq; using UnityEngine; using UnityEngine.Events; using Logger = NewHorizons.Utility.Logger; +using NewHorizons.External.Props; namespace NewHorizons { @@ -158,7 +159,7 @@ namespace NewHorizons float scale, bool alignWithNormal) { var prefab = SearchUtilities.Find(propToCopyPath); - var detailInfo = new PropModule.DetailInfo() { + var detailInfo = new DetailInfo() { position = position, rotation = eulerAngles, scale = scale, @@ -171,7 +172,7 @@ namespace NewHorizons float sourceRadius = 1f, float detectionRadius = 20f, float identificationRadius = 10f, bool insideCloak = false, bool onlyAudibleToScope = true, string reveals = "") { - var info = new SignalModule.SignalInfo() + var info = new SignalInfo() { audio = audio, detectionRadius = detectionRadius, @@ -192,7 +193,7 @@ namespace NewHorizons float range = 1f, string blockAfterPersistentCondition = null, float lookAtRadius = 1f, string pathToAnimController = null, float remoteTriggerRadius = 0f) { - var info = new PropModule.DialogueInfo() + var info = new DialogueInfo() { blockAfterPersistentCondition = blockAfterPersistentCondition, lookAtRadius = lookAtRadius, @@ -201,7 +202,7 @@ namespace NewHorizons radius = radius, range = range, xmlFile = xmlFile, - remoteTrigger = new PropModule.DialogueInfo.RemoteTriggerInfo() + remoteTrigger = new DialogueInfo.RemoteTriggerInfo() { position = null, radius = remoteTriggerRadius, diff --git a/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs b/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs index 04554fd1..affb71d7 100644 --- a/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs +++ b/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs @@ -1,6 +1,7 @@ using NewHorizons.Builder.Props; using NewHorizons.External.Configs; using NewHorizons.External.Modules; +using NewHorizons.External.Props; using NewHorizons.Handlers; using System.Collections.Generic; using System.Linq; @@ -22,7 +23,7 @@ namespace NewHorizons.Utility.DebugUtilities public AstroObject body; public string system; public GameObject gameObject; - public PropModule.DetailInfo detailInfo; + public DetailInfo detailInfo; } // VASE @@ -149,7 +150,7 @@ namespace NewHorizons.Utility.DebugUtilities var sector = planetGO.GetComponentInChildren(); var prefab = SearchUtilities.Find(currentObject); - var detailInfo = new PropModule.DetailInfo() + var detailInfo = new DetailInfo() { position = data.pos, rotation = data.rot.eulerAngles, @@ -214,7 +215,7 @@ namespace NewHorizons.Utility.DebugUtilities RegisterProp_WithReturn(body, prop); } - private PropPlacementData RegisterProp_WithReturn(AstroObject body, GameObject prop, string propPath = null, PropModule.DetailInfo detailInfo = null) + private PropPlacementData RegisterProp_WithReturn(AstroObject body, GameObject prop, string propPath = null, DetailInfo detailInfo = null) { if (Main.Debug) { @@ -226,7 +227,7 @@ namespace NewHorizons.Utility.DebugUtilities Logger.LogVerbose($"Adding prop to {Main.Instance.CurrentStarSystem}::{body.name}"); - detailInfo = detailInfo == null ? new PropModule.DetailInfo() : detailInfo; + detailInfo = detailInfo == null ? new DetailInfo() : detailInfo; detailInfo.path = propPath == null ? currentObject : propPath; PropPlacementData data = new PropPlacementData @@ -241,14 +242,14 @@ namespace NewHorizons.Utility.DebugUtilities return data; } - public Dictionary GetPropsConfigByBody() + public Dictionary GetPropsConfigByBody() { var groupedProps = props .GroupBy(p => p.system + "." + p.body) .Select(grp => grp.ToList()) .ToList(); - Dictionary propConfigs = new Dictionary(); + Dictionary propConfigs = new Dictionary(); foreach (List bodyProps in groupedProps) { @@ -258,7 +259,7 @@ namespace NewHorizons.Utility.DebugUtilities Logger.LogVerbose("getting prop group for body " + body.name); //string bodyName = GetAstroObjectName(bodyProps[0].body); - PropModule.DetailInfo[] infoArray = new PropModule.DetailInfo[bodyProps.Count]; + DetailInfo[] infoArray = new DetailInfo[bodyProps.Count]; propConfigs[body] = infoArray; for (int i = 0; i < bodyProps.Count; i++)