using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("UniversalModList")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("UniversalModList")]
[assembly: AssemblyTitle("UniversalModList")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[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;
}
}
}
[BepInPlugin("universal.mod.list", "Universal Mod List", "1.2.2")]
public class UniversalModList : BaseUnityPlugin
{
private static UniversalModList instance;
private GameObject canvas;
private bool visible;
private int selectedModIndex = 0;
private GameObject leftContent;
private GameObject rightContent;
private float originalTimeScale = 1f;
private List<Behaviour> disabledComponents = new List<Behaviour>();
private ConfigEntry<KeyCode> openKeybind;
private static List<string> logEntries = new List<string>();
private static readonly int maxLogEntries = 100;
private Text consoleTextComponent;
private readonly Color colorBackground = new Color(0.04f, 0.02f, 0.08f, 0.96f);
private readonly Color colorPanel = new Color(0.07f, 0.04f, 0.12f, 0.9f);
private readonly Color colorAccent = new Color(0f, 0.9f, 1f, 1f);
private readonly Color colorAccentHover = new Color(0f, 1f, 0.7f, 1f);
private readonly Color colorButtonNeutral = new Color(0.12f, 0.07f, 0.22f, 0.85f);
private readonly Color colorText = new Color(0f, 1f, 1f, 1f);
private readonly Color colorTextWhite = new Color(0.95f, 0.98f, 1f, 1f);
private readonly Color colorTitle = new Color(0.78f, 1f, 0f, 1f);
private Font mainFont;
private void Awake()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Expected O, but got Unknown
instance = this;
Application.logMessageReceived += new LogCallback(HandleLog);
openKeybind = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Open List Hotkey", (KeyCode)282, "Hotkey to toggle the Mod List menu.");
}
private void Start()
{
try
{
mainFont = Font.CreateDynamicFontFromOSFont("Arial", 14);
}
catch
{
mainFont = Resources.GetBuiltinResource<Font>("Arial.ttf");
}
ModEntry modEntry = new ModEntry();
modEntry.ModName = "Developer Console";
modEntry.CustomUIBuilder = BuildDevConsoleUI;
modEntry.ModType = typeof(UniversalModList);
ModRegistry.Register(modEntry);
CreateUI();
if ((Object)(object)canvas != (Object)null)
{
canvas.SetActive(false);
}
}
private void Update()
{
//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_001e: 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_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
bool flag = false;
KeyCode value = openKeybind.Value;
try
{
if (Keyboard.current != null)
{
Key inputSystemKey = GetInputSystemKey(value);
if (((ButtonControl)Keyboard.current[inputSystemKey]).wasPressedThisFrame)
{
flag = true;
}
}
}
catch
{
}
try
{
if (Input.GetKeyDown(value))
{
flag = true;
}
}
catch
{
}
if (flag)
{
visible = !visible;
if ((Object)(object)canvas != (Object)null)
{
canvas.SetActive(visible);
if (visible)
{
originalTimeScale = Time.timeScale;
Time.timeScale = 0f;
EnsureEventSystem();
FreezeGameplayInputs();
BuildLeftMenu();
BuildRightMenu();
}
else
{
Time.timeScale = originalTimeScale;
UnfreezeGameplayInputs();
Cursor.visible = false;
Cursor.lockState = (CursorLockMode)1;
}
}
}
if (visible)
{
Time.timeScale = 0f;
Cursor.visible = true;
Cursor.lockState = (CursorLockMode)0;
}
}
private void HandleLog(string logString, string stackTrace, LogType type)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Invalid comparison between Unknown and I4
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Invalid comparison between Unknown and I4
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Invalid comparison between Unknown and I4
string arg = "white";
if ((int)type == 0 || (int)type == 4)
{
arg = "#ff5555";
}
else if ((int)type == 2)
{
arg = "#ffcc00";
}
else if ((int)type == 3)
{
arg = "#aaffaa";
}
string item = $"[{DateTime.Now:HH:mm:ss}] <color={arg}>{logString}</color>";
logEntries.Add(item);
if (logEntries.Count > maxLogEntries)
{
logEntries.RemoveAt(0);
}
if (visible && (Object)(object)consoleTextComponent != (Object)null)
{
UpdateConsoleUI();
}
}
private void FreezeGameplayInputs()
{
disabledComponents.Clear();
try
{
Behaviour[] array = Object.FindObjectsOfType<Behaviour>();
foreach (Behaviour val in array)
{
if ((Object)(object)val == (Object)null || !val.enabled || val is UniversalModList || ((Object)((Component)val).gameObject).name.Contains("ModMenu") || ((Object)((Component)val).gameObject).name.Contains("EventSystem"))
{
continue;
}
Type type = ((object)val).GetType();
if (type.Namespace == null || !type.Namespace.StartsWith("UnityEngine"))
{
string text = type.Name.ToLower();
if (text.Contains("player") || text.Contains("camera") || text.Contains("look") || text.Contains("move") || text.Contains("shoot") || text.Contains("gun") || text.Contains("weapon"))
{
val.enabled = false;
disabledComponents.Add(val);
}
}
}
}
catch
{
}
}
private void UnfreezeGameplayInputs()
{
foreach (Behaviour disabledComponent in disabledComponents)
{
if ((Object)(object)disabledComponent != (Object)null)
{
try
{
disabledComponent.enabled = true;
}
catch
{
}
}
}
disabledComponents.Clear();
}
private void EnsureEventSystem()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
if ((Object)(object)EventSystem.current == (Object)null)
{
GameObject val = new GameObject("EventSystem");
val.AddComponent<EventSystem>();
val.AddComponent<StandaloneInputModule>();
Object.DontDestroyOnLoad((Object)(object)val);
}
}
private void CreateUI()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Expected O, but got Unknown
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: 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_00ca: 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_00f8: 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_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Expected O, but got Unknown
//IL_0174: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0250: Unknown result type (might be due to invalid IL or missing references)
canvas = new GameObject("ModMenuCanvas");
Object.DontDestroyOnLoad((Object)(object)canvas);
Canvas val = canvas.AddComponent<Canvas>();
val.renderMode = (RenderMode)0;
val.sortingOrder = 9999;
canvas.AddComponent<CanvasScaler>();
canvas.AddComponent<GraphicRaycaster>();
GameObject val2 = new GameObject("MenuBackground");
val2.transform.SetParent(canvas.transform, false);
Image val3 = val2.AddComponent<Image>();
((Graphic)val3).color = colorBackground;
Outline val4 = val2.AddComponent<Outline>();
((Shadow)val4).effectColor = colorAccent;
((Shadow)val4).effectDistance = new Vector2(2f, 2f);
RectTransform component = val2.GetComponent<RectTransform>();
component.anchorMin = new Vector2(0.5f, 0.5f);
component.anchorMax = new Vector2(0.5f, 0.5f);
component.pivot = new Vector2(0.5f, 0.5f);
component.sizeDelta = new Vector2(1100f, 700f);
GameObject val5 = new GameObject("HeaderTitle");
val5.transform.SetParent(val2.transform, false);
Text val6 = val5.AddComponent<Text>();
val6.text = "INSTALLED MOD LIST";
val6.font = mainFont;
val6.fontSize = 26;
val6.alignment = (TextAnchor)3;
((Graphic)val6).color = colorTitle;
RectTransform component2 = val5.GetComponent<RectTransform>();
component2.anchorMin = new Vector2(0f, 1f);
component2.anchorMax = new Vector2(1f, 1f);
component2.pivot = new Vector2(0.5f, 1f);
component2.anchoredPosition = new Vector2(20f, -10f);
component2.sizeDelta = new Vector2(-40f, 45f);
leftContent = CreateScrollablePanel("LeftPanel", new Vector2(20f, 20f), new Vector2(300f, 610f), val2.transform);
rightContent = CreateScrollablePanel("RightPanel", new Vector2(340f, 20f), new Vector2(740f, 610f), val2.transform);
}
private GameObject CreateScrollablePanel(string name, Vector2 pos, Vector2 size, Transform parent)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_0027: 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)
//IL_0045: 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_0067: 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_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: 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)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Expected O, but got Unknown
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Expected O, but got Unknown
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Expected O, but got Unknown
GameObject val = new GameObject(name);
val.transform.SetParent(parent, false);
RectTransform val2 = val.AddComponent<RectTransform>();
Image val3 = val.AddComponent<Image>();
((Graphic)val3).color = colorPanel;
Outline val4 = val.AddComponent<Outline>();
((Shadow)val4).effectColor = colorAccent * 0.5f;
((Shadow)val4).effectDistance = new Vector2(1.5f, 1.5f);
val2.anchorMin = Vector2.zero;
val2.anchorMax = Vector2.zero;
val2.pivot = Vector2.zero;
val2.anchoredPosition = pos;
val2.sizeDelta = size;
GameObject val5 = new GameObject("Viewport");
val5.transform.SetParent(val.transform, false);
RectTransform val6 = val5.AddComponent<RectTransform>();
val6.anchorMin = Vector2.zero;
val6.anchorMax = Vector2.one;
val6.pivot = new Vector2(0f, 1f);
val6.sizeDelta = new Vector2(-10f, -10f);
val6.anchoredPosition = new Vector2(5f, -5f);
val5.AddComponent<RectMask2D>();
GameObject val7 = new GameObject("Content");
val7.transform.SetParent(val5.transform, false);
RectTransform val8 = val7.AddComponent<RectTransform>();
val8.anchorMin = new Vector2(0f, 1f);
val8.anchorMax = new Vector2(1f, 1f);
val8.pivot = new Vector2(0.5f, 1f);
val8.sizeDelta = new Vector2(0f, 0f);
VerticalLayoutGroup val9 = val7.AddComponent<VerticalLayoutGroup>();
((HorizontalOrVerticalLayoutGroup)val9).spacing = 8f;
((LayoutGroup)val9).padding = new RectOffset(5, 5, 5, 5);
((HorizontalOrVerticalLayoutGroup)val9).childControlHeight = false;
((HorizontalOrVerticalLayoutGroup)val9).childForceExpandHeight = false;
((HorizontalOrVerticalLayoutGroup)val9).childForceExpandWidth = true;
ContentSizeFitter val10 = val7.AddComponent<ContentSizeFitter>();
val10.verticalFit = (FitMode)2;
ScrollRect val11 = val.AddComponent<ScrollRect>();
val11.content = val8;
val11.viewport = val6;
val11.horizontal = false;
val11.vertical = true;
val11.scrollSensitivity = 25f;
return val7;
}
private void BuildLeftMenu()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Expected O, but got Unknown
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: 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_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_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: 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_01ad: Expected O, but got Unknown
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: 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_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_026e: Unknown result type (might be due to invalid IL or missing references)
//IL_0278: Expected O, but got Unknown
if ((Object)(object)leftContent == (Object)null)
{
return;
}
foreach (Transform item in leftContent.transform)
{
Transform val = item;
Object.Destroy((Object)(object)((Component)val).gameObject);
}
for (int i = 0; i < ModRegistry.Mods.Count; i++)
{
ModEntry modEntry = ModRegistry.Mods[i];
int index = i;
GameObject val2 = new GameObject("Button_" + modEntry.ModName);
val2.transform.SetParent(leftContent.transform, false);
LayoutElement val3 = val2.AddComponent<LayoutElement>();
val3.minHeight = 38f;
bool flag = index == selectedModIndex;
Image val4 = val2.AddComponent<Image>();
((Graphic)val4).color = (flag ? colorAccent : colorButtonNeutral);
if (flag)
{
Outline val5 = val2.AddComponent<Outline>();
((Shadow)val5).effectColor = colorAccentHover;
((Shadow)val5).effectDistance = new Vector2(1f, 1f);
}
Button val6 = val2.AddComponent<Button>();
ColorBlock colors = ((Selectable)val6).colors;
((ColorBlock)(ref colors)).normalColor = ((Graphic)val4).color;
((ColorBlock)(ref colors)).highlightedColor = colorAccentHover;
((ColorBlock)(ref colors)).pressedColor = colorAccent;
((ColorBlock)(ref colors)).selectedColor = (flag ? colorAccent : colorButtonNeutral);
((Selectable)val6).colors = colors;
GameObject val7 = new GameObject("Text");
val7.transform.SetParent(val2.transform, false);
Text val8 = val7.AddComponent<Text>();
val8.text = modEntry.ModName.ToUpper();
val8.font = mainFont;
val8.fontSize = 13;
val8.alignment = (TextAnchor)3;
((Graphic)val8).color = colorTextWhite;
RectTransform component = val7.GetComponent<RectTransform>();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.sizeDelta = new Vector2(-20f, 0f);
component.anchoredPosition = new Vector2(15f, 0f);
((UnityEvent)val6.onClick).AddListener((UnityAction)delegate
{
selectedModIndex = index;
BuildLeftMenu();
BuildRightMenu();
});
}
}
private void BuildRightMenu()
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
if ((Object)(object)rightContent == (Object)null)
{
return;
}
consoleTextComponent = null;
foreach (Transform item in rightContent.transform)
{
Transform val = item;
Object.Destroy((Object)(object)((Component)val).gameObject);
}
if (ModRegistry.Mods != null && ModRegistry.Mods.Count != 0)
{
if (selectedModIndex < 0 || selectedModIndex >= ModRegistry.Mods.Count)
{
selectedModIndex = 0;
}
ModEntry modEntry = ModRegistry.Mods[selectedModIndex];
if (modEntry.CustomUIBuilder != null)
{
modEntry.CustomUIBuilder(rightContent, this);
}
else
{
BuildDefaultModInfoUI(rightContent, modEntry);
}
}
}
private void BuildDefaultModInfoUI(GameObject parent, ModEntry mod)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Expected O, but got Unknown
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Expected O, but got Unknown
GameObject val = new GameObject("ModInfoTitle");
val.transform.SetParent(parent.transform, false);
LayoutElement val2 = val.AddComponent<LayoutElement>();
val2.minHeight = 35f;
Text val3 = val.AddComponent<Text>();
val3.text = mod.ModName.ToUpper();
val3.font = mainFont;
val3.fontSize = 16;
val3.alignment = (TextAnchor)4;
((Graphic)val3).color = colorTitle;
GameObject val4 = new GameObject("ModInfoDetails");
val4.transform.SetParent(parent.transform, false);
LayoutElement val5 = val4.AddComponent<LayoutElement>();
val5.minHeight = 300f;
Text val6 = val4.AddComponent<Text>();
val6.font = mainFont;
val6.fontSize = 13;
((Graphic)val6).color = colorTextWhite;
val6.alignment = (TextAnchor)0;
val6.supportRichText = true;
RectTransform component = val4.GetComponent<RectTransform>();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.sizeDelta = new Vector2(-20f, -10f);
component.anchoredPosition = new Vector2(10f, 5f);
string text = "N/A";
string text2 = "1.2.2";
string text3 = "Unknown Path";
if (mod.ModType != null)
{
try
{
text3 = Path.GetFileName(mod.ModType.Assembly.Location);
}
catch
{
}
object[] customAttributes = mod.ModType.GetCustomAttributes(typeof(BepInPlugin), inherit: true);
if (customAttributes.Length != 0)
{
BepInPlugin val7 = (BepInPlugin)customAttributes[0];
text = val7.GUID;
text2 = val7.Version.ToString();
}
}
val6.text = "<b>MOD INFORMATION</b>\n\n - <b>NAME:</b> <color=#00ffff>" + mod.ModName + "</color>\n - <b>VERSION:</b> <color=#00ffff>" + text2 + "</color>\n - <b>GUID/ID:</b> <color=#aaffaa>" + text + "</color>\n - <b>FILE NAME:</b> <color=#aaffaa>" + text3 + "</color>\n\n<b>STATUS:</b> <color=#78ff00>ACTIVE & RUNNING</color>\n\n\n<color=#ffcc00><b>NOTICE:</b> THIS MOD RUNS STANDALONE. CONFIGURE IT VIA BEPINEX/CONFIG/</color>";
}
private void BuildDevConsoleUI(GameObject rightPanelContent, UniversalModList framework)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_003b: 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_0059: 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_0084: 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_008e: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: 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_00cb: Expected O, but got Unknown
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: 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_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Expected O, but got Unknown
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Expected O, but got Unknown
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Expected O, but got Unknown
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0228: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_0263: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("ClearButton");
val.transform.SetParent(rightPanelContent.transform, false);
LayoutElement val2 = val.AddComponent<LayoutElement>();
val2.minHeight = 35f;
Image val3 = val.AddComponent<Image>();
((Graphic)val3).color = colorButtonNeutral;
Outline val4 = val.AddComponent<Outline>();
((Shadow)val4).effectColor = colorAccent * 0.5f;
((Shadow)val4).effectDistance = new Vector2(1f, 1f);
Button val5 = val.AddComponent<Button>();
ColorBlock colors = ((Selectable)val5).colors;
((ColorBlock)(ref colors)).normalColor = colorButtonNeutral;
((ColorBlock)(ref colors)).highlightedColor = colorAccent;
((ColorBlock)(ref colors)).pressedColor = colorAccentHover;
((Selectable)val5).colors = colors;
GameObject val6 = new GameObject("Text");
val6.transform.SetParent(val.transform, false);
Text val7 = val6.AddComponent<Text>();
val7.text = "CLEAR LOGS";
val7.font = mainFont;
val7.fontSize = 13;
val7.alignment = (TextAnchor)4;
((Graphic)val7).color = colorTextWhite;
RectTransform component = val6.GetComponent<RectTransform>();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.sizeDelta = Vector2.zero;
((UnityEvent)val5.onClick).AddListener((UnityAction)delegate
{
logEntries.Clear();
UpdateConsoleUI();
});
GameObject val8 = new GameObject("LogContainer");
val8.transform.SetParent(rightPanelContent.transform, false);
LayoutElement val9 = val8.AddComponent<LayoutElement>();
val9.minHeight = 500f;
GameObject val10 = new GameObject("ConsoleText");
val10.transform.SetParent(val8.transform, false);
consoleTextComponent = val10.AddComponent<Text>();
consoleTextComponent.font = mainFont;
consoleTextComponent.fontSize = 11;
((Graphic)consoleTextComponent).color = colorTextWhite;
consoleTextComponent.supportRichText = true;
consoleTextComponent.alignment = (TextAnchor)6;
RectTransform component2 = val10.GetComponent<RectTransform>();
component2.anchorMin = Vector2.zero;
component2.anchorMax = Vector2.one;
component2.sizeDelta = new Vector2(-10f, -10f);
component2.anchoredPosition = new Vector2(5f, 5f);
UpdateConsoleUI();
}
private void UpdateConsoleUI()
{
if ((Object)(object)consoleTextComponent != (Object)null)
{
consoleTextComponent.text = string.Join("\n", logEntries.ToArray());
}
}
private Key GetInputSystemKey(KeyCode key)
{
//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_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0004: 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_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected I4, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: 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_0054: 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_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
return (Key)((key - 282) switch
{
0 => 94,
1 => 95,
2 => 96,
3 => 97,
4 => 98,
5 => 99,
6 => 100,
7 => 101,
8 => 102,
9 => 103,
10 => 104,
11 => 105,
_ => 94,
});
}
}
public class ModEntry
{
public string ModName;
public Type ModType;
public Action<GameObject, UniversalModList> CustomUIBuilder;
}
public static class ModRegistry
{
public static List<ModEntry> Mods = new List<ModEntry>();
public static void Register(ModEntry mod)
{
Mods.Add(mod);
}
}