From f93fcc16e96a18c7b381290c599c9441e3b9a241 Mon Sep 17 00:00:00 2001
From: Az <56699741+AlchlcDvl@users.noreply.github.com>
Date: Tue, 3 Nov 2026 09:21:38 -0500
Subject: [PATCH] deprecate some constructors
---
MiraAPI.Example/ExampleColors.cs | 4 ++--
MiraAPI/Colors/CustomColor.cs | 4 ++++
MiraAPI/PluginLoading/MiraPluginManager.cs | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/MiraAPI.Example/ExampleColors.cs b/MiraAPI.Example/ExampleColors.cs
index 0b9c4b6e..88710683 100644
--- a/MiraAPI.Example/ExampleColors.cs
+++ b/MiraAPI.Example/ExampleColors.cs
@@ -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);
}
diff --git a/MiraAPI/Colors/CustomColor.cs b/MiraAPI/Colors/CustomColor.cs
index 836c1fec..fa3df61c 100644
--- a/MiraAPI/Colors/CustomColor.cs
+++ b/MiraAPI/Colors/CustomColor.cs
@@ -116,6 +116,7 @@ public class CustomColor(StringNames? nameId, string? rawId, Color32 mainColor,
/// The name of the option as a value.
/// The main color.
/// The shadow color.
+ [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,
///
/// The name of the option as a value.
/// The main color.
+ [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,
/// The name of the option as a value.
/// The main color.
/// The shadow color.
+ [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,
///
/// The name of the option as a value.
/// The main color.
+ [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)
{
diff --git a/MiraAPI/PluginLoading/MiraPluginManager.cs b/MiraAPI/PluginLoading/MiraPluginManager.cs
index 9d4b47dd..ad12098b 100644
--- a/MiraAPI/PluginLoading/MiraPluginManager.cs
+++ b/MiraAPI/PluginLoading/MiraPluginManager.cs
@@ -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);
}