using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Pigeon;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("Encyclopedia")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0-alpha.0.4+a795b6c3565b11ba4f687b01afd7adcacced55b6")]
[assembly: AssemblyProduct("Encyclopedia")]
[assembly: AssemblyTitle("Encyclopedia")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
[CompilerGenerated]
[ExcludeFromCodeCoverage]
internal static class GitVersionInformation
{
public const string AssemblySemFileVer = "0.0.1.0";
public const string AssemblySemVer = "0.0.1.0";
public const string BranchName = "master";
public const string BuildMetaData = "";
public const string CommitDate = "2025-11-27";
public const string CommitsSinceVersionSource = "5";
public const string EscapedBranchName = "master";
public const string FullBuildMetaData = "Branch.master.Sha.a795b6c3565b11ba4f687b01afd7adcacced55b6";
public const string FullSemVer = "0.0.1-5";
public const string InformationalVersion = "0.0.1-5+Branch.master.Sha.a795b6c3565b11ba4f687b01afd7adcacced55b6";
public const string Major = "0";
public const string MajorMinorPatch = "0.0.1";
public const string Minor = "0";
public const string Patch = "1";
public const string PreReleaseLabel = "";
public const string PreReleaseLabelWithDash = "";
public const string PreReleaseNumber = "5";
public const string PreReleaseTag = "5";
public const string PreReleaseTagWithDash = "-5";
public const string SemVer = "0.0.1-5";
public const string Sha = "a795b6c3565b11ba4f687b01afd7adcacced55b6";
public const string ShortSha = "a795b6c";
public const string UncommittedChanges = "13";
public const string VersionSourceSha = "";
public const string WeightedPreReleaseNumber = "55005";
}
namespace Encyclopedia
{
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "Encyclopedia";
public const string PLUGIN_NAME = "Encyclopedia";
public const string PLUGIN_VERSION = "0.0.0";
}
}
namespace SparrohEncyclopedia
{
[BepInPlugin("sparroh.encyclopedia", "Encyclopedia", "1.1.0")]
[MycoMod(/*Could not decode attribute arguments.*/)]
public class EncyclopediaPlugin : BaseUnityPlugin
{
private enum ResizeEdge
{
None,
Bottom,
Right,
BottomRight,
Left,
Top
}
[CompilerGenerated]
private static class <>O
{
public static WindowFunction <0>__EncyclopediaWindow;
}
public const string PluginGUID = "sparroh.encyclopedia";
public const string PluginName = "Encyclopedia";
public const string PluginVersion = "1.1.0";
private static float windowX = 0f;
private static float windowY = 0f;
private static float windowWidth = 400f;
private static float windowHeight = 300f;
private static bool isDragging = false;
private static Vector2 dragOffset;
private static bool isResizing = false;
private static ResizeEdge currentResizeEdge = ResizeEdge.None;
private static bool windowPositionInitialized = false;
private static Vector2 leftScrollPos = Vector2.zero;
private static Vector2 rightScrollPos = Vector2.zero;
private void Awake()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
new Harmony("sparroh.encyclopedia").PatchAll(typeof(MenuPatches));
}
private void InitializeWindowPosition()
{
if (!windowPositionInitialized)
{
windowWidth = (float)Screen.width * 0.1f;
windowHeight = (float)Screen.height * 0.2f;
windowX = (float)Screen.width - windowWidth;
windowY = (float)Screen.height * 0.1f;
windowPositionInitialized = true;
}
}
private void OnGUI()
{
//IL_022a: 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_0041: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Expected O, but got Unknown
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Expected O, but got Unknown
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: 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_0290: Unknown result type (might be due to invalid IL or missing references)
//IL_0280: Unknown result type (might be due to invalid IL or missing references)
//IL_0285: Unknown result type (might be due to invalid IL or missing references)
//IL_028b: Expected O, but got Unknown
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
//IL_02b7: Invalid comparison between Unknown and I4
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_02da: Unknown result type (might be due to invalid IL or missing references)
//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Invalid comparison between Unknown and I4
//IL_0190: 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_02ee: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0312: Unknown result type (might be due to invalid IL or missing references)
//IL_0318: Invalid comparison between Unknown and I4
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: Expected O, but got Unknown
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
if (MenuPatches.ShowTooltip && !string.IsNullOrEmpty(MenuPatches.CurrentTooltipText))
{
float num = (float)Screen.height * 0.7f;
GUIStyle tooltipStyle = new GUIStyle(GUI.skin.label);
tooltipStyle.normal.background = Texture2D.whiteTexture;
tooltipStyle.normal.textColor = Color.black;
tooltipStyle.fontSize = 12;
tooltipStyle.wordWrap = true;
tooltipStyle.alignment = (TextAnchor)3;
tooltipStyle.padding = new RectOffset(8, 8, 6, 6);
tooltipStyle.richText = false;
Vector2 tooltipPosition = MenuPatches.TooltipPosition;
float num2 = Mathf.Min(400f, 300f);
float num3 = Mathf.Clamp(tooltipStyle.CalcHeight(new GUIContent(MenuPatches.CurrentTooltipText), num2), 80f, num) + 12f;
float num4 = ((tooltipPosition.y - num3 - 20f >= 0f) ? (tooltipPosition.y - num3 - 10f) : (tooltipPosition.y + 20f));
if (num4 < 5f)
{
num4 = 5f;
}
else if (num4 + num3 > (float)Screen.height - 5f)
{
num4 = (float)Screen.height - num3 - 5f;
}
float num5 = ((tooltipPosition.x + 15f + num2 <= (float)Screen.width - 5f) ? (tooltipPosition.x + 15f) : (tooltipPosition.x - num2 - 15f));
if (num5 < 5f)
{
num5 = 5f;
}
else if (num5 + num2 > (float)Screen.width - 5f)
{
num5 = (float)Screen.width - num2 - 5f;
}
Rect tooltipRect = new Rect(num5, num4, num2, num3);
GUI.Window(999, tooltipRect, (WindowFunction)delegate
{
//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_002f: Unknown result type (might be due to invalid IL or missing references)
Color color = GUI.color;
GUI.color = Color.white;
GUI.Label(new Rect(0f, 0f, ((Rect)(ref tooltipRect)).width, ((Rect)(ref tooltipRect)).height), MenuPatches.CurrentTooltipText, tooltipStyle);
GUI.color = color;
}, "", GUIStyle.none);
}
if (MenuPatches.IsMenuOpen && GUI.Button(new Rect((float)(Screen.width - 110), 10f, 100f, 30f), "Encyclopedia"))
{
MenuPatches.ToggleEncyclopedia();
}
if (!MenuPatches.ShowEncyclopediaGUI)
{
return;
}
InitializeWindowPosition();
HandleDragAndResize();
Rect val = new Rect(windowX, windowY, windowWidth, windowHeight);
object obj = <>O.<0>__EncyclopediaWindow;
if (obj == null)
{
WindowFunction val2 = EncyclopediaWindow;
<>O.<0>__EncyclopediaWindow = val2;
obj = (object)val2;
}
GUI.Window(0, val, (WindowFunction)obj, "Mycopunk Encyclopedia [Drag | Resize ↗]");
Event current = Event.current;
if (current.isMouse && ((int)current.type == 0 || (int)current.type == 1 || (int)current.type == 3))
{
Vector2 mousePosition = current.mousePosition;
if (mousePosition.x >= windowX && mousePosition.x <= windowX + windowWidth && mousePosition.y >= windowY && mousePosition.y <= windowY + windowHeight && (int)current.type != 6)
{
current.Use();
}
}
}
private void HandleDragAndResize()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_039c: Unknown result type (might be due to invalid IL or missing references)
//IL_03a2: Invalid comparison between Unknown and I4
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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_05ac: Unknown result type (might be due to invalid IL or missing references)
//IL_05b2: Invalid comparison between Unknown and I4
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_03af: Unknown result type (might be due to invalid IL or missing references)
//IL_03b4: 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_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_041d: Unknown result type (might be due to invalid IL or missing references)
//IL_0422: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: 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_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_049d: Unknown result type (might be due to invalid IL or missing references)
//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
//IL_044a: Unknown result type (might be due to invalid IL or missing references)
//IL_0471: Unknown result type (might be due to invalid IL or missing references)
//IL_0500: Unknown result type (might be due to invalid IL or missing references)
//IL_055a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: 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_010a: 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)
//IL_005e: 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_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0511: Unknown result type (might be due to invalid IL or missing references)
//IL_0568: 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_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: 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_0266: 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_01c8: 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)
//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
//IL_027f: 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_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0330: Unknown result type (might be due to invalid IL or missing references)
//IL_02de: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_0240: Unknown result type (might be due to invalid IL or missing references)
//IL_0346: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
//IL_0362: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: Unknown result type (might be due to invalid IL or missing references)
//IL_0372: Unknown result type (might be due to invalid IL or missing references)
Event current = Event.current;
if ((int)current.type == 0)
{
Vector2 mousePosition = current.mousePosition;
if (mousePosition.x >= windowX && mousePosition.x <= windowX + windowWidth && mousePosition.y >= windowY && mousePosition.y <= windowY + 30f)
{
isDragging = true;
dragOffset = mousePosition - new Vector2(windowX, windowY);
current.Use();
}
else if (mousePosition.x >= windowX + windowWidth - 20f && mousePosition.x <= windowX + windowWidth && mousePosition.y >= windowY + windowHeight - 20f && mousePosition.y <= windowY + windowHeight)
{
isResizing = true;
currentResizeEdge = ResizeEdge.BottomRight;
current.Use();
}
else if (mousePosition.x >= windowX && mousePosition.x <= windowX + 20f && mousePosition.y >= windowY + windowHeight - 20f && mousePosition.y <= windowY + windowHeight)
{
isResizing = true;
currentResizeEdge = ResizeEdge.Bottom;
current.Use();
}
else if (mousePosition.x >= windowX + windowWidth - 20f && mousePosition.x <= windowX + windowWidth && mousePosition.y >= windowY && mousePosition.y <= windowY + 20f)
{
isResizing = true;
currentResizeEdge = ResizeEdge.Right;
current.Use();
}
else if (mousePosition.x >= windowX && mousePosition.x <= windowX + 20f && mousePosition.y >= windowY && mousePosition.y <= windowY + 20f)
{
isResizing = true;
currentResizeEdge = ResizeEdge.None;
current.Use();
}
else if (mousePosition.x >= windowX + 20f && mousePosition.x <= windowX + windowWidth - 20f && mousePosition.y >= windowY + windowHeight - 10f && mousePosition.y <= windowY + windowHeight)
{
isResizing = true;
currentResizeEdge = ResizeEdge.Bottom;
current.Use();
}
else if (mousePosition.x >= windowX + windowWidth - 10f && mousePosition.x <= windowX + windowWidth && mousePosition.y >= windowY + 20f && mousePosition.y <= windowY + windowHeight - 20f)
{
isResizing = true;
currentResizeEdge = ResizeEdge.Right;
current.Use();
}
else if (mousePosition.x >= windowX && mousePosition.x <= windowX + 10f && mousePosition.y >= windowY + 20f && mousePosition.y <= windowY + windowHeight - 20f)
{
isResizing = true;
currentResizeEdge = ResizeEdge.Left;
current.Use();
}
else if (mousePosition.x >= windowX + 20f && mousePosition.x <= windowX + windowWidth - 20f && mousePosition.y >= windowY && mousePosition.y <= windowY + 10f)
{
isResizing = true;
currentResizeEdge = ResizeEdge.Top;
current.Use();
}
}
else if ((int)current.type == 3)
{
if (isDragging)
{
Vector2 mousePosition2 = current.mousePosition;
windowX = Mathf.Clamp(mousePosition2.x - dragOffset.x, 0f, (float)Screen.width - windowWidth);
windowY = Mathf.Clamp(mousePosition2.y - dragOffset.y, 0f, (float)Screen.height - windowHeight);
current.Use();
}
else
{
if (!isResizing)
{
return;
}
Vector2 mousePosition3 = current.mousePosition;
switch (currentResizeEdge)
{
case ResizeEdge.BottomRight:
windowWidth = Mathf.Clamp(mousePosition3.x - windowX, 300f, (float)Screen.width - windowX);
windowHeight = Mathf.Clamp(mousePosition3.y - windowY, 200f, (float)Screen.height - windowY);
break;
case ResizeEdge.Bottom:
windowHeight = Mathf.Clamp(mousePosition3.y - windowY, 200f, (float)Screen.height - windowY);
break;
case ResizeEdge.Right:
windowWidth = Mathf.Clamp(mousePosition3.x - windowX, 300f, (float)Screen.width - windowX);
break;
case ResizeEdge.Left:
if (windowX + windowWidth - mousePosition3.x >= 300f)
{
windowX = Mathf.Clamp(mousePosition3.x, 0f, windowX + windowWidth - 300f);
windowWidth = windowX + windowWidth - windowX;
}
break;
case ResizeEdge.Top:
if (windowY + windowHeight - mousePosition3.y >= 200f)
{
windowY = Mathf.Clamp(mousePosition3.y, 0f, windowY + windowHeight - 200f);
windowHeight = windowY + windowHeight - windowY;
}
break;
}
current.Use();
}
}
else if ((int)current.type == 1)
{
isDragging = false;
isResizing = false;
currentResizeEdge = ResizeEdge.None;
current.Use();
}
}
private static void EncyclopediaWindow(int windowId)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: 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_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
//IL_0066: Expected O, but got Unknown
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_1699: Unknown result type (might be due to invalid IL or missing references)
//IL_1c2e: Unknown result type (might be due to invalid IL or missing references)
//IL_1002: Unknown result type (might be due to invalid IL or missing references)
//IL_1010: Unknown result type (might be due to invalid IL or missing references)
//IL_101a: Expected O, but got Unknown
//IL_1021: Unknown result type (might be due to invalid IL or missing references)
//IL_1036: Unknown result type (might be due to invalid IL or missing references)
//IL_104b: Unknown result type (might be due to invalid IL or missing references)
//IL_0ecd: Unknown result type (might be due to invalid IL or missing references)
//IL_0ed2: Unknown result type (might be due to invalid IL or missing references)
//IL_0ee3: Unknown result type (might be due to invalid IL or missing references)
//IL_0ee8: Unknown result type (might be due to invalid IL or missing references)
//IL_0efb: Unknown result type (might be due to invalid IL or missing references)
//IL_0f00: Unknown result type (might be due to invalid IL or missing references)
//IL_0f10: Unknown result type (might be due to invalid IL or missing references)
//IL_0f15: Unknown result type (might be due to invalid IL or missing references)
//IL_0f54: Unknown result type (might be due to invalid IL or missing references)
//IL_0f5b: Unknown result type (might be due to invalid IL or missing references)
//IL_0f60: Unknown result type (might be due to invalid IL or missing references)
//IL_0f79: Unknown result type (might be due to invalid IL or missing references)
//IL_0f7e: Unknown result type (might be due to invalid IL or missing references)
//IL_0f97: Unknown result type (might be due to invalid IL or missing references)
//IL_0f9c: Unknown result type (might be due to invalid IL or missing references)
//IL_0fb5: Unknown result type (might be due to invalid IL or missing references)
//IL_0fba: Unknown result type (might be due to invalid IL or missing references)
//IL_0fd1: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd9: Unknown result type (might be due to invalid IL or missing references)
//IL_0dde: Unknown result type (might be due to invalid IL or missing references)
//IL_0de3: Unknown result type (might be due to invalid IL or missing references)
//IL_0dfb: Unknown result type (might be due to invalid IL or missing references)
//IL_0e0f: Unknown result type (might be due to invalid IL or missing references)
//IL_0e14: Unknown result type (might be due to invalid IL or missing references)
//IL_0e29: Expected O, but got Unknown
//IL_0e29: Unknown result type (might be due to invalid IL or missing references)
//IL_107f: Unknown result type (might be due to invalid IL or missing references)
//IL_1085: Invalid comparison between Unknown and I4
//IL_108b: Unknown result type (might be due to invalid IL or missing references)
//IL_1090: Unknown result type (might be due to invalid IL or missing references)
//IL_1094: Unknown result type (might be due to invalid IL or missing references)
//IL_10c6: Unknown result type (might be due to invalid IL or missing references)
//IL_024e: 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_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_049e: Unknown result type (might be due to invalid IL or missing references)
//IL_0502: Unknown result type (might be due to invalid IL or missing references)
//IL_0566: Unknown result type (might be due to invalid IL or missing references)
//IL_05ca: Unknown result type (might be due to invalid IL or missing references)
//IL_0821: Unknown result type (might be due to invalid IL or missing references)
//IL_0827: Invalid comparison between Unknown and I4
//IL_062e: Unknown result type (might be due to invalid IL or missing references)
//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
//IL_082d: Unknown result type (might be due to invalid IL or missing references)
//IL_0832: Unknown result type (might be due to invalid IL or missing references)
//IL_0859: Unknown result type (might be due to invalid IL or missing references)
//IL_0380: Unknown result type (might be due to invalid IL or missing references)
//IL_088c: Unknown result type (might be due to invalid IL or missing references)
//IL_0944: Unknown result type (might be due to invalid IL or missing references)
//IL_0d1b: Unknown result type (might be due to invalid IL or missing references)
//IL_0d92: Unknown result type (might be due to invalid IL or missing references)
//IL_0d94: Unknown result type (might be due to invalid IL or missing references)
//IL_0d99: Unknown result type (might be due to invalid IL or missing references)
//IL_0d9d: Unknown result type (might be due to invalid IL or missing references)
//IL_0da2: Unknown result type (might be due to invalid IL or missing references)
//IL_1126: Unknown result type (might be due to invalid IL or missing references)
//IL_15bb: Unknown result type (might be due to invalid IL or missing references)
//IL_15f9: Unknown result type (might be due to invalid IL or missing references)
//IL_1bf0: Unknown result type (might be due to invalid IL or missing references)
//IL_1640: Unknown result type (might be due to invalid IL or missing references)
//IL_0744: Unknown result type (might be due to invalid IL or missing references)
//IL_16ed: Unknown result type (might be due to invalid IL or missing references)
//IL_1703: Unknown result type (might be due to invalid IL or missing references)
//IL_1661: Unknown result type (might be due to invalid IL or missing references)
//IL_0a3d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a59: Unknown result type (might be due to invalid IL or missing references)
//IL_0a5e: Unknown result type (might be due to invalid IL or missing references)
//IL_0a62: Unknown result type (might be due to invalid IL or missing references)
//IL_0a67: Unknown result type (might be due to invalid IL or missing references)
//IL_11f3: Unknown result type (might be due to invalid IL or missing references)
//IL_120f: Unknown result type (might be due to invalid IL or missing references)
//IL_1214: Unknown result type (might be due to invalid IL or missing references)
//IL_1218: Unknown result type (might be due to invalid IL or missing references)
//IL_121d: Unknown result type (might be due to invalid IL or missing references)
//IL_0aa3: Unknown result type (might be due to invalid IL or missing references)
//IL_0aaa: Expected O, but got Unknown
//IL_0abd: Unknown result type (might be due to invalid IL or missing references)
//IL_0ac7: Unknown result type (might be due to invalid IL or missing references)
//IL_0acc: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad1: Unknown result type (might be due to invalid IL or missing references)
//IL_0ae2: Unknown result type (might be due to invalid IL or missing references)
//IL_0af3: Unknown result type (might be due to invalid IL or missing references)
//IL_0afc: Unknown result type (might be due to invalid IL or missing references)
//IL_0b12: Unknown result type (might be due to invalid IL or missing references)
//IL_0b19: Expected O, but got Unknown
//IL_0b22: Unknown result type (might be due to invalid IL or missing references)
//IL_0b50: Unknown result type (might be due to invalid IL or missing references)
//IL_0b6d: Unknown result type (might be due to invalid IL or missing references)
//IL_0b74: Expected O, but got Unknown
//IL_0ba0: Unknown result type (might be due to invalid IL or missing references)
//IL_0bbd: Unknown result type (might be due to invalid IL or missing references)
//IL_0bc2: Unknown result type (might be due to invalid IL or missing references)
//IL_0bd7: Unknown result type (might be due to invalid IL or missing references)
//IL_0c44: Unknown result type (might be due to invalid IL or missing references)
//IL_0c4a: Invalid comparison between Unknown and I4
//IL_1233: Unknown result type (might be due to invalid IL or missing references)
//IL_14e7: Unknown result type (might be due to invalid IL or missing references)
//IL_14ed: Invalid comparison between Unknown and I4
//IL_0c50: Unknown result type (might be due to invalid IL or missing references)
//IL_0c55: Unknown result type (might be due to invalid IL or missing references)
//IL_0c84: Unknown result type (might be due to invalid IL or missing references)
//IL_1261: Unknown result type (might be due to invalid IL or missing references)
//IL_1268: Expected O, but got Unknown
//IL_127b: Unknown result type (might be due to invalid IL or missing references)
//IL_1280: Unknown result type (might be due to invalid IL or missing references)
//IL_1285: Unknown result type (might be due to invalid IL or missing references)
//IL_1296: Unknown result type (might be due to invalid IL or missing references)
//IL_12a7: Unknown result type (might be due to invalid IL or missing references)
//IL_12b0: Unknown result type (might be due to invalid IL or missing references)
//IL_12c6: Unknown result type (might be due to invalid IL or missing references)
//IL_12cd: Expected O, but got Unknown
//IL_12d6: Unknown result type (might be due to invalid IL or missing references)
//IL_1302: Unknown result type (might be due to invalid IL or missing references)
//IL_14f3: Unknown result type (might be due to invalid IL or missing references)
//IL_14f8: Unknown result type (might be due to invalid IL or missing references)
//IL_1527: Unknown result type (might be due to invalid IL or missing references)
//IL_0cbb: Unknown result type (might be due to invalid IL or missing references)
//IL_1370: Unknown result type (might be due to invalid IL or missing references)
//IL_1377: Expected O, but got Unknown
//IL_1350: Unknown result type (might be due to invalid IL or missing references)
//IL_155e: Unknown result type (might be due to invalid IL or missing references)
//IL_0c04: Unknown result type (might be due to invalid IL or missing references)
//IL_0c11: Unknown result type (might be due to invalid IL or missing references)
//IL_0c23: Unknown result type (might be due to invalid IL or missing references)
//IL_13d9: Unknown result type (might be due to invalid IL or missing references)
//IL_13f1: Unknown result type (might be due to invalid IL or missing references)
//IL_13f8: Expected O, but got Unknown
//IL_146b: Unknown result type (might be due to invalid IL or missing references)
//IL_147e: Unknown result type (might be due to invalid IL or missing references)
//IL_1483: Unknown result type (might be due to invalid IL or missing references)
//IL_1498: Unknown result type (might be due to invalid IL or missing references)
//IL_14aa: Unknown result type (might be due to invalid IL or missing references)
//IL_14b7: Unknown result type (might be due to invalid IL or missing references)
//IL_14c9: Unknown result type (might be due to invalid IL or missing references)
//IL_18af: Unknown result type (might be due to invalid IL or missing references)
//IL_18cb: Unknown result type (might be due to invalid IL or missing references)
//IL_18d0: Unknown result type (might be due to invalid IL or missing references)
//IL_18d4: Unknown result type (might be due to invalid IL or missing references)
//IL_18d9: Unknown result type (might be due to invalid IL or missing references)
//IL_1941: Unknown result type (might be due to invalid IL or missing references)
//IL_1948: Expected O, but got Unknown
//IL_195b: Unknown result type (might be due to invalid IL or missing references)
//IL_1965: Unknown result type (might be due to invalid IL or missing references)
//IL_196a: Unknown result type (might be due to invalid IL or missing references)
//IL_1b2d: Unknown result type (might be due to invalid IL or missing references)
//IL_1b33: Invalid comparison between Unknown and I4
//IL_19a5: Unknown result type (might be due to invalid IL or missing references)
//IL_19aa: Unknown result type (might be due to invalid IL or missing references)
//IL_19bb: Unknown result type (might be due to invalid IL or missing references)
//IL_19d3: Unknown result type (might be due to invalid IL or missing references)
//IL_19e9: Unknown result type (might be due to invalid IL or missing references)
//IL_19f0: Expected O, but got Unknown
//IL_19f9: Unknown result type (might be due to invalid IL or missing references)
//IL_1a27: Unknown result type (might be due to invalid IL or missing references)
//IL_1a44: Unknown result type (might be due to invalid IL or missing references)
//IL_1a4b: Expected O, but got Unknown
//IL_1972: Unknown result type (might be due to invalid IL or missing references)
//IL_197f: Unknown result type (might be due to invalid IL or missing references)
//IL_198c: Unknown result type (might be due to invalid IL or missing references)
//IL_1999: Unknown result type (might be due to invalid IL or missing references)
//IL_1b39: Unknown result type (might be due to invalid IL or missing references)
//IL_1b3e: Unknown result type (might be due to invalid IL or missing references)
//IL_1b6d: Unknown result type (might be due to invalid IL or missing references)
//IL_1aa0: Unknown result type (might be due to invalid IL or missing references)
//IL_1abd: Unknown result type (might be due to invalid IL or missing references)
//IL_1ac2: Unknown result type (might be due to invalid IL or missing references)
//IL_1ad7: Unknown result type (might be due to invalid IL or missing references)
//IL_1a7b: Unknown result type (might be due to invalid IL or missing references)
//IL_1ba4: Unknown result type (might be due to invalid IL or missing references)
//IL_1aed: Unknown result type (might be due to invalid IL or missing references)
//IL_1afa: Unknown result type (might be due to invalid IL or missing references)
//IL_1b0c: Unknown result type (might be due to invalid IL or missing references)
float num = 200f;
float num2 = num + 10f;
Event current = Event.current;
MenuPatches.ClearTooltip();
Rect val = new Rect(num, 0f, 2f, windowHeight);
GUIStyle val2 = new GUIStyle(GUI.skin.box);
val2.normal.background = Texture2D.whiteTexture;
val2.margin = new RectOffset(0, 0, 0, 0);
GUI.Box(val, "", val2);
GUI.Label(new Rect(10f, 30f, num - 20f, 30f), "\ud83d\udcda Categories", GUI.skin.label);
List<Upgrade> universalUpgrades = MenuPatches.GetUniversalUpgrades();
int count = universalUpgrades.Count;
List<IUpgradable> list = Global.Instance.AllGear.Where((IUpgradable g) => (int)g.GearType == 0 && g is IWeapon).ToList();
int count2 = list.Count;
PlayerResource[] playerResources = Global.Instance.PlayerResources;
int num3 = playerResources.Length;
int num4 = 0;
int num5 = 0;
try
{
num4 = Global.Instance.Missions.Where((Mission m) => ((Enum)m.MissionFlags).HasFlag((Enum)(object)(MissionFlags)1) && m.CanBeSelected()).ToList().Count;
}
catch (Exception)
{
num4 = 0;
}
try
{
num5 = GetTotalEnemyCount();
}
catch (Exception)
{
num5 = 0;
}
int num6 = 0;
Character[] characters = Global.Instance.Characters;
foreach (Character val3 in characters)
{
if (((Dude)val3).Info.HasVisibleUpgrades((Rarity)(-1)) && ((Dude)val3).Info.Upgrades.Length != 0)
{
num6++;
}
}
IUpgradable[] allGear = Global.Instance.AllGear;
foreach (IUpgradable val4 in allGear)
{
if (val4.Info.HasVisibleUpgrades((Rarity)(-1)) && val4.Info.Upgrades.Length != 0)
{
num6++;
}
}
if (count > 0)
{
num6++;
}
if (count2 > 0)
{
num6++;
}
if (num3 > 0)
{
num6++;
}
if (num4 > 0)
{
num6++;
}
if (num5 > 0)
{
num6++;
}
float num7 = 40f;
float num8 = 5f;
float num9 = (float)num6 * (num7 + num8);
leftScrollPos = GUI.BeginScrollView(new Rect(10f, 60f, num - 20f, windowHeight - 110f), leftScrollPos, new Rect(0f, 0f, num - 40f, num9), false, true);
float num10 = 0f;
characters = Global.Instance.Characters;
foreach (Character val5 in characters)
{
if (!((Object)(object)((Dude)val5).Info != (Object)null) || !((Dude)val5).Info.HasVisibleUpgrades((Rarity)(-1)) || ((Dude)val5).Info.Upgrades == null || ((Dude)val5).Info.Upgrades.Length == 0)
{
continue;
}
List<Upgrade> list2 = ((Dude)val5).Info.Upgrades.Where((Upgrade u) => !Regex.IsMatch(u.Name, "(_test_|_dev_|_wip|debug|temp|placeholder|todo|_old|_backup|_copy|_staging|_exp|_alpha|_beta|_proto|_mock|_fake|_stub|_wingsuit|\\.skinasset$|^test_|^wingsuit|^experimental|^dev_|^exp_|^proto_|^Test$|^Debug$|^Temp$|^Placeholder$|^Todo$|^Old$|^Backup$|^Copy$|^Staging$|^Exp$|^Alpha$|^Beta$|^Proto$|^Mock$|^Fake$|^Stub$|^Wingsuit$|^Experimental$)", RegexOptions.IgnoreCase)).ToList();
string text = ((MenuPatches.SelectedCategoryIndex >= 0 && MenuPatches.SelectedCategoryGear == val5) ? $"▶ {((Dude)val5).ClassName}\n({list2.Count} upgrades)" : $"{((Dude)val5).ClassName}\n({list2.Count} upgrades)");
if (GUI.Button(new Rect(0f, num10, num - 40f, num7), text))
{
int num11 = 0;
Character[] characters2 = Global.Instance.Characters;
foreach (Character val6 in characters2)
{
if (((Dude)val6).Info.HasVisibleUpgrades((Rarity)(-1)) && ((Dude)val6).Info.Upgrades.Length != 0)
{
if ((Object)(object)val6 == (Object)(object)val5)
{
MenuPatches.SelectCategory(num11);
break;
}
num11++;
}
}
allGear = Global.Instance.AllGear;
foreach (IUpgradable val7 in allGear)
{
if (val7.Info.HasVisibleUpgrades((Rarity)(-1)) && val7.Info.Upgrades.Length != 0)
{
num11++;
}
}
MenuPatches.ClearTooltip();
}
num10 += num7 + num8;
}
if (count > 0)
{
string text2 = (MenuPatches.IsUniversalSelected ? $"▶ Universal Upgrades\n({count} upgrades)" : $"Universal Upgrades\n({count} upgrades)");
if (GUI.Button(new Rect(0f, num10, num - 40f, num7), text2))
{
MenuPatches.SelectUniversal();
MenuPatches.ClearTooltip();
}
num10 += num7 + num8;
}
if (count2 > 0)
{
string text3 = (MenuPatches.IsWeaponSelected ? $"▶ Weapon Stats\n({count2} weapons)" : $"Weapon Stats\n({count2} weapons)");
if (GUI.Button(new Rect(0f, num10, num - 40f, num7), text3))
{
MenuPatches.SelectWeapons();
MenuPatches.ClearTooltip();
}
num10 += num7 + num8;
}
if (num3 > 0)
{
string text4 = (MenuPatches.IsResourcesSelected ? $"▶ Resources\n({num3} resources)" : $"Resources\n({num3} resources)");
if (GUI.Button(new Rect(0f, num10, num - 40f, num7), text4))
{
MenuPatches.SelectResources();
MenuPatches.ClearTooltip();
}
num10 += num7 + num8;
}
if (num4 > 0)
{
string text5 = (MenuPatches.IsMissionsSelected ? $"▶ Missions\n({num4} missions)" : $"Missions\n({num4} missions)");
if (GUI.Button(new Rect(0f, num10, num - 40f, num7), text5))
{
MenuPatches.SelectMissions();
MenuPatches.ClearTooltip();
}
num10 += num7 + num8;
}
if (num5 > 0)
{
string text6 = (MenuPatches.IsEnemiesSelected ? $"▶ Enemies\n({num5} enemies)" : $"Enemies\n({num5} enemies)");
if (GUI.Button(new Rect(0f, num10, num - 40f, num7), text6))
{
MenuPatches.SelectEnemies();
MenuPatches.ClearTooltip();
}
num10 += num7 + num8;
}
allGear = Global.Instance.AllGear;
foreach (IUpgradable val8 in allGear)
{
if (!((Object)(object)val8.Info != (Object)null) || !val8.Info.HasVisibleUpgrades((Rarity)(-1)) || val8.Info.Upgrades == null || val8.Info.Upgrades.Length == 0 || !Global.Instance.AllGear.Contains(val8))
{
continue;
}
string text7 = ((MenuPatches.SelectedCategoryIndex >= 0 && MenuPatches.SelectedCategoryGear == val8) ? $"▶ {val8.Info.Name}\n({val8.Info.Upgrades.Length} upgrades)" : $"{val8.Info.Name}\n({val8.Info.Upgrades.Length} upgrades)");
if (GUI.Button(new Rect(0f, num10, num - 40f, num7), text7))
{
int num12 = 0;
characters = Global.Instance.Characters;
foreach (Character val9 in characters)
{
if (((Dude)val9).Info.HasVisibleUpgrades((Rarity)(-1)) && ((Dude)val9).Info.Upgrades.Length != 0)
{
num12++;
}
}
IUpgradable[] allGear2 = Global.Instance.AllGear;
foreach (IUpgradable val10 in allGear2)
{
if (val10.Info.HasVisibleUpgrades((Rarity)(-1)) && val10.Info.Upgrades.Length != 0)
{
if (val10 == val8)
{
MenuPatches.SelectCategory(num12);
break;
}
num12++;
}
}
MenuPatches.ClearTooltip();
}
num10 += num7 + num8;
}
GUI.EndScrollView();
if ((int)current.type == 6)
{
Vector2 mousePosition = current.mousePosition;
Rect val11 = default(Rect);
((Rect)(ref val11))..ctor(10f, 60f, num - 20f, windowHeight - 110f);
if (((Rect)(ref val11)).Contains(mousePosition))
{
float num13 = Mathf.Max(0f, num9 - (windowHeight - 110f));
leftScrollPos.y = Mathf.Clamp(leftScrollPos.y + current.delta.y * 20f, 0f, num13);
current.Use();
}
}
GUI.BeginGroup(new Rect(num2, 30f, windowWidth - num2 - 10f, windowHeight - 50f));
if ((MenuPatches.SelectedCategoryIndex >= 0 && MenuPatches.SelectedCategoryGear != null) || MenuPatches.IsUniversalSelected || MenuPatches.IsWeaponSelected || MenuPatches.IsResourcesSelected || MenuPatches.IsMissionsSelected || MenuPatches.IsEnemiesSelected)
{
if (MenuPatches.IsUniversalSelected)
{
string text8 = "Universal Upgrades";
GUI.Label(new Rect(0f, 0f, windowWidth - num2 - 10f - 20f, 30f), text8, GUI.skin.label);
List<Upgrade> list3 = universalUpgrades;
list3.Sort(delegate(Upgrade a, Upgrade b)
{
int rarityOrder3 = GetRarityOrder(a);
int rarityOrder4 = GetRarityOrder(b);
return (rarityOrder3 != rarityOrder4) ? rarityOrder3.CompareTo(rarityOrder4) : a.Name.CompareTo(b.Name);
});
int num14 = 110;
int num15 = 85;
int num16 = (int)(windowWidth - num2 - 10f - 20f - 20f - 25f);
int num17 = num14 + 8;
int num18 = 1;
if (num17 > 0)
{
num18 = num16 / num17;
num18 = Mathf.Max(1, num18);
}
int count3 = list3.Count;
int num19 = ((count3 > 0) ? ((count3 + num18 - 1) / num18) : 0);
int num20 = ((num18 > 0) ? ((num18 - 1) * (num14 + 8) + num14) : 0);
int num21 = ((num19 > 0) ? ((num19 - 1) * (num15 + 8) + num15) : 0);
Rect val12 = new Rect(0f, 40f, windowWidth - num2 - 10f - 20f, windowHeight - 120f);
Rect val13 = default(Rect);
((Rect)(ref val13))..ctor(0f, 0f, (float)num20, (float)num21);
rightScrollPos = GUI.BeginScrollView(val12, rightScrollPos, val13, false, true);
Rect val18 = default(Rect);
Vector2 mousePosition3 = default(Vector2);
for (int k = 0; k < list3.Count; k++)
{
Upgrade val14 = list3[k];
int num22 = k / num18;
float num23 = k % num18 * (num14 + 8);
float num24 = num22 * (num15 + 8);
GUIStyle val15 = new GUIStyle(GUI.skin.box);
val15.normal.background = Texture2D.whiteTexture;
Color backgroundColor = Global.GetRarity(val14.Rarity).backgroundColor;
Color color = GUI.color;
GUI.color = backgroundColor;
GUI.Box(new Rect(num23, num24, (float)num14, (float)num15), "", val15);
GUI.color = color;
ref RarityData rarity = ref Global.GetRarity(val14.Rarity);
GUIStyle val16 = new GUIStyle(GUI.skin.label);
val16.normal.textColor = rarity.color;
val16.fontSize = 10;
GUI.Label(new Rect(num23 + 10f, num24 + 10f, (float)(num14 - 20), 15f), ((RarityData)(ref rarity)).Name, val16);
GUIStyle val17 = new GUIStyle(GUI.skin.label);
val17.fontSize = 12;
val17.wordWrap = true;
GUI.Label(new Rect(num23 + 10f, num24 + 25f, (float)(num14 - 20), 60f), StripRichTextTags(val14.Name), val17);
Vector2 mousePosition2 = Event.current.mousePosition;
((Rect)(ref val18))..ctor(num23, num24, (float)num14, (float)num15);
if (((Rect)(ref val18)).Contains(mousePosition2))
{
IUpgradable gear = Global.Instance.AllGear?.FirstOrDefault();
string upgradeTooltipText = GetUpgradeTooltipText(val14, gear, isUnlocked: true);
((Vector2)(ref mousePosition3))..ctor(mousePosition2.x + windowX, mousePosition2.y + windowY);
MenuPatches.SetTooltip(upgradeTooltipText, mousePosition3);
}
}
GUI.EndScrollView();
if ((int)current.type == 6)
{
Vector2 mousePosition4 = current.mousePosition;
Rect val19 = default(Rect);
((Rect)(ref val19))..ctor(num2, 70f, windowWidth - num2 - 10f - 20f, windowHeight - 120f);
if (((Rect)(ref val19)).Contains(mousePosition4))
{
float num25 = Mathf.Max(0f, (float)num21 - (windowHeight - 120f));
rightScrollPos.y = Mathf.Clamp(rightScrollPos.y + current.delta.y * 20f, 0f, num25);
current.Use();
}
}
}
else if (MenuPatches.IsWeaponSelected)
{
string text9 = "Weapon Stats";
GUI.Label(new Rect(0f, 0f, windowWidth - num2 - 10f - 20f, 30f), text9, GUI.skin.label);
int num26 = 15;
float num27 = list.Count * (50 + num26);
float num28 = windowWidth - num2 - 10f - 20f;
Rect val20 = default(Rect);
((Rect)(ref val20))..ctor(0f, 40f, num28, windowHeight - 120f);
Rect val21 = default(Rect);
((Rect)(ref val21))..ctor(0f, 0f, ((Rect)(ref val20)).width, num27);
rightScrollPos = GUI.BeginScrollView(val20, rightScrollPos, val21, false, false);
float num29 = 0f;
Rect val27 = default(Rect);
Vector2 mousePosition5 = default(Vector2);
foreach (IUpgradable item in list)
{
Color color2 = new Color(0.85f, 0.85f, 0.85f, 1f);
Color color3 = GUI.color;
GUI.color = color2;
Rect val22 = new Rect(10f, num29, 200f, 50f);
GUIStyle val23 = new GUIStyle(GUI.skin.box);
val23.normal.background = Texture2D.whiteTexture;
GUI.Box(val22, "", val23);
GUI.color = color3;
StripRichTextTags(item.Info.Name);
Sprite val24 = null;
try
{
PropertyInfo property = ((object)item).GetType().GetProperty("Info", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (property != null)
{
object value = property.GetValue(item);
if (value != null)
{
PropertyInfo property2 = value.GetType().GetProperty("Icon", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (property2 != null)
{
object? value2 = property2.GetValue(value);
val24 = (Sprite)((value2 is Sprite) ? value2 : null);
}
}
}
}
catch (Exception)
{
}
if ((Object)(object)val24 != (Object)null && (Object)(object)val24.texture != (Object)null)
{
Rect val25 = val24.rect;
float num30 = 200f / ((Rect)(ref val25)).width;
val25 = val24.rect;
float num31 = Mathf.Min(num30, 50f / ((Rect)(ref val25)).height);
val25 = val24.rect;
float num32 = ((Rect)(ref val25)).width * num31;
val25 = val24.rect;
float num33 = ((Rect)(ref val25)).height * num31;
float num34 = 10f + (190f - num32) / 2f;
float num35 = num29 + (50f - num33) / 2f;
Rect val26 = new Rect(num34, num35, num32, num33);
val25 = val24.textureRect;
float num36 = ((Rect)(ref val25)).xMin / (float)((Texture)val24.texture).width;
val25 = val24.textureRect;
float num37 = ((Rect)(ref val25)).yMin / (float)((Texture)val24.texture).height;
val25 = val24.textureRect;
float num38 = ((Rect)(ref val25)).width / (float)((Texture)val24.texture).width;
val25 = val24.textureRect;
new Rect(num36, num37, num38, ((Rect)(ref val25)).height / (float)((Texture)val24.texture).height);
GUI.DrawTexture(val26, (Texture)(object)val24.texture);
}
((Rect)(ref val27))..ctor(10f, num29, 200f, 50f);
if (((Rect)(ref val27)).Contains(Event.current.mousePosition))
{
string weaponTooltipText = GetWeaponTooltipText((IWeapon)item);
((Vector2)(ref mousePosition5))..ctor(Event.current.mousePosition.x + windowX, Event.current.mousePosition.y + windowY);
MenuPatches.SetTooltip(weaponTooltipText, mousePosition5);
}
num29 += (float)(50 + num26);
}
GUI.EndScrollView();
if ((int)current.type == 6)
{
Vector2 mousePosition6 = current.mousePosition;
if (((Rect)(ref val20)).Contains(mousePosition6))
{
float num39 = Mathf.Max(0f, num27 - ((Rect)(ref val20)).height);
rightScrollPos.y = Mathf.Clamp(rightScrollPos.y + current.delta.y * 20f, 0f, num39);
current.Use();
}
}
}
else if (MenuPatches.IsResourcesSelected)
{
string text10 = "Resources";
GUI.Label(new Rect(0f, 0f, windowWidth - num2 - 10f - 20f, 30f), text10, GUI.skin.label);
int num40 = 90;
int num41 = 70;
int num42 = (int)(windowWidth - num2 - 10f - 20f - 20f - 25f);
int num43 = num40 + 8;
int num44 = 1;
if (num43 > 0)
{
num44 = num42 / num43;
num44 = Mathf.Max(1, num44);
}
int num45 = playerResources.Length;
int num46 = ((num45 > 0) ? ((num45 + num44 - 1) / num44) : 0);
int num47 = ((num44 > 0) ? ((num44 - 1) * (num40 + 8) + num40) : 0);
int num48 = ((num46 > 0) ? ((num46 - 1) * (num41 + 8) + num41) : 0);
Rect val28 = new Rect(0f, 40f, windowWidth - num2 - 10f - 20f, windowHeight - 120f);
Rect val29 = default(Rect);
((Rect)(ref val29))..ctor(0f, 0f, (float)num47, (float)num48);
rightScrollPos = GUI.BeginScrollView(val28, rightScrollPos, val29, false, true);
Rect val35 = default(Rect);
Vector2 mousePosition8 = default(Vector2);
for (int l = 0; l < playerResources.Length; l++)
{
PlayerResource val30 = playerResources[l];
if ((int)val30.Visibility != 0)
{
int num49 = l / num44;
float num50 = l % num44 * (num40 + 8);
float num51 = num49 * (num41 + 8);
GUIStyle val31 = new GUIStyle(GUI.skin.box);
val31.normal.background = Texture2D.whiteTexture;
Color color4 = val30.Color;
Color color5 = GUI.color;
GUI.color = color4;
GUI.Box(new Rect(num50, num51, (float)num40, (float)num41), "", val31);
GUI.color = color5;
ref RarityData rarity2 = ref Global.GetRarity(val30.Rarity);
GUIStyle val32 = new GUIStyle(GUI.skin.label);
val32.normal.textColor = rarity2.color;
val32.fontSize = 8;
GUI.Label(new Rect(num50 + 5f, num51 + 5f, 50f, 12f), ((RarityData)(ref rarity2)).Name, val32);
if ((Object)(object)val30.Icon != (Object)null)
{
float num52 = num50 + ((float)num40 - 20f) / 2f;
float num53 = num51 + 20f;
GUI.DrawTexture(new Rect(num52, num53, 20f, 20f), (Texture)(object)val30.Icon.texture);
}
GUIStyle val33 = new GUIStyle(GUI.skin.label);
val33.fontSize = 9;
val33.wordWrap = true;
val33.alignment = (TextAnchor)1;
string text11 = StripRichTextTags(val30.Name);
if (text11.Length > 12)
{
text11 = text11.Substring(0, 10) + "...";
}
GUI.Label(new Rect(num50 + 3f, num51 + 42f, (float)(num40 - 6), 20f), text11, val33);
GUIStyle val34 = new GUIStyle(GUI.skin.label);
val34.fontSize = 8;
val34.alignment = (TextAnchor)7;
string text12 = val30.ItemCount.ToString();
if (val30.Max > 0 && val30.Max < 9999)
{
text12 += $"/{val30.Max}";
}
GUI.Label(new Rect(num50 + 3f, num51 + 50f, (float)(num40 - 6), 15f), text12, val34);
Vector2 mousePosition7 = Event.current.mousePosition;
((Rect)(ref val35))..ctor(num50, num51, (float)num40, (float)num41);
if (((Rect)(ref val35)).Contains(mousePosition7))
{
string resourceTooltipText = GetResourceTooltipText(val30);
((Vector2)(ref mousePosition8))..ctor(mousePosition7.x + windowX, mousePosition7.y + windowY);
MenuPatches.SetTooltip(resourceTooltipText, mousePosition8);
}
}
}
GUI.EndScrollView();
if ((int)current.type == 6)
{
Vector2 mousePosition9 = current.mousePosition;
Rect val36 = default(Rect);
((Rect)(ref val36))..ctor(num2, 70f, windowWidth - num2 - 10f - 20f, windowHeight - 120f);
if (((Rect)(ref val36)).Contains(mousePosition9))
{
float num54 = Mathf.Max(0f, (float)num48 - (windowHeight - 120f));
rightScrollPos.y = Mathf.Clamp(rightScrollPos.y + current.delta.y * 20f, 0f, num54);
current.Use();
}
}
}
else if (MenuPatches.IsMissionsSelected)
{
string text13 = "Missions";
GUI.Label(new Rect(0f, 0f, windowWidth - num2 - 10f - 20f, 30f), text13, GUI.skin.label);
GUI.Label(new Rect(10f, 40f, windowWidth - num2 - 10f - 20f, windowHeight - 120f), "Missions system currently unavailable due to compatibility issues.\nThis feature will be added in a future update.");
}
else if (MenuPatches.IsEnemiesSelected)
{
string text14 = "Enemies";
GUI.Label(new Rect(0f, 0f, windowWidth - num2 - 10f - 20f, 30f), text14, GUI.skin.label);
try
{
DisplayEnemiesPanel(windowWidth, num2, windowHeight, rightScrollPos);
}
catch (Exception)
{
GUI.Label(new Rect(10f, 40f, windowWidth - num2 - 10f - 20f, windowHeight - 120f), "Enemies database currently unavailable due to compatibility issues.\nThis feature will be added in a future update.");
}
}
else
{
IUpgradable selectedCategoryGear = MenuPatches.SelectedCategoryGear;
string text15 = selectedCategoryGear.Info.Name ?? "";
GUI.Label(new Rect(0f, 0f, windowWidth - num2 - 10f - 20f, 30f), text15, GUI.skin.label);
_ = Vector2.zero;
List<Upgrade> list4 = new List<Upgrade>();
Character val37 = (Character)(object)((selectedCategoryGear is Character) ? selectedCategoryGear : null);
if (val37 != null)
{
list4 = ((Dude)val37).Info.Upgrades.Where((Upgrade u) => !Regex.IsMatch(u.Name, "(_test_|_dev_|_wip|debug|temp|placeholder|todo|_old|_backup|_copy|_staging|_exp|_alpha|_beta|_proto|_mock|_fake|_stub|_wingsuit|\\.skinasset$|^test_|^wingsuit|^experimental|^dev_|^exp_|^proto_|^Test$|^Debug$|^Temp$|^Placeholder$|^Todo$|^Old$|^Backup$|^Copy$|^Staging$|^Exp$|^Alpha$|^Beta$|^Proto$|^Mock$|^Fake$|^Stub$|^Wingsuit$|^Experimental$)", RegexOptions.IgnoreCase)).ToList();
}
else
{
list4.AddRange(selectedCategoryGear.Info.Upgrades);
}
list4.Sort(delegate(Upgrade a, Upgrade b)
{
int rarityOrder = GetRarityOrder(a);
int rarityOrder2 = GetRarityOrder(b);
return (rarityOrder != rarityOrder2) ? rarityOrder.CompareTo(rarityOrder2) : a.Name.CompareTo(b.Name);
});
List<Upgrade> list5 = list4.Where((Upgrade u) => (int)u.UpgradeType != 2).ToList();
List<Upgrade> list6 = list4.Where((Upgrade u) => (int)u.UpgradeType == 2).ToList();
int num55 = 110;
int num56 = 85;
int num57 = (int)(windowWidth - num2 - 10f - 20f - 20f - 25f);
int num58 = num55 + 8;
int num59 = 1;
if (num58 > 0)
{
num59 = num57 / num58;
num59 = Mathf.Max(1, num59);
}
int count4 = list5.Count;
int count5 = list6.Count;
int num60 = count4 + count5;
int num61 = ((num60 > 0) ? ((num60 + num59 - 1) / num59) : 0);
int num62 = ((num59 > 0) ? ((num59 - 1) * (num55 + 8) + num55) : 0);
int num63 = ((num61 > 0) ? ((num61 - 1) * (num56 + 8) + num56) : 0);
Rect val38 = new Rect(0f, 40f, windowWidth - num2 - 10f - 20f, windowHeight - 120f);
Rect val39 = default(Rect);
((Rect)(ref val39))..ctor(0f, 0f, (float)num62, (float)num63);
rightScrollPos = GUI.BeginScrollView(val38, rightScrollPos, val39, false, true);
list4.Clear();
list4.AddRange(list5);
list4.AddRange(list6);
Rect val44 = default(Rect);
Vector2 mousePosition11 = default(Vector2);
for (int n = 0; n < list4.Count; n++)
{
Upgrade val40 = list4[n];
bool flag = PlayerData.GetUpgradeInfo(selectedCategoryGear, val40).TotalInstancesCollected > 0;
int num64 = n / num59;
float num65 = n % num59 * (num55 + 8);
float num66 = num64 * (num56 + 8);
GUIStyle val41 = new GUIStyle(GUI.skin.box);
val41.normal.background = Texture2D.whiteTexture;
Color backgroundColor2 = Global.GetRarity(val40.Rarity).backgroundColor;
if (!flag)
{
((Color)(ref backgroundColor2))..ctor(backgroundColor2.r * 0.5f, backgroundColor2.g * 0.5f, backgroundColor2.b * 0.5f, backgroundColor2.a);
}
Color color6 = GUI.color;
GUI.color = backgroundColor2;
GUI.Box(new Rect(num65, num66, (float)num55, (float)num56), "", val41);
GUI.color = color6;
ref RarityData rarity3 = ref Global.GetRarity(val40.Rarity);
GUIStyle val42 = new GUIStyle(GUI.skin.label);
val42.normal.textColor = rarity3.color;
val42.fontSize = 10;
GUI.Label(new Rect(num65 + 10f, num66 + 10f, (float)(num55 - 20), 15f), ((RarityData)(ref rarity3)).Name, val42);
GUIStyle val43 = new GUIStyle(GUI.skin.label);
val43.fontSize = 12;
val43.wordWrap = true;
if (!flag)
{
val43.normal.textColor = new Color(1f, 1f, 1f, 0.5f);
}
GUI.Label(new Rect(num65 + 10f, num66 + 25f, (float)(num55 - 20), 60f), StripRichTextTags(val40.Name), val43);
Vector2 mousePosition10 = Event.current.mousePosition;
((Rect)(ref val44))..ctor(num65, num66, (float)num55, (float)num56);
if (((Rect)(ref val44)).Contains(mousePosition10))
{
string upgradeTooltipText2 = GetUpgradeTooltipText(val40, selectedCategoryGear, flag);
((Vector2)(ref mousePosition11))..ctor(mousePosition10.x + windowX, mousePosition10.y + windowY);
MenuPatches.SetTooltip(upgradeTooltipText2, mousePosition11);
}
}
GUI.EndScrollView();
if ((int)current.type == 6)
{
Vector2 mousePosition12 = current.mousePosition;
Rect val45 = default(Rect);
((Rect)(ref val45))..ctor(num2, 70f, windowWidth - num2 - 10f - 20f, windowHeight - 120f);
if (((Rect)(ref val45)).Contains(mousePosition12))
{
float num67 = Mathf.Max(0f, (float)num63 - (windowHeight - 120f));
rightScrollPos.y = Mathf.Clamp(rightScrollPos.y + current.delta.y * 20f, 0f, num67);
current.Use();
}
}
}
}
else
{
GUI.Label(new Rect(0f, 0f, windowWidth - num2 - 10f - 20f, 100f), "\ud83d\udcd6 Select a category from the left panel to view upgrades\n\nUpgrades will appear as cards with icons, names, and hover tooltips.\nLocked upgrades appear dimmed to show they are not yet collected.", GUI.skin.label);
}
GUI.EndGroup();
if (GUI.Button(new Rect(windowWidth - 70f, windowHeight - 40f, 60f, 30f), "Close"))
{
MenuPatches.ShowEncyclopediaGUI = false;
MenuPatches.ClearTooltip();
}
}
private static int GetRarityOrder(Upgrade upgrade)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return ((RarityData)(ref Global.GetRarity(upgrade.Rarity))).Name switch
{
"Oddity" => 1,
"Exotic" => 2,
"Epic" => 3,
"Rare" => 4,
"Standard" => 5,
_ => 6,
};
}
private static string StripRichTextTags(string text)
{
if (string.IsNullOrEmpty(text))
{
return text;
}
return Regex.Replace(text, "<[^>]*>", "");
}
private static string GetUpgradeStatRanges(Upgrade upgrade, IUpgradable gear)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Expected O, but got Unknown
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
MethodInfo methodInfo = AccessTools.Method(typeof(HoverInfo), "ShowExtraInfo", (Type[])null, (Type[])null);
MethodInfo methodInfo2 = AccessTools.Method(typeof(StatRangePatches), "ShowExtraInfoPrefix", (Type[])null, (Type[])null);
Harmony val = new Harmony("encyclopedia.statranges");
try
{
StatRangePatches.ForceShowExtraInfo = true;
val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
return StripRichTextTags(upgrade.GetStatList(0, new UpgradeInstance(upgrade, gear)));
}
finally
{
StatRangePatches.ForceShowExtraInfo = false;
val.Unpatch((MethodBase)methodInfo, methodInfo2);
}
}
private static string GetUpgradeTooltipText(Upgrade upgrade, IUpgradable gear, bool isUnlocked)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Expected O, but got Unknown
ref RarityData rarity = ref Global.GetRarity(upgrade.Rarity);
string text = "-- " + StripRichTextTags(upgrade.Name) + " --\n";
if (!isUnlocked)
{
text += "[Not Collected Yet]\n";
}
text = text + ((RarityData)(ref rarity)).Name + " Upgrade\n\n";
text = text + StripRichTextTags(upgrade.Description) + "\n\n";
text += "Properties:\n";
string upgradeStatRanges = GetUpgradeStatRanges(upgrade, gear);
if (!string.IsNullOrEmpty(upgradeStatRanges))
{
text += upgradeStatRanges;
}
else
{
string text2 = StripRichTextTags(upgrade.GetStatList(0, new UpgradeInstance(upgrade, gear)));
if (!string.IsNullOrEmpty(text2))
{
string[] array = text2.Split(new char[1] { '\n' });
foreach (string text3 in array)
{
if (!string.IsNullOrWhiteSpace(text3))
{
text = text + "• " + text3 + "\n";
}
}
}
else
{
text += "• Special upgrade effect (see description above)\n";
}
}
return text;
}
private static string GetWeaponTooltipText(IWeapon weapon)
{
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Expected O, but got Unknown
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: 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)
string text = "-- " + StripRichTextTags(((IUpgradable)weapon).Info.Name) + " --\n";
string text2 = StripRichTextTags(((IUpgradable)weapon).Info.Description);
text = text + text2 + "\n\n";
text += "Base Stats:\n";
try
{
Dictionary<string, StatInfo> dictionary = new Dictionary<string, StatInfo>();
Dictionary<string, StatInfo> dictionary2 = new Dictionary<string, StatInfo>();
UpgradeStatChanges val = new UpgradeStatChanges();
IEnumerator<StatInfo> enumerator = ((IGear)weapon).EnumeratePrimaryStats(val);
while (enumerator.MoveNext())
{
dictionary[enumerator.Current.name] = enumerator.Current;
}
IEnumerator<StatInfo> enumerator2 = ((IGear)weapon).EnumerateSecondaryStats(val);
while (enumerator2.MoveNext())
{
if (enumerator2.Current.name != "Aim Zoom")
{
dictionary2[enumerator2.Current.name] = enumerator2.Current;
}
}
AddWeaponStatToTooltip(ref text, dictionary2, "Damage");
AddWeaponStatToTooltip(ref text, dictionary, "Damage Type");
AddWeaponStatToTooltip(ref text, dictionary2, "Fire Rate");
AddWeaponStatToTooltip(ref text, dictionary2, "Ammo Capacity");
AddWeaponStatToTooltip(ref text, dictionary2, "Reload Duration");
AddWeaponStatToTooltip(ref text, dictionary2, "Range");
ref GunData gunData = ref weapon.GunData;
text += $"\n• Burst Size: {gunData.burstSize}\n";
text = text + "• Fire Mode: " + ((gunData.automatic == 1) ? "Automatic" : "Semi Automatic") + "\n";
}
catch (Exception)
{
text += "Base Stats: [Error loading weapon data]\n";
text += "• Type: Primary Weapon\n";
}
return text;
}
private static void AddWeaponStatToTooltip(ref string tooltip, Dictionary<string, StatInfo> stats, string statName)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
if (!stats.TryGetValue(statName, out var value))
{
return;
}
string text = StripColors(value.value);
if (statName == "Fire Rate")
{
try
{
if (float.TryParse(text, NumberStyles.Float, CultureInfo.InvariantCulture, out var result) && result > 0f)
{
float num = result / 60f;
tooltip += $"• {value.name}: {num:F1} shots/sec\n";
return;
}
}
catch (Exception)
{
}
}
tooltip = tooltip + "• " + value.name + ": " + text + "\n";
}
private static string StripColors(string text)
{
if (string.IsNullOrEmpty(text))
{
return text;
}
return Regex.Replace(text, "<color#[0-9A-Fa-f]{8}>|</color>", "");
}
private static string GetResourceTooltipText(PlayerResource resource)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
ref RarityData rarity = ref Global.GetRarity(resource.Rarity);
string text = "-- " + StripRichTextTags(resource.Name) + " --\n";
string text2 = (resource.IsItem ? "Item" : "Resource");
text = text + ((RarityData)(ref rarity)).Name + " " + text2 + "\n\n";
string text3 = StripRichTextTags(resource.Description);
if (!string.IsNullOrEmpty(text3))
{
text = text + text3 + "\n\n";
}
text += $"Owned: {resource.ItemCount}";
if (resource.Max > 0 && resource.Max < 9999)
{
text += $"/{resource.Max}";
}
text += "\n\n";
text = ((resource.Max <= 0 || resource.Max >= 9999) ? (text + "• Unlimited capacity\n") : (text + $"• Max capacity: {resource.Max}\n"));
if (resource.IsItem)
{
text += "• Can be used as an item\n";
if (resource.UnlockUseCount > 0)
{
text += $"• Usable after collecting {resource.UnlockUseCount} samples\n";
}
}
else
{
text += "• Resource can be gathered repeatedly\n";
}
return text;
}
private static string GetMissionTooltipText(Mission mission)
{
return string.Concat(string.Concat(string.Concat(string.Concat("-- Mission Information --\n\n" + "Missions provide objectives and challenges throughout the game.\n", "Each mission has specific goals to complete.\n\n"), "• Log in regularly to get new missions\n"), "• Different types of challenges available\n"), "• Rewards for mission completion\n");
}
private static void DisplayEnemiesPanel(float windowWidth, float rightPanelX, float windowHeight, Vector2 rightScrollPos)
{
//IL_0383: Unknown result type (might be due to invalid IL or missing references)
//IL_0388: Unknown result type (might be due to invalid IL or missing references)
//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
//IL_0395: Unknown result type (might be due to invalid IL or missing references)
//IL_039a: Unknown result type (might be due to invalid IL or missing references)
//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
//IL_0400: Unknown result type (might be due to invalid IL or missing references)
//IL_040d: Unknown result type (might be due to invalid IL or missing references)
//IL_041f: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Expected O, but got Unknown
//IL_0212: 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_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_022d: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_0256: Expected O, but got Unknown
//IL_0448: Unknown result type (might be due to invalid IL or missing references)
//IL_044e: Invalid comparison between Unknown and I4
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Expected O, but got Unknown
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0455: Unknown result type (might be due to invalid IL or missing references)
//IL_045a: Unknown result type (might be due to invalid IL or missing references)
//IL_0481: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: Unknown result type (might be due to invalid IL or missing references)
//IL_031b: Expected I4, but got Unknown
//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
//IL_0333: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_0352: Unknown result type (might be due to invalid IL or missing references)
//IL_0357: Unknown result type (might be due to invalid IL or missing references)
//IL_0362: Unknown result type (might be due to invalid IL or missing references)
//IL_0367: Unknown result type (might be due to invalid IL or missing references)
//IL_0372: Unknown result type (might be due to invalid IL or missing references)
//IL_0377: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: 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_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
try
{
Type typeFromHandle = typeof(EnemyManager);
PropertyInfo property = typeFromHandle.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public);
if (property == null)
{
return;
}
object value = property.GetValue(null);
if (value == null)
{
return;
}
PropertyInfo property2 = typeFromHandle.GetProperty("EnemyClassGroups", BindingFlags.Instance | BindingFlags.Public);
if (property2 == null)
{
return;
}
object value2 = property2.GetValue(value);
if (value2 == null)
{
return;
}
List<EnemyClassGroup> itemsFromWeightedArray = GetItemsFromWeightedArray<EnemyClassGroup>(value2);
if (itemsFromWeightedArray == null)
{
return;
}
List<EnemyClass> list = new List<EnemyClass>();
foreach (EnemyClassGroup item in itemsFromWeightedArray)
{
if ((Object)(object)item != (Object)null && item.enemyClasses != null)
{
List<EnemyClass> itemsFromWeightedArray2 = GetItemsFromWeightedArray<EnemyClass>(item.enemyClasses);
if (itemsFromWeightedArray2 != null)
{
list.AddRange(itemsFromWeightedArray2);
}
}
}
int num = 100;
int num2 = 80;
int num3 = (int)(windowWidth - rightPanelX - 10f - 20f - 20f - 25f);
int num4 = num + 8;
int num5 = 1;
if (num4 > 0)
{
num5 = num3 / num4;
num5 = Mathf.Max(1, num5);
}
int count = list.Count;
int num6 = ((count > 0) ? ((count + num5 - 1) / num5) : 0);
int num7 = ((num5 > 0) ? ((num5 - 1) * (num + 8) + num) : 0);
int num8 = ((num6 > 0) ? ((num6 - 1) * (num2 + 8) + num2) : 0);
Rect val = new Rect(0f, 40f, windowWidth - rightPanelX - 10f - 20f, windowHeight - 120f);
Rect val2 = default(Rect);
((Rect)(ref val2))..ctor(0f, 0f, (float)num7, (float)num8);
rightScrollPos = GUI.BeginScrollView(val, rightScrollPos, val2, false, true);
Rect val7 = default(Rect);
Vector2 mousePosition2 = default(Vector2);
for (int i = 0; i < list.Count; i++)
{
EnemyClass val3 = list[i];
int num9 = i / num5;
float num10 = i % num5 * (num + 8);
float num11 = num9 * (num2 + 8);
GUIStyle val4 = new GUIStyle(GUI.skin.box);
val4.normal.background = Texture2D.whiteTexture;
Color color = new Color(0.3f, 0.3f, 0.4f, 1f);
Color color2 = GUI.color;
GUI.color = color;
GUI.Box(new Rect(num10, num11, (float)num, (float)num2), "", val4);
GUI.color = color2;
GUIStyle val5 = new GUIStyle(GUI.skin.label);
val5.fontSize = 10;
val5.wordWrap = true;
val5.alignment = (TextAnchor)1;
string text = StripRichTextTags(val3.Name);
if (text.Length > 14)
{
text = text.Substring(0, 12) + "...";
}
GUI.Label(new Rect(num10 + 5f, num11 + 8f, (float)(num - 10), 20f), text, val5);
GUIStyle val6 = new GUIStyle(GUI.skin.label);
val6.fontSize = 8;
val6.alignment = (TextAnchor)4;
string text2 = "";
Color color3 = Color.white;
try
{
EnemyType enemyType = val3.config.enemyType;
switch ((int)enemyType)
{
case 0:
text2 = "Grunt";
color3 = new Color(0.7f, 0.7f, 0.7f);
break;
case 1:
text2 = "Brute";
color3 = new Color(0.8f, 0.6f, 0.4f);
break;
case 2:
text2 = "Abom.";
color3 = Color.red;
break;
case 3:
text2 = "BOSS";
color3 = Color.yellow;
break;
}
}
catch (Exception)
{
text2 = "Unknown";
color3 = Color.gray;
}
if (!string.IsNullOrEmpty(text2))
{
Color color4 = GUI.color;
GUI.color = color3;
GUI.Label(new Rect(num10 + 5f, num11 + 30f, (float)(num - 10), 15f), text2, val6);
GUI.color = color4;
}
Vector2 mousePosition = Event.current.mousePosition;
((Rect)(ref val7))..ctor(num10, num11, (float)num, (float)num2);
if (((Rect)(ref val7)).Contains(mousePosition))
{
string enemyTooltipText = GetEnemyTooltipText(val3);
((Vector2)(ref mousePosition2))..ctor(mousePosition.x + windowX, mousePosition.y + windowY);
MenuPatches.SetTooltip(enemyTooltipText, mousePosition2);
}
}
GUI.EndScrollView();
Event current2 = Event.current;
if ((int)current2.type == 6)
{
Vector2 mousePosition3 = current2.mousePosition;
Rect val8 = default(Rect);
((Rect)(ref val8))..ctor(rightPanelX, 70f, windowWidth - rightPanelX - 10f - 20f, windowHeight - 120f);
if (((Rect)(ref val8)).Contains(mousePosition3))
{
float num12 = Mathf.Max(0f, (float)num8 - (windowHeight - 120f));
rightScrollPos.y = Mathf.Clamp(rightScrollPos.y + current2.delta.y * 20f, 0f, num12);
current2.Use();
}
}
}
catch (Exception)
{
throw;
}
}
private static string GetEnemyTooltipText(EnemyClass enemy)
{
//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_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Expected I4, but got Unknown
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
string text = "-- " + StripRichTextTags(enemy.Name) + " --\n\n";
try
{
string text2 = "";
EnemyType enemyType = enemy.config.enemyType;
switch ((int)enemyType)
{
case 0:
text2 = "Grunt (Basic enemy)";
break;
case 1:
text2 = "Brute (Heavy combatant)";
break;
case 2:
text2 = "Abomination (Powerful mutated enemy)";
break;
case 3:
text2 = "Boss (End-game threat)";
break;
}
if (!string.IsNullOrEmpty(text2))
{
text = text + text2 + "\n\n";
}
}
catch (Exception)
{
text += "Enemy type information unavailable\n\n";
}
try
{
PropertyInfo property = ((object)enemy.config).GetType().GetProperty("Description", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (property != null)
{
string text3 = property.GetValue(enemy.config) as string;
if (!string.IsNullOrEmpty(text3))
{
text = text + "Description:\n" + StripRichTextTags(text3) + "\n\n";
}
}
}
catch (Exception)
{
}
text += "Combat Information:\n";
if (enemy.legChance > 0f)
{
text += $"• {enemy.legChance * 100f:F0}% chance to have legs\n";
}
if (enemy.armChance > 0f)
{
text += $"• {enemy.armChance * 100f:F0}% chance to have arms\n";
}
try
{
FieldInfo field = ((object)enemy).GetType().GetField("attachmentsGroups", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (field != null && field.GetValue(enemy) is Array array && array.Length > 0)
{
int num = 0;
foreach (object item in array)
{
if (item == null)
{
continue;
}
FieldInfo field2 = item.GetType().GetField("chance", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
FieldInfo field3 = item.GetType().GetField("max", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (field2 != null && field3 != null)
{
float num2 = (float)field2.GetValue(item);
int num3 = (int)field3.GetValue(item);
if (num2 > 0f && num3 > 0)
{
num++;
}
}
}
if (num > 0)
{
text += $"• Can spawn with up to {num} types of attachments\n";
}
}
}
catch (Exception)
{
}
if (enemy.overclockChance > 0f)
{
text += $"• {enemy.overclockChance * 100f:F0}% chance to be overclocked\n";
}
return text;
}
private static int GetTotalEnemyCount()
{
try
{
Type typeFromHandle = typeof(EnemyManager);
PropertyInfo property = typeFromHandle.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public);
if (property == null)
{
return 0;
}
object value = property.GetValue(null);
if (value == null)
{
return 0;
}
PropertyInfo property2 = typeFromHandle.GetProperty("EnemyClassGroups", BindingFlags.Instance | BindingFlags.Public);
if (property2 == null)
{
return 0;
}
object value2 = property2.GetValue(value);
if (value2 == null)
{
return 0;
}
List<EnemyClassGroup> itemsFromWeightedArray = GetItemsFromWeightedArray<EnemyClassGroup>(value2);
if (itemsFromWeightedArray == null)
{
return 0;
}
int num = 0;
foreach (EnemyClassGroup item in itemsFromWeightedArray)
{
if (!((Object)(object)item == (Object)null) && item.enemyClasses != null)
{
List<EnemyClass> itemsFromWeightedArray2 = GetItemsFromWeightedArray<EnemyClass>(item.enemyClasses);
if (itemsFromWeightedArray2 != null)
{
num += itemsFromWeightedArray2.Count;
}
}
}
return num;
}
catch (Exception)
{
return 0;
}
}
private static List<T> GetItemsFromWeightedArray<T>(object weightedArray)
{
if (weightedArray == null)
{
return null;
}
Type type = weightedArray.GetType();
if (!type.IsGenericType || type.GetGenericTypeDefinition().Name != "WeightedArray`1")
{
throw new ArgumentException("Expected instance of WeightedArray<T>");
}
FieldInfo? field = type.GetField("items", BindingFlags.Instance | BindingFlags.NonPublic);
if (field == null)
{
throw new MissingFieldException("Could not find 'items' field in WeightedArray");
}
if (!(field.GetValue(weightedArray) is Array array))
{
return null;
}
List<T> list = new List<T>();
foreach (object item2 in array)
{
if (item2 != null)
{
Type type2 = item2.GetType();
FieldInfo field2 = type2.GetField("weight");
FieldInfo field3 = type2.GetField("value");
if (!(field2 == null) && !(field3 == null) && (int)field2.GetValue(item2) > 0)
{
T item = (T)field3.GetValue(item2);
list.Add(item);
}
}
}
return list;
}
}
public static class MenuPatches
{
private const int SELECT_WEAPONS = -10;
public static bool IsMenuOpen { get; private set; }
public static bool ShowEncyclopediaGUI { get; set; }
public static int SelectedCategoryIndex { get; set; }
public static IUpgradable SelectedCategoryGear { get; set; }
public static string CurrentTooltipText { get; set; } = "";
public static Vector2 TooltipPosition { get; set; } = Vector2.zero;
public static bool ShowTooltip { get; set; } = false;
public static bool IsUniversalSelected { get; set; } = false;
public static bool IsWeaponSelected { get; set; } = false;
public static bool IsResourcesSelected { get; set; } = false;
public static bool IsMissionsSelected { get; set; } = false;
public static bool IsEnemiesSelected { get; set; } = false;
[HarmonyPatch(typeof(Menu), "Open")]
public static void Prefix(Menu __instance)
{
IsMenuOpen = true;
ShowEncyclopediaGUI = false;
SelectedCategoryIndex = -1;
SelectedCategoryGear = null;
IsUniversalSelected = false;
IsWeaponSelected = false;
IsResourcesSelected = false;
IsMissionsSelected = false;
IsEnemiesSelected = false;
}
[HarmonyPatch(typeof(Menu), "Close")]
public static void Prefix()
{
IsMenuOpen = false;
ShowEncyclopediaGUI = false;
SelectedCategoryIndex = -1;
SelectedCategoryGear = null;
IsUniversalSelected = false;
IsWeaponSelected = false;
IsResourcesSelected = false;
IsMissionsSelected = false;
IsEnemiesSelected = false;
}
public static void ToggleEncyclopedia()
{
ShowEncyclopediaGUI = !ShowEncyclopediaGUI;
if (!ShowEncyclopediaGUI)
{
SelectedCategoryIndex = -1;
SelectedCategoryGear = null;
IsUniversalSelected = false;
IsWeaponSelected = false;
IsResourcesSelected = false;
IsMissionsSelected = false;
IsEnemiesSelected = false;
ShowTooltip = false;
CurrentTooltipText = "";
}
}
public static void SetTooltip(string text, Vector2 mousePosition)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
if (CurrentTooltipText != text)
{
CurrentTooltipText = text;
ShowTooltip = !string.IsNullOrEmpty(text);
TooltipPosition = mousePosition;
}
}
public static void ClearTooltip()
{
ShowTooltip = false;
CurrentTooltipText = "";
}
public static void SelectUniversal()
{
SelectedCategoryIndex = -1;
SelectedCategoryGear = null;
SelectedCategoryIndex = -2;
IsUniversalSelected = true;
SelectedCategoryGear = null;
IsWeaponSelected = false;
}
public static void SelectWeapons()
{
SelectedCategoryIndex = -10;
SelectedCategoryGear = null;
IsUniversalSelected = false;
IsWeaponSelected = true;
IsResourcesSelected = false;
IsMissionsSelected = false;
IsEnemiesSelected = false;
}
public static void SelectResources()
{
SelectedCategoryIndex = -3;
SelectedCategoryGear = null;
IsUniversalSelected = false;
IsWeaponSelected = false;
IsResourcesSelected = true;
IsMissionsSelected = false;
IsEnemiesSelected = false;
}
public static void SelectMissions()
{
SelectedCategoryIndex = -4;
SelectedCategoryGear = null;
IsUniversalSelected = false;
IsWeaponSelected = false;
IsResourcesSelected = false;
IsMissionsSelected = true;
IsEnemiesSelected = false;
}
public static void SelectEnemies()
{
SelectedCategoryIndex = -5;
SelectedCategoryGear = null;
IsUniversalSelected = false;
IsWeaponSelected = false;
IsResourcesSelected = false;
IsMissionsSelected = false;
IsEnemiesSelected = true;
}
public static List<Upgrade> GetUniversalUpgrades()
{
GenericPlayerUpgrade[] source = Resources.FindObjectsOfTypeAll<GenericPlayerUpgrade>();
HashSet<Upgrade> skillTreeUpgrades = new HashSet<Upgrade>();
Character[] characters = Global.Instance.Characters;
for (int i = 0; i < characters.Length; i++)
{
SkillTree skillTree = characters[i].SkillTree;
if ((Object)(object)skillTree != (Object)null)
{
SkillTreeUpgradeUI[] componentsInChildren = ((Component)skillTree).GetComponentsInChildren<SkillTreeUpgradeUI>();
skillTreeUpgrades.UnionWith(componentsInChildren.Select((SkillTreeUpgradeUI ui) => ui.Upgrade));
}
}
HashSet<Upgrade> characterSpecificUpgrades = new HashSet<Upgrade>();
characters = Global.Instance.Characters;
foreach (Character val in characters)
{
characterSpecificUpgrades.UnionWith(((Dude)val).Info.Upgrades);
}
return source.Where((GenericPlayerUpgrade u) => !Regex.IsMatch(((Upgrade)u).Name, "(_test_|_dev_|_wip|debug|temp|placeholder|todo|_old|_backup|_copy|_staging|_exp|_alpha|_beta|_proto|_mock|_fake|_stub|_wingsuit|\\.skinasset$|^test_|^wingsuit|^experimental|^dev_|^exp_|^proto_|^Test$|^Debug$|^Temp$|^Placeholder$|^Todo$|^Old$|^Backup$|^Copy$|^Staging$|^Exp$|^Alpha$|^Beta$|^Proto$|^Mock$|^Fake$|^Stub$|^Wingsuit$|^Experimental$)", RegexOptions.IgnoreCase) && !skillTreeUpgrades.Contains((Upgrade)(object)u) && !characterSpecificUpgrades.Contains((Upgrade)(object)u)).Cast<Upgrade>().ToList();
}
public static void SelectCategory(int categoryIndex)
{
IsUniversalSelected = false;
IsWeaponSelected = false;
SelectedCategoryIndex = categoryIndex;
int num = 0;
Character[] characters = Global.Instance.Characters;
foreach (Character val in characters)
{
if (((Dude)val).Info.HasVisibleUpgrades((Rarity)(-1)) && ((Dude)val).Info.Upgrades.Length != 0)
{
if (num == categoryIndex)
{
SelectedCategoryGear = (IUpgradable)(object)val;
return;
}
num++;
}
}
IUpgradable[] allGear = Global.Instance.AllGear;
foreach (IUpgradable val2 in allGear)
{
if (val2.Info.HasVisibleUpgrades((Rarity)(-1)) && val2.Info.Upgrades.Length != 0)
{
if (num == categoryIndex)
{
SelectedCategoryGear = val2;
break;
}
num++;
}
}
}
public static string GetEncyclopediaContent()
{
string text = "MYCOPUNK ENCYCLOPEDIA\n\nAvailable Categories:\n\n";
int num = 0;
Character[] characters = Global.Instance.Characters;
foreach (Character val in characters)
{
if ((Object)(object)val.SkillTree != (Object)null && val.SkillTree.upgrades.Count > 0)
{
List<Upgrade> list = val.SkillTree.upgrades.ConvertAll((SkillTreeUpgradeUI ui) => ui.Upgrade);
text += $"{((Dude)val).ClassName}: {list.Count} upgrades\n";
num += list.Count;
}
}
IUpgradable[] allGear = Global.Instance.AllGear;
foreach (IUpgradable val2 in allGear)
{
if (val2.Info.HasVisibleUpgrades((Rarity)(-1)) && val2.Info.Upgrades.Length != 0)
{
text += $"{val2.Info.Name}: {val2.Info.Upgrades.Length} upgrades\n";
num += val2.Info.Upgrades.Length;
}
}
return text + $"\n Total: {num} upgrades across all categories";
}
}
public static class StatRangePatches
{
public static bool ForceShowExtraInfo { get; set; }
public static bool ShowExtraInfoPrefix(ref bool __result)
{
if (ForceShowExtraInfo)
{
__result = true;
return false;
}
return true;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}