skip abstract types correctly

This commit is contained in:
Az committed 2026-11-16 01:17:52 -05:00
1 parent f37e354d32
commit 16999684eb
9 files changed
+10 -16

No files matched your search

+1 -6
View File
@@ -17,12 +17,7 @@ public static class GameOverManager
internal static bool RegisterGameOver(Type type, in MiraPluginManager.RegistrationContext _)
{
if (!typeof(CustomGameOver).IsAssignableFrom(type))
{
return false;
}
if (type.IsAbstract)
if (type.IsAbstract || !typeof(CustomGameOver).IsAssignableFrom(type))
{
return false;
}
+1 -1
View File
@@ -21,7 +21,7 @@ public static class CustomGameModeManager
internal static bool RegisterGameMode(Type type, in MiraPluginManager.RegistrationContext context)
{
if (!typeof(AbstractGameMode).IsAssignableFrom(type))
if (type.IsAbstract || !typeof(AbstractGameMode).IsAssignableFrom(type))
{
return false;
}
@@ -58,8 +58,7 @@ public class ModdedEnumOptionAttribute(string? title, Type enumType, string idPr
/// <inheritdoc />
public override void SetValue(object value)
{
var opt = HolderOption as ModdedEnumOption;
opt?.SetValue((int)value);
(HolderOption as ModdedEnumOption)?.SetValue((int)value);
}
/// <inheritdoc />
+1 -1
View File
@@ -73,7 +73,7 @@ public static class ModdedOptionsManager
internal static bool RegisterGroup(Type type, in MiraPluginManager.RegistrationContext context)
{
if (!type.IsAssignableTo(typeof(AbstractOptionGroup)))
if (type.IsAbstract || !type.IsAssignableTo(typeof(AbstractOptionGroup)))
{
return false;
}
+1 -1
View File
@@ -33,7 +33,7 @@ public static class CustomButtonManager
internal static bool RegisterButton(Type type, in MiraPluginManager.RegistrationContext context)
{
if (!type.IsAssignableTo(typeof(CustomActionButton)) || Activator.CreateInstance(type) is not CustomActionButton button)
if (type.IsAbstract || !type.IsAssignableTo(typeof(CustomActionButton)) || Activator.CreateInstance(type) is not CustomActionButton button)
{
return false;
}
@@ -19,7 +19,7 @@ public static class LocalSettingsManager
internal static bool RegisterLocalTabs(Type type, in MiraPluginManager.RegistrationContext context)
{
if (!type.IsAssignableTo(typeof(LocalSettingsTab)))
if (type.IsAbstract || !type.IsAssignableTo(typeof(LocalSettingsTab)))
{
return false;
}
@@ -25,7 +25,7 @@ public static class MeetingButtonManager
internal static bool RegisterTargetedMeetingButton(Type type, in MiraPluginManager.RegistrationContext context)
{
if (!typeof(TargetedMeetingButton).IsAssignableFrom(type))
if (type.IsAbstract || !typeof(TargetedMeetingButton).IsAssignableFrom(type))
{
return false;
}
@@ -40,7 +40,7 @@ public static class MeetingButtonManager
internal static bool RegisterMeetingButton(Type type, in MiraPluginManager.RegistrationContext context)
{
if (!typeof(MeetingActionButton).IsAssignableFrom(type))
if (type.IsAbstract || !typeof(MeetingActionButton).IsAssignableFrom(type))
{
return false;
}
+1 -1
View File
@@ -69,7 +69,7 @@ public static class ModifierManager
internal static bool RegisterModifier(Type type, in MiraPluginManager.RegistrationContext context)
{
if (!typeof(BaseModifier).IsAssignableFrom(type))
if (type.IsAbstract || !typeof(BaseModifier).IsAssignableFrom(type))
{
return false;
}
+1 -1
View File
@@ -121,7 +121,7 @@ public static class CustomRoleManager
internal static bool RegisterRole(Type type, in MiraPluginManager.RegistrationContext context)
{
if (!(typeof(RoleBehaviour).IsAssignableFrom(type) && typeof(ICustomRole).IsAssignableFrom(type)))
if (type.IsAbstract || !(typeof(RoleBehaviour).IsAssignableFrom(type) && typeof(ICustomRole).IsAssignableFrom(type)))
{
return false;
}