mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Change color to use lowercase properties
This commit is contained in:
parent
466df12003
commit
71874669c9
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@ -36,12 +37,13 @@ namespace NewHorizons.External.Modules
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// How dense the fog is, if you put fog.
|
/// How dense the fog is, if you put fog.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// FIXME: Min & Max Needed!
|
[Range(0f, 1f)]
|
||||||
public float fogDensity;
|
public float fogDensity;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Radius of fog sphere, independent of the atmosphere. This has to be set for there to be fog.
|
/// Radius of fog sphere, independent of the atmosphere. This has to be set for there to be fog.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Range(0f, float.MaxValue)]
|
||||||
public float fogSize;
|
public float fogSize;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
<NoWarn>1701;1702;1591</NoWarn>
|
<NoWarn>1701;1702;1591</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
<Reference Include="..\NJsonSchema\*.dll" />
|
<Reference Include="..\NJsonSchema\*.dll" />
|
||||||
<PackageReference Include="HarmonyX" Version="2.10.0" />
|
<PackageReference Include="HarmonyX" Version="2.10.0" />
|
||||||
<PackageReference Include="OWML" Version="2.3.3" />
|
<PackageReference Include="OWML" Version="2.3.3" />
|
||||||
|
|||||||
@ -1,23 +1,44 @@
|
|||||||
using UnityEngine;
|
using Newtonsoft.Json;
|
||||||
|
using UnityEngine;
|
||||||
namespace NewHorizons.Utility
|
namespace NewHorizons.Utility
|
||||||
{
|
{
|
||||||
|
[JsonObject]
|
||||||
public class MColor
|
public class MColor
|
||||||
{
|
{
|
||||||
public MColor(int r, int g, int b, int a)
|
public MColor(int r, int g, int b, int a)
|
||||||
{
|
{
|
||||||
R = r;
|
this.r = r;
|
||||||
G = g;
|
this.g = g;
|
||||||
B = b;
|
this.b = b;
|
||||||
A = a;
|
this.a = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int R { get; }
|
/// <summary>
|
||||||
public int G { get; }
|
/// The red component of this colour
|
||||||
public int B { get; }
|
/// </summary>
|
||||||
public int A { get; }
|
[System.ComponentModel.DataAnnotations.Range(0f, int.MaxValue)]
|
||||||
|
public int r;
|
||||||
|
|
||||||
public Color32 ToColor32() => new Color32((byte)R, (byte)G, (byte)B, (byte)A);
|
/// <summary>
|
||||||
|
/// The green component of this colour
|
||||||
|
/// </summary>
|
||||||
|
[System.ComponentModel.DataAnnotations.Range(0f, int.MaxValue)]
|
||||||
|
public int g;
|
||||||
|
|
||||||
public Color ToColor() => new Color(R / 255f, G / 255f, B / 255f, A / 255f);
|
/// <summary>
|
||||||
|
/// The blue component of this colour
|
||||||
|
/// </summary>
|
||||||
|
[System.ComponentModel.DataAnnotations.Range(0f, int.MaxValue)]
|
||||||
|
public int b;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The alpha (opacity) component of this colour
|
||||||
|
/// </summary>
|
||||||
|
[System.ComponentModel.DataAnnotations.Range(0f, int.MaxValue)]
|
||||||
|
public int a;
|
||||||
|
|
||||||
|
public Color32 ToColor32() => new Color32((byte)r, (byte)g, (byte)b, (byte)a);
|
||||||
|
|
||||||
|
public Color ToColor() => new Color(r / 255f, g / 255f, b / 255f, a / 255f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.14" />
|
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.14" />
|
||||||
<PackageReference Include="NJsonSchema" Version="10.7.1" />
|
<PackageReference Include="NJsonSchema" Version="10.7.1" />
|
||||||
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.168" IncludeAssets="compile" />
|
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.168" IncludeAssets="compile" />
|
||||||
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\NewHorizons\NewHorizons.csproj" />
|
<ProjectReference Include="..\NewHorizons\NewHorizons.csproj" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user