From 98dd5ca05675dc0f8c0aa8a480a617e55af23e80 Mon Sep 17 00:00:00 2001
From: XtraCube <72575280+XtraCube@users.noreply.github.com>
Date: Sun, 18 May 2025 12:40:40 -0400
Subject: [PATCH] fix more warnings
---
MiraAPI/GameModes/.editorconfig | 2 ++
MiraAPI/GameOptions/ModdedOptionsManager.cs | 2 --
MiraAPI/Patches/GameModes/.editorconfig | 2 ++
MiraAPI/PluginLoading/IMiraPlugin.cs | 11 +++++++++++
MiraAPI/PluginLoading/MiraPluginManager.cs | 4 ++--
5 files changed, 17 insertions(+), 4 deletions(-)
create mode 100644 MiraAPI/GameModes/.editorconfig
create mode 100644 MiraAPI/Patches/GameModes/.editorconfig
diff --git a/MiraAPI/GameModes/.editorconfig b/MiraAPI/GameModes/.editorconfig
new file mode 100644
index 0000000..948715b
--- /dev/null
+++ b/MiraAPI/GameModes/.editorconfig
@@ -0,0 +1,2 @@
+[*.cs]
+dotnet_diagnostic.CS1591.severity = none
\ No newline at end of file
diff --git a/MiraAPI/GameOptions/ModdedOptionsManager.cs b/MiraAPI/GameOptions/ModdedOptionsManager.cs
index 4d28884..c3e7e22 100644
--- a/MiraAPI/GameOptions/ModdedOptionsManager.cs
+++ b/MiraAPI/GameOptions/ModdedOptionsManager.cs
@@ -175,7 +175,6 @@ public static class ModdedOptionsManager
///
/// The original setter method.
/// The new object value.
- // 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
/// The result of the property getter.
/// False so the original getter gets skipped.
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();
diff --git a/MiraAPI/Patches/GameModes/.editorconfig b/MiraAPI/Patches/GameModes/.editorconfig
new file mode 100644
index 0000000..d825cc9
--- /dev/null
+++ b/MiraAPI/Patches/GameModes/.editorconfig
@@ -0,0 +1,2 @@
+[*.cs]
+dotnet_diagnostic.S125.severity = none
\ No newline at end of file
diff --git a/MiraAPI/PluginLoading/IMiraPlugin.cs b/MiraAPI/PluginLoading/IMiraPlugin.cs
index 07928da..af3d3d5 100644
--- a/MiraAPI/PluginLoading/IMiraPlugin.cs
+++ b/MiraAPI/PluginLoading/IMiraPlugin.cs
@@ -2,8 +2,19 @@
namespace MiraAPI.PluginLoading;
+///
+/// The interface that all Mira plugins must implement.
+///
public interface IMiraPlugin
{
+ ///
+ /// Gets the name to display on the options menu.
+ ///
string OptionsTitleText { get; }
+
+ ///
+ /// Gets the BepInEx configuration file for the plugin.
+ ///
+ /// The BepInEx configuration file for the plugin.
public ConfigFile GetConfigFile();
}
diff --git a/MiraAPI/PluginLoading/MiraPluginManager.cs b/MiraAPI/PluginLoading/MiraPluginManager.cs
index c68c8ce..7ae2e12 100644
--- a/MiraAPI/PluginLoading/MiraPluginManager.cs
+++ b/MiraAPI/PluginLoading/MiraPluginManager.cs
@@ -183,7 +183,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.Error($"{field.Name} is a field, not a property. Use properties for options.");
}
@@ -254,7 +254,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.Error($"{field.Name} is a field, not a property. Use properties for colors.");
}