using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("REPOJP")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("zabuMod")] [assembly: AssemblyTitle("zabuMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace REPOJP.HideUnusedButtons { [BepInPlugin("REPOJP.HideUnusedButtons", "HideUnusedButtons", "4.0.0")] public class HideUnusedButtonsPlugin : BaseUnityPlugin { public const string PluginGuid = "REPOJP.HideUnusedButtons"; public const string PluginName = "HideUnusedButtons"; public const string PluginVersion = "4.0.0"; internal static ManualLogSource Log; private Harmony harmony; internal static ConfigEntry Enabled; internal static ConfigEntry HideMainMenuTutorialButton; internal static ConfigEntry DisableMainMenuTutorialEvent; internal static ConfigEntry HideEscapeQuitGameButton; internal static ConfigEntry DisableEscapeQuitGameEvent; internal static ConfigEntry LogBlockedActions; private void Awake() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown try { ((Component)this).transform.parent = null; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Log = ((BaseUnityPlugin)this).Logger; BindConfig(); harmony = new Harmony("REPOJP.HideUnusedButtons"); harmony.PatchAll(); Log.LogInfo((object)"HideUnusedButtons loaded. Version=4.0.0"); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Failure: Awake\n" + ex)); } } private void OnDestroy() { try { if (harmony != null) { harmony.UnpatchSelf(); harmony = null; } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Failure: OnDestroy\n" + ex)); } } private void BindConfig() { Enabled = ((BaseUnityPlugin)this).Config.Bind("General", "Enabled", true, "Enables this mod.このMODを有効化します。"); HideMainMenuTutorialButton = ((BaseUnityPlugin)this).Config.Bind("Main Menu Tutorial", "HideTutorialButton", true, "Hides the Tutorial button from the main menu.メインメニューのTutorialボタンを非表示にします。"); DisableMainMenuTutorialEvent = ((BaseUnityPlugin)this).Config.Bind("Main Menu Tutorial", "DisableTutorialButtonEvent", true, "Blocks the Tutorial button event even if it is called directly.Tutorialボタン処理が直接呼ばれてもチュートリアル開始をブロックします。"); HideEscapeQuitGameButton = ((BaseUnityPlugin)this).Config.Bind("Escape Menu Quit Game", "HideQuitGameButton", true, "Hides the Quit Game button from the Escape menu.Escape画面のQuit Gameボタンを非表示にします。"); DisableEscapeQuitGameEvent = ((BaseUnityPlugin)this).Config.Bind("Escape Menu Quit Game", "DisableQuitGameButtonEvent", true, "Blocks the Quit Game button event from the Escape menu even if it is called directly.Escape画面のQuit Game処理が直接呼ばれてもゲーム終了をブロックします。"); LogBlockedActions = ((BaseUnityPlugin)this).Config.Bind("Debug", "LogBlockedActions", false, "Logs when a blocked button event is called.ブロックしたボタン処理が呼ばれた時にログを出力します。"); } internal static bool IsEnabled() { return Enabled != null && Enabled.Value; } internal static bool ShouldLogBlockedActions() { return LogBlockedActions != null && LogBlockedActions.Value; } internal static void WriteBlockedLog(string message) { if (ShouldLogBlockedActions() && Log != null) { Log.LogInfo((object)message); } } } internal static class MenuButtonUtility { private static readonly FieldInfo MenuButtonDisabledField = AccessTools.Field(typeof(MenuButton), "disabled"); internal static void HideButton(MenuButton menuButton) { try { if (!((Object)(object)menuButton == (Object)null) && !((Object)(object)((Component)menuButton).gameObject == (Object)null)) { if (MenuButtonDisabledField != null) { MenuButtonDisabledField.SetValue(menuButton, true); } Button component = ((Component)menuButton).GetComponent