diff --git a/NewHorizons/Builder/Props/EchoesOfTheEye/ProjectionTotemBuilder.cs b/NewHorizons/Builder/Props/EchoesOfTheEye/ProjectionTotemBuilder.cs index fdd18663..69155147 100644 --- a/NewHorizons/Builder/Props/EchoesOfTheEye/ProjectionTotemBuilder.cs +++ b/NewHorizons/Builder/Props/EchoesOfTheEye/ProjectionTotemBuilder.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; +using UnityEngine.InputSystem; namespace NewHorizons.Builder.Props.EchoesOfTheEye { @@ -100,14 +101,27 @@ namespace NewHorizons.Builder.Props.EchoesOfTheEye { projectionObj.gameObject.AddComponent(); var projection = projectionObj.gameObject.AddComponent(); - projection._setActive = true; + projection._setActive = info.toggleProjectedObjectsActive; projection.Awake(); + projections.Add(projection); } } projector._projections = projections.ToArray(); } - projector.SetLit(info.startLit); + var sensor = projector._lightSensor as SingleLightSensor; + sensor._detectFlashlight = true; + sensor._lightSourceMask |= LightSourceType.FLASHLIGHT; + + projector._lit = info.startLit; + projector._startLit = info.startLit; + projector._extinguishOnly = info.extinguishOnly; + /* + Delay.FireOnNextUpdate(() => + { + projector.Start(); + }); + */ return totemObj; } diff --git a/NewHorizons/Builder/Props/PropBuildManager.cs b/NewHorizons/Builder/Props/PropBuildManager.cs index 64c4221f..74d638e9 100644 --- a/NewHorizons/Builder/Props/PropBuildManager.cs +++ b/NewHorizons/Builder/Props/PropBuildManager.cs @@ -102,6 +102,10 @@ namespace NewHorizons.Builder.Props // If a prop has set its parentPath and the parent cannot be found, add it to the next pass and try again later nextPass = new List(); + MakeGeneralProps(go, config.Props.gravityCannons, (cannon) => GravityCannonBuilder.Make(go, sector, cannon, mod), (cannon) => cannon.shuttleID); + MakeGeneralProps(go, config.Props.shuttles, (shuttle) => ShuttleBuilder.Make(go, sector, mod, shuttle), (shuttle) => shuttle.id); + MakeGeneralProps(go, config.Props.details, (detail) => DetailBuilder.Make(go, sector, mod, detail), (detail) => detail.path); + MakeGeneralProps(go, config.Props.geysers, (geyser) => GeyserBuilder.Make(go, sector, geyser)); if (Main.HasDLC) { MakeGeneralProps(go, config.Props.dreamCandles, (candle) => DreamCandleBuilder.Make(go, sector, candle, mod)); @@ -110,12 +114,8 @@ namespace NewHorizons.Builder.Props MakeGeneralProps(go, config.Props.grappleTotems, (totem) => GrappleTotemBuilder.Make(go, sector, totem, mod)); MakeGeneralProps(go, config.Props.dreamCampfires, (campfire) => DreamCampfireBuilder.Make(go, sector, campfire, mod), (campfire) => campfire.id); MakeGeneralProps(go, config.Props.dreamArrivalPoints, (point) => DreamArrivalPointBuilder.Make(go, sector, point, mod), (point) => point.id); + MakeGeneralProps(go, config.Props.rafts, (raft) => RaftBuilder.Make(go, sector, raft, planetBody)); } - MakeGeneralProps(go, config.Props.gravityCannons, (cannon) => GravityCannonBuilder.Make(go, sector, cannon, mod), (cannon) => cannon.shuttleID); - MakeGeneralProps(go, config.Props.shuttles, (shuttle) => ShuttleBuilder.Make(go, sector, mod, shuttle), (shuttle) => shuttle.id); - MakeGeneralProps(go, config.Props.details, (detail) => DetailBuilder.Make(go, sector, mod, detail), (detail) => detail.path); - MakeGeneralProps(go, config.Props.geysers, (geyser) => GeyserBuilder.Make(go, sector, geyser)); - if (Main.HasDLC) MakeGeneralProps(go, config.Props.rafts, (raft) => RaftBuilder.Make(go, sector, raft, planetBody)); MakeGeneralProps(go, config.Props.tornados, (tornado) => TornadoBuilder.Make(go, sector, tornado, config.Atmosphere?.clouds != null)); MakeGeneralProps(go, config.Props.volcanoes, (volcano) => VolcanoBuilder.Make(go, sector, volcano)); MakeGeneralProps(go, config.Props.dialogue, (dialogueInfo) => @@ -139,6 +139,7 @@ namespace NewHorizons.Builder.Props MakeGeneralProps(go, config.Props.warpTransmitters, (warpTransmitter) => WarpPadBuilder.Make(go, sector, mod, warpTransmitter), (warpTransmitter) => warpTransmitter.frequency); MakeGeneralProps(go, config.Props.audioSources, (audioSource) => AudioSourceBuilder.Make(go, sector, audioSource, mod), (audioSource) => audioSource.audio); RemoteBuilder.MakeGeneralProps(go, sector, config.Props.remotes, nhBody); + if (Main.HasDLC) MakeGeneralProps(go, config.Props.projectionTotems, (totem) => ProjectionTotemBuilder.Make(go, sector, totem, mod)); RunMultiPass(); diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 3ae2e82f..b453b170 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -153,6 +153,11 @@ namespace NewHorizons.External.Modules /// public DreamCandleInfo[] dreamCandles; + /// + /// Adds dream world projection totems (requires Echoes of the Eye DLC). + /// + public ProjectionTotemInfo[] projectionTotems; + [Obsolete("reveal is deprecated. Use Volumes->revealVolumes instead.")] public RevealVolumeInfo[] reveal; [Obsolete("audioVolumes is deprecated. Use Volumes->audioVolumes instead.")] public AudioVolumeInfo[] audioVolumes; diff --git a/NewHorizons/External/Modules/Props/EchoesOfTheEye/AlarmTotemInfo.cs b/NewHorizons/External/Modules/Props/EchoesOfTheEye/AlarmTotemInfo.cs index 94b0919f..3537b978 100644 --- a/NewHorizons/External/Modules/Props/EchoesOfTheEye/AlarmTotemInfo.cs +++ b/NewHorizons/External/Modules/Props/EchoesOfTheEye/AlarmTotemInfo.cs @@ -1,3 +1,4 @@ +using NewHorizons.External.SerializableData; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -12,12 +13,12 @@ namespace NewHorizons.External.Modules.Props.EchoesOfTheEye public class AlarmTotemInfo : GeneralPropInfo { /// - /// The maximum distance of the alarm's "vision cone". + /// The maximum distance of the alarm's vision cone. /// [DefaultValue(45f)] public float sightDistance = 45; /// - /// The width of the alarm's "vision cone" in degrees. + /// The width of the alarm's vision cone in degrees. /// [DefaultValue(60f)] public float sightAngle = 60f; diff --git a/NewHorizons/External/Modules/Props/EchoesOfTheEye/ProjectionTotemInfo.cs b/NewHorizons/External/Modules/Props/EchoesOfTheEye/ProjectionTotemInfo.cs index 40b695bb..0852b7e9 100644 --- a/NewHorizons/External/Modules/Props/EchoesOfTheEye/ProjectionTotemInfo.cs +++ b/NewHorizons/External/Modules/Props/EchoesOfTheEye/ProjectionTotemInfo.cs @@ -40,5 +40,10 @@ namespace NewHorizons.External.Modules.Props.EchoesOfTheEye /// Relative paths from this planet to objects that will appear or disappear when this totem is lit or extinguished. Some types of objects and effects are not supported and will remain visible and active. /// public string[] pathsToProjectedObjects; + + /// + /// If set, projected objects will be set to fully active or fully disabled instantly instead of smoothly fading lights/renderers/colliders. Use this if the normal behavior is insufficient for the objects you're using. + /// + public bool toggleProjectedObjectsActive; } }