use exception for invalid resource name in spritetools

This commit is contained in:
XtraCube committed 2025-01-02 11:16:31 -05:00
1 parent 204d1fe123
commit 96f108ab92
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ public static class ModdedOptionsManager
{
if (Activator.CreateInstance(type) is not AbstractOptionGroup group)
{
Logger<MiraApiPlugin>.Error($"Failed to create group from {type.Name}");
Logger<MiraApiPlugin>.Error($"Skipping option group {type.Name}. Does not inherit AbstractOptionGroup.");
return false;
}
+1 -1
View File
@@ -17,7 +17,7 @@ internal static class CustomButtonManager
{
if (!typeof(CustomActionButton).IsAssignableFrom(buttonType))
{
Logger<MiraApiPlugin>.Error($"{buttonType?.Name} does not inherit from CustomActionButton.");
Logger<MiraApiPlugin>.Error($"Skipping button {buttonType.Name}. Does not inherit CustomActionButton!");
return;
}
+1 -1
View File
@@ -28,7 +28,7 @@ public static class SpriteTools
}
else
{
Logger<MiraApiPlugin>.Error($"Resource not found: {resourcePath}\nReturning empty sprite!");
throw new ArgumentException($"Resource not found: {resourcePath}");
}
return Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f), pixelsPerUnit);
+1 -1
View File
@@ -97,7 +97,7 @@ public static class Extensions
if (length > chunkSize)
{
Logger<MiraApiPlugin>.Error($"NetData length is greater than chunk size: {length} > {chunkSize}");
Logger<MiraApiPlugin>.Info($"NetData length is greater than chunk size: {length} > {chunkSize}");
continue;
}