Add default values to modules

This commit is contained in:
Nick 2022-05-22 00:49:09 -04:00
parent 0e545850cc
commit 59624b6a2c
15 changed files with 102 additions and 24 deletions

View File

@ -19,6 +19,7 @@ namespace NewHorizons.Builder.Props
if (!detailInfoToCorrespondingSpawnedGameObject.ContainsKey(detail)) return null;
return detailInfoToCorrespondingSpawnedGameObject[detail];
}
public static void Make(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, string uniqueModName, PropModule.DetailInfo detail)
{
GameObject detailGO = null;

View File

@ -200,8 +200,6 @@ namespace NewHorizons.Builder.Props
streamingRenderMeshHandle.enabled = false;
}
// Height of the hurricane is 405 by default
if (info.height != 0) hurricaneGO.transform.localScale = Vector3.one * info.height / 405f;

View File

@ -1,6 +1,7 @@
using NewHorizons.External.Modules;
using NewHorizons.External.Modules.VariableSize;
using NewHorizons.Utility;
using System.ComponentModel;
using UnityEngine;
namespace NewHorizons.External.Configs
@ -9,9 +10,11 @@ namespace NewHorizons.External.Configs
{
public string Name { get; set; }
public string Version { get; set; }
public string StarSystem { get; set; } = "SolarSystem";
[DefaultValue("SolarSystem")] public string StarSystem { get; set; } = "SolarSystem";
public bool Destroy { get; set; }
public string[] RemoveChildren { get; set; }
[DefaultValue(-1)]
public int BuildPriority { get; set; } = -1;
public bool CanShowOnTitle { get; set; } = true;
public bool IsQuantumState { get; set; }

View File

@ -1,12 +1,15 @@
namespace NewHorizons.External.Configs
using System.ComponentModel;
namespace NewHorizons.External.Configs
{
public class StarSystemConfig
{
public bool canEnterViaWarpDrive = true;
public bool startHere = false;
public bool destroyStockPlanets = true;
[DefaultValue(true)] public bool canEnterViaWarpDrive = true;
[DefaultValue(true)] public bool enableTimeLoop = true;
[DefaultValue(true)] public bool destroyStockPlanets = true;
public bool startHere;
public string factRequiredForWarp;
public bool enableTimeLoop = true;
public bool mapRestricted;
public NomaiCoordinates coords;
public SkyboxConfig skybox;

View File

@ -1,12 +1,21 @@
namespace NewHorizons.External.Modules
using System.ComponentModel;
namespace NewHorizons.External.Modules
{
public class AsteroidBeltModule
{
public float InnerRadius { get; set; }
public float OuterRadius { get; set; }
[DefaultValue(20)]
public float MinSize { get; set; } = 20;
[DefaultValue(50)]
public float MaxSize { get; set; } = 50;
[DefaultValue(-1)]
public int Amount { get; set; } = -1;
public float Inclination { get; set; }
public float LongitudeOfAscendingNode { get; set; }
public int RandomSeed { get; set; }

View File

@ -1,4 +1,5 @@
using NewHorizons.Utility;
using System.ComponentModel;
using UnityEngine;
namespace NewHorizons.External.Modules
@ -24,7 +25,7 @@ namespace NewHorizons.External.Modules
[System.Obsolete("CloudRamp is deprecated, please use CloudInfo instead")] public string CloudRamp { get; set; }
[System.Obsolete("CloudFluidType is deprecated, please use CloudInfo instead")] public string CloudFluidType { get; set; }
[System.Obsolete("UseBasicCloudShader is deprecated, please use CloudInfo instead")] public bool UseBasicCloudShader { get; set; }
[System.Obsolete("ShadowsOnClouds is deprecated, please use CloudInfo instead")] public bool ShadowsOnClouds { get; set; } = true;
[DefaultValue(true)] [System.Obsolete("ShadowsOnClouds is deprecated, please use CloudInfo instead")] public bool ShadowsOnClouds { get; set; } = true;
[System.Obsolete("HasAtmosphere is deprecated, please use UseAtmosphereShader instead")] public bool HasAtmosphere { get; set; }
#endregion Obsolete

View File

@ -1,4 +1,6 @@
using NewHorizons.Utility;
using System.ComponentModel;
namespace NewHorizons.External.Modules
{
public class BaseModule
@ -6,16 +8,24 @@ namespace NewHorizons.External.Modules
public bool HasMapMarker { get; set; }
public float AmbientLight { get; set; }
public float SurfaceGravity { get; set; }
[DefaultValue("linear")]
public string GravityFallOff { get; set; } = "linear";
public float SurfaceSize { get; set; }
public float SphereOfInfluence { get; set; }
public float GroundSize { get; set; }
public bool HasCometTail { get; set; }
public MVector3 CometTailRotation { get; set; }
[DefaultValue(true)]
public bool HasReferenceFrame { get; set; } = true;
public bool CenterOfSolarSystem { get; set; } = false;
public float CloakRadius { get; set; } = 0f;
public bool CenterOfSolarSystem { get; set; }
public float CloakRadius { get; set; }
public bool InvulnerableToSun { get; set; }
[DefaultValue(true)]
public bool ShowMinimap { get; set; } = true;
#region Obsolete

View File

@ -1,5 +1,7 @@
using NewHorizons.Components.Orbital;
using NewHorizons.Utility;
using System.ComponentModel;
namespace NewHorizons.External.Modules
{
public class OrbitModule : IOrbitalParameters
@ -16,11 +18,14 @@ namespace NewHorizons.External.Modules
public float SiderealPeriod { get; set; }
public bool IsTidallyLocked { get; set; }
public MVector3 AlignmentAxis { get; set; }
[DefaultValue(true)]
public bool ShowOrbitLine { get; set; } = true;
public bool DottedOrbitLine { get; set; } = false;
public bool DottedOrbitLine { get; set; }
public bool IsStatic { get; set; }
public MColor Tint { get; set; }
public bool TrackingOrbitLine { get; set; } = false;
public bool TrackingOrbitLine { get; set; }
public OrbitalParameters GetOrbitalParameters(Gravity primaryGravity, Gravity secondaryGravity)
{

View File

@ -1,4 +1,6 @@
using NewHorizons.Utility;
using System.ComponentModel;
namespace NewHorizons.External.Modules
{
public class PropModule
@ -35,6 +37,8 @@ namespace NewHorizons.External.Modules
public string assetBundle;
public MVector3 position;
public MVector3 rotation;
[DefaultValue(1f)]
public float scale { get; set; } = 1f;
public bool alignToNormal;
public string[] removeChildren;
@ -55,11 +59,20 @@ namespace NewHorizons.External.Modules
{
public MVector3 position;
public float elevation;
[DefaultValue(30)]
public float height = 30;
public MColor tint;
public float wanderRate;
[DefaultValue(45)]
public float wanderDegreesX = 45;
[DefaultValue(45)]
public float wanderDegreesZ = 45;
[DefaultValue("upwards")]
public string type = "upwards";
[System.Obsolete("downwards is deprecated, please use type instead")] public bool downwards;

View File

@ -1,4 +1,6 @@
using NewHorizons.Utility;
using System.ComponentModel;
namespace NewHorizons.External.Modules
{
public class ShipLogModule
@ -14,12 +16,15 @@ namespace NewHorizons.External.Modules
{
public string revealedSprite;
public string outlineSprite;
[DefaultValue(1f)]
public float scale = 1f;
public bool invisibleWhenHidden;
public float offset = 0f;
public float offset;
public MVector2 manualPosition;
public MVector2 manualNavigationPosition;
public bool remove = false;
public bool remove;
public ShipLogDetailInfo[] details;
}
@ -27,7 +32,7 @@ namespace NewHorizons.External.Modules
{
public string revealedSprite;
public string outlineSprite;
public float rotation = 0f;
public float rotation;
public bool invisibleWhenHidden;
public MVector2 position;
public MVector2 scale;

View File

@ -1,4 +1,6 @@
using NewHorizons.Utility;
using System.ComponentModel;
namespace NewHorizons.External.Modules
{
public class SignalModule
@ -10,14 +12,23 @@ namespace NewHorizons.External.Modules
public MVector3 Position;
public string Frequency;
public string Name;
public string AudioClip = null;
public string AudioFilePath = null;
public string AudioClip;
public string AudioFilePath;
[DefaultValue("")]
public string Reveals = "";
[DefaultValue(1f)]
public float SourceRadius = 1f;
public float DetectionRadius = 0f;
public float DetectionRadius;
[DefaultValue(10f)]
public float IdentificationRadius = 10f;
[DefaultValue(true)]
public bool OnlyAudibleToScope = true;
public bool InsideCloak = false;
public bool InsideCloak;
}
}
}

View File

@ -1,10 +1,15 @@
using NewHorizons.Utility;
using System.ComponentModel;
namespace NewHorizons.External.Modules.VariableSize
{
public class FunnelModule : VariableSizeModule
{
public string Target { get; set; }
[DefaultValue("Sand")]
public string Type { get; set; } = "Sand";
public MColor Tint { get; set; }
}
}

View File

@ -7,8 +7,8 @@
public float Inclination { get; set; }
public float LongitudeOfAscendingNode { get; set; }
public string Texture { get; set; }
public bool Unlit { get; set; } = false;
public float RotationSpeed { get; set; } = 0f;
public bool Unlit { get; set; }
public float RotationSpeed { get; set; }
public string FluidType { get; set; }
}
}

View File

@ -1,4 +1,6 @@
using NewHorizons.Utility;
using System.ComponentModel;
namespace NewHorizons.External.Modules.VariableSize
{
public class SingularityModule : VariableSizeModule
@ -8,6 +10,6 @@ namespace NewHorizons.External.Modules.VariableSize
public string TargetStarSystem;
public string Type; //BlackHole or WhiteHole
public MVector3 Position;
public bool MakeZeroGVolume = true;
[DefaultValue(true)] public bool MakeZeroGVolume = true;
}
}

View File

@ -1,16 +1,28 @@
using NewHorizons.Utility;
using System.ComponentModel;
namespace NewHorizons.External.Modules.VariableSize
{
public class StarModule : VariableSizeModule
{
[DefaultValue(2000)]
public float Size { get; set; } = 2000f;
public MColor Tint { get; set; }
public MColor EndTint { get; set; }
public MColor SupernovaTint { get; set; }
public MColor LightTint { get; set; }
[DefaultValue(1f)]
public float SolarLuminosity { get; set; } = 1f;
[DefaultValue(true)]
public bool HasAtmosphere { get; set; } = true;
[DefaultValue(true)]
public bool GoSupernova { get; set; } = true;
}
}