mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'remnant-rework' of https://github.com/Outer-Wilds-New-Horizons/new-horizons into remnant-rework
This commit is contained in:
commit
39d3d68ea5
Binary file not shown.
@ -85,19 +85,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
fluidCLFV._layer = 5;
|
||||
fluidCLFV._priority = 1;
|
||||
fluidCLFV._density = 1.2f;
|
||||
|
||||
var fluidType = FluidVolume.Type.CLOUD;
|
||||
|
||||
try
|
||||
{
|
||||
fluidType = (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(CloudFluidType), atmo.clouds.fluidType).ToUpper());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Couldn't parse fluid volume type [{atmo.clouds.fluidType}]:\n{ex}");
|
||||
}
|
||||
|
||||
fluidCLFV._fluidType = fluidType;
|
||||
fluidCLFV._fluidType = atmo.clouds.fluidType.ConvertToOW(FluidVolume.Type.CLOUD);
|
||||
fluidCLFV._allowShipAutoroll = true;
|
||||
fluidCLFV._disableOnStart = false;
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@ namespace NewHorizons.Builder.Body
|
||||
}
|
||||
}
|
||||
|
||||
private static GameObject AddColouredSphere(GameObject rootObj, float size, VariableSizeModule.TimeValuePair[] curve, Color color)
|
||||
private static GameObject AddColouredSphere(GameObject rootObj, float size, TimeValuePair[] curve, Color color)
|
||||
{
|
||||
GameObject sphereGO = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
sphereGO.transform.name = "ProxySphere";
|
||||
@ -257,7 +257,7 @@ namespace NewHorizons.Builder.Body
|
||||
return sphereGO;
|
||||
}
|
||||
|
||||
private static SizeController AddSizeController(GameObject go, VariableSizeModule.TimeValuePair[] curve, float size)
|
||||
private static SizeController AddSizeController(GameObject go, TimeValuePair[] curve, float size)
|
||||
{
|
||||
var sizeController = go.AddComponent<SizeController>();
|
||||
sizeController.SetScaleCurve(curve);
|
||||
|
||||
@ -7,7 +7,6 @@ using System.Collections.Generic;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -46,20 +45,11 @@ namespace NewHorizons.Builder.Body
|
||||
trigger._shape = ringShape;
|
||||
|
||||
var sfv = ringVolume.AddComponent<RingFluidVolume>();
|
||||
var fluidType = FluidVolume.Type.NONE;
|
||||
|
||||
try
|
||||
{
|
||||
fluidType = (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(CloudFluidType), ring.fluidType).ToUpper());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Couldn't parse fluid volume type [{ring.fluidType}]:\n{ex}");
|
||||
}
|
||||
|
||||
sfv._fluidType = fluidType;
|
||||
sfv._fluidType = ring.fluidType.ConvertToOW();
|
||||
sfv._density = 5f;
|
||||
|
||||
if (ringGO.TryGetComponent<RingOpacityController>(out var ringOC)) ringOC.SetRingFluidVolume(sfv);
|
||||
|
||||
ringVolume.SetActive(true);
|
||||
|
||||
|
||||
@ -127,10 +117,17 @@ namespace NewHorizons.Builder.Body
|
||||
rot._localAxis = Vector3.down;
|
||||
}
|
||||
|
||||
if (ring.curve != null)
|
||||
if (ring.scaleCurve != null)
|
||||
{
|
||||
var levelController = ringGO.AddComponent<SizeController>();
|
||||
levelController.SetScaleCurve(ring.curve);
|
||||
levelController.SetScaleCurve(ring.scaleCurve);
|
||||
}
|
||||
|
||||
if (ring.opacityCurve != null)
|
||||
{
|
||||
var ringOC = ringGO.AddComponent<RingOpacityController>();
|
||||
ringOC.SetOpacityCurve(ring.opacityCurve);
|
||||
ringOC.SetMeshRenderer(ringMR);
|
||||
}
|
||||
|
||||
return ringGO;
|
||||
|
||||
@ -100,7 +100,7 @@ namespace NewHorizons.Builder.Body
|
||||
}
|
||||
|
||||
public static GameObject MakeBlackHole(GameObject planetGO, Sector sector, Vector3 localPosition, float size,
|
||||
bool hasDestructionVolume, string targetSolarSystem, VariableSizeModule.TimeValuePair[] curve = null, bool makeAudio = true)
|
||||
bool hasDestructionVolume, string targetSolarSystem = null, TimeValuePair[] curve = null, bool makeAudio = true)
|
||||
{
|
||||
var blackHole = new GameObject("BlackHole");
|
||||
blackHole.SetActive(false);
|
||||
@ -193,7 +193,7 @@ namespace NewHorizons.Builder.Body
|
||||
}
|
||||
|
||||
public static GameObject MakeWhiteHole(GameObject planetGO, Sector sector, OWRigidbody OWRB, Vector3 localPosition, float size,
|
||||
VariableSizeModule.TimeValuePair[] curve, bool makeZeroGVolume = true)
|
||||
TimeValuePair[] curve, bool makeZeroGVolume = true)
|
||||
{
|
||||
var whiteHole = new GameObject("WhiteHole");
|
||||
whiteHole.SetActive(false);
|
||||
@ -287,7 +287,7 @@ namespace NewHorizons.Builder.Body
|
||||
return whiteHole;
|
||||
}
|
||||
|
||||
public static GameObject MakeBlackHoleProxy(GameObject rootObject, MVector3 position, float size, VariableSizeModule.TimeValuePair[] curve = null)
|
||||
public static GameObject MakeBlackHoleProxy(GameObject rootObject, MVector3 position, float size, TimeValuePair[] curve = null)
|
||||
{
|
||||
if (_blackHoleProxyPrefab == null) _blackHoleProxyPrefab = SearchUtilities.Find(_blackHoleProxyPath);
|
||||
|
||||
@ -316,7 +316,7 @@ namespace NewHorizons.Builder.Body
|
||||
return blackHoleRender;
|
||||
}
|
||||
|
||||
public static GameObject MakeWhiteHoleProxy(GameObject rootObject, MVector3 position, float size, VariableSizeModule.TimeValuePair[] curve = null)
|
||||
public static GameObject MakeWhiteHoleProxy(GameObject rootObject, MVector3 position, float size, TimeValuePair[] curve = null)
|
||||
{
|
||||
if (_whiteHoleProxyPrefab == null) _whiteHoleProxyPrefab = SearchUtilities.Find(_whiteHoleProxyPath);
|
||||
|
||||
@ -345,7 +345,7 @@ namespace NewHorizons.Builder.Body
|
||||
return whiteHoleRenderer;
|
||||
}
|
||||
|
||||
private static SizeController AddSizeController(GameObject go, VariableSizeModule.TimeValuePair[] curve, float size)
|
||||
private static SizeController AddSizeController(GameObject go, TimeValuePair[] curve, float size)
|
||||
{
|
||||
var sizeController = go.AddComponent<SizeController>();
|
||||
sizeController.SetScaleCurve(curve);
|
||||
|
||||
@ -208,6 +208,8 @@ namespace NewHorizons.Builder.Props
|
||||
component._nomaiTexts[i] = wallText;
|
||||
}
|
||||
|
||||
if (info.disableWall) whiteboard.FindChild("Props_NOM_Whiteboard_Shared").SetActive(false);
|
||||
|
||||
whiteboard.SetActive(true);
|
||||
}
|
||||
|
||||
@ -251,6 +253,14 @@ namespace NewHorizons.Builder.Props
|
||||
component._visualSector = sector;
|
||||
component._dataPointID = info.reveals;
|
||||
|
||||
if (info.disableStructure)
|
||||
{
|
||||
platform.FindChild("Structure_NOM_RemoteViewer").SetActive(false);
|
||||
platform.FindChild("RemoteViewer_FadeGeo").SetActive(false);
|
||||
}
|
||||
|
||||
if (info.disablePool) platform.FindChild("RemoteViewer_Pool").SetActive(false);
|
||||
|
||||
platform.SetActive(true);
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ using NewHorizons.Components;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using Random = UnityEngine.Random;
|
||||
@ -143,15 +144,9 @@ namespace NewHorizons.Builder.Props
|
||||
tornadoGO.GetComponentInChildren<CapsuleShape>().enabled = true;
|
||||
|
||||
// Resize it so the force volume goes all the way up
|
||||
switch (downwards)
|
||||
{
|
||||
case true:
|
||||
tornadoGO.transform.Find("MockDownTornado_FluidCenter").localScale = new Vector3(1, 2f, 1);
|
||||
break;
|
||||
default:
|
||||
tornadoGO.transform.Find("MockUpTornado_FluidCenter").localScale = new Vector3(1, 2f, 1);
|
||||
break;
|
||||
}
|
||||
var fluidGO = tornadoGO.transform.Find(downwards ? "MockDownTornado_FluidCenter" : "MockUpTornado_FluidCenter");
|
||||
fluidGO.GetComponent<TornadoFluidVolume>()._fluidType = info.fluidType.ConvertToOW(FluidVolume.Type.CLOUD);
|
||||
fluidGO.localScale = new Vector3(1, 2f, 1);
|
||||
|
||||
if (info.tint != null)
|
||||
{
|
||||
@ -176,6 +171,7 @@ namespace NewHorizons.Builder.Props
|
||||
hurricaneGO.transform.rotation = Quaternion.FromToRotation(Vector3.up, sector.transform.TransformDirection(position.normalized));
|
||||
|
||||
var fluidVolume = hurricaneGO.GetComponentInChildren<HurricaneFluidVolume>();
|
||||
fluidVolume._fluidType = info.fluidType.ConvertToOW(FluidVolume.Type.CLOUD);
|
||||
fluidVolume._density = 8;
|
||||
|
||||
var effects = hurricaneGO.transform.Find("Effects_GD_Hurricane").gameObject;
|
||||
|
||||
@ -17,5 +17,7 @@ namespace NewHorizons.Components
|
||||
|
||||
fluidDetector.AddVolume(this);
|
||||
}
|
||||
|
||||
public override bool IsSpherical() => false;
|
||||
}
|
||||
}
|
||||
|
||||
51
NewHorizons/Components/RingOpacityController.cs
Normal file
51
NewHorizons/Components/RingOpacityController.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
using NewHorizons.Utility;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components
|
||||
{
|
||||
public class RingOpacityController : MonoBehaviour
|
||||
{
|
||||
private static readonly int Alpha = Shader.PropertyToID("_Alpha");
|
||||
|
||||
public AnimationCurve opacityCurve { get; protected set; }
|
||||
public float CurrentOpacity { get; protected set; }
|
||||
|
||||
private MeshRenderer _meshRenderer;
|
||||
private RingFluidVolume _ringFluidVolume;
|
||||
|
||||
protected void FixedUpdate()
|
||||
{
|
||||
if (opacityCurve != null)
|
||||
{
|
||||
CurrentOpacity = opacityCurve.Evaluate(TimeLoop.GetMinutesElapsed());
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentOpacity = 1;
|
||||
}
|
||||
|
||||
if (_ringFluidVolume != null)
|
||||
{
|
||||
if (Mathf.Approximately(CurrentOpacity, 0) && _ringFluidVolume.IsVolumeActive()) _ringFluidVolume.SetVolumeActivation(false);
|
||||
else if (!_ringFluidVolume.IsVolumeActive()) _ringFluidVolume.SetVolumeActivation(true);
|
||||
}
|
||||
|
||||
if (_meshRenderer == null) return;
|
||||
|
||||
_meshRenderer.material.SetFloat(Alpha, CurrentOpacity);
|
||||
}
|
||||
|
||||
public void SetOpacityCurve(TimeValuePair[] curve)
|
||||
{
|
||||
opacityCurve = new AnimationCurve();
|
||||
foreach (var pair in curve)
|
||||
{
|
||||
opacityCurve.AddKey(new Keyframe(pair.time, pair.value));
|
||||
}
|
||||
}
|
||||
|
||||
public void SetMeshRenderer(MeshRenderer meshRenderer) => _meshRenderer = meshRenderer;
|
||||
public void SetRingFluidVolume(RingFluidVolume ringFluidVolume) => _ringFluidVolume = ringFluidVolume;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
using NewHorizons.Utility;
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Components.SizeControllers
|
||||
{
|
||||
@ -22,7 +23,7 @@ namespace NewHorizons.Components.SizeControllers
|
||||
base.transform.localScale = Vector3.one * CurrentScale;
|
||||
}
|
||||
|
||||
public void SetScaleCurve(VariableSizeModule.TimeValuePair[] curve)
|
||||
public void SetScaleCurve(TimeValuePair[] curve)
|
||||
{
|
||||
scaleCurve = new AnimationCurve();
|
||||
foreach (var pair in curve)
|
||||
|
||||
6
NewHorizons/External/Configs/PlanetConfig.cs
vendored
6
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -377,6 +377,12 @@ namespace NewHorizons.External.Configs
|
||||
if (!string.IsNullOrEmpty(Cloak.audioClip)) Cloak.audio = Cloak.audioClip;
|
||||
if (!string.IsNullOrEmpty(Cloak.audioFilePath)) Cloak.audio = Cloak.audioFilePath;
|
||||
}
|
||||
|
||||
// Rings are no longer variable size module
|
||||
if (Ring != null)
|
||||
{
|
||||
if (Ring.curve != null) Ring.scaleCurve = Ring.curve;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@ using Newtonsoft.Json.Converters;
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum CloudFluidType
|
||||
public enum FluidType
|
||||
{
|
||||
[EnumMember(Value = @"none")] None = 0,
|
||||
|
||||
@ -126,7 +126,7 @@ namespace NewHorizons.External.Modules
|
||||
/// <summary>
|
||||
/// Fluid type for sounds/effects when colliding with this cloud.
|
||||
/// </summary>
|
||||
[DefaultValue("cloud")] public CloudFluidType fluidType = CloudFluidType.Cloud;
|
||||
[DefaultValue("cloud")] public FluidType fluidType = FluidType.Cloud;
|
||||
|
||||
/// <summary>
|
||||
/// Add lightning to this planet like on Giant's Deep.
|
||||
@ -202,8 +202,8 @@ namespace NewHorizons.External.Modules
|
||||
[Obsolete("CloudRamp is deprecated, please use CloudInfo instead")]
|
||||
public string cloudRamp;
|
||||
|
||||
[Obsolete("CloudFluidType is deprecated, please use CloudInfo instead")]
|
||||
public CloudFluidType fluidType;
|
||||
[Obsolete("FluidType is deprecated, please use CloudInfo instead")]
|
||||
public FluidType fluidType;
|
||||
|
||||
[Obsolete("UseBasicCloudShader is deprecated, please use CloudInfo instead")]
|
||||
public bool useBasicCloudShader;
|
||||
|
||||
20
NewHorizons/External/Modules/PropModule.cs
vendored
20
NewHorizons/External/Modules/PropModule.cs
vendored
@ -325,6 +325,11 @@ namespace NewHorizons.External.Modules
|
||||
/// 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.
|
||||
/// </summary>
|
||||
public float audioDistance;
|
||||
|
||||
/// <summary>
|
||||
/// Fluid type for sounds/effects when colliding with this tornado.
|
||||
/// </summary>
|
||||
[DefaultValue("cloud")] public FluidType fluidType = FluidType.Cloud;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
@ -893,6 +898,11 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
public string rename;
|
||||
|
||||
/// <summary>
|
||||
/// Disable the wall, leaving only the pedestal and text.
|
||||
/// </summary>
|
||||
public bool disableWall;
|
||||
|
||||
[JsonObject]
|
||||
public class SharedNomaiTextInfo
|
||||
{
|
||||
@ -955,6 +965,16 @@ namespace NewHorizons.External.Modules
|
||||
/// A ship log fact to reveal when the platform is connected to.
|
||||
/// </summary>
|
||||
[DefaultValue("")] public string reveals = "";
|
||||
|
||||
/// <summary>
|
||||
/// Disable the structure, leaving only the pedestal.
|
||||
/// </summary>
|
||||
public bool disableStructure;
|
||||
|
||||
/// <summary>
|
||||
/// Disable the pool that rises when you place a stone.
|
||||
/// </summary>
|
||||
public bool disablePool;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
|
||||
@ -1,15 +1,17 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using NewHorizons.Utility;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NewHorizons.External.Modules.VariableSize
|
||||
namespace NewHorizons.External.Modules
|
||||
{
|
||||
[JsonObject]
|
||||
public class RingModule : VariableSizeModule
|
||||
public class RingModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Fluid type for sounds/effects when colliding with this ring.
|
||||
/// </summary>
|
||||
public CloudFluidType fluidType = CloudFluidType.None;
|
||||
public FluidType fluidType = FluidType.None;
|
||||
|
||||
/// <summary>
|
||||
/// Angle between the rings and the equatorial plane of the planet.
|
||||
@ -45,5 +47,20 @@ namespace NewHorizons.External.Modules.VariableSize
|
||||
/// Should this ring be unlit?
|
||||
/// </summary>
|
||||
public bool unlit;
|
||||
|
||||
#region Obsolete
|
||||
[Obsolete("curve is deprecated, please use scaleCurve instead")]
|
||||
public TimeValuePair[] curve;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Scale rings over time. Optional. Value between 0-1, time is in minutes.
|
||||
/// </summary>
|
||||
public TimeValuePair[] scaleCurve;
|
||||
|
||||
/// <summary>
|
||||
/// Fade rings in/out over time. Optional. Value between 0-1, time is in minutes.
|
||||
/// </summary>
|
||||
public TimeValuePair[] opacityCurve;
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
using NewHorizons.Utility;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
@ -7,22 +8,8 @@ namespace NewHorizons.External.Modules.VariableSize
|
||||
public class VariableSizeModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Scale this module over time
|
||||
/// Scale this object over time
|
||||
/// </summary>
|
||||
public TimeValuePair[] curve;
|
||||
|
||||
[JsonObject]
|
||||
public class TimeValuePair
|
||||
{
|
||||
/// <summary>
|
||||
/// A specific point in time
|
||||
/// </summary>
|
||||
public float time;
|
||||
|
||||
/// <summary>
|
||||
/// The value for this point in time
|
||||
/// </summary>
|
||||
public float value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
|
||||
namespace NewHorizons.Handlers
|
||||
{
|
||||
|
||||
@ -331,7 +331,7 @@
|
||||
"fluidType": {
|
||||
"description": "Fluid type for sounds/effects when colliding with this cloud.",
|
||||
"default": "cloud",
|
||||
"$ref": "#/definitions/CloudFluidType"
|
||||
"$ref": "#/definitions/FluidType"
|
||||
},
|
||||
"hasLightning": {
|
||||
"type": "boolean",
|
||||
@ -392,7 +392,7 @@
|
||||
"basic"
|
||||
]
|
||||
},
|
||||
"CloudFluidType": {
|
||||
"FluidType": {
|
||||
"type": "string",
|
||||
"description": "",
|
||||
"x-enumNames": [
|
||||
@ -661,7 +661,7 @@
|
||||
"properties": {
|
||||
"curve": {
|
||||
"type": "array",
|
||||
"description": "Scale this module over time",
|
||||
"description": "Scale this object over time",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
@ -765,7 +765,7 @@
|
||||
"properties": {
|
||||
"curve": {
|
||||
"type": "array",
|
||||
"description": "Scale this module over time",
|
||||
"description": "Scale this object over time",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
@ -1676,6 +1676,11 @@
|
||||
"type": "number",
|
||||
"description": "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.",
|
||||
"format": "float"
|
||||
},
|
||||
"fluidType": {
|
||||
"description": "Fluid type for sounds/effects when colliding with this tornado.",
|
||||
"default": "cloud",
|
||||
"$ref": "#/definitions/FluidType"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1746,7 +1751,7 @@
|
||||
"properties": {
|
||||
"curve": {
|
||||
"type": "array",
|
||||
"description": "Scale this module over time",
|
||||
"description": "Scale this object over time",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
@ -1974,6 +1979,10 @@
|
||||
"rename": {
|
||||
"type": "string",
|
||||
"description": "An optional rename of this object"
|
||||
},
|
||||
"disableWall": {
|
||||
"type": "boolean",
|
||||
"description": "Disable the wall, leaving only the pedestal and text."
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -2036,6 +2045,14 @@
|
||||
"type": "string",
|
||||
"description": "A ship log fact to reveal when the platform is connected to.",
|
||||
"default": ""
|
||||
},
|
||||
"disableStructure": {
|
||||
"type": "boolean",
|
||||
"description": "Disable the structure, leaving only the pedestal."
|
||||
},
|
||||
"disablePool": {
|
||||
"type": "boolean",
|
||||
"description": "Disable the pool that rises when you place a stone."
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -2104,16 +2121,9 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"curve": {
|
||||
"type": "array",
|
||||
"description": "Scale this module over time",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
},
|
||||
"fluidType": {
|
||||
"description": "Fluid type for sounds/effects when colliding with this ring.",
|
||||
"$ref": "#/definitions/CloudFluidType"
|
||||
"$ref": "#/definitions/FluidType"
|
||||
},
|
||||
"inclination": {
|
||||
"type": "number",
|
||||
@ -2149,6 +2159,20 @@
|
||||
"unlit": {
|
||||
"type": "boolean",
|
||||
"description": "Should this ring be unlit?"
|
||||
},
|
||||
"scaleCurve": {
|
||||
"type": "array",
|
||||
"description": "Scale rings over time. Optional. Value between 0-1, time is in minutes.",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
},
|
||||
"opacityCurve": {
|
||||
"type": "array",
|
||||
"description": "Fade rings in/out over time. Optional. Value between 0-1, time is in minutes.",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -2158,7 +2182,7 @@
|
||||
"properties": {
|
||||
"curve": {
|
||||
"type": "array",
|
||||
"description": "Scale this module over time",
|
||||
"description": "Scale this object over time",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
@ -2330,7 +2354,7 @@
|
||||
"properties": {
|
||||
"curve": {
|
||||
"type": "array",
|
||||
"description": "Scale this module over time",
|
||||
"description": "Scale this object over time",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
@ -2464,7 +2488,7 @@
|
||||
"properties": {
|
||||
"curve": {
|
||||
"type": "array",
|
||||
"description": "Scale this module over time",
|
||||
"description": "Scale this object over time",
|
||||
"items": {
|
||||
"$ref": "#/definitions/TimeValuePair"
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -215,5 +216,18 @@ namespace NewHorizons.Utility
|
||||
Utility.Logger.LogVerbose($"Coordinate Check for {system}: {xCorrect}, {yCorrect}, {zCorrect} [{string.Join("-", coordinates.x)}, {string.Join("-", coordinates.y)}, {string.Join("-", coordinates.z)}]");
|
||||
return xCorrect && yCorrect && zCorrect;
|
||||
}
|
||||
|
||||
public static FluidVolume.Type ConvertToOW(this FluidType fluidType, FluidVolume.Type @default = FluidVolume.Type.NONE)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (FluidVolume.Type)Enum.Parse(typeof(FluidVolume.Type), Enum.GetName(typeof(FluidType), fluidType).ToUpper());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Couldn't parse fluid volume type [{fluidType}]:\n{ex}");
|
||||
return @default;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
NewHorizons/Utility/TimeValuePair.cs
Normal file
18
NewHorizons/Utility/TimeValuePair.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NewHorizons.Utility
|
||||
{
|
||||
[JsonObject]
|
||||
public class TimeValuePair
|
||||
{
|
||||
/// <summary>
|
||||
/// A specific point in time
|
||||
/// </summary>
|
||||
public float time;
|
||||
|
||||
/// <summary>
|
||||
/// The value for this point in time
|
||||
/// </summary>
|
||||
public float value;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user