diff --git a/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs b/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs index 8ede367c..eca21992 100644 --- a/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/CloudsBuilder.cs @@ -117,7 +117,7 @@ namespace NewHorizons.Builder.Atmosphere for(int i = 0; i < atmo.clouds.lightningGradient.Length; i++) { var pair = atmo.clouds.lightningGradient[i]; - gradient[i] = new GradientColorKey(pair.Tint, pair.Time); + gradient[i] = new GradientColorKey(pair.tint, pair.time); } lightningGenerator._lightColor.colorKeys = gradient; diff --git a/NewHorizons/Builder/Body/AsteroidBeltBuilder.cs b/NewHorizons/Builder/Body/AsteroidBeltBuilder.cs index 7839ba51..64543600 100644 --- a/NewHorizons/Builder/Body/AsteroidBeltBuilder.cs +++ b/NewHorizons/Builder/Body/AsteroidBeltBuilder.cs @@ -40,13 +40,13 @@ namespace NewHorizons.Builder.Body config.Orbit = new OrbitModule() { - IsMoon = true, + isMoon = true, inclination = belt.inclination + Random.Range(-2f, 2f), longitudeOfAscendingNode = belt.longitudeOfAscendingNode, trueAnomaly = 360f * (i + Random.Range(-0.2f, 0.2f)) / (float)count, - PrimaryBody = bodyName, + primaryBody = bodyName, semiMajorAxis = Random.Range(belt.innerRadius, belt.outerRadius), - ShowOrbitLine = false + showOrbitLine = false }; config.ProcGen = belt.procGen; diff --git a/NewHorizons/Builder/General/AstroObjectBuilder.cs b/NewHorizons/Builder/General/AstroObjectBuilder.cs index 777a75e3..a2fecf27 100644 --- a/NewHorizons/Builder/General/AstroObjectBuilder.cs +++ b/NewHorizons/Builder/General/AstroObjectBuilder.cs @@ -14,7 +14,7 @@ namespace NewHorizons.Builder.General if (config.Orbit != null) astroObject.SetOrbitalParametersFromConfig(config.Orbit); var type = AstroObject.Type.Planet; - if (config.Orbit.IsMoon) type = AstroObject.Type.Moon; + if (config.Orbit.isMoon) type = AstroObject.Type.Moon; // else if (config.Base.IsSatellite) type = AstroObject.Type.Satellite; else if (config.Base.hasCometTail) type = AstroObject.Type.Comet; else if (config.Star != null) type = AstroObject.Type.Star; @@ -25,25 +25,25 @@ namespace NewHorizons.Builder.General astroObject._primaryBody = primaryBody; // Expand gravitational sphere of influence of the primary to encompass this body if needed - if (primaryBody?.gameObject?.GetComponent() != null && !config.Orbit.IsStatic) + if (primaryBody?.gameObject?.GetComponent() != null && !config.Orbit.isStatic) { var primarySphereOfInfluence = primaryBody.GetGravityVolume().gameObject.GetComponent(); if (primarySphereOfInfluence.radius < config.Orbit.semiMajorAxis) primarySphereOfInfluence.radius = config.Orbit.semiMajorAxis * 1.5f; } - if (config.Orbit.IsTidallyLocked) + if (config.Orbit.isTidallyLocked) { var alignment = body.AddComponent(); alignment.SetTargetBody(primaryBody?.GetAttachedOWRigidbody()); alignment._usePhysicsToRotate = true; - if (config.Orbit.AlignmentAxis == null) + if (config.Orbit.alignmentAxis == null) { alignment._localAlignmentAxis = new Vector3(0, -1, 0); } else { - alignment._localAlignmentAxis = config.Orbit.AlignmentAxis; + alignment._localAlignmentAxis = config.Orbit.alignmentAxis; } } diff --git a/NewHorizons/Builder/General/MarkerBuilder.cs b/NewHorizons/Builder/General/MarkerBuilder.cs index 726e6f16..bcb945a9 100644 --- a/NewHorizons/Builder/General/MarkerBuilder.cs +++ b/NewHorizons/Builder/General/MarkerBuilder.cs @@ -1,6 +1,11 @@ -using NewHorizons.External.Configs; +#region + +using NewHorizons.External.Configs; using NewHorizons.Handlers; using UnityEngine; + +#endregion + namespace NewHorizons.Builder.General { static class MarkerBuilder @@ -12,7 +17,7 @@ namespace NewHorizons.Builder.General var markerType = MapMarker.MarkerType.Planet; - if (config.Orbit.IsMoon) + if (config.Orbit.isMoon) { markerType = MapMarker.MarkerType.Moon; } diff --git a/NewHorizons/Builder/Orbital/InitialMotionBuilder.cs b/NewHorizons/Builder/Orbital/InitialMotionBuilder.cs index d10b0e7f..bb3f95e9 100644 --- a/NewHorizons/Builder/Orbital/InitialMotionBuilder.cs +++ b/NewHorizons/Builder/Orbital/InitialMotionBuilder.cs @@ -19,11 +19,11 @@ namespace NewHorizons.Builder.Orbital initialMotion._orbitImpulseScalar = 0f; // Rotation - initialMotion._initAngularSpeed = orbit.SiderealPeriod == 0 ? 0f : 2f * Mathf.PI / (orbit.SiderealPeriod * 60f); - var rotationAxis = Quaternion.AngleAxis(orbit.AxialTilt, Vector3.right) * Vector3.up; + initialMotion._initAngularSpeed = orbit.siderealPeriod == 0 ? 0f : 2f * Mathf.PI / (orbit.siderealPeriod * 60f); + var rotationAxis = Quaternion.AngleAxis(orbit.axialTilt, Vector3.right) * Vector3.up; secondaryBody.transform.rotation = Quaternion.FromToRotation(Vector3.up, rotationAxis); - if (!orbit.IsStatic && primaryBody != null) + if (!orbit.isStatic && primaryBody != null) { SetInitialMotion(initialMotion, primaryBody, secondaryBody); } diff --git a/NewHorizons/Builder/Orbital/OrbitlineBuilder.cs b/NewHorizons/Builder/Orbital/OrbitlineBuilder.cs index d6adef42..d86fc9e2 100644 --- a/NewHorizons/Builder/Orbital/OrbitlineBuilder.cs +++ b/NewHorizons/Builder/Orbital/OrbitlineBuilder.cs @@ -20,16 +20,16 @@ namespace NewHorizons.Builder.Orbital var lineRenderer = orbitGO.AddComponent(); - lineRenderer.material = new Material(config.Orbit.DottedOrbitLine ? _dottedLineMaterial : _lineMaterial); - lineRenderer.textureMode = config.Orbit.DottedOrbitLine ? LineTextureMode.RepeatPerSegment : LineTextureMode.Stretch; + lineRenderer.material = new Material(config.Orbit.dottedOrbitLine ? _dottedLineMaterial : _lineMaterial); + lineRenderer.textureMode = config.Orbit.dottedOrbitLine ? LineTextureMode.RepeatPerSegment : LineTextureMode.Stretch; - var width = config.Orbit.DottedOrbitLine ? 100 : 50; + var width = config.Orbit.dottedOrbitLine ? 100 : 50; lineRenderer.startWidth = width; lineRenderer.endWidth = width; lineRenderer.useWorldSpace = false; lineRenderer.loop = false; - var numVerts = config.Orbit.DottedOrbitLine ? 128 : 256; + var numVerts = config.Orbit.dottedOrbitLine ? 128 : 256; lineRenderer.positionCount = numVerts; var ecc = config.Orbit.eccentricity; @@ -37,7 +37,7 @@ namespace NewHorizons.Builder.Orbital var parentGravity = astroObject.GetPrimaryBody()?.GetGravityVolume(); OrbitLine orbitLine; - if (config.Orbit.TrackingOrbitLine || (new Gravity(parentGravity).Power == 1 && ecc != 0)) + if (config.Orbit.trackingOrbitLine || (new Gravity(parentGravity).Power == 1 && ecc != 0)) { orbitLine = orbitGO.AddComponent(); } @@ -57,7 +57,7 @@ namespace NewHorizons.Builder.Orbital } var color = Color.white; - if (config.Orbit.Tint != null) color = config.Orbit.Tint; + if (config.Orbit.tint != null) color = config.Orbit.tint; else if (config.Star != null) color = config.Star.tint; else if (config.Atmosphere?.clouds?.tint != null) color = config.Atmosphere.clouds.tint; else if (config.Singularity != null) color = new Color(1f, 0.5f, 1f); diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index 849838f9..b2cc2c44 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -333,7 +333,7 @@ namespace NewHorizons.Builder.Props { var a = info.arcInfo[i]; if (a.position == null) arc.transform.localPosition = Vector3.zero; - else arc.transform.localPosition = new Vector3(a.position.X, a.position.Y, 0); + else arc.transform.localPosition = new Vector3(a.position.x, a.position.y, 0); arc.transform.localRotation = Quaternion.Euler(0, 0, a.zRotation); } diff --git a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs index 59439558..7b8102a1 100644 --- a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs @@ -388,7 +388,7 @@ namespace NewHorizons.Builder.ShipLog int newLevel = parent.level + 1; MapModeObject lastSibling = parent; - foreach (NewHorizonsBody body in searchList.Where(b => b.Config.Orbit.PrimaryBody == parent.mainBody.Config.name || b.Config.name == secondaryName)) + foreach (NewHorizonsBody body in searchList.Where(b => b.Config.Orbit.primaryBody == parent.mainBody.Config.name || b.Config.name == secondaryName)) { bool even = newLevel % 2 == 0; newX = even ? newX : newX + 1; diff --git a/NewHorizons/Components/QuantumPlanet.cs b/NewHorizons/Components/QuantumPlanet.cs index ff5f283b..68763c74 100644 --- a/NewHorizons/Components/QuantumPlanet.cs +++ b/NewHorizons/Components/QuantumPlanet.cs @@ -81,7 +81,7 @@ namespace NewHorizons.Components var newOrbit = newState.orbit ?? groundState.orbit; newOrbit.trueAnomaly = Random.Range(0f, 360f); - primaryBody = AstroObjectLocator.GetAstroObject(newOrbit.PrimaryBody); + primaryBody = AstroObjectLocator.GetAstroObject(newOrbit.primaryBody); var primaryGravity = new Gravity(primaryBody.GetGravityVolume()); var secondaryGravity = new Gravity(_astroObject.GetGravityVolume()); orbitalParams = newOrbit.GetOrbitalParameters(primaryGravity, secondaryGravity); diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index 84f7b87b..40da8bdb 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -45,6 +45,7 @@ namespace NewHorizons.Components.SizeControllers private StarEvolutionController _proxy; private float maxScale; + private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp"); void Awake() { @@ -55,10 +56,10 @@ namespace NewHorizons.Components.SizeControllers _endSurfaceMaterial = new Material(sun._endSurfaceMaterial); // Copy over the material that was set in star builder - _collapseStartSurfaceMaterial.SetTexture("_ColorRamp", supernova._surface.sharedMaterial.GetTexture("_ColorRamp")); - _collapseEndSurfaceMaterial.SetTexture("_ColorRamp", supernova._surface.sharedMaterial.GetTexture("_ColorRamp")); - _startSurfaceMaterial.SetTexture("_ColorRamp", supernova._surface.sharedMaterial.GetTexture("_ColorRamp")); - _endSurfaceMaterial.SetTexture("_ColorRamp", supernova._surface.sharedMaterial.GetTexture("_ColorRamp")); + _collapseStartSurfaceMaterial.SetTexture(ColorRamp, supernova._surface.sharedMaterial.GetTexture(ColorRamp)); + _collapseEndSurfaceMaterial.SetTexture(ColorRamp, supernova._surface.sharedMaterial.GetTexture(ColorRamp)); + _startSurfaceMaterial.SetTexture(ColorRamp, supernova._surface.sharedMaterial.GetTexture(ColorRamp)); + _endSurfaceMaterial.SetTexture(ColorRamp, supernova._surface.sharedMaterial.GetTexture(ColorRamp)); if (startColour == null) { diff --git a/NewHorizons/External/Configs/PlanetConfig.cs b/NewHorizons/External/Configs/PlanetConfig.cs index af1eac0c..f35c9616 100644 --- a/NewHorizons/External/Configs/PlanetConfig.cs +++ b/NewHorizons/External/Configs/PlanetConfig.cs @@ -160,7 +160,7 @@ namespace NewHorizons.External.Configs public void MigrateAndValidate() { // Validate - if (Base.centerOfSolarSystem) Orbit.IsStatic = true; + if (Base.centerOfSolarSystem) Orbit.isStatic = true; if (Atmosphere?.clouds?.lightningGradient != null) Atmosphere.clouds.hasLightning = true; // Backwards compatability diff --git a/NewHorizons/External/Modules/OrbitModule.cs b/NewHorizons/External/Modules/OrbitModule.cs index d9c06ced..7438b841 100644 --- a/NewHorizons/External/Modules/OrbitModule.cs +++ b/NewHorizons/External/Modules/OrbitModule.cs @@ -2,67 +2,69 @@ using System.ComponentModel.DataAnnotations; using NewHorizons.Components.Orbital; using NewHorizons.Utility; +using Newtonsoft.Json; namespace NewHorizons.External.Modules { + [JsonObject] public class OrbitModule : IOrbitalParameters { /// /// The name of the body this one will orbit around /// - public string PrimaryBody { get; set; } + public string primaryBody; /// /// Is this the moon of a planet? Used for determining when its name is shown on the map. /// - public bool IsMoon { get; set; } + public bool isMoon; /// /// The angle between the normal to the orbital plane and its axis of rotation. /// - public float AxialTilt { get; set; } + public float axialTilt; /// /// Rotation period in minutes. /// - public float SiderealPeriod { get; set; } + public float siderealPeriod; /// /// Should the body always have one side facing its primary? /// - public bool IsTidallyLocked { get; set; } + public bool isTidallyLocked; /// /// If it is tidally locked, this direction will face towards the primary. Ex: Interloper uses `0, -1, 0`. Most planets /// will want something like `-1, 0, 0`. /// - public MVector3 AlignmentAxis { get; set; } + public MVector3 alignmentAxis; /// /// Referring to the orbit line in the map screen. /// [DefaultValue(true)] - public bool ShowOrbitLine { get; set; } = true; + public bool showOrbitLine = true; /// /// Should the orbit line be dotted? /// - public bool DottedOrbitLine { get; set; } = false; + public bool dottedOrbitLine; /// /// Is the body meant to stay in one place without moving? /// - public bool IsStatic { get; set; } + public bool isStatic; /// /// Colour of the orbit-line in the map view. /// - public MColor Tint { get; set; } + public MColor tint; /// /// Should we just draw a line behind its orbit instead of the entire circle/ellipse? /// - public bool TrackingOrbitLine { get; set; } + public bool trackingOrbitLine; /// /// The semi-major axis of the ellipse that is the body's orbit. For a circular orbit this is the radius. diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index d9cd5e70..57ca2c3d 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -266,14 +266,14 @@ namespace NewHorizons.Handlers public static GameObject GenerateBody(NewHorizonsBody body, bool defaultPrimaryToSun = false) { AstroObject primaryBody; - if (body.Config.Orbit.PrimaryBody != null) + if (body.Config.Orbit.primaryBody != null) { - primaryBody = AstroObjectLocator.GetAstroObject(body.Config.Orbit.PrimaryBody); + primaryBody = AstroObjectLocator.GetAstroObject(body.Config.Orbit.primaryBody); if (primaryBody == null) { if (defaultPrimaryToSun) { - Logger.Log($"Couldn't find {body.Config.Orbit.PrimaryBody}, defaulting to Sun"); + Logger.Log($"Couldn't find {body.Config.Orbit.primaryBody}, defaulting to Sun"); primaryBody = AstroObjectLocator.GetAstroObject("Sun"); } else @@ -341,12 +341,12 @@ namespace NewHorizons.Handlers Main.SystemDict[body.Config.starSystem].SpawnPoint = SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody); } - if (body.Config.Orbit.ShowOrbitLine && !body.Config.Orbit.IsStatic) + if (body.Config.Orbit.showOrbitLine && !body.Config.Orbit.isStatic) { - Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => OrbitlineBuilder.Make(body.Object, ao as NHAstroObject, body.Config.Orbit.IsMoon, body.Config)); + Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => OrbitlineBuilder.Make(body.Object, ao as NHAstroObject, body.Config.Orbit.isMoon, body.Config)); } - if (!body.Config.Orbit.IsStatic) + if (!body.Config.Orbit.isStatic) { DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config); } @@ -507,10 +507,10 @@ namespace NewHorizons.Handlers // By default keep it with the same primary body else update to the new one var primary = ao._primaryBody; - if (!string.IsNullOrEmpty(body.Config.Orbit.PrimaryBody)) + if (!string.IsNullOrEmpty(body.Config.Orbit.primaryBody)) { // If we can't find the new one we want to try again later (return false) - primary = AstroObjectLocator.GetAstroObject(body.Config.Orbit.PrimaryBody); + primary = AstroObjectLocator.GetAstroObject(body.Config.Orbit.primaryBody); if (primary == null) return; } @@ -539,7 +539,7 @@ namespace NewHorizons.Handlers GameObject.Destroy(go.GetComponentInChildren().gameObject); var isMoon = newAO.GetAstroObjectType() == AstroObject.Type.Moon || newAO.GetAstroObjectType() == AstroObject.Type.Satellite; - if (body.Config.Orbit.ShowOrbitLine) OrbitlineBuilder.Make(go, newAO, isMoon, body.Config); + if (body.Config.Orbit.showOrbitLine) OrbitlineBuilder.Make(go, newAO, isMoon, body.Config); DetectorBuilder.SetDetector(primary, newAO, go.GetComponentInChildren()); diff --git a/NewHorizons/Handlers/PlanetGraphHandler.cs b/NewHorizons/Handlers/PlanetGraphHandler.cs index 28a7ffc1..0da5aabc 100644 --- a/NewHorizons/Handlers/PlanetGraphHandler.cs +++ b/NewHorizons/Handlers/PlanetGraphHandler.cs @@ -74,12 +74,12 @@ namespace NewHorizons.Handlers childBodies.Add(bodies[j]); } // If uh the primary body straight up matches the name - else if (bodies[j].Config.Orbit.PrimaryBody == bodies[i].Config.name) + else if (bodies[j].Config.Orbit.primaryBody == bodies[i].Config.name) { childBodies.Add(bodies[j]); } // If finding the astro object of the primary body matches the astro object but not null bc if its a new planet it'll always be null - else if (AstroObjectLocator.GetAstroObject(bodies[j].Config.Orbit.PrimaryBody) == astroObjects[i] && astroObjects[i] != null) + else if (AstroObjectLocator.GetAstroObject(bodies[j].Config.Orbit.primaryBody) == astroObjects[i] && astroObjects[i] != null) { childBodies.Add(bodies[j]); } @@ -119,7 +119,7 @@ namespace NewHorizons.Handlers private static bool DetermineIfChildOfFocal(NewHorizonsBody body, FocalPointNode node) { var name = body.Config.name.ToLower(); - var primary = (body.Config.Orbit?.PrimaryBody ?? "").ToLower(); + var primary = (body.Config.Orbit?.primaryBody ?? "").ToLower(); var primaryName = node.primary.body.Config.name.ToLower(); var secondaryName = node.secondary.body.Config.name.ToLower(); return name != primaryName && name != secondaryName && (primary == node.body.Config.name.ToLower() || primary == primaryName || primary == secondaryName); @@ -134,7 +134,7 @@ namespace NewHorizons.Handlers { body = body, children = bodies - .Where(b => string.Equals(b.Config.Orbit.PrimaryBody, body.Config.name, StringComparison.CurrentCultureIgnoreCase)) + .Where(b => string.Equals(b.Config.Orbit.primaryBody, body.Config.name, StringComparison.CurrentCultureIgnoreCase)) .Select(b => ConstructGraph(b, bodies)) }; } diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 6df9de2f..7b78b1e1 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -17,7 +17,7 @@ using UnityEngine.Events; using UnityEngine.SceneManagement; using Logger = NewHorizons.Utility.Logger; using NewHorizons.Utility.DebugUtilities; -using Newtonsoft.Json.Schema; +using Newtonsoft.Json; namespace NewHorizons { @@ -113,25 +113,8 @@ namespace NewHorizons TextTranslation.Get().SetLanguage(TextTranslation.Get().GetLanguage()); } - #region Assembly Stuff - - public static Assembly ResolveAssembly(object sender, ResolveEventArgs e) - { - Logger.LogError($"Couldn't resolve assembly: {e.Name} from {e.RequestingAssembly.FullName}... Trying to fix it."); - if (e.Name.Contains("Namotion.Reflection")) - return Assembly.LoadFrom("Namotion.Reflection.dll"); - else if (e.Name.Contains("Microsoft.CSharp")) - return Assembly.LoadFrom("Microsoft.CSharp.dll"); - else - return null; - } - - #endregion - public void Start() { - AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly; - // Patches Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); @@ -385,11 +368,6 @@ namespace NewHorizons Logger.Log($"Registering {language} translation from {mod.ModHelper.Manifest.Name} from {relativeFile}"); var config = new TranslationConfig($"{folder}{relativeFile}"); - if (config == null) - { - Logger.Log($"Found {folder}{relativeFile} but couldn't load it"); - continue; - } foundFile = true; @@ -405,9 +383,11 @@ namespace NewHorizons try { var config = mod.ModHelper.Storage.Load(relativeDirectory); + // var config = JsonConvert.DeserializeObject(File.ReadAllText($"{mod.ModHelper.Manifest.ModFolderPath}/{relativeDirectory}")); + config.MigrateAndValidate(); - Logger.Log($"Loaded {config.name}"); + Logger.Log($"Loaded {config.name}"); if (!SystemDict.ContainsKey(config.starSystem)) { diff --git a/NewHorizons/NewHorizons.csproj b/NewHorizons/NewHorizons.csproj index 9627f0eb..eaceb333 100644 --- a/NewHorizons/NewHorizons.csproj +++ b/NewHorizons/NewHorizons.csproj @@ -1,55 +1,60 @@  - - {8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF} - net48 - Build - NewHorizons - NewHorizons - Copyright © 2020 - true - false - true - - - portable - 1701;1702;1591 - - - none - 1701;1702;1591 - - - - - - - - - - - Always - - - Always - - - Always - - - - - - - - True - True - Settings.settings - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + + {8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF} + net48 + Build + NewHorizons + NewHorizons + Copyright © 2020 + true + false + true + None + + + portable + 1701;1702;1591 + + + none + 1701;1702;1591 + + + + + + + ../System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll + + + + + Always + + + Always + + + Always + + + Always + + + + + + + + True + True + Settings.settings + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + \ No newline at end of file diff --git a/NewHorizons/Utility/MGradient.cs b/NewHorizons/Utility/MGradient.cs index 4848cdc4..dc4fe1ec 100644 --- a/NewHorizons/Utility/MGradient.cs +++ b/NewHorizons/Utility/MGradient.cs @@ -3,18 +3,20 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; namespace NewHorizons.Utility { + [JsonObject] public class MGradient { public MGradient(float time, MColor tint) { - Time = time; - Tint = tint; + this.time = time; + this.tint = tint; } - public float Time { get; } - public MColor Tint { get; } + public float time; + public MColor tint; } } diff --git a/NewHorizons/Utility/MVector2.cs b/NewHorizons/Utility/MVector2.cs index f8bc789a..1cc25605 100644 --- a/NewHorizons/Utility/MVector2.cs +++ b/NewHorizons/Utility/MVector2.cs @@ -1,16 +1,23 @@ -using UnityEngine; +#region + +using Newtonsoft.Json; +using UnityEngine; + +#endregion + namespace NewHorizons.Utility { + [JsonObject] public class MVector2 { public MVector2(float x, float y) { - X = x; - Y = y; + this.x = x; + this.y = y; } - public float X { get; } - public float Y { get; } + public float x; + public float y; public static implicit operator MVector2(Vector2 vec) { @@ -19,7 +26,7 @@ namespace NewHorizons.Utility public static implicit operator Vector2(MVector2 vec) { - return new Vector2(vec.X, vec.Y); + return new Vector2(vec.x, vec.y); } } } \ No newline at end of file diff --git a/NewHorizons/Utility/MVector3.cs b/NewHorizons/Utility/MVector3.cs index 60250a90..4a02f49c 100644 --- a/NewHorizons/Utility/MVector3.cs +++ b/NewHorizons/Utility/MVector3.cs @@ -1,18 +1,20 @@ -using UnityEngine; +using Newtonsoft.Json; +using UnityEngine; namespace NewHorizons.Utility { + [JsonObject] public class MVector3 { public MVector3(float x, float y, float z) { - X = x; - Y = y; - Z = z; + this.x = x; + this.y = y; + this.z = z; } - public float X { get; } - public float Y { get; } - public float Z { get; } + public float x; + public float y; + public float z; public static implicit operator MVector3(Vector3 vec) { @@ -21,7 +23,7 @@ namespace NewHorizons.Utility public static implicit operator Vector3(MVector3 vec) { - return new Vector3(vec.X, vec.Y, vec.Z); + return new Vector3(vec.x, vec.y, vec.z); } } } diff --git a/SchemaExporter/SchemaExporter.cs b/SchemaExporter/SchemaExporter.cs index e186007d..e0d64bd6 100644 --- a/SchemaExporter/SchemaExporter.cs +++ b/SchemaExporter/SchemaExporter.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Linq; using NewHorizons.External.Configs; using NJsonSchema; using NJsonSchema.Generation; diff --git a/SchemaExporter/SchemaExporter.csproj b/SchemaExporter/SchemaExporter.csproj index e46253cd..6c156b5f 100644 --- a/SchemaExporter/SchemaExporter.csproj +++ b/SchemaExporter/SchemaExporter.csproj @@ -7,6 +7,7 @@ true false false + None portable @@ -27,6 +28,6 @@ - + diff --git a/System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll b/System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll new file mode 100644 index 00000000..18886b42 Binary files /dev/null and b/System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll differ