diff --git a/MiraAPI/MiraApiPlugin.cs b/MiraAPI/MiraApiPlugin.cs index 74e972a..469ffd2 100644 --- a/MiraAPI/MiraApiPlugin.cs +++ b/MiraAPI/MiraApiPlugin.cs @@ -31,17 +31,6 @@ public partial class MiraApiPlugin : BasePlugin /// public static Color DefaultHeaderColor { get; } = new Color32(77, 77, 77, 255); - /// - /// Gets the name for the first custom category in the game options menu, if any. - /// - public static string CustomCategoryMenuNameOne { get; } = "Custom Category 1"; - - /// - /// Gets the name for the second custom category in the game options menu, if any. - /// - public static string CustomCategoryMenuNameTwo { get; } = "Custom Category 2"; - - private static MiraPluginManager? PluginManager { get; set; } internal Harmony Harmony { get; } = new(Id); diff --git a/MiraAPI/Patches/Options/GameSettingMenuPatches.cs b/MiraAPI/Patches/Options/GameSettingMenuPatches.cs index 72bf586..1a3e055 100644 --- a/MiraAPI/Patches/Options/GameSettingMenuPatches.cs +++ b/MiraAPI/Patches/Options/GameSettingMenuPatches.cs @@ -251,7 +251,7 @@ internal static class GameSettingMenuPatches __instance.ChangeTab(4, true); })); - _customOneButton.buttonText.text = MiraApiPlugin.CustomCategoryMenuNameOne; + _customOneButton.buttonText.text = SelectedMod != null ? SelectedMod.MiraPlugin.CustomOptionMenuNameOne : "Custom Category 1"; customPos.y += 0.5f; _customOneButton.transform.localPosition = customPos; _customOneButton.name = "CustomOneButton"; @@ -273,7 +273,7 @@ internal static class GameSettingMenuPatches __instance.ChangeTab(5, true); })); - _customTwoButton.buttonText.text = MiraApiPlugin.CustomCategoryMenuNameTwo; + _customTwoButton.buttonText.text = SelectedMod != null ? SelectedMod.MiraPlugin.CustomOptionMenuNameTwo : "Custom Category 2"; customPos.y += 0.5f; _customTwoButton.transform.localPosition = customPos; _customTwoButton.name = "CustomTwoButton"; @@ -416,6 +416,8 @@ internal static class GameSettingMenuPatches if (SelectedModIdx != 0) { + _customOneButton.buttonText.text = SelectedMod!.MiraPlugin.CustomOptionMenuNameOne; + _customTwoButton.buttonText.text = SelectedMod!.MiraPlugin.CustomOptionMenuNameTwo; var modHasRoles = SelectedMod!.InternalRoles.Count != 0; var modHasCustomOne = SelectedMod.InternalOptionGroups.Exists( x => x.ParentMenu == MenuCategory.CustomOne); diff --git a/MiraAPI/PluginLoading/IMiraPlugin.cs b/MiraAPI/PluginLoading/IMiraPlugin.cs index af3d3d5..8e2f2b6 100644 --- a/MiraAPI/PluginLoading/IMiraPlugin.cs +++ b/MiraAPI/PluginLoading/IMiraPlugin.cs @@ -12,6 +12,16 @@ public interface IMiraPlugin /// string OptionsTitleText { get; } + /// + /// Gets the name for the first custom category in the game options menu, if any. + /// + public virtual string CustomOptionMenuNameOne => "Custom Category 1"; + + /// + /// Gets the name for the second custom category in the game options menu, if any. + /// + public virtual string CustomOptionMenuNameTwo => "Custom Category 2"; + /// /// Gets the BepInEx configuration file for the plugin. ///