mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-11-19 13:17:10 +00:00
Expose color id for custom colors
This commit is contained in:
1 parent
890fa065e7
commit
6f3fee3859
2 files changed
+10
No files matched your search
@@ -48,6 +48,11 @@ public class CustomColor(StringNames name, Color32 mainColor, Color32 shadowColo
|
||||
/// </summary>
|
||||
public StringNames Name { get; set; } = name;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the id of the color.
|
||||
/// </summary>
|
||||
public int ColorId { get; internal set; } = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the color is lighter or darker. Can be used to help with colorblind stuff.
|
||||
/// </summary>
|
||||
|
||||
@@ -50,6 +50,11 @@ public static class PaletteManager
|
||||
var colors = CustomColors.Select(x => x.MainColor).ToArray();
|
||||
var shadowColors = CustomColors.Select(x => x.ShadowColor).ToArray();
|
||||
var stringNames = CustomColors.Select(x => x.Name).ToArray();
|
||||
var newColorId = originalLength;
|
||||
foreach (var color in CustomColors)
|
||||
{
|
||||
color.ColorId = newColorId++;
|
||||
}
|
||||
|
||||
Palette.PlayerColors = Palette.PlayerColors.ToArray().AddRangeToArray(colors);
|
||||
Palette.ShadowColors = Palette.ShadowColors.ToArray().AddRangeToArray(shadowColors);
|
||||
|
||||
Reference in new issue
Block a user