using System;
using System.Collections.Generic;
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.Logging;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.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 SRHM
{
public enum AllItems : byte
{
None = byte.MaxValue,
Flashlight = 0,
Saw = 1,
DoorKey = 2,
GasCan = 3,
CabinetKey = 4,
VanTire = 5,
RubiksCube = 6,
Aminaking = 7,
BowlingBall = 8,
IDCard = 9,
ThrowableBottle = 10,
Airhorn = 11,
Bounty = 12,
Zorran = 13,
Recorder = 14,
Guitar = 15,
Violin = 16,
Accordion = 17,
PlushieZorti = 18,
JimmysKey = 19,
MudurHeart = 20,
BoxingGloves = 21,
GrapplingHook = 22,
Snowball = 23,
Boomerang = 24,
ZubbidiRaki = 25,
WaterGun = 26,
AminakuCrown = 27,
ThrowableCheese = 28,
ThrowableCupcake = 29,
FlareGun = 30,
FlareShell = 31,
Plank = 32,
Sword = 33,
CellKeys = 34,
Ak47 = 35
}
public struct DebugColliderInfo
{
public GameObject debugPrimitive;
public Collider originalCollider;
public Transform originalTransform;
}
[BepInPlugin("krw.mods.srhm", "Speedrun Routing Helper Mod (SRHM)", "1.0.2")]
public class Plugin : BaseUnityPlugin
{
public struct LocationOfInterest
{
public string Name;
public Vector3 Coordinates;
public LocationOfInterest(string name, Vector3 coords)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
Name = name;
Coordinates = coords;
}
}
internal static ManualLogSource Log;
private AllItems[] selectedItems;
private bool[] dropdownOpen;
private Rect windowRect = new Rect(10f, 40f, 300f, 607f);
private Rect[] dropdownRects;
private Rect colorWindowRect = new Rect(320f, 300f, 250f, 218f);
private bool colorWindowOpen;
private const int MAX_INVENTORY_SLOTS = 5;
private bool showUI;
private bool flyingEnabled;
private bool refreshInventory;
private float inventoryRefreshTimer;
private float currentTimescale = 1f;
private string timescaleInput = "1.0";
private bool showCollisions;
private string statusText;
private bool _showCrosshair;
private bool _showCrosshairSettingsWindow;
private Rect _crosshairSettingsWindowRect = new Rect(320f, 10f, 250f, 282f);
private bool _crosshairSettingsWindowWasOpen;
private float _crosshairSize = 2f;
private Color _crosshairColor = Color.white;
private int _crosshairType;
private bool _debugModeEnabled;
private GameObject _rollableSnowball;
private float _snowballSize = 1f;
private string _snowballSizeInput = "1.0";
private Vector3 _basketballCourtCoordinates = new Vector3(30f, 10f, 30f);
private string _jimmyKeypadComboValue = "";
private bool _jimmyKeypadFound;
private string _factoryKeypadComboValue = "";
private bool _factoryKeypadFound;
private string _ritualKeypadComboValue = "";
private bool _ritualKeypadFound;
private string _jailKeypadComboValue = "";
private bool _jailKeypadFound;
private string _coloredKeypadComboValue = "";
private bool _coloredKeypadFound;
private Rect _keypadWindowRect = new Rect((float)(Screen.width - 260 - 250 - 10), 10f, 250f, 100f);
private bool _showKeypadWindow;
private const float KEYPAD_LINE_HEIGHT = 25f;
private const int MAX_KEYPAD_ROWS = 2;
private const float KEYPAD_WINDOW_BASE_HEIGHT = 0f;
private List<DebugColliderInfo> debugColliders = new List<DebugColliderInfo>();
private Material debugMaterial;
private Color debugColor = Color.green;
private float debugTransparency = 0.3f;
private bool _showMapLoaderWindow;
private Rect _mapLoaderWindowRect = new Rect(320f, 525f, 250f, 126f);
private bool _colorWindowWasOpen;
private bool _mapLoaderWindowWasOpen;
private bool _showPlayerPosition;
private Rect _playerPositionWindowRect = new Rect((float)(Screen.width / 2 - 150), 10f, 300f, 50f);
private bool _showSnowballWindow;
private Rect _snowballWindowRect = new Rect(10f, 657f, 250f, 120f);
private bool _snowballWindowWasOpen;
private bool _showTeleportationWindow;
private Rect _teleportationWindowRect = new Rect((float)(Screen.width - 260), 10f, 250f, 185f);
private bool _teleportationWindowWasOpen;
private string _teleportXInput = "0";
private string _teleportYInput = "0";
private string _teleportZInput = "0";
private readonly Dictionary<string, List<LocationOfInterest>> _locationsOfInterest = new Dictionary<string, List<LocationOfInterest>>
{
{
"ZortaganeMapOlan",
new List<LocationOfInterest>
{
new LocationOfInterest("Spawn", new Vector3(25f, 0f, 5f)),
new LocationOfInterest("Exit Gate", new Vector3(5f, 0f, 10f)),
new LocationOfInterest("Zmotie", new Vector3(-30f, 0f, 3f)),
new LocationOfInterest("Top Floor Gate", new Vector3(-40f, 0f, -28f)),
new LocationOfInterest("Arcadia", new Vector3(-50f, 0f, 0f)),
new LocationOfInterest("Jimmy's Room", new Vector3(-50f, 0f, 18f)),
new LocationOfInterest("Aminaking", new Vector3(-40f, 0f, 25f)),
new LocationOfInterest("Top Floor", new Vector3(0f, 0f, 300f)),
new LocationOfInterest("Locked Room", new Vector3(-12f, 0f, 305f)),
new LocationOfInterest("Vent Entrance", new Vector3(-10f, 4.5f, 329f)),
new LocationOfInterest("Zorty", new Vector3(0f, 0f, 332f)),
new LocationOfInterest("Elevator Room", new Vector3(10f, 0f, 305f)),
new LocationOfInterest("Secret Hatch Room", new Vector3(24f, -9f, 315f)),
new LocationOfInterest("Garage", new Vector3(0f, 0f, -652f))
}
},
{
"YozgatMapOlan",
new List<LocationOfInterest>
{
new LocationOfInterest("Not done yet :)", new Vector3(150f, 30f, 0f))
}
},
{
"SeagateMapOlan",
new List<LocationOfInterest>
{
new LocationOfInterest("I haven't played episode 3 yet :)", new Vector3(150f, 30f, 0f))
}
}
};
private Vector2 _scrollPositionTeleportation = Vector2.zero;
private string _currentSceneName = "";
private const float TELEPORT_MENU_MIN_HEIGHT = 150f;
private const float TELEPORT_MENU_LINE_HEIGHT = 25f;
private HashSet<AllItems> _availableItems = new HashSet<AllItems>();
private void Awake()
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: 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)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Expected O, but got Unknown
//IL_021a: Unknown result type (might be due to invalid IL or missing references)
Log = ((BaseUnityPlugin)this).Logger;
Log.LogInfo((object)"Plugin Speedrun Routing Helper Mod (SRHM) is loaded!");
statusText = "SRHM Legacy 1.0.2 by KRW CLASSIC";
_jimmyKeypadComboValue = "";
_keypadWindowRect = new Rect((float)(Screen.width - 260 - 250 - 10), 10f, 250f, 100f);
SceneManager.activeSceneChanged += OnActiveSceneChanged;
selectedItems = new AllItems[5];
dropdownOpen = new bool[5];
dropdownRects = (Rect[])(object)new Rect[5];
for (int i = 0; i < 5; i++)
{
dropdownRects[i] = new Rect(((Rect)(ref windowRect)).xMax + 10f, ((Rect)(ref windowRect)).y + (float)(i * 30), 200f, 200f);
}
if ((Object)(object)PlayerController.PlayerClient.Value != (Object)null)
{
UpdateAvailableItems();
}
Shader val = Shader.Find("HDRP/Lit");
if ((Object)(object)val != (Object)null)
{
debugMaterial = new Material(val);
debugMaterial.SetOverrideTag("RenderType", "Transparent");
debugMaterial.SetInt("_SurfaceType", 1);
debugMaterial.SetInt("_BlendMode", 0);
debugMaterial.SetInt("_SrcBlend", 5);
debugMaterial.SetInt("_DstBlend", 10);
debugMaterial.SetInt("_ZWrite", 0);
debugMaterial.DisableKeyword("_ALPHATEST_ON");
debugMaterial.EnableKeyword("_ALPHABLEND_ON");
debugMaterial.DisableKeyword("_ALPHAPREMULTIPLY_ON");
debugMaterial.renderQueue = 3000;
debugMaterial.SetInt("_AlphaCutoffEnable", 0);
debugMaterial.SetInt("_ZTestTransparent", 4);
debugMaterial.SetColor("_BaseColor", new Color(debugColor.r, debugColor.g, debugColor.b, debugTransparency));
Log.LogInfo((object)"Initialized debug material with HDRP/Lit (manual transparent settings) as main option.");
}
else
{
Log.LogError((object)"HDRP/Lit shader not found. Collision visualization will not work.");
}
}
private void Update()
{
UpdateUIState();
HandleFlyingInput();
UpdateSnowballState();
if (Input.GetKeyDown((KeyCode)287))
{
_debugModeEnabled = !_debugModeEnabled;
Log.LogInfo((object)$"Debug Mode toggled: {_debugModeEnabled}");
}
if (showUI)
{
inventoryRefreshTimer += Time.deltaTime;
if (inventoryRefreshTimer >= 1f)
{
refreshInventory = true;
inventoryRefreshTimer = 0f;
}
}
else
{
inventoryRefreshTimer = 0f;
}
if (showCollisions)
{
RefreshDebugColliders();
}
}
private void OnGUI()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Expected O, but got Unknown
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Expected O, but got Unknown
//IL_0143: 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_0161: 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)
//IL_0181: Expected O, but got Unknown
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ba: Expected O, but got Unknown
//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Expected O, but got Unknown
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Expected O, but got Unknown
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: Unknown result type (might be due to invalid IL or missing references)
//IL_0226: Unknown result type (might be due to invalid IL or missing references)
//IL_023a: Expected O, but got Unknown
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_023a: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Expected O, but got Unknown
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0201: Unknown result type (might be due to invalid IL or missing references)
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_025f: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Expected O, but got Unknown
//IL_026e: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginArea(new Rect(10f, 10f, 300f, 30f));
GUILayout.Label(statusText, Array.Empty<GUILayoutOption>());
GUILayout.EndArea();
if (_showCrosshair)
{
DrawCrosshair();
}
if (showUI)
{
windowRect = GUILayout.Window(0, windowRect, new WindowFunction(ModWindow), "Speedrun Routing Helper Mod", Array.Empty<GUILayoutOption>());
for (int i = 0; i < selectedItems.Length; i++)
{
int slotIndexCopy = i;
if (dropdownOpen[i])
{
dropdownRects[i] = GUILayout.Window(i + 1, dropdownRects[i], (WindowFunction)delegate(int id)
{
DropdownWindow(id, slotIndexCopy);
}, "Select Item", Array.Empty<GUILayoutOption>());
}
}
if (colorWindowOpen)
{
colorWindowRect = GUILayout.Window(selectedItems.Length + 1, colorWindowRect, new WindowFunction(ColorWindow), "Collision Display Settings", Array.Empty<GUILayoutOption>());
}
}
if (_showKeypadWindow)
{
_keypadWindowRect = GUILayout.Window(selectedItems.Length + 2, _keypadWindowRect, new WindowFunction(KeypadComboWindow), "Keypad Codes", Array.Empty<GUILayoutOption>());
}
if (_showMapLoaderWindow)
{
_mapLoaderWindowRect = GUILayout.Window(selectedItems.Length + 3, _mapLoaderWindowRect, new WindowFunction(MapLoaderWindow), "Map Loader", Array.Empty<GUILayoutOption>());
}
if (_showPlayerPosition)
{
_playerPositionWindowRect = GUILayout.Window(selectedItems.Length + 4, _playerPositionWindowRect, new WindowFunction(PlayerPositionWindow), "Player Position", Array.Empty<GUILayoutOption>());
}
if (showUI && (Object)(object)_rollableSnowball != (Object)null)
{
_snowballWindowRect = GUILayout.Window(selectedItems.Length + 5, _snowballWindowRect, new WindowFunction(SnowballWindow), "Snowball Options", Array.Empty<GUILayoutOption>());
}
if (_showTeleportationWindow)
{
_teleportationWindowRect = GUILayout.Window(selectedItems.Length + 6, _teleportationWindowRect, new WindowFunction(TeleportationWindow), "Teleportation Menu", Array.Empty<GUILayoutOption>());
}
if (_showCrosshairSettingsWindow)
{
_crosshairSettingsWindowRect = GUILayout.Window(selectedItems.Length + 7, _crosshairSettingsWindowRect, new WindowFunction(CrosshairSettingsWindow), "Crosshair Settings", Array.Empty<GUILayoutOption>());
}
if (_debugModeEnabled)
{
DrawWindowPositions();
}
}
private void ModWindow(int windowID)
{
//IL_0387: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < selectedItems.Length; i++)
{
GUILayout.Space(10f);
GUILayout.Label($"Slot {i + 1}:", Array.Empty<GUILayoutOption>());
if (!GUILayout.Button(selectedItems[i].ToString(), Array.Empty<GUILayoutOption>()))
{
continue;
}
for (int j = 0; j < dropdownOpen.Length; j++)
{
if (i != j)
{
dropdownOpen[j] = false;
}
}
dropdownOpen[i] = !dropdownOpen[i];
}
GUILayout.Space(20f);
GUILayout.Label("Timescale:", Array.Empty<GUILayoutOption>());
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
float num = Mathf.Log(0.01f);
float num2 = Mathf.Log(100f);
float num3 = Mathf.Log(currentTimescale);
float num4 = GUILayout.HorizontalSlider(num3, num, num2, Array.Empty<GUILayoutOption>());
if (num4 != num3)
{
currentTimescale = Mathf.Exp(num4);
timescaleInput = currentTimescale.ToString("F2");
Time.timeScale = currentTimescale;
}
string text = GUILayout.TextField(timescaleInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
if (text != timescaleInput)
{
timescaleInput = text;
if (float.TryParse(timescaleInput, out var result))
{
currentTimescale = Mathf.Clamp(result, 0.01f, 100f);
Time.timeScale = currentTimescale;
}
}
GUILayout.EndHorizontal();
GUILayout.Space(10f);
bool flag = GUILayout.Toggle(_showKeypadWindow, "Show Keypad Codes", Array.Empty<GUILayoutOption>());
if (flag != _showKeypadWindow)
{
_showKeypadWindow = flag;
}
GUILayout.Space(10f);
bool flag2 = GUILayout.Toggle(_showPlayerPosition, "Show Player Position", Array.Empty<GUILayoutOption>());
if (flag2 != _showPlayerPosition)
{
_showPlayerPosition = flag2;
}
GUILayout.Space(10f);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
bool flag3 = GUILayout.Toggle(_showCrosshair, "Show Crosshair", Array.Empty<GUILayoutOption>());
if (flag3 != _showCrosshair)
{
_showCrosshair = flag3;
}
if (GUILayout.Button(_showCrosshairSettingsWindow ? "Hide Crosshair Settings" : "Show Crosshair Settings", Array.Empty<GUILayoutOption>()))
{
_showCrosshairSettingsWindow = !_showCrosshairSettingsWindow;
}
GUILayout.EndHorizontal();
GUILayout.Space(10f);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
bool flag4 = GUILayout.Toggle(showCollisions, "Show Colliders", Array.Empty<GUILayoutOption>());
if (flag4 != showCollisions)
{
showCollisions = flag4;
SetCollisionVisualizationEnabled(showCollisions);
}
if (GUILayout.Button(colorWindowOpen ? "Hide Color Settings" : "Show Color Settings", Array.Empty<GUILayoutOption>()))
{
colorWindowOpen = !colorWindowOpen;
}
GUILayout.EndHorizontal();
GUILayout.Space(10f);
GUILayout.Space(10f);
if (GUILayout.Button(_showMapLoaderWindow ? "Hide Map Loader" : "Show Map Loader", Array.Empty<GUILayoutOption>()))
{
_showMapLoaderWindow = !_showMapLoaderWindow;
}
GUILayout.Space(10f);
if (GUILayout.Button(_showTeleportationWindow ? "Hide Teleportation Menu" : "Show Teleportation Menu", Array.Empty<GUILayoutOption>()))
{
_showTeleportationWindow = !_showTeleportationWindow;
if (_showTeleportationWindow)
{
UpdateTeleportationWindowHeight();
}
}
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void DropdownWindow(int windowID, int slotIndex)
{
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
List<string> list = new List<string>();
foreach (AllItems value in Enum.GetValues(typeof(AllItems)))
{
if (_availableItems.Contains(value))
{
list.Add(value.ToString());
}
}
list.Remove(AllItems.None.ToString());
list.Insert(0, AllItems.None.ToString());
float num = list.Count * 25;
((Rect)(ref dropdownRects[slotIndex])).height = num + 30f;
int num2 = list.IndexOf(selectedItems[slotIndex].ToString());
int num3 = GUILayout.SelectionGrid(num2, list.ToArray(), 1, Array.Empty<GUILayoutOption>());
if (num3 != num2)
{
AllItems allItems = (AllItems)Enum.Parse(typeof(AllItems), list[num3]);
selectedItems[slotIndex] = allItems;
AddItemToPlayer(slotIndex, selectedItems[slotIndex]);
dropdownOpen[slotIndex] = false;
}
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void ColorWindow(int windowID)
{
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: 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)
GUILayout.Label("Collision Color:", Array.Empty<GUILayoutOption>());
Color val = default(Color);
((Color)(ref val))..ctor(GUILayout.HorizontalSlider(debugColor.r, 0f, 1f, Array.Empty<GUILayoutOption>()), GUILayout.HorizontalSlider(debugColor.g, 0f, 1f, Array.Empty<GUILayoutOption>()), GUILayout.HorizontalSlider(debugColor.b, 0f, 1f, Array.Empty<GUILayoutOption>()));
GUILayout.Label($"R: {debugColor.r:F2}", Array.Empty<GUILayoutOption>());
GUILayout.Label($"G: {debugColor.g:F2}", Array.Empty<GUILayoutOption>());
GUILayout.Label($"B: {debugColor.b:F2}", Array.Empty<GUILayoutOption>());
if (val != debugColor)
{
debugColor = val;
UpdateDebugMaterialProperties();
}
GUILayout.Space(5f);
GUILayout.Label($"Transparency: {debugTransparency:F2}", Array.Empty<GUILayoutOption>());
float num = GUILayout.HorizontalSlider(debugTransparency, 0f, 1f, Array.Empty<GUILayoutOption>());
if (num != debugTransparency)
{
debugTransparency = num;
UpdateDebugMaterialProperties();
}
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void KeypadComboWindow(int windowID)
{
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
if (_jimmyKeypadFound)
{
GUILayout.Label("Jimmy's Keypad: " + _jimmyKeypadComboValue, Array.Empty<GUILayoutOption>());
}
if (_factoryKeypadFound)
{
GUILayout.Label("Factory Keypad: " + _factoryKeypadComboValue, Array.Empty<GUILayoutOption>());
}
if (_ritualKeypadFound)
{
GUILayout.Label("Ritual Keypad: " + _ritualKeypadComboValue, Array.Empty<GUILayoutOption>());
}
if (_jailKeypadFound)
{
GUILayout.Label("Jail Keypad: " + _jailKeypadComboValue, Array.Empty<GUILayoutOption>());
}
if (_coloredKeypadFound)
{
GUILayout.Label("Colored Keypad: " + _coloredKeypadComboValue, Array.Empty<GUILayoutOption>());
}
else
{
GUILayout.Space(20f);
}
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void PlayerPositionWindow(int windowID)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Expected O, but got Unknown
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: 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_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
PlayerController value = PlayerController.PlayerClient.Value;
if ((Object)(object)value != (Object)null)
{
Vector3 position = ((Component)value).transform.position;
GUIStyle val = new GUIStyle(GUI.skin.label);
val.normal.textColor = Color.white;
val.alignment = (TextAnchor)4;
GUILayout.Label($"X: {position.x:F2} Y: {position.y:F2} Z: {position.z:F2}", val, Array.Empty<GUILayoutOption>());
}
else
{
GUIStyle val2 = new GUIStyle(GUI.skin.label);
val2.normal.textColor = Color.white;
val2.alignment = (TextAnchor)4;
GUILayout.Label("Player not found", val2, Array.Empty<GUILayoutOption>());
}
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void SnowballWindow(int windowID)
{
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUI.enabled = (Object)(object)_rollableSnowball != (Object)null;
GUILayout.Label("Snowball Size:", Array.Empty<GUILayoutOption>());
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
float num = GUILayout.HorizontalSlider(_snowballSize, 0.5f, 50f, Array.Empty<GUILayoutOption>());
if (num != _snowballSize)
{
_snowballSize = num;
_snowballSizeInput = _snowballSize.ToString("F2");
SetSnowballSize(_snowballSize);
}
string text = GUILayout.TextField(_snowballSizeInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
if (text != _snowballSizeInput)
{
_snowballSizeInput = text;
if (float.TryParse(_snowballSizeInput, out var result))
{
_snowballSize = Mathf.Clamp(result, 0.5f, 50f);
SetSnowballSize(_snowballSize);
}
}
GUILayout.EndHorizontal();
GUILayout.Space(10f);
if (GUILayout.Button("Teleport to Basketball Court", Array.Empty<GUILayoutOption>()))
{
TeleportSnowballToBasketballCourt();
}
GUILayout.Space(10f);
if (GUILayout.Button("Stop Snowball", Array.Empty<GUILayoutOption>()))
{
StopSnowball();
}
GUI.enabled = true;
GUILayout.Space(10f);
Vector3 position = _rollableSnowball.transform.position;
GUILayout.Label($"Coordinates: X: {position.x:F2} Y: {position.y:F2} Z: {position.z:F2}", Array.Empty<GUILayoutOption>());
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void MapLoaderWindow(int windowID)
{
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
if ((Object)(object)Object.FindAnyObjectByType<MultiplayerNetworkManager>() != (Object)null)
{
if (GUILayout.Button("Lobby", Array.Empty<GUILayoutOption>()))
{
TryChangeMap("InGame");
Log.LogInfo((object)"Map change requested for: Lobby (InGame)");
}
if (GUILayout.Button("Zortagane (Episode 1)", Array.Empty<GUILayoutOption>()))
{
TryChangeMap("ZortaganeMapOlan");
Log.LogInfo((object)"Map change requested for: ZortaganeMapOlan");
}
if (GUILayout.Button("Yozgat (Episode 2)", Array.Empty<GUILayoutOption>()))
{
TryChangeMap("YozgatMapOlan");
Log.LogInfo((object)"Map change requested for: YozgatMapOlan");
}
GUI.enabled = false;
GUILayout.Button("Seagate (Episode 3)", Array.Empty<GUILayoutOption>());
GUI.enabled = true;
}
else
{
GUILayout.Label("MultiplayerNetworkManager not found. Cannot load maps.", Array.Empty<GUILayoutOption>());
Log.LogError((object)"MultiplayerNetworkManager instance not found. Cannot load maps.");
}
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void TeleportationWindow(int windowID)
{
//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_01de: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUILayout.Label("Enter Coordinates (X, Y, Z):", Array.Empty<GUILayoutOption>());
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
_teleportXInput = GUILayout.TextField(_teleportXInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
_teleportYInput = GUILayout.TextField(_teleportYInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
_teleportZInput = GUILayout.TextField(_teleportZInput, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Teleport", Array.Empty<GUILayoutOption>()))
{
if (float.TryParse(_teleportXInput, out var result) && float.TryParse(_teleportYInput, out var result2) && float.TryParse(_teleportZInput, out var result3))
{
TeleportPlayer(new Vector3(result, result2, result3));
}
else
{
Log.LogWarning((object)"Invalid coordinates entered for teleportation.");
}
}
if (GUILayout.Button("Clear", Array.Empty<GUILayoutOption>()))
{
_teleportXInput = "0";
_teleportYInput = "0";
_teleportZInput = "0";
}
GUILayout.EndHorizontal();
GUILayout.Space(20f);
GUILayout.Label("Locations of Interest:", Array.Empty<GUILayoutOption>());
if (_locationsOfInterest.ContainsKey(_currentSceneName))
{
_ = _locationsOfInterest[_currentSceneName].Count;
foreach (LocationOfInterest item in _locationsOfInterest[_currentSceneName])
{
if (GUILayout.Button($"{item.Name} ({item.Coordinates.x:F0}, {item.Coordinates.y:F0}, {item.Coordinates.z:F0})", Array.Empty<GUILayoutOption>()))
{
TeleportPlayer(item.Coordinates);
_teleportXInput = item.Coordinates.x.ToString("F2");
_teleportYInput = item.Coordinates.y.ToString("F2");
_teleportZInput = item.Coordinates.z.ToString("F2");
}
}
}
else
{
GUILayout.Label("No specific locations of interest for this scene.", Array.Empty<GUILayoutOption>());
}
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void CrosshairSettingsWindow(int windowID)
{
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUILayout.Label("Crosshair Size:", Array.Empty<GUILayoutOption>());
_crosshairSize = GUILayout.HorizontalSlider(_crosshairSize, 1f, 10f, Array.Empty<GUILayoutOption>());
GUILayout.Label($"Size: {_crosshairSize:F1}", Array.Empty<GUILayoutOption>());
GUILayout.Space(10f);
GUILayout.Label("Crosshair Color:", Array.Empty<GUILayoutOption>());
_crosshairColor.r = GUILayout.HorizontalSlider(_crosshairColor.r, 0f, 1f, Array.Empty<GUILayoutOption>());
_crosshairColor.g = GUILayout.HorizontalSlider(_crosshairColor.g, 0f, 1f, Array.Empty<GUILayoutOption>());
_crosshairColor.b = GUILayout.HorizontalSlider(_crosshairColor.b, 0f, 1f, Array.Empty<GUILayoutOption>());
GUILayout.Label($"R: {_crosshairColor.r:F2} G: {_crosshairColor.g:F2} B: {_crosshairColor.b:F2}", Array.Empty<GUILayoutOption>());
GUILayout.Space(10f);
GUILayout.Label("Crosshair Type:", Array.Empty<GUILayoutOption>());
string[] array = new string[4] { "Dot", "Plus", "X", "Square" };
_crosshairType = GUILayout.SelectionGrid(_crosshairType, array, 2, Array.Empty<GUILayoutOption>());
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 10000f, 10000f));
}
private void TryChangeMap(string mapName)
{
if ((Object)(object)Object.FindAnyObjectByType<MultiplayerNetworkManager>() != (Object)null)
{
Type typeFromHandle = typeof(MultiplayerNetworkManager);
MethodInfo method = typeFromHandle.GetMethod("ChangeMapServer", BindingFlags.Static | BindingFlags.Public);
if (method != null)
{
method.Invoke(null, new object[1] { mapName });
Log.LogInfo((object)("Used ChangeMapServer to load: " + mapName));
return;
}
MethodInfo method2 = typeFromHandle.GetMethod("ChangeMap", BindingFlags.Static | BindingFlags.Public);
if (method2 != null)
{
method2.Invoke(null, new object[1] { mapName });
Log.LogInfo((object)("Used ChangeMap to load: " + mapName));
}
else
{
Log.LogError((object)("MultiplayerNetworkManager does not contain ChangeMapServer or ChangeMap method. Cannot change map to: " + mapName));
}
}
else
{
Log.LogError((object)"MultiplayerNetworkManager instance not found. Cannot change maps.");
}
}
private void TeleportPlayer(Vector3 targetPosition)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: 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)
PlayerController value = PlayerController.PlayerClient.Value;
if ((Object)(object)value != (Object)null)
{
((Component)value).gameObject.SetActive(false);
((Component)value).transform.position = targetPosition;
((Component)value).gameObject.SetActive(true);
Log.LogInfo((object)$"Player teleported to: {targetPosition}");
}
else
{
Log.LogWarning((object)"Player not found, cannot teleport.");
}
}
private void SetSnowballSize(float size)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_rollableSnowball != (Object)null)
{
_rollableSnowball.SetActive(false);
_rollableSnowball.transform.localScale = new Vector3(size, size, size);
_rollableSnowball.SetActive(true);
Log.LogInfo((object)$"Lobby Snowball size set to: {size}");
}
else
{
Log.LogWarning((object)"Cannot set snowball size: RollableSnow GameObject not found.");
}
}
private void TeleportSnowballToBasketballCourt()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_rollableSnowball != (Object)null)
{
_rollableSnowball.SetActive(false);
_rollableSnowball.transform.position = _basketballCourtCoordinates;
_rollableSnowball.SetActive(true);
Log.LogInfo((object)$"Snowball teleported to Basketball Court at {_basketballCourtCoordinates}.");
StopSnowball();
}
else
{
Log.LogWarning((object)"Snowball not found, cannot teleport snowball to Basketball Court.");
}
}
private void StopSnowball()
{
//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)
if ((Object)(object)_rollableSnowball != (Object)null)
{
Rigidbody component = _rollableSnowball.GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null)
{
component.velocity = Vector3.zero;
component.angularVelocity = Vector3.zero;
Log.LogInfo((object)"Snowball movement stopped.");
}
else
{
Log.LogWarning((object)"Snowball does not have a Rigidbody component, cannot stop movement.");
}
}
else
{
Log.LogWarning((object)"Snowball not found, cannot stop snowball movement.");
}
}
private void ReadInitialPlayerInventory()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
PlayerController value = PlayerController.PlayerClient.Value;
if ((Object)(object)value != (Object)null && value.Inventory != null)
{
for (int i = 0; i < 5; i++)
{
if (i < ((Inventory)value.Inventory).slotsCount)
{
byte itemIndex = ((Inventory)value.Inventory).GetSlot(i).itemIndex;
if (itemIndex == byte.MaxValue)
{
selectedItems[i] = AllItems.None;
}
else
{
selectedItems[i] = (AllItems)itemIndex;
}
}
else
{
selectedItems[i] = AllItems.None;
}
}
}
else
{
Log.LogWarning((object)"Player or Inventory not found. Initializing with None.");
for (int j = 0; j < 5; j++)
{
selectedItems[j] = AllItems.None;
}
}
}
private void AddItemToPlayer(int slotIndex, AllItems item)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
PlayerController value = PlayerController.PlayerClient.Value;
if ((Object)(object)value != (Object)null && value.Inventory != null)
{
if (item == AllItems.None)
{
((Inventory)value.Inventory).RemoveItem(slotIndex);
Log.LogInfo((object)$"Removed item from slot {slotIndex}.");
}
else
{
byte b = (byte)item;
((Inventory)value.Inventory).SetItem(slotIndex, b, (byte)0);
Log.LogInfo((object)$"Set {item.ToString()} to slot {slotIndex}.");
}
refreshInventory = true;
}
else
{
Log.LogError((object)"Player or Inventory not found. Cannot set item.");
}
}
private void UpdateUIState()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)PlayerController.PlayerClient.Value != (Object)null)
{
if (refreshInventory)
{
ReadInitialPlayerInventory();
refreshInventory = false;
}
}
else if (showUI)
{
showUI = false;
for (int i = 0; i < 5; i++)
{
selectedItems[i] = AllItems.None;
}
refreshInventory = false;
}
}
private void HandleFlyingInput()
{
//IL_0009: 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_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
if (Input.GetKeyDown((KeyCode)118))
{
PlayerController value = PlayerController.PlayerClient.Value;
if ((Object)(object)value != (Object)null)
{
flyingEnabled = !flyingEnabled;
value.Data.noclip = flyingEnabled;
Log.LogInfo((object)$"Flying toggled: {flyingEnabled}");
}
else
{
Log.LogWarning((object)"Player not found, cannot toggle flying.");
}
}
if (!Input.GetKeyDown((KeyCode)303))
{
return;
}
Log.LogInfo((object)"RightShift key pressed.");
if ((Object)(object)PlayerController.PlayerClient.Value != (Object)null)
{
Log.LogInfo((object)"PlayerController found. Toggling UI.");
showUI = !showUI;
Log.LogInfo((object)$"Main UI toggled: {showUI}");
if (!showUI)
{
_colorWindowWasOpen = colorWindowOpen;
_mapLoaderWindowWasOpen = _showMapLoaderWindow;
_snowballWindowWasOpen = _showSnowballWindow;
_teleportationWindowWasOpen = _showTeleportationWindow;
_crosshairSettingsWindowWasOpen = _showCrosshairSettingsWindow;
colorWindowOpen = false;
_showMapLoaderWindow = false;
_showSnowballWindow = false;
_showTeleportationWindow = false;
_showCrosshairSettingsWindow = false;
}
else
{
colorWindowOpen = _colorWindowWasOpen;
_showMapLoaderWindow = _mapLoaderWindowWasOpen;
_showSnowballWindow = _snowballWindowWasOpen;
_showTeleportationWindow = _teleportationWindowWasOpen;
_showCrosshairSettingsWindow = _crosshairSettingsWindowWasOpen;
}
}
else
{
Log.LogWarning((object)"PlayerController not found when RightShift pressed. Cannot toggle Main UI.");
Log.LogWarning((object)"Player not found, cannot toggle Main UI.");
}
}
private void FindKeypadCombo()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
Scene activeScene = SceneManager.GetActiveScene();
string name = ((Scene)(ref activeScene)).name;
Log.LogInfo((object)("Checking keypads in scene: " + name));
_jimmyKeypadFound = false;
_jimmyKeypadComboValue = "";
_factoryKeypadFound = false;
_factoryKeypadComboValue = "";
_ritualKeypadFound = false;
_ritualKeypadComboValue = "";
_jailKeypadFound = false;
_jailKeypadComboValue = "";
_coloredKeypadFound = false;
_coloredKeypadComboValue = "";
((Rect)(ref _keypadWindowRect)).height = 0f;
int num = 0;
switch (name)
{
case "InGame":
Log.LogInfo((object)"In Lobby scene, clearing all keypad info.");
return;
case "ZortaganeMapOlan":
{
Log.LogInfo((object)"Searching for Episode 1 keypads.");
GameObject val2 = GameObject.Find("PUZZLE2/ArcadeShopAndJimmysRoom/JimmySituation/JimmySecurityRoomKeypad");
if ((Object)(object)val2 != (Object)null)
{
Component component2 = val2.GetComponent("Keypad");
if ((Object)(object)component2 != (Object)null)
{
FieldInfo field2 = ((object)component2).GetType().GetField("keypadCombo", BindingFlags.Instance | BindingFlags.NonPublic);
if (field2 != null)
{
_jimmyKeypadComboValue = field2.GetValue(component2).ToString();
_jimmyKeypadFound = true;
num++;
}
else
{
Log.LogWarning((object)"Jimmy's Keypad component found, but 'keypadCombo' field not found.");
}
}
else
{
Log.LogWarning((object)"Jimmy's Keypad component not found on GameObject.");
}
}
else
{
Log.LogWarning((object)"Jimmy's Keypad GameObject not found.");
}
GameObject val3 = GameObject.Find("Factory/FactoryParent/networked/FirstDoorPuzzle/FactoryDoorKeypad");
if ((Object)(object)val3 != (Object)null)
{
Component component3 = val3.GetComponent("Keypad");
if ((Object)(object)component3 != (Object)null)
{
FieldInfo field3 = ((object)component3).GetType().GetField("keypadCombo", BindingFlags.Instance | BindingFlags.NonPublic);
if (field3 != null)
{
_factoryKeypadComboValue = field3.GetValue(component3).ToString();
_factoryKeypadFound = true;
num++;
}
else
{
Log.LogWarning((object)"Factory Keypad component found, but 'keypadCombo' field not found.");
}
}
else
{
Log.LogWarning((object)"Factory Keypad component not found on GameObject.");
}
}
else
{
Log.LogWarning((object)"Factory Keypad GameObject not found.");
}
break;
}
case "YozgatMapOlan":
{
Log.LogInfo((object)"Searching for Episode 2 keypads.");
GameObject val4 = GameObject.Find("BerrysCabin/Puzzle/RitualKeypad");
if ((Object)(object)val4 != (Object)null)
{
Component component4 = val4.GetComponent("Keypad");
if ((Object)(object)component4 != (Object)null)
{
FieldInfo field4 = ((object)component4).GetType().GetField("keypadCombo", BindingFlags.Instance | BindingFlags.NonPublic);
if (field4 != null)
{
_ritualKeypadComboValue = field4.GetValue(component4).ToString();
_ritualKeypadFound = true;
num++;
}
else
{
Log.LogWarning((object)"Ritual Keypad component found, but 'keypadCombo' field not found.");
}
}
else
{
Log.LogWarning((object)"Ritual Keypad component not found on GameObject.");
}
}
else
{
Log.LogWarning((object)"Ritual Keypad GameObject not found.");
}
GameObject val5 = GameObject.Find("ColinsCabin/Puzzle/ColoredKeypad");
if ((Object)(object)val5 != (Object)null)
{
Component component5 = val5.GetComponent("ColoredKeypad");
if ((Object)(object)component5 != (Object)null)
{
FieldInfo field5 = ((object)component5).GetType().BaseType.GetField("keypadCombo", BindingFlags.Instance | BindingFlags.NonPublic);
if (field5 != null)
{
string? text = field5.GetValue(component5).ToString();
List<string> list = new List<string>();
string text2 = text;
for (int i = 0; i < text2.Length; i++)
{
char c = text2[i];
switch (c)
{
case 'r':
list.Add("<b><color=red>Red</color></b>");
break;
case 'g':
list.Add("<b><color=green>Green</color></b>");
break;
case 'b':
list.Add("<b><color=#009EFF>Blue</color></b>");
break;
case 'y':
list.Add("<b><color=yellow>Yellow</color></b>");
break;
default:
list.Add("<b>" + c + "</b>");
break;
}
}
_coloredKeypadComboValue = string.Join(", ", list);
_coloredKeypadFound = true;
num++;
}
else
{
Log.LogWarning((object)"Colored Keypad component found, but 'keypadCombo' field not found in base class.");
}
}
else
{
Log.LogWarning((object)"Colored Keypad component not found on GameObject.");
}
}
else
{
Log.LogWarning((object)"Colored Keypad GameObject not found.");
}
break;
}
case "SeagateMapOlan":
{
Log.LogInfo((object)"Searching for Episode 3 keypads.");
GameObject val = GameObject.Find("----------| Environment |----------/Islands/PirateIsland/PirateIsland_Indoor/puzzle/Keypad");
if ((Object)(object)val != (Object)null)
{
Component component = val.GetComponent("Keypad");
if ((Object)(object)component != (Object)null)
{
FieldInfo field = ((object)component).GetType().GetField("keypadCombo", BindingFlags.Instance | BindingFlags.NonPublic);
if (field != null)
{
_jailKeypadComboValue = field.GetValue(component).ToString();
_jailKeypadFound = true;
num++;
}
else
{
Log.LogWarning((object)"Jail Keypad component found, but 'keypadCombo' field not found.");
}
}
else
{
Log.LogWarning((object)"Jail Keypad component not found on GameObject.");
}
}
else
{
Log.LogWarning((object)"Jail Keypad GameObject not found.");
}
break;
}
default:
Log.LogInfo((object)("Not in a known keypad scene (" + name + "), clearing all keypad info."));
break;
}
((Rect)(ref _keypadWindowRect)).height = 0f + (float)Mathf.Min(num, 2) * 25f;
}
private void UpdateSnowballState()
{
//IL_008c: 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)_rollableSnowball == (Object)null)
{
_rollableSnowball = GameObject.Find("ChristmasManager/activateWhenChristmas/RollableSnow");
if ((Object)(object)_rollableSnowball != (Object)null)
{
_snowballSize = _rollableSnowball.transform.localScale.x;
_snowballSizeInput = _snowballSize.ToString("F2");
Log.LogInfo((object)$"Found RollableSnow. Initial size: {_snowballSize}");
}
}
else
{
_snowballSize = _rollableSnowball.transform.localScale.x;
_snowballSizeInput = _snowballSize.ToString("F2");
}
}
private void UpdateDebugMaterialProperties()
{
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)debugMaterial != (Object)null)
{
debugMaterial.SetColor("_BaseColor", new Color(debugColor.r, debugColor.g, debugColor.b, debugTransparency));
}
}
private void ClearDebugColliders()
{
foreach (DebugColliderInfo debugCollider in debugColliders)
{
if ((Object)(object)debugCollider.debugPrimitive != (Object)null)
{
Object.Destroy((Object)(object)debugCollider.debugPrimitive.gameObject);
}
}
debugColliders.Clear();
}
private void RefreshDebugColliders()
{
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
if (!showCollisions)
{
return;
}
foreach (DebugColliderInfo debugCollider in debugColliders)
{
if ((Object)(object)debugCollider.debugPrimitive == (Object)null || (Object)(object)debugCollider.originalCollider == (Object)null || (Object)(object)debugCollider.originalTransform == (Object)null)
{
Log.LogWarning((object)"Missing debug primitive or original collider/transform in DebugColliderInfo. Regenerating all debug colliders.");
ClearDebugColliders();
SetCollisionVisualizationEnabled(enable: true);
break;
}
debugCollider.debugPrimitive.transform.localPosition = Vector3.zero;
debugCollider.debugPrimitive.transform.localRotation = Quaternion.identity;
Vector3 localScale = Vector3.one;
Collider originalCollider = debugCollider.originalCollider;
BoxCollider val = (BoxCollider)(object)((originalCollider is BoxCollider) ? originalCollider : null);
if (val != null)
{
debugCollider.debugPrimitive.transform.localPosition = val.center;
localScale = val.size;
}
else
{
Collider originalCollider2 = debugCollider.originalCollider;
SphereCollider val2 = (SphereCollider)(object)((originalCollider2 is SphereCollider) ? originalCollider2 : null);
if (val2 != null)
{
debugCollider.debugPrimitive.transform.localPosition = val2.center;
localScale = Vector3.one * (val2.radius * 2f);
}
else
{
Collider originalCollider3 = debugCollider.originalCollider;
CapsuleCollider val3 = (CapsuleCollider)(object)((originalCollider3 is CapsuleCollider) ? originalCollider3 : null);
if (val3 != null)
{
debugCollider.debugPrimitive.transform.localPosition = val3.center;
float height = val3.height;
float radius = val3.radius;
if (val3.direction == 0)
{
((Vector3)(ref localScale))..ctor(height, radius * 2f, radius * 2f);
debugCollider.debugPrimitive.transform.localRotation = Quaternion.Euler(0f, 0f, 90f);
}
else if (val3.direction == 1)
{
((Vector3)(ref localScale))..ctor(radius * 2f, height, radius * 2f);
debugCollider.debugPrimitive.transform.localRotation = Quaternion.identity;
}
else if (val3.direction == 2)
{
((Vector3)(ref localScale))..ctor(radius * 2f, radius * 2f, height);
debugCollider.debugPrimitive.transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
}
}
}
}
debugCollider.debugPrimitive.transform.localScale = localScale;
}
}
private void SetCollisionVisualizationEnabled(bool enable)
{
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: 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)
//IL_0265: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_020b: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
if (enable)
{
Log.LogInfo((object)"Enabling collision visualization.");
foreach (DebugColliderInfo debugCollider in debugColliders)
{
Object.Destroy((Object)(object)debugCollider.debugPrimitive);
}
debugColliders.Clear();
Collider[] array = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0);
Log.LogInfo((object)$"Found {array.Length} colliders for visualization.");
Collider[] array2 = array;
foreach (Collider val in array2)
{
if (!val.enabled || !((Component)val).gameObject.activeInHierarchy || val.isTrigger)
{
continue;
}
GameObject val2 = null;
Vector3 localPosition = Vector3.zero;
Vector3 localScale = Vector3.one;
Quaternion localRotation = Quaternion.identity;
BoxCollider val3 = (BoxCollider)(object)((val is BoxCollider) ? val : null);
if (val3 != null)
{
val2 = GameObject.CreatePrimitive((PrimitiveType)3);
localPosition = val3.center;
localScale = val3.size;
localRotation = Quaternion.identity;
}
else
{
SphereCollider val4 = (SphereCollider)(object)((val is SphereCollider) ? val : null);
if (val4 != null)
{
val2 = GameObject.CreatePrimitive((PrimitiveType)0);
localPosition = val4.center;
localScale = Vector3.one * (val4.radius * 2f);
localRotation = Quaternion.identity;
}
else
{
CapsuleCollider val5 = (CapsuleCollider)(object)((val is CapsuleCollider) ? val : null);
if (val5 != null)
{
val2 = GameObject.CreatePrimitive((PrimitiveType)1);
localPosition = val5.center;
float height = val5.height;
float radius = val5.radius;
if (val5.direction == 0)
{
((Vector3)(ref localScale))..ctor(height, radius * 2f, radius * 2f);
localRotation = Quaternion.Euler(0f, 0f, 90f);
}
else if (val5.direction == 1)
{
((Vector3)(ref localScale))..ctor(radius * 2f, height, radius * 2f);
localRotation = Quaternion.identity;
}
else if (val5.direction == 2)
{
((Vector3)(ref localScale))..ctor(radius * 2f, radius * 2f, height);
localRotation = Quaternion.Euler(90f, 0f, 0f);
}
}
}
}
if ((Object)(object)val2 != (Object)null)
{
((Object)val2).name = "DebugCollider_" + ((Object)((Component)val).gameObject).name;
val2.transform.SetParent(((Component)val).transform, false);
val2.transform.localPosition = localPosition;
val2.transform.localScale = localScale;
val2.transform.localRotation = localRotation;
Collider component = val2.GetComponent<Collider>();
if ((Object)(object)component != (Object)null)
{
component.enabled = false;
}
Renderer component2 = val2.GetComponent<Renderer>();
if ((Object)(object)component2 != (Object)null)
{
component2.material = debugMaterial;
}
debugColliders.Add(new DebugColliderInfo
{
debugPrimitive = val2,
originalCollider = val,
originalTransform = ((Component)val).transform
});
}
}
Log.LogInfo((object)$"Created {debugColliders.Count} debug cubes.");
return;
}
Log.LogInfo((object)"Disabling collision visualization.");
foreach (DebugColliderInfo debugCollider2 in debugColliders)
{
Object.Destroy((Object)(object)debugCollider2.debugPrimitive);
}
debugColliders.Clear();
Log.LogInfo((object)"Destroyed all debug cubes.");
}
private void OnActiveSceneChanged(Scene current, Scene next)
{
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
Log.LogInfo((object)("Scene changed from " + ((Scene)(ref current)).name + " to " + ((Scene)(ref next)).name));
_rollableSnowball = GameObject.Find("ChristmasManager/activateWhenChristmas/RollableSnow");
if ((Object)(object)_rollableSnowball != (Object)null)
{
_snowballSize = _rollableSnowball.transform.localScale.x;
_snowballSizeInput = _snowballSize.ToString("F2");
Log.LogInfo((object)$"Found RollableSnow in new scene. Initial size: {_snowballSize}");
}
else
{
Log.LogWarning((object)"RollableSnow not found in new scene. It will be re-found on the next update.");
}
FindKeypadCombo();
_currentSceneName = ((Scene)(ref next)).name;
UpdateTeleportationWindowHeight();
if ((Object)(object)PlayerController.PlayerClient.Value != (Object)null)
{
UpdateAvailableItems();
}
}
private void UpdateTeleportationWindowHeight()
{
float num = 150f;
if (_locationsOfInterest.ContainsKey(_currentSceneName))
{
int count = _locationsOfInterest[_currentSceneName].Count;
num += (float)count * 25f;
}
((Rect)(ref _teleportationWindowRect)).height = num;
}
private void DrawCrosshair()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_0270: Unknown result type (might be due to invalid IL or missing references)
//IL_028e: Unknown result type (might be due to invalid IL or missing references)
//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
float num = Screen.width / 2;
float num2 = Screen.height / 2;
GUI.color = _crosshairColor;
switch (_crosshairType)
{
case 0:
GUI.DrawTexture(new Rect(num - _crosshairSize / 2f, num2 - _crosshairSize / 2f, _crosshairSize, _crosshairSize), (Texture)(object)Texture2D.whiteTexture);
break;
case 1:
GUI.DrawTexture(new Rect(num - _crosshairSize * 2f, num2 - _crosshairSize / 2f, _crosshairSize * 4f, _crosshairSize), (Texture)(object)Texture2D.whiteTexture);
GUI.DrawTexture(new Rect(num - _crosshairSize / 2f, num2 - _crosshairSize * 2f, _crosshairSize, _crosshairSize * 4f), (Texture)(object)Texture2D.whiteTexture);
break;
case 2:
{
float num3 = _crosshairSize * 2f;
float num4 = _crosshairSize / 2f;
GUIUtility.RotateAroundPivot(45f, new Vector2(num, num2));
GUI.DrawTexture(new Rect(num - num3 / 2f, num2 - num4 / 2f, num3, num4), (Texture)(object)Texture2D.whiteTexture);
GUIUtility.RotateAroundPivot(-45f, new Vector2(num, num2));
GUIUtility.RotateAroundPivot(-45f, new Vector2(num, num2));
GUI.DrawTexture(new Rect(num - num3 / 2f, num2 - num4 / 2f, num3, num4), (Texture)(object)Texture2D.whiteTexture);
GUIUtility.RotateAroundPivot(45f, new Vector2(num, num2));
break;
}
case 3:
{
Rect val = default(Rect);
((Rect)(ref val))..ctor(num - _crosshairSize * 1.5f / 2f, num2 - _crosshairSize * 1.5f / 2f, _crosshairSize * 1.5f, _crosshairSize * 1.5f);
DrawLine(new Vector2(((Rect)(ref val)).x, ((Rect)(ref val)).y), new Vector2(((Rect)(ref val)).xMax, ((Rect)(ref val)).y), 1f);
DrawLine(new Vector2(((Rect)(ref val)).x, ((Rect)(ref val)).yMax), new Vector2(((Rect)(ref val)).xMax, ((Rect)(ref val)).yMax), 1f);
DrawLine(new Vector2(((Rect)(ref val)).x, ((Rect)(ref val)).y), new Vector2(((Rect)(ref val)).x, ((Rect)(ref val)).yMax), 1f);
DrawLine(new Vector2(((Rect)(ref val)).xMax, ((Rect)(ref val)).y), new Vector2(((Rect)(ref val)).xMax, ((Rect)(ref val)).yMax), 1f);
break;
}
}
GUI.color = Color.white;
}
private void DrawLine(Vector2 start, Vector2 end, float width)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: 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_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: 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_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = end - start;
float magnitude = ((Vector2)(ref val)).magnitude;
if (!(magnitude < 0.01f))
{
float num = Mathf.Atan2(val.y, val.x) * 57.29578f;
Matrix4x4 matrix = GUI.matrix;
GUIUtility.RotateAroundPivot(num, start);
GUI.DrawTexture(new Rect(start.x, start.y - width / 2f, magnitude, width), (Texture)(object)Texture2D.whiteTexture);
GUI.matrix = matrix;
}
}
private void UpdateAvailableItems()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Expected I4, but got Unknown
Log.LogInfo((object)"UAI called");
if ((Object)(object)PlayerController.PlayerClient.Value == (Object)null)
{
Log.LogWarning((object)"Player not found. Skipping UpdateAvailableItems.");
return;
}
_availableItems.Clear();
_availableItems.Add(AllItems.None);
try
{
ItemScriptable[] allItems = GameData.GetAllItems();
foreach (ItemScriptable val in allItems)
{
if ((Object)(object)val != (Object)null)
{
_availableItems.Add((AllItems)(int)val.item);
}
}
_availableItems.Remove(AllItems.ZubbidiRaki);
_availableItems.Remove(AllItems.WaterGun);
_availableItems.Remove(AllItems.AminakuCrown);
Log.LogInfo((object)"Legacy Build: Removed ZubbidiRaki, WaterGun, AminakuCrown (IDs 25-27) from available items.");
Log.LogInfo((object)$"Updated available items list. Found {_availableItems.Count - 1} actual items.");
}
catch (Exception ex)
{
Log.LogError((object)("Error updating available items: " + ex.Message + ". This might happen in scenes where GameData is not fully initialized."));
}
}
private void DrawWindowPositions()
{
//IL_001f: 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)
//IL_005c: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: 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)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginArea(new Rect((float)(Screen.width - 300), 50f, 290f, (float)(Screen.height - 60)));
GUILayout.BeginVertical(GUIStyle.op_Implicit("box"), Array.Empty<GUILayoutOption>());
GUILayout.Label("<b><color=yellow>Window Positions (Debug)</color></b>", Array.Empty<GUILayoutOption>());
GUIStyle val = new GUIStyle(GUI.skin.label);
val.normal.textColor = Color.white;
val.wordWrap = true;
DisplayRectInfo("Main Window", windowRect, val);
for (int i = 0; i < dropdownRects.Length; i++)
{
if (dropdownOpen[i])
{
DisplayRectInfo($"Dropdown {i}", dropdownRects[i], val);
}
}
if (colorWindowOpen)
{
DisplayRectInfo("Collision Color", colorWindowRect, val);
}
if (_showKeypadWindow)
{
DisplayRectInfo("Keypad Codes", _keypadWindowRect, val);
}
if (_showMapLoaderWindow)
{
DisplayRectInfo("Map Loader", _mapLoaderWindowRect, val);
}
if (_showPlayerPosition)
{
DisplayRectInfo("Player Position", _playerPositionWindowRect, val);
}
DisplayRectInfo("Snowball Options", _snowballWindowRect, val);
if (_showTeleportationWindow)
{
DisplayRectInfo("Teleportation Menu", _teleportationWindowRect, val);
}
if (_showCrosshairSettingsWindow)
{
DisplayRectInfo("Crosshair Settings", _crosshairSettingsWindowRect, val);
}
if (_snowballWindowWasOpen)
{
DisplayRectInfo("Snowball Settings", _snowballWindowRect, val);
}
GUILayout.EndVertical();
GUILayout.EndArea();
}
private void DisplayRectInfo(string name, Rect rect, GUIStyle style)
{
GUILayout.Label($"<b>{name}:</b> X: {((Rect)(ref rect)).x:F0}, Y: {((Rect)(ref rect)).y:F0}, W: {((Rect)(ref rect)).width:F0}, H: {((Rect)(ref rect)).height:F0}", style, Array.Empty<GUILayoutOption>());
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "krw.mods.srhm";
public const string PLUGIN_NAME = "Speedrun Routing Helper Mod (SRHM)";
public const string PLUGIN_VERSION = "1.0.2";
}
}