using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BigWalkLocalizationAPI.Api; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using ModSettingsMenu.Api; using ModSettingsMenu.Configuration; using ModSettingsMenu.Localization; using ModSettingsMenu.Runtime; using Rewired; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ModSettingsMenu")] [assembly: AssemblyDescription("Mod Settings Menu for Big Walk by Ice Box Studio")] [assembly: AssemblyCompany("Ice Box Studio")] [assembly: AssemblyProduct("ModSettingsMenu")] [assembly: AssemblyCopyright("Copyright © 2026 Ice Box Studio All rights reserved.")] [assembly: ComVisible(false)] [assembly: Guid("3ac874ec-c025-43fb-a507-b958bf6bc5a7")] [assembly: AssemblyFileVersion("1.1.1.0")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyVersion("1.1.1.0")] namespace ModSettingsMenu { [BepInPlugin("IceBoxStudio.BigWalk.ModSettingsMenu", "ModSettingsMenu", "1.1.1")] [BepInDependency("IceBoxStudio.BigWalk.LocalizationAPI", ">=1.1.0")] public class ModSettingsMenu : BasePlugin { private Harmony _harmony; internal static ManualLogSource Logger { get; private set; } public override void Load() { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown Logger = ((BasePlugin)this).Log; LocalizationApi.LanguageChanged += OnLanguageChanged; ModSettingsRegistry.RefreshRequested += RefreshMenus; bool flag = default(bool); try { Logger.LogInfo((object)"============================================="); ManualLogSource logger = Logger; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(1, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("ModSettingsMenu"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(I18n.Text("plugin.initializing")); } logger.LogInfo(val); ManualLogSource logger2 = Logger; val = new BepInExInfoLogInterpolatedStringHandler(54, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(I18n.Text("plugin.author_prefix")); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Ice Box Studio(https://steamcommunity.com/id/ibox666/)"); } logger2.LogInfo(val); ClassInjector.RegisterTypeInIl2Cpp(); _harmony = new Harmony("IceBoxStudio.BigWalk.ModSettingsMenu"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); ManualLogSource logger3 = Logger; val = new BepInExInfoLogInterpolatedStringHandler(1, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("ModSettingsMenu"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(I18n.Text("plugin.initialized")); } logger3.LogInfo(val); Logger.LogInfo((object)"============================================="); } catch (Exception ex) { ManualLogSource logger4 = Logger; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Failed to initialize Mod Settings Menu: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } logger4.LogError(val2); } } private static void OnLanguageChanged(string _) { RefreshMenus(); } private static void RefreshMenus() { ModSettingsMenuController.RefreshLocalizedText(); } } public static class PluginInfo { public const string PLUGIN_GUID = "IceBoxStudio.BigWalk.ModSettingsMenu"; public const string PLUGIN_NAME = "ModSettingsMenu"; public const string PLUGIN_VERSION = "1.1.1"; } } namespace ModSettingsMenu.Runtime { internal sealed class ConfigRows { private readonly Transform _content; private readonly GameObject _heading; private readonly GameObject _binary; private readonly GameObject _array; private readonly GameObject _slider; private readonly GameObject _button; private readonly GameObject _keybind; private readonly KeybindCapture _capture; private readonly ConfigTextEditor _textEditor = new ConfigTextEditor(); private readonly List _rows = new List(); private readonly List> _rowSelectables = new List>(); private string _pluginGuid; private Selectable _category; private Selectable _back; private GameObject _lastSelected; public bool IsEditingText => _textEditor.IsEditing; private Selectable FirstSelectable { get { if (_rowSelectables.Count <= 0) { return null; } return _rowSelectables[0][0]; } } private Selectable LastSelectable { get { if (_rowSelectables.Count <= 0) { return null; } return _rowSelectables[_rowSelectables.Count - 1][0]; } } public ConfigRows(Transform content, GameObject heading, GameObject binary, GameObject array, GameObject slider, GameObject button, GameObject keybind, KeybindCapture capture) { _content = content; _heading = heading; _binary = binary; _array = array; _slider = slider; _button = button; _keybind = keybind; _capture = capture; } public void Build(ModConfig mod) { Clear(); _lastSelected = null; if (mod == null) { _pluginGuid = null; return; } string gUID = mod.Info.Metadata.GUID; if (!string.Equals(gUID, _pluginGuid, StringComparison.OrdinalIgnoreCase)) { _pluginGuid = gUID; } ConfigEntryBase[] array = mod.ConfigFile.Values.OrderBy((ConfigEntryBase entry) => ModSettingsOrder.GetSectionOrder(mod, entry.Definition.Section)).ThenBy((ConfigEntryBase entry) => entry.Definition.Section, StringComparer.OrdinalIgnoreCase).ThenBy((ConfigEntryBase entry) => ModSettingsOrder.GetEntryOrder(mod, entry)) .ThenBy((ConfigEntryBase entry) => entry.Definition.Key, StringComparer.OrdinalIgnoreCase) .ToArray(); string text = null; int contentSize = 0; foreach (ConfigEntryBase val in array) { if (!string.Equals(text, val.Definition.Section, StringComparison.OrdinalIgnoreCase)) { text = val.Definition.Section; CreateHeading(LocalizationApi.GetConfigSection(text, mod.ConfigFile), contentSize++); } Create(val, contentSize++); } CreateReset(mod, contentSize++); WireRows(); SetContentSize(contentSize); if ((Object)(object)_category != (Object)null || (Object)(object)_back != (Object)null) { ConnectNavigation(_category, _back); } } public void Refresh(ModConfig mod) { Build(mod); } public void EnsureSelectionVisible() { EventSystem current = EventSystem.current; GameObject val = ((current != null) ? current.currentSelectedGameObject : null); if ((Object)(object)val == (Object)null || (Object)(object)val == (Object)(object)_lastSelected) { return; } _lastSelected = val; for (int i = 0; i < _rowSelectables.Count; i++) { List list = _rowSelectables[i]; for (int j = 0; j < list.Count; j++) { if ((Object)(object)list[j] != (Object)null && (Object)(object)((Component)list[j]).gameObject == (Object)(object)val) { ScrollToRow(i); return; } } } } public bool Update() { return _textEditor.Update(); } public void CommitText() { _textEditor.Commit(); } public bool CancelText() { return _textEditor.Cancel(); } public void Scroll(float delta) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Approximately(delta, 0f)) { return; } ScrollRect componentInParent = ((Component)_content).GetComponentInParent(); RectTransform component = ((Component)_content).GetComponent(); RectTransform val = ((componentInParent != null) ? componentInParent.viewport : null); if (!((Object)(object)componentInParent == (Object)null) && !((Object)(object)component == (Object)null) && !((Object)(object)val == (Object)null) && RectTransformUtility.RectangleContainsScreenPoint(val, new Vector2(Input.mousePosition.x, Input.mousePosition.y), (Camera)null)) { Rect rect = component.rect; float height = ((Rect)(ref rect)).height; rect = val.rect; float num = Mathf.Max(0f, height - ((Rect)(ref rect)).height); if (!(num <= 0f)) { Vector2 anchoredPosition = component.anchoredPosition; anchoredPosition.y = Mathf.Clamp(anchoredPosition.y - delta * 80f, 0f, num); component.anchoredPosition = anchoredPosition; } } } private void Clear() { _textEditor.Commit(); for (int i = 0; i < _rows.Count; i++) { if ((Object)(object)_rows[i] != (Object)null) { _rows[i].SetActive(false); Object.Destroy((Object)(object)_rows[i]); } } _rows.Clear(); _rowSelectables.Clear(); } private void Create(ConfigEntryBase entry, int index) { Type settingType = entry.SettingType; ConfigDescription description = entry.Description; AcceptableValueBase acceptable = ((description != null) ? description.AcceptableValues : null); IReadOnlyList values; double min; double max; if (settingType == typeof(bool)) { CreateBool(entry, index); } else if (settingType == typeof(KeyCode)) { CreateKeybind(entry, index); } else if (settingType.IsEnum || ConfigValues.TryGetAcceptableValues(acceptable, out values)) { CreateArray(entry, index); } else if (ConfigValues.TryGetNumericRange(acceptable, out min, out max) && ConfigValues.IsSliderType(settingType)) { CreateSlider(entry, index, min, max); } else { CreateInput(entry, index); } } private void CreateBool(ConfigEntryBase entry, int index) { GameObject val = New(_binary, index); Button left = ((Component)NativeUi.Require(val.transform, "GameObject/LeftOption")).GetComponent