mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-28 09:39:08 +00:00
finally fix custom colors, stupid among us and no errors for somr reason supe rweird
This commit is contained in:
1 parent
7999506359
commit
5a95a6b352
2 files changed
+24
-8
No files matched your search
@@ -18,12 +18,15 @@ public static class PaletteManager
|
||||
|
||||
internal static void RegisterAllColors()
|
||||
{
|
||||
var colors = CustomColors.Select(x => x.MainColor);
|
||||
var shadowColors = CustomColors.Select(x => x.ShadowColor);
|
||||
var stringNames = CustomColors.Select(x => x.Name);
|
||||
var colors = CustomColors.Select(x => x.MainColor).ToArray();
|
||||
var shadowColors = CustomColors.Select(x => x.ShadowColor).ToArray();
|
||||
var stringNames = CustomColors.Select(x => x.Name).ToArray();
|
||||
|
||||
Palette.PlayerColors = Palette.PlayerColors.ToArray().AddRangeToArray(colors.ToArray());
|
||||
Palette.ShadowColors = Palette.ShadowColors.ToArray().AddRangeToArray(shadowColors.ToArray());
|
||||
Palette.ColorNames = Palette.ColorNames.ToArray().AddRangeToArray(stringNames.ToArray());
|
||||
Palette.PlayerColors = Palette.PlayerColors.ToArray().AddRangeToArray(colors);
|
||||
Palette.ShadowColors = Palette.ShadowColors.ToArray().AddRangeToArray(shadowColors);
|
||||
Palette.ColorNames = Palette.ColorNames.ToArray().AddRangeToArray(stringNames);
|
||||
|
||||
Palette.TextColors = Palette.TextColors.ToArray().AddRangeToArray(colors);
|
||||
Palette.TextOutlineColors = Palette.TextOutlineColors.ToArray().AddRangeToArray(shadowColors);
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,23 @@ namespace MiraAPI.Utilities.Assets;
|
||||
/// </summary>
|
||||
public static class SpriteTools
|
||||
{
|
||||
/// <summary>
|
||||
/// Delegate for LoadImage.
|
||||
/// </summary>
|
||||
public delegate bool DLoadImage(IntPtr tex, IntPtr data, bool markNonReadable);
|
||||
|
||||
public static DLoadImage ICallLoadImage;
|
||||
/// <summary>
|
||||
/// The ICall for LoadImage.
|
||||
/// </summary>
|
||||
public static DLoadImage? ICallLoadImage;
|
||||
|
||||
/// <summary>
|
||||
/// Load an image into a texture.
|
||||
/// </summary>
|
||||
/// <param name="tex">The texture.</param>
|
||||
/// <param name="data">Byte data of image.</param>
|
||||
/// <param name="markNonReadable">Mark nonreadable.</param>
|
||||
/// <returns>True if succeeded.</returns>
|
||||
public static bool LoadImage(Texture2D tex, byte[] data, bool markNonReadable)
|
||||
{
|
||||
ICallLoadImage ??= IL2CPP.ResolveICall<DLoadImage>("UnityEngine.ImageConversion::LoadImage");
|
||||
@@ -48,4 +61,4 @@ public static class SpriteTools
|
||||
|
||||
return Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user