mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-11-19 13:17:10 +00:00
deprecate some constructors
This commit is contained in:
3 files changed
+7
-3
No files matched your search
@@ -10,9 +10,9 @@ public static class ExampleColors
|
||||
{
|
||||
public static CustomColor Cerulean { get; } = new("cerulean", new Color(0.0f, 0.48f, 0.65f), CustomColorBrightness.Lighter);
|
||||
|
||||
public static CustomColor Rose { get; } = new("rose", new Color(0.98f, 0.26f, 0.62f));
|
||||
public static CustomColor Rose { get; } = new("rose", new Color(0.98f, 0.26f, 0.62f), CustomColorBrightness.Lighter);
|
||||
|
||||
public static CustomColor Gold { get; } = new("gold", new Color(1.0f, 0.84f, 0.0f));
|
||||
public static CustomColor Gold { get; } = new("gold", new Color(1.0f, 0.84f, 0.0f), CustomColorBrightness.Lighter);
|
||||
|
||||
public static VariableColor Rainbow { get; } = new("rainbow", t => new HsbColor(MathUtilities.PingPong(t, 1f, 0.3f), 1f, 1f), CustomColorBrightness.Lighter);
|
||||
}
|
||||
@@ -116,6 +116,7 @@ public class CustomColor(StringNames? nameId, string? rawId, Color32 mainColor,
|
||||
/// <param name="nameId">The name of the option as a <see cref="StringNames"/> value.</param>
|
||||
/// <param name="mainColor">The main color.</param>
|
||||
/// <param name="shadowColor">The shadow color.</param>
|
||||
[Obsolete("Use the constructor that takes in a CustomColorBrightness parameter. This will be removed in a future version.")]
|
||||
public CustomColor(StringNames nameId, Color32 mainColor, Color32 shadowColor)
|
||||
: this(nameId, null, mainColor, shadowColor, CustomColorBrightness.Darker)
|
||||
{
|
||||
@@ -126,6 +127,7 @@ public class CustomColor(StringNames? nameId, string? rawId, Color32 mainColor,
|
||||
/// </summary>
|
||||
/// <param name="nameId">The name of the option as a <see cref="StringNames"/> value.</param>
|
||||
/// <param name="mainColor">The main color.</param>
|
||||
[Obsolete("Use the constructor that takes in a CustomColorBrightness parameter. This will be removed in a future version.")]
|
||||
public CustomColor(StringNames nameId, Color32 mainColor)
|
||||
: this(nameId, null, mainColor, mainColor.DarkenAbsolute(60), CustomColorBrightness.Darker)
|
||||
{
|
||||
@@ -137,6 +139,7 @@ public class CustomColor(StringNames? nameId, string? rawId, Color32 mainColor,
|
||||
/// <param name="rawId">The name of the option as a <see cref="string"/> value.</param>
|
||||
/// <param name="mainColor">The main color.</param>
|
||||
/// <param name="shadowColor">The shadow color.</param>
|
||||
[Obsolete("Use the constructor that takes in a CustomColorBrightness parameter. This will be removed in a future version.")]
|
||||
public CustomColor(string rawId, Color32 mainColor, Color32 shadowColor)
|
||||
: this(null, rawId, mainColor, shadowColor, CustomColorBrightness.Darker)
|
||||
{
|
||||
@@ -147,6 +150,7 @@ public class CustomColor(StringNames? nameId, string? rawId, Color32 mainColor,
|
||||
/// </summary>
|
||||
/// <param name="rawId">The name of the option as a <see cref="string"/> value.</param>
|
||||
/// <param name="mainColor">The main color.</param>
|
||||
[Obsolete("Use the constructor that takes in a CustomColorBrightness parameter. This will be removed in a future version.")]
|
||||
public CustomColor(string rawId, Color32 mainColor)
|
||||
: this(null, rawId, mainColor, mainColor.DarkenAbsolute(60), CustomColorBrightness.Darker)
|
||||
{
|
||||
|
||||
@@ -331,7 +331,7 @@ public sealed class MiraPluginManager
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(color.RawId))
|
||||
if (!string.IsNullOrEmpty(color.RawId) && !string.IsNullOrEmpty(attribute.IdPrefix))
|
||||
{
|
||||
color.Name = MiraLocaleManager.GetOrCreateLocaleString(attribute.IdPrefix + color.RawId);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user