Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of TeleportMenu v1.0.3
Mods/TeleportMenu.dll
Decompiled 2 months agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using Il2CppScheduleOne.PlayerScripts; using MelonLoader; using MelonLoader.Utils; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using ScheduleITeleportMenu; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(Main), "Teleport Menu", "1.0.3", "MrTibbz", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("TeleportMenu")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("TeleportMenu")] [assembly: AssemblyTitle("TeleportMenu")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ScheduleITeleportMenu { public class Main : MelonMod { public class MenuSettings { public float windowX = 100f; public float windowY = 100f; public float windowWidth = 490f; public float windowHeight = 653f; public float bgColorR = 50f; public float bgColorG = 50f; public float bgColorB = 50f; public float windowOpacity = 1f; public float fontSize = 14f; } [Serializable] public struct TeleportData { public float x; public float y; public float z; public string name; public TeleportData(Vector3 position, string name) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) x = position.x; y = position.y; z = position.z; this.name = name; } public Vector3 ToVector3() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) return new Vector3(x, y, z); } } private bool showMenu = false; private int selectedTab = 0; private Vector3 teleportLocation = new Vector3(0f, 0f, 0f); private MenuSettings settings = new MenuSettings(); private string settingsFilePath; private Rect windowRect = new Rect(100f, 100f, 425f, 550f); private float fontSize; private float windowOpacity; private string teleportLocationFilePath = Path.Combine(MelonEnvironment.UserDataDirectory, "TeleportMenu/SavedTeleportLocation.json"); private float bgColorR = 50f; private float bgColorG = 50f; private float bgColorB = 50f; public override void OnUpdate() { if (Input.GetKeyDown((KeyCode)283)) { showMenu = !showMenu; } } public override void OnGUI() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (showMenu) { windowRect = GUI.Window(0, windowRect, WindowFunction.op_Implicit((Action<int>)WindowFunction), ""); } } public override void OnInitializeMelon() { settingsFilePath = Path.Combine(MelonEnvironment.UserDataDirectory, "TeleportMenu/TeleportMenuSettings.json"); EnsureDirectoryExists(); LoadSettings(); } private void WindowFunction(int windowID) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref windowRect)).width, 30f)); DrawTitleBar(); DrawBackground(new Rect(0f, 30f, ((Rect)(ref windowRect)).width, ((Rect)(ref windowRect)).height - 30f)); float num = (float)((double)((Rect)(ref windowRect)).width / 4.5); float num2 = (((Rect)(ref windowRect)).width - 4f * num) / 2f; DrawTabButton(new Rect(num2, 60f, num, 40f), "Properties", 0); DrawTabButton(new Rect(num2 + num, 60f, num, 40f), "Businesses", 1); DrawTabButton(new Rect(num2 + 2f * num, 60f, num, 40f), "Dealers", 2); DrawTabButton(new Rect(num2 + 3f * num, 60f, num, 40f), "Stores", 3); float num3 = 100f; DrawTabButton(new Rect(num2, num3, num, 40f), "World", 4); DrawTabButton(new Rect(num2 + num, num3, num, 40f), "Misc", 5); DrawTabButton(new Rect(num2 + 2f * num, num3, num, 40f), "Settings", 6); float yOffset = num3 + 50f; float num4 = 220f; float startX = (((Rect)(ref windowRect)).width - num4) / 2f; float num5 = 0f; if (selectedTab == 0) { num5 = ShowPropertiesTab(ref yOffset, startX, num4); } if (selectedTab == 1) { num5 = ShowBusinessesTab(ref yOffset, startX, num4); } if (selectedTab == 2) { num5 = ShowDealersTab(ref yOffset, startX, num4); } if (selectedTab == 3) { num5 = ShowStoresTab(ref yOffset, startX, num4); } if (selectedTab == 4) { num5 = ShowWorldTab(ref yOffset, startX, num4); } if (selectedTab == 5) { num5 = ShowMiscTab(ref yOffset, startX, num4); } if (selectedTab == 6) { num5 = ShowSettingsTab(ref yOffset, startX, num4); } } private void DrawTitleBar() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = (int)fontSize }; val.normal.textColor = Color.white; GUIStyle val2 = val; GUI.Box(new Rect(0f, 0f, ((Rect)(ref windowRect)).width, 30f), "Teleport Menu", val2); } private void DrawBackground(Rect rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0057: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(); val.normal.background = MakeTexture((int)settings.bgColorR, (int)settings.bgColorG, (int)settings.bgColorB, windowOpacity); val.border = new RectOffset(10, 10, 10, 10); GUIStyle val2 = val; GUI.Box(rect, "", val2); } private Texture2D MakeTexture(int r, int g, int b, float opacity) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(1, 1); val.SetPixel(0, 0, new Color((float)r / 255f, (float)g / 255f, (float)b / 255f, opacity)); val.Apply(); return val; } private void DrawTabButton(Rect rect, string label, int tabIndex) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.button) { fontSize = (int)fontSize }; val.normal.textColor = Color.white; val.hover.textColor = Color.cyan; val.alignment = (TextAnchor)4; GUIStyle val2 = val; if (selectedTab == tabIndex) { val2.normal.background = MakeTexture(0, 50, 150, 1f); } if (GUI.Button(rect, label, val2)) { selectedTab = tabIndex; } } private float ShowPropertiesTab(ref float yOffset, float startX, float buttonWidth) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) float num = 0f; num += AddTeleportButton(ref yOffset, startX, buttonWidth, "RV", new Vector3(14f, 0.9f, -77f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Motel", new Vector3(-66f, 1.6f, 83f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Sweatshop", new Vector3(-64f, 0.4f, 142f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Storage Unit", new Vector3(-5.1f, 1f, 103f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Bungalow", new Vector3(-168f, -2.7f, 114f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Barn", new Vector3(181f, 1f, -14f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Docks Warehouse", new Vector3(-81f, -1.5f, -59f)); return num + AddTeleportButton(ref yOffset, startX, buttonWidth, "Manor", new Vector3(163f, 11f, -71f)); } private float ShowBusinessesTab(ref float yOffset, float startX, float buttonWidth) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) float num = 0f; num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Laundromat", new Vector3(-22.5f, 1f, 25f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Post Office", new Vector3(47f, 1f, 5f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Car Wash", new Vector3(-8.5f, 1f, -19f)); return num + AddTeleportButton(ref yOffset, startX, buttonWidth, "Taco Ticklers", new Vector3(-30f, 1f, 62f)); } private float ShowDealersTab(ref float yOffset, float startX, float buttonWidth) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) float num = 0f; num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Benji Coleman", new Vector3(-67f, 1.6f, 88f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Molly Presley", new Vector3(-166f, -2.8f, 93f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Brad Crosby", new Vector3(2.6f, 1f, 83f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Jane Lucero", new Vector3(-27.4f, 0.9f, -82f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Wei Long", new Vector3(65f, 5f, -67f)); return num + AddTeleportButton(ref yOffset, startX, buttonWidth, "Leo Rivers", new Vector3(149f, 1.7f, 65f)); } private float ShowStoresTab(ref float yOffset, float startX, float buttonWidth) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) float num = 0f; num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Dan's Hardware", new Vector3(-21f, -3f, 137f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Handy Hank's", new Vector3(104f, 1f, 25f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Gas-Mart", new Vector3(-113f, -2.9f, 68f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Gas-Mart/Auto Shop", new Vector3(16f, 1f, -16.5f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Pawnshop", new Vector3(-61.3f, 1f, 53f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Shred Shack", new Vector3(-39f, -2.9f, 121f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Ray's Real Estate", new Vector3(81.5f, 1f, -7f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Blueball's Boutique", new Vector3(71f, 1f, -8f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Thrifty Threads", new Vector3(-22.5f, 1f, 12f)); return num + AddTeleportButton(ref yOffset, startX, buttonWidth, "Top Tattoo", new Vector3(-130f, -2.9f, 67.4f)); } private float ShowWorldTab(ref float yOffset, float startX, float buttonWidth) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) float num = 0f; num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Warehouse", new Vector3(-42f, -1.5f, 43f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Warehouse Inside", new Vector3(-42f, -1f, 38f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Casino", new Vector3(22.8f, 2f, 89f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Construction site", new Vector3(-130f, -3f, 97f)); num += AddTeleportButton(ref yOffset, startX, buttonWidth, "Water Front", new Vector3(51.5f, 1f, 95f)); return num + AddTeleportButton(ref yOffset, startX, buttonWidth, "Westville", new Vector3(-137.2f, -3f, 44f)); } private float ShowMiscTab(ref float yOffset, float startX, float buttonWidth) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) float result = 0f; if (GUI.Button(new Rect(startX, yOffset, buttonWidth, 40f), "Teleport to Location")) { TeleportToLocation(); } yOffset += 50f; GUI.Label(new Rect(startX, yOffset, 220f, 20f), "X:"); teleportLocation.x = GUI.HorizontalSlider(new Rect(startX + 30f, yOffset + 20f, 150f, 20f), teleportLocation.x, -200f, 200f); GUI.Label(new Rect(startX + 190f, yOffset + 20f, 50f, 20f), teleportLocation.x.ToString("F1")); yOffset += 50f; GUI.Label(new Rect(startX, yOffset, 220f, 20f), "Y:"); teleportLocation.y = GUI.HorizontalSlider(new Rect(startX + 30f, yOffset + 20f, 150f, 20f), teleportLocation.y, 0f, 100f); GUI.Label(new Rect(startX + 190f, yOffset + 20f, 50f, 20f), teleportLocation.y.ToString("F1")); yOffset += 50f; GUI.Label(new Rect(startX, yOffset, 220f, 20f), "Z:"); teleportLocation.z = GUI.HorizontalSlider(new Rect(startX + 30f, yOffset + 20f, 150f, 20f), teleportLocation.z, -200f, 200f); GUI.Label(new Rect(startX + 190f, yOffset + 20f, 50f, 20f), teleportLocation.z.ToString("F1")); yOffset += 50f; if (GUI.Button(new Rect(startX, yOffset, buttonWidth, 40f), "Save Location")) { SaveTeleportLocation(); } yOffset += 50f; if (GUI.Button(new Rect(startX, yOffset, buttonWidth, 40f), "Load Location")) { LoadTeleportLocation(); } yOffset += 50f; return result; } private float ShowSettingsTab(ref float yOffset, float startX, float buttonWidth) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) float num = 150f; float num2 = 250f; float num3 = num2 + num; float num4 = yOffset + 300f; GUI.Label(new Rect(30f, yOffset, num, 20f), "Window Width:"); ((Rect)(ref windowRect)).width = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), ((Rect)(ref windowRect)).width, 400f, 1000f); yOffset += 35f; GUI.Label(new Rect(30f, yOffset, num, 20f), "Window Height:"); ((Rect)(ref windowRect)).height = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), ((Rect)(ref windowRect)).height, 400f, 1000f); yOffset += 35f; GUI.Label(new Rect(30f, yOffset, num, 20f), "Window X Position:"); ((Rect)(ref windowRect)).x = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), ((Rect)(ref windowRect)).x, 0f, (float)Screen.width - ((Rect)(ref windowRect)).width); yOffset += 35f; GUI.Label(new Rect(30f, yOffset, num, 20f), "Window Y Position:"); ((Rect)(ref windowRect)).y = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), ((Rect)(ref windowRect)).y, 0f, (float)Screen.height - ((Rect)(ref windowRect)).height); yOffset += 55f; GUI.Label(new Rect(30f, yOffset, num, 20f), $"Background Red: {(int)settings.bgColorR}"); settings.bgColorR = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), settings.bgColorR, 0f, 255f); yOffset += 35f; GUI.Label(new Rect(30f, yOffset, num, 20f), $"Background Green: {(int)settings.bgColorG}"); settings.bgColorG = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), settings.bgColorG, 0f, 255f); yOffset += 35f; GUI.Label(new Rect(30f, yOffset, num, 20f), $"Background Blue: {(int)settings.bgColorB}"); settings.bgColorB = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), settings.bgColorB, 0f, 255f); yOffset += 55f; GUI.Label(new Rect(30f, yOffset, num, 20f), "Window Opacity:"); windowOpacity = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), windowOpacity, 0f, 1f); yOffset += 35f; GUI.Label(new Rect(30f, yOffset, num, 20f), "Font Size:"); fontSize = GUI.HorizontalSlider(new Rect(30f + num, yOffset, num2, 20f), fontSize, 10f, 30f); yOffset += 35f; if (GUI.Button(new Rect(startX, yOffset, num3 / 2f, 30f), "Save Settings")) { UpdateSettingsFromCurrent(); SaveSettings(); } yOffset += 40f; if (GUI.Button(new Rect(startX, yOffset, num3 / 2f, 30f), "Load Settings")) { LoadSettings(); } yOffset += 40f; if (GUI.Button(new Rect(startX, yOffset, num3 / 2f, 30f), "Reset to Default")) { ResetSettings(); } return yOffset; } private void ResetSettings() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) windowRect = new Rect(100f, 100f, 490f, 653f); windowOpacity = 1f; fontSize = 14f; settings.bgColorR = 50f; settings.bgColorG = 50f; settings.bgColorB = 50f; SaveSettings(); } private void SaveSettings() { string contents = JsonConvert.SerializeObject((object)settings, (Formatting)1); File.WriteAllText(settingsFilePath, contents); MelonLogger.Msg($"Settings saved: {settings.bgColorR}, {settings.bgColorG}, {settings.bgColorB}"); } private void LoadSettings() { if (File.Exists(settingsFilePath)) { string text = File.ReadAllText(settingsFilePath); settings = JsonConvert.DeserializeObject<MenuSettings>(text); fontSize = settings.fontSize; windowOpacity = settings.windowOpacity; MelonLogger.Msg($"Settings loaded: {settings.bgColorR}, {settings.bgColorG}, {settings.bgColorB}"); } else { fontSize = 14f; windowOpacity = 1f; MelonLogger.Msg("No settings file found, using defaults."); } ((Rect)(ref windowRect)).x = settings.windowX; ((Rect)(ref windowRect)).y = settings.windowY; ((Rect)(ref windowRect)).width = settings.windowWidth; ((Rect)(ref windowRect)).height = settings.windowHeight; settings.bgColorR = bgColorR; settings.bgColorG = bgColorG; settings.bgColorB = bgColorB; } private void UpdateSettingsFromCurrent() { settings.windowX = ((Rect)(ref windowRect)).x; settings.windowY = ((Rect)(ref windowRect)).y; settings.windowWidth = ((Rect)(ref windowRect)).width; settings.windowHeight = ((Rect)(ref windowRect)).height; bgColorR = settings.bgColorR; bgColorG = settings.bgColorG; bgColorB = settings.bgColorB; settings.fontSize = fontSize; settings.windowOpacity = windowOpacity; } private void EnsureDirectoryExists() { string directoryName = Path.GetDirectoryName(teleportLocationFilePath); if (!Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } } public void SaveTeleportLocation() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)Player.Local).transform.position; TeleportData teleportData = new TeleportData(position, "TeleportLocation"); string contents = JsonConvert.SerializeObject((object)teleportData, (Formatting)1); File.WriteAllText(teleportLocationFilePath, contents); MelonLogger.Msg($"Teleport location saved: {position}"); } public void LoadTeleportLocation() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (File.Exists(teleportLocationFilePath)) { string text = File.ReadAllText(teleportLocationFilePath); Vector3 val = JsonConvert.DeserializeObject<TeleportData>(text).ToVector3(); ((Component)Player.Local).transform.position = val; MelonLogger.Msg($"Teleported to saved location: {val}"); } else { MelonLogger.Warning("No saved teleport location found!"); } } private float AddTeleportButton(ref float yOffset, float startX, float buttonWidth, string label, Vector3 location) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (GUI.Button(new Rect(startX, yOffset, buttonWidth, 40f), label)) { TeleportToPresetLocation(location); } yOffset += 50f; return 50f; } private void TeleportToPresetLocation(Vector3 targetLocation) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.Local != (Object)null) { ((Component)Player.Local).transform.position = targetLocation; MelonLogger.Msg($"Teleported to {targetLocation}"); } } private void TeleportToLocation() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.Local != (Object)null) { ((Component)Player.Local).transform.position = teleportLocation; MelonLogger.Msg($"Teleported to {teleportLocation}"); } } } }