Merge branch 'dev' into commission

# Conflicts:
#	MiraAPI/Patches/Options/LobbyViewPanePatches.cs
This commit is contained in:
XtraCube committed 2025-05-18 15:56:09 -04:00
commit b8d24c28e1
6 files changed
+18 -5

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
[*.cs]
dotnet_diagnostic.CS1591.severity = none
@@ -175,7 +175,6 @@ public static class ModdedOptionsManager
/// </summary>
/// <param name="__originalMethod">The original setter method.</param>
/// <param name="value">The new object value.</param>
// ReSharper disable InconsistentNaming
public static void PropertySetterPatch(MethodBase __originalMethod, object value)
{
var attribute = OptionAttributes.First(pair => pair.Key.GetSetMethod() == __originalMethod).Value;
@@ -189,7 +188,6 @@ public static class ModdedOptionsManager
/// <param name="__result">The result of the property getter.</param>
/// <returns>False so the original getter gets skipped.</returns>
public static bool PropertyGetterPatch(MethodBase __originalMethod, ref object __result)
// ReSharper restore InconsistentNaming
{
var attribute = OptionAttributes.First(pair => pair.Key.GetGetMethod() == __originalMethod).Value;
__result = attribute.GetValue();
+2
View File
@@ -0,0 +1,2 @@
[*.cs]
dotnet_diagnostic.S125.severity = none
@@ -143,7 +143,7 @@ public static class LobbyViewPanePatches
}
var filteredGroups = SelectedMod.InternalOptionGroups
.Where(x => x.OptionableType == null && x.GroupVisible.Invoke());
.Where(x => x is { ShowInModifiersMenu: false, OptionableType: null } && x.GroupVisible.Invoke());
DrawOptions(__instance, filteredGroups);
return false;
}
+11
View File
@@ -2,8 +2,19 @@
namespace MiraAPI.PluginLoading;
/// <summary>
/// The interface that all Mira plugins must implement.
/// </summary>
public interface IMiraPlugin
{
/// <summary>
/// Gets the name to display on the options menu.
/// </summary>
string OptionsTitleText { get; }
/// <summary>
/// Gets the BepInEx configuration file for the plugin.
/// </summary>
/// <returns>The BepInEx configuration file for the plugin.</returns>
public ConfigFile GetConfigFile();
}
+2 -2
View File
@@ -209,7 +209,7 @@ public sealed class MiraPluginManager
ModdedOptionsManager.RegisterAttributeOption(type, attribute, property, pluginInfo);
}
foreach (var field in type.GetFields().Where(f=>f.FieldType.IsAssignableTo(typeof(IModdedOption))))
foreach (var field in type.GetFields().Where(f => f.FieldType.IsAssignableTo(typeof(IModdedOption))))
{
Logger<MiraApiPlugin>.Error($"{field.Name} is a field, not a property. Use properties for options.");
}
@@ -280,7 +280,7 @@ public sealed class MiraPluginManager
PaletteManager.CustomColors.Add(color);
}
foreach (var field in type.GetFields().Where(f=>f.FieldType.IsAssignableTo(typeof(CustomColor))))
foreach (var field in type.GetFields().Where(f => f.FieldType.IsAssignableTo(typeof(CustomColor))))
{
Logger<MiraApiPlugin>.Error($"{field.Name} is a field, not a property. Use properties for colors.");
}