using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using GameConsole;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Microsoft.Data.Sqlite;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using SQLitePCL;
using TMPro;
using ULTRASTATS.Capture;
using ULTRASTATS.Core;
using ULTRASTATS.Legacy;
using ULTRASTATS.Patches;
using ULTRASTATS.Queries;
using ULTRASTATS.Storage;
using ULTRASTATS.UI;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ULTRASTATS")]
[assembly: AssemblyConfiguration("Package")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f18da2485d646ed7b7449a594300c8932bccc684")]
[assembly: AssemblyProduct("ULTRASTATS")]
[assembly: AssemblyTitle("ULTRASTATS")]
[assembly: AssemblyVersion("1.0.0.0")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ULTRASTATS
{
[BepInProcess("ULTRAKILL.exe")]
[BepInPlugin("atom.ultrastats", "ULTRASTATS", "0.1.4")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public sealed class Plugin : BaseUnityPlugin
{
internal enum MainMenuButtonCornerOption
{
BottomRight,
BottomLeft,
TopRight,
TopLeft
}
internal enum DefaultMainMenuTabOption
{
Info,
Stats,
Plots
}
public const string ModGuid = "atom.ultrastats";
public const string ModName = "ULTRASTATS";
public const string ModVer = "0.1.4";
private Harmony? _harmony;
private bool _lifecycleHooksRegistered;
internal static Plugin Instance { get; private set; }
internal static ManualLogSource Log { get; private set; }
internal static UltraStatsConfig Config { get; private set; }
internal static string DataFolderPath => UltraStatsPaths.DataFolderPath;
internal static string DataFolderParentPath => UltraStatsPaths.DataFolderParentPath;
internal static bool DebugLoggingEnabled => Config?.EnableDebugLogging ?? false;
internal static bool CaptureLoggingEnabled => Config?.EnableCaptureLogging ?? true;
internal static bool CampaignLoggingEnabled => Config?.EnableCampaignLogging ?? true;
internal static bool CybergrindLoggingEnabled => Config?.EnableCybergrindLogging ?? true;
internal static bool CustomLevelLoggingEnabled
{
get
{
if (AngryLevelLoaderInstalled)
{
return Config?.EnableCustomLevelLogging ?? true;
}
return false;
}
}
internal static bool LevelDeathLoggingEnabled => Config?.EnableLevelDeathLogging ?? true;
internal static int MinimumCampaignLikeRunSeconds => Config?.MinimumCampaignLikeRunSeconds ?? 12;
internal static bool AngryLevelLoaderInstalled => CustomLevelMetadataResolver.AngryAvailable;
internal static MainMenuButtonCornerOption MainMenuButtonCorner => (MainMenuButtonCornerOption)(Config?.MainMenuButtonCorner ?? ULTRASTATS.Core.MainMenuButtonCorner.BottomRight);
internal static DefaultMainMenuTabOption DefaultMainMenuTab => (DefaultMainMenuTabOption)(Config?.DefaultTab ?? MainMenuDefaultTab.Stats);
internal static RunFilterSortDirection NewColumnFirstClickSortDirection => Config?.NewColumnFirstClickSortDirection ?? RunFilterSortDirection.Ascending;
internal static AngryBundleSortMode AngryBundleSortMode => Config?.AngryBundleSortMode ?? AngryBundleSortMode.Alphabetical;
internal static bool ShowLegacyTransitionNotice => Config?.ShowLegacyTransitionNotice ?? true;
internal static bool HasSeenFreshInstallWelcome => File.Exists(UltraStatsPaths.FreshInstallWelcomeSeenMarkerPath);
private static bool IsDebugBuild => false;
private static string BuildConfiguration => "Release";
private void Awake()
{
//IL_0309: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Expected O, but got Unknown
Instance = this;
Log = ((BaseUnityPlugin)this).Logger;
Config = new UltraStatsConfig();
Config.BuildUI();
UltraStatsStartupNoticeController.CaptureStartupState();
BepInExLogs_US.ModLoaded();
BepInExLogs_US.Debug(LogStartupFingerprint);
BepInExLogs_US.Debug(() => "Data folder parent = " + DataFolderParentPath);
BepInExLogs_US.Debug(() => "Data folder = " + DataFolderPath);
BepInExLogs_US.Debug(() => $"Campaign logging enabled = {CampaignLoggingEnabled}");
BepInExLogs_US.Debug(() => $"Cybergrind logging enabled = {CybergrindLoggingEnabled}");
BepInExLogs_US.Debug(() => $"Custom level logging enabled = {CustomLevelLoggingEnabled}");
BepInExLogs_US.Debug(() => $"Campaign/custom death logging enabled = {LevelDeathLoggingEnabled}");
BepInExLogs_US.Debug(() => $"Minimum fallback completion run length seconds = {MinimumCampaignLikeRunSeconds}");
BepInExLogs_US.Debug(() => $"Capture logging enabled = {CaptureLoggingEnabled}");
BepInExLogs_US.Debug(() => $"Angry Level Loader available = {AngryLevelLoaderInstalled}");
BepInExLogs_US.Debug(() => $"Main menu button corner = {MainMenuButtonCorner}");
BepInExLogs_US.Debug(() => $"Main menu default tab = {DefaultMainMenuTab}");
BepInExLogs_US.Debug(() => $"New column first-click sort = {NewColumnFirstClickSortDirection}");
BepInExLogs_US.Debug(() => $"Angry bundle sort mode = {AngryBundleSortMode}");
BepInExLogs_US.Debug(() => $"Show legacy transition notice = {ShowLegacyTransitionNotice}");
BepInExLogs_US.Debug(() => $"Has seen fresh install welcome = {HasSeenFreshInstallWelcome}");
BepInExLogs_US.Debug(() => (!Chainloader.PluginInfos.ContainsKey("com.eternalUnion.angryLevelLoader")) ? "Angry Level Loader is not loaded." : "Angry Level Loader is loaded.");
if (!AngryLevelLoaderInstalled)
{
BepInExLogs_US.Warn("Angry Level Loader not found. Custom level logging is disabled.");
}
try
{
UltraStatsBootstrap.Initialize();
}
catch (Exception ex)
{
BepInExLogs_US.Error("SQLite bootstrap failed", ex);
return;
}
Application.quitting += OnAppQuitting;
SceneManager.activeSceneChanged += OnActiveSceneChanged;
_lifecycleHooksRegistered = true;
_harmony = new Harmony("atom.ultrastats");
_harmony.PatchAll();
if (DebugLoggingEnabled)
{
LogPatchRegistration();
}
MainMenuButton_US.Init();
BepInExLogs_US.Debug("Harmony patches applied.");
}
private void OnDestroy()
{
try
{
if (_lifecycleHooksRegistered)
{
SceneManager.activeSceneChanged -= OnActiveSceneChanged;
Application.quitting -= OnAppQuitting;
_lifecycleHooksRegistered = false;
}
MainMenuButton_US.Shutdown();
UltraStatsBootstrap.SuppressActiveRun("plugin destroy");
FlushPendingRuns("Plugin.OnDestroy");
UltraStatsBootstrap.Shutdown();
}
finally
{
Harmony? harmony = _harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
}
private static void OnAppQuitting()
{
UltraStatsBootstrap.SuppressActiveRun("application quit");
FlushPendingRuns("Application.quitting");
}
private static void OnActiveSceneChanged(Scene oldScene, Scene newScene)
{
UltraStatsBootstrap.SuppressActiveRun("active scene changed without completion/death");
FlushPendingRuns("SceneManager.activeSceneChanged");
}
private static void FlushPendingRuns(string reason)
{
UltraStatsBootstrap.FlushPendingRuns(reason);
}
private static string LogStartupFingerprint()
{
Assembly assembly = typeof(Plugin).Assembly;
string location = assembly.Location;
string text = "unavailable";
try
{
if (!string.IsNullOrWhiteSpace(location) && File.Exists(location))
{
text = File.GetLastWriteTimeUtc(location).ToString("O");
}
}
catch (Exception ex)
{
text = "unavailable (" + ex.Message + ")";
}
return $"Startup fingerprint: assembly_location={location}; assembly_version={assembly.GetName().Version}; build_config={BuildConfiguration}; dll_last_write_utc={text}; capture_logging_enabled={CaptureLoggingEnabled}";
}
private static void LogPatchRegistration()
{
MethodInfo methodInfo = AccessTools.Method(typeof(SecretMissionPit), "OnTriggerEnter", (Type[])null, (Type[])null);
bool flag = ((methodInfo == null) ? null : Harmony.GetPatchInfo((MethodBase)methodInfo))?.Prefixes.Any((Patch patch) => string.Equals(patch.owner, "atom.ultrastats", StringComparison.Ordinal)) ?? false;
BepInExLogs_US.Debug("Patch registration: SecretMissionPit.OnTriggerEnter prefix=" + (flag ? "registered" : "missing"));
}
internal static void MarkFreshInstallWelcomeSeen()
{
if (HasSeenFreshInstallWelcome)
{
return;
}
try
{
Directory.CreateDirectory(UltraStatsPaths.InternalStateDirectory);
File.WriteAllText(UltraStatsPaths.FreshInstallWelcomeSeenMarkerPath, DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString());
}
catch (Exception ex)
{
Log.LogWarning((object)("[ULTRASTATS] Could not persist fresh install welcome state: " + ex.Message));
}
}
}
internal readonly struct FilterCycleLabelContent
{
public string Text { get; }
public bool IsRichText { get; }
public Color? Color { get; }
private FilterCycleLabelContent(string text, bool isRichText, Color? color)
{
Text = text ?? string.Empty;
IsRichText = isRichText;
Color = color;
}
public static FilterCycleLabelContent Plain(string text, Color? color = null)
{
return new FilterCycleLabelContent(text, isRichText: false, color);
}
public static FilterCycleLabelContent Rich(string richText)
{
return new FilterCycleLabelContent(richText, isRichText: true, null);
}
public string ToDisplayText()
{
if (string.IsNullOrEmpty(Text))
{
return string.Empty;
}
if (IsRichText)
{
return Text;
}
return UltraStatsRichCycleButton.WrapColor(UltraStatsRichCycleButton.EscapeRichText(Text), Color);
}
}
internal static class FilterBooleanLabelPresets
{
public static FilterCycleLabelContent CheatsUsed => FilterCycleLabelContent.Rich("CHEATS USED ");
public static FilterCycleLabelContent MajorAssists => FilterCycleLabelContent.Rich("MAJOR ASSISTS ");
public static FilterCycleLabelContent Challenge => FilterCycleLabelContent.Rich("CHALLENGE ");
public static FilterCycleLabelContent NoDamage => FilterCycleLabelContent.Rich("NO DAMAGE ");
public static FilterCycleLabelContent StrayModeSaveFile => FilterRichTextLabels.StrayModeSaveFile;
public static FilterCycleLabelContent MasqueradeDivinitySaveFile => FilterRichTextLabels.MasqueradeDivinitySaveFile;
public static FilterCycleLabelContent FentoKill => FilterCycleLabelContent.Rich("FENTOKILL ");
public static FilterCycleLabelContent BillionNemesis => FilterCycleLabelContent.Rich("BILLION NEMESIS ");
public static FilterCycleLabelContent ForceRadiance => FilterCycleLabelContent.Rich(FlagRichTextFormatter.FormatForceRadianceText("FORCERADIANCE"));
public static FilterCycleLabelContent ForceSand => FilterCycleLabelContent.Rich(FlagRichTextFormatter.FormatForceSandText("FORCESAND"));
}
internal readonly struct FilterCycleDisplayState
{
public string ValueText { get; }
public Color? ValueColor { get; }
public FilterCycleLabelContent Label { get; }
public FilterCycleDisplayState(string valueText, Color? valueColor, FilterCycleLabelContent label)
{
ValueText = valueText ?? string.Empty;
ValueColor = valueColor;
Label = label;
}
}
internal static class FilterCycleButtons
{
private const string NeutralTriStateSymbol = "*";
private static readonly Color DefaultIncludeColor = new Color(0.33f, 0.9f, 0.33f, 1f);
private static readonly Color DefaultExcludeColor = new Color(0.92f, 0.24f, 0.24f, 1f);
public static UltraStatsFilterTriStateButton CreateTriStateButton(RectTransform parent, Transform styleRoot, string name, FilterCycleLabelContent label, Color? neutralValueColor = null, Color? includeValueColor = null, Color? excludeValueColor = null, float height = 34f)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
UltraStatsRichCycleButton ultraStatsRichCycleButton = CreateSequenceButton(parent, styleRoot, name, new FilterCycleDisplayState[3]
{
new FilterCycleDisplayState("*", neutralValueColor, label),
new FilterCycleDisplayState("+", (Color)(((??)includeValueColor) ?? DefaultIncludeColor), label),
new FilterCycleDisplayState("-", (Color)(((??)excludeValueColor) ?? DefaultExcludeColor), label)
}, height);
UltraStatsFilterTriStateButton ultraStatsFilterTriStateButton = ((Component)ultraStatsRichCycleButton).gameObject.AddComponent();
ultraStatsFilterTriStateButton.Initialize(ultraStatsRichCycleButton);
return ultraStatsFilterTriStateButton;
}
public static UltraStatsRichCycleButton CreateSequenceButton(RectTransform parent, Transform styleRoot, string name, FilterCycleDisplayState[] states, float height = 34f)
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)parent == (Object)null)
{
throw new ArgumentNullException("parent");
}
if ((Object)(object)styleRoot == (Object)null)
{
throw new ArgumentNullException("styleRoot");
}
if (states == null || states.Length == 0)
{
throw new ArgumentException("At least one cycle state is required.", "states");
}
UltraStatsVanillaButtonState state;
Button val = MainMenuButton_US.CreateVanillaStyledButton((Transform)(object)parent, styleRoot, name, new Vector2(220f, height), UltraStatsRichCycleButton.BuildButtonText(states[0]), null, out state);
LayoutElement obj = ((Component)val).gameObject.GetComponent() ?? ((Component)val).gameObject.AddComponent();
obj.preferredHeight = height;
obj.minHeight = height;
obj.preferredWidth = 0f;
obj.minWidth = 0f;
obj.flexibleWidth = 1f;
ConfigureButtonLabelVisuals(val);
UltraStatsRichCycleButton ultraStatsRichCycleButton = ((Component)val).gameObject.AddComponent();
ultraStatsRichCycleButton.Initialize(val, states, 0);
return ultraStatsRichCycleButton;
}
private static void ConfigureButtonLabelVisuals(Button button)
{
TMP_Text[] componentsInChildren = ((Component)button).GetComponentsInChildren(true);
foreach (TMP_Text obj in componentsInChildren)
{
obj.richText = true;
obj.enableAutoSizing = false;
obj.fontSize = 16f;
obj.fontStyle = (FontStyles)1;
obj.alignment = (TextAlignmentOptions)514;
obj.enableWordWrapping = false;
obj.overflowMode = (TextOverflowModes)0;
}
Text[] componentsInChildren2 = ((Component)button).GetComponentsInChildren(true);
foreach (Text obj2 in componentsInChildren2)
{
obj2.supportRichText = true;
obj2.resizeTextForBestFit = false;
obj2.fontSize = 16;
obj2.fontStyle = (FontStyle)1;
obj2.alignment = (TextAnchor)4;
obj2.horizontalOverflow = (HorizontalWrapMode)1;
}
}
}
internal sealed class UltraStatsRichCycleButton : MonoBehaviour
{
private Button _button;
private FilterCycleDisplayState[] _states = Array.Empty();
private TMP_Text[] _tmpTexts = Array.Empty();
private Text[] _legacyTexts = Array.Empty();
private int _stateIndex;
public int StateIndex => _stateIndex;
public event Action? OnStateIndexChanged;
public void Initialize(Button button, FilterCycleDisplayState[] states, int initialStateIndex)
{
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
if ((Object)(object)button == (Object)null)
{
throw new ArgumentNullException("button");
}
if (states == null || states.Length == 0)
{
throw new ArgumentException("At least one cycle state is required.", "states");
}
_button = button;
_states = new FilterCycleDisplayState[states.Length];
Array.Copy(states, _states, states.Length);
_tmpTexts = ((Component)button).GetComponentsInChildren(true);
_legacyTexts = ((Component)button).GetComponentsInChildren(true);
_stateIndex = Mathf.Clamp(initialStateIndex, 0, _states.Length - 1);
TMP_Text[] tmpTexts = _tmpTexts;
for (int i = 0; i < tmpTexts.Length; i++)
{
tmpTexts[i].richText = true;
}
Text[] legacyTexts = _legacyTexts;
for (int i = 0; i < legacyTexts.Length; i++)
{
legacyTexts[i].supportRichText = true;
}
((UnityEvent)_button.onClick).AddListener(new UnityAction(AdvanceState));
RefreshLabel();
}
public void SetStateIndexWithoutNotify(int index)
{
if (_states.Length != 0)
{
_stateIndex = Mathf.Clamp(index, 0, _states.Length - 1);
RefreshLabel();
}
}
private void OnDestroy()
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Expected O, but got Unknown
if ((Object)(object)_button != (Object)null)
{
((UnityEvent)_button.onClick).RemoveListener(new UnityAction(AdvanceState));
}
}
private void AdvanceState()
{
if (_states.Length != 0)
{
_stateIndex = (_stateIndex + 1) % _states.Length;
RefreshLabel();
this.OnStateIndexChanged?.Invoke(_stateIndex);
}
}
private void RefreshLabel()
{
if (_states.Length != 0)
{
string text = BuildButtonText(_states[_stateIndex]);
TMP_Text[] tmpTexts = _tmpTexts;
for (int i = 0; i < tmpTexts.Length; i++)
{
tmpTexts[i].text = text;
}
Text[] legacyTexts = _legacyTexts;
for (int i = 0; i < legacyTexts.Length; i++)
{
legacyTexts[i].text = text;
}
}
}
public static string BuildButtonText(FilterCycleDisplayState state)
{
string text = WrapColor(EscapeRichText(state.ValueText), state.ValueColor);
string text2 = state.Label.ToDisplayText();
if (!string.IsNullOrEmpty(text2))
{
return text + " " + text2;
}
return text;
}
internal static string WrapColor(string value, Color? color)
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
if (string.IsNullOrEmpty(value) || !color.HasValue)
{
return value;
}
return "" + value + " ";
}
internal static string EscapeRichText(string value)
{
if (string.IsNullOrEmpty(value))
{
return string.Empty;
}
return value.Replace("&", "&").Replace("<", "<").Replace(">", ">");
}
}
internal sealed class UltraStatsFilterTriStateButton : MonoBehaviour
{
private UltraStatsRichCycleButton _cycleButton;
public RunFilterTriState Value => (RunFilterTriState)Mathf.Clamp(_cycleButton?.StateIndex ?? 0, 0, 2);
public event Action? OnValueChanged;
public void Initialize(UltraStatsRichCycleButton cycleButton)
{
_cycleButton = cycleButton ?? throw new ArgumentNullException("cycleButton");
_cycleButton.OnStateIndexChanged += HandleCycleStateChanged;
}
public void SetValueWithoutNotify(RunFilterTriState value)
{
_cycleButton?.SetStateIndexWithoutNotify(Mathf.Clamp((int)value, 0, 2));
}
private void OnDestroy()
{
if ((Object)(object)_cycleButton != (Object)null)
{
_cycleButton.OnStateIndexChanged -= HandleCycleStateChanged;
}
}
private void HandleCycleStateChanged(int stateIndex)
{
this.OnValueChanged?.Invoke((RunFilterTriState)Mathf.Clamp(stateIndex, 0, 2));
}
}
internal static class FilterRichTextLabels
{
public static FilterCycleLabelContent StrayModeSaveFile => FilterCycleLabelContent.Rich("ST RA YMO DE ");
public static FilterCycleLabelContent MasqueradeDivinitySaveFile => FilterCycleLabelContent.Rich("MASQUERADE DIVINITY ");
public static FilterCycleLabelContent GetSaveFileLabel(int saveSlot)
{
return saveSlot switch
{
1015064007 => StrayModeSaveFile,
11 => MasqueradeDivinitySaveFile,
_ => FilterCycleLabelContent.Plain($"Save {saveSlot}"),
};
}
public static string GetSaveFileDisplayText(int saveSlot)
{
return GetSaveFileLabel(saveSlot).ToDisplayText();
}
}
internal static class FilterWindowLayout
{
public const float ColumnStackSpacing = 5f;
public const float ControlRowSpacing = 10f;
public const float CompactRowSpacing = 6f;
public const float CompactSectionGapHeight = 6f;
public const float SectionGapHeight = 10f;
public const float LowerSectionSpacing = 6f;
public const float BooleanSectionSpacing = 8f;
public const float DividerThickness = 1f;
public const float DividerTopPadding = 0f;
public const float DividerBottomPadding = 0f;
public const float LowerSectionDividerTopPadding = 11f;
public const float LowerSectionDividerBottomPadding = 10f;
public const float CenterDividerWidth = 2f;
public const float SectionLabelHeight = 15f;
public const float InlineRowHeight = 30f;
public const float InlineLabelWidth = 120f;
public const float TriStateButtonHeight = 30f;
public static RectTransform CreateVerticalSection(Transform parent, string name, float spacing = 6f)
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: 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_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Expected O, but got Unknown
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name, new Type[4]
{
typeof(RectTransform),
typeof(VerticalLayoutGroup),
typeof(ContentSizeFitter),
typeof(LayoutElement)
});
val.transform.SetParent(parent, false);
LayoutElement component = val.GetComponent();
component.minHeight = 0f;
component.flexibleHeight = 0f;
VerticalLayoutGroup component2 = val.GetComponent();
((LayoutGroup)component2).padding = new RectOffset(0, 0, 0, 0);
((HorizontalOrVerticalLayoutGroup)component2).spacing = spacing;
((LayoutGroup)component2).childAlignment = (TextAnchor)0;
((HorizontalOrVerticalLayoutGroup)component2).childControlWidth = true;
((HorizontalOrVerticalLayoutGroup)component2).childControlHeight = true;
((HorizontalOrVerticalLayoutGroup)component2).childForceExpandWidth = true;
((HorizontalOrVerticalLayoutGroup)component2).childForceExpandHeight = false;
ContentSizeFitter component3 = val.GetComponent();
component3.horizontalFit = (FitMode)0;
component3.verticalFit = (FitMode)2;
return val.GetComponent();
}
public static GameObject CreateSpacer(Transform parent, string name, float height)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Expected O, but got Unknown
GameObject val = new GameObject(name, new Type[2]
{
typeof(RectTransform),
typeof(LayoutElement)
});
val.transform.SetParent(parent, false);
LayoutElement component = val.GetComponent();
component.preferredHeight = height;
component.minHeight = height;
component.flexibleHeight = 0f;
return val;
}
public static RectTransform CreateDivider(Transform parent, string name, Color color, float topPadding = 0f, float bottomPadding = 0f, float thickness = 1f)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
//IL_00b2: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name, new Type[2]
{
typeof(RectTransform),
typeof(LayoutElement)
});
val.transform.SetParent(parent, false);
LayoutElement component = val.GetComponent();
float num = Mathf.Max(1f, thickness);
float minHeight = (component.preferredHeight = Mathf.Max(0f, topPadding) + num + Mathf.Max(0f, bottomPadding));
component.minHeight = minHeight;
component.flexibleHeight = 0f;
GameObject val2 = new GameObject(name + "Line", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val2.transform.SetParent(val.transform, false);
Image component2 = val2.GetComponent();
((Graphic)component2).color = color;
((Graphic)component2).raycastTarget = false;
RectTransform component3 = val2.GetComponent();
component3.anchorMin = new Vector2(0f, 1f);
component3.anchorMax = new Vector2(1f, 1f);
component3.pivot = new Vector2(0.5f, 1f);
component3.sizeDelta = new Vector2(0f, num);
component3.anchoredPosition = new Vector2(0f, 0f - Mathf.Max(0f, topPadding));
return val.GetComponent();
}
public static TextMeshProUGUI CreateTextLabel(Transform parent, Transform styleRoot, string name, string text, float fontSize, TextAlignmentOptions alignment, float preferredHeight, float preferredWidth = -1f)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name, new Type[3]
{
typeof(RectTransform),
typeof(TextMeshProUGUI),
typeof(LayoutElement)
});
val.transform.SetParent(parent, false);
LayoutElement component = val.GetComponent();
if (preferredHeight > 0f)
{
component.preferredHeight = preferredHeight;
component.minHeight = preferredHeight;
}
if (preferredWidth >= 0f)
{
component.preferredWidth = preferredWidth;
component.minWidth = preferredWidth;
component.flexibleWidth = 0f;
}
TextMeshProUGUI component2 = val.GetComponent();
((TMP_Text)component2).richText = true;
MainMenuButton_US.ApplyPanelTextStyle(styleRoot, component2);
((TMP_Text)component2).text = text ?? string.Empty;
((TMP_Text)component2).fontSize = fontSize;
((Graphic)component2).color = Color.white;
((TMP_Text)component2).alignment = alignment;
((TMP_Text)component2).enableWordWrapping = false;
((TMP_Text)component2).overflowMode = (TextOverflowModes)1;
((Graphic)component2).raycastTarget = false;
return component2;
}
}
internal static class FlagRichTextFormatter
{
private static readonly string[] ForceRadiancePalette = new string[13]
{
"#48ffff", "#c7f797", "#ffff7f", "#ffbf50", "#ffafbf", "#ff7087", "#9f70c7", "#6087cf", "#48ffff", "#c7f797",
"#ffff7f", "#ffbf50", "#ffafbf"
};
private static readonly string[] ForceSandPalette = new string[9] { "#E0AD6D", "#E29D6A", "#E49067", "#DD7A60", "#DA685B", "#EA655E", "#EB585A", "#EA4D58", "#EE4858" };
public static string FormatForceRadianceText(string text)
{
return ApplyPalette(text, ForceRadiancePalette);
}
public static string FormatForceSandText(string text)
{
return ApplyPalette(text, ForceSandPalette);
}
public static string FormatRunDateByFlags(string dateText, long flags)
{
return FormatRunDateByFlags(dateText, FlagEncoding.Has(flags, 16L), FlagEncoding.Has(flags, 32L));
}
public static string FormatRunDateByFlags(string dateText, bool forceRadianceEnabled, bool forceSandEnabled)
{
if (string.IsNullOrEmpty(dateText) || dateText == "-")
{
return dateText ?? string.Empty;
}
if (forceRadianceEnabled && forceSandEnabled)
{
int num = (dateText.Length + 1) / 2;
return ApplyPalette(dateText.Substring(0, num), ForceRadiancePalette) + ApplyPalette(dateText.Substring(num), ForceSandPalette);
}
if (forceRadianceEnabled)
{
return ApplyPalette(dateText, ForceRadiancePalette);
}
if (forceSandEnabled)
{
return ApplyPalette(dateText, ForceSandPalette);
}
return dateText;
}
public static string FormatNoHitDeathsText(string deathsText, long flags)
{
if (!FlagEncoding.Has(flags, 8L) || string.IsNullOrEmpty(deathsText) || deathsText == "-")
{
return deathsText ?? string.Empty;
}
return WrapColor(deathsText, "orange");
}
private static string ApplyPalette(string text, string[] palette)
{
if (string.IsNullOrEmpty(text))
{
return string.Empty;
}
if (palette == null || palette.Length == 0)
{
return UltraStatsRichCycleButton.EscapeRichText(text);
}
StringBuilder stringBuilder = new StringBuilder(text.Length * 24);
for (int i = 0; i < text.Length; i++)
{
stringBuilder.Append("');
stringBuilder.Append(UltraStatsRichCycleButton.EscapeRichText(text[i].ToString()));
stringBuilder.Append(" ");
}
return stringBuilder.ToString();
}
private static string WrapColor(string text, string colorToken)
{
if (string.IsNullOrEmpty(text))
{
return string.Empty;
}
return "" + UltraStatsRichCycleButton.EscapeRichText(text) + " ";
}
}
internal enum StartupNoticeType
{
None,
FreshInstallWelcome,
LegacyTransition
}
internal static class UltraStatsStartupNoticeController
{
private readonly struct StartupNoticeCopy
{
public string Title { get; }
public string Body { get; }
public StartupNoticeCopy(string title, string body)
{
Title = title;
Body = body;
}
}
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static Func <>9__17_0;
public static UnityAction <>9__20_0;
internal string b__17_0()
{
return $"Startup notices captured: hasDbAtStartup={_hadDatabaseAtStartup}, hasLegacyAtStartup={_hadLegacyDataAtStartup}";
}
internal void b__20_0()
{
}
}
private const string OverlayObjectName = "ULTRASTATS_StartupNoticeOverlay";
private const float WindowWidth = 760f;
private const float WindowHeight = 344f;
private const float WindowInset = 18f;
private const float TitleTopInset = -44f;
private const float TitleBottomInset = -12f;
private const float DividerTopInset = -54f;
private const float DividerBottomInset = -52f;
private const float BodyTopInset = -66f;
private const float BodyBottomInset = 18f;
private const float CloseButtonTopOffset = 18f;
private static readonly StartupNoticeCopy FreshInstallCopy = new StartupNoticeCopy("ULTRASTATS NOTICE", "Dear User,\nWelcome to ULTRASTATS, the stattracker for ULTRAKILL. If you have any issues with ULTRASTATS please DM me on discord (atomsmasher_1586).\nThis mod is currently still early in development with much more planned to come so stay tuned! To see your saved runs click on the button in the bottom right (you can change where the button appears in Plugin Configurator).\n\nP.S. If you see this and are an old user, it's because ULTRASTATS can't find your run database.");
private static readonly StartupNoticeCopy LegacyTransitionCopy = new StartupNoticeCopy("ULTRASTATS NOTICE", "Dear User,\nWelcome to ULTRASTATS v0.1.2!\nA lot has changed with this update, mainly switching the way ULTRASTATS stores data. Now your runs are all stored in a database file (ultrastats.db) instead of in .jsonl files. If everything looks correct in the stats chart then you are free to delete the old (now unused) Difficulty_ folders in your ULTRASTATS data folder.\n\nTHIS MESSAGE WILL REAPPEAR UNTIL THOSE OLD FOLDERS ARE DELETED OR STARTUP NOTICES ARE DISABLED IN PLUGIN CONFIGURATOR.\n\nIf something goes wrong with conversion from .jsonl to .db delete ultrastats.db to reattempt conversion. If that still doesn't work DM me on discord (atomsmasher_1586).");
private static bool _startupStateCaptured;
private static bool _hadDatabaseAtStartup;
private static bool _hadLegacyDataAtStartup;
private static bool _noticeHandledThisSession;
public static void CaptureStartupState()
{
if (!_startupStateCaptured)
{
_hadDatabaseAtStartup = File.Exists(UltraStatsPaths.DatabasePath);
_hadLegacyDataAtStartup = LegacyBootstrapImporter.HasLegacyData(UltraStatsPaths.LegacyJsonlRoot);
_startupStateCaptured = true;
BepInExLogs_US.Debug(() => $"Startup notices captured: hasDbAtStartup={_hadDatabaseAtStartup}, hasLegacyAtStartup={_hadLegacyDataAtStartup}");
}
}
public static void TryShowIfNeeded(Transform mainMenu)
{
if ((Object)(object)mainMenu == (Object)null || _noticeHandledThisSession)
{
return;
}
CaptureStartupState();
_noticeHandledThisSession = true;
if (!((Object)(object)mainMenu.Find("ULTRASTATS_StartupNoticeOverlay") != (Object)null))
{
StartupNoticeType startupNoticeType = DecideNoticeType();
if (startupNoticeType != 0)
{
BuildNoticeOverlay(mainMenu, startupNoticeType);
}
}
}
private static StartupNoticeType DecideNoticeType()
{
bool flag = File.Exists(UltraStatsPaths.DatabasePath);
if (_hadLegacyDataAtStartup && flag && Plugin.ShowLegacyTransitionNotice)
{
return StartupNoticeType.LegacyTransition;
}
if (!_hadDatabaseAtStartup && !_hadLegacyDataAtStartup && !Plugin.HasSeenFreshInstallWelcome)
{
return StartupNoticeType.FreshInstallWelcome;
}
return StartupNoticeType.None;
}
private static void BuildNoticeOverlay(Transform mainMenu, StartupNoticeType noticeType)
{
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_0080: 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_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Expected O, but got Unknown
//IL_0132: 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_016d: 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_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: 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_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_025a: 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_02aa: Unknown result type (might be due to invalid IL or missing references)
//IL_02af: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
//IL_02e7: 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_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_0325: Unknown result type (might be due to invalid IL or missing references)
//IL_0335: Unknown result type (might be due to invalid IL or missing references)
//IL_0379: Unknown result type (might be due to invalid IL or missing references)
//IL_038e: Unknown result type (might be due to invalid IL or missing references)
//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
//IL_03da: Unknown result type (might be due to invalid IL or missing references)
//IL_0406: Unknown result type (might be due to invalid IL or missing references)
//IL_041b: Unknown result type (might be due to invalid IL or missing references)
//IL_0430: Unknown result type (might be due to invalid IL or missing references)
//IL_0444: 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_0464: Expected O, but got Unknown
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Expected O, but got Unknown
GameObject val = new GameObject("ULTRASTATS_StartupNoticeOverlay", new Type[7]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image),
typeof(Button),
typeof(Canvas),
typeof(GraphicRaycaster),
typeof(UltraStatsStartupNoticeModal)
});
val.transform.SetParent(mainMenu, false);
RectTransform component = val.GetComponent();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
Canvas component2 = val.GetComponent();
component2.overrideSorting = true;
component2.sortingOrder = 950;
Image component3 = val.GetComponent();
((Graphic)component3).color = new Color(0f, 0f, 0f, 0.66f);
((Graphic)component3).raycastTarget = true;
UltraStatsStartupNoticeModal component4 = val.GetComponent();
component4.Initialize(noticeType);
Button component5 = val.GetComponent();
((Selectable)component5).transition = (Transition)0;
((UnityEvent)component5.onClick).AddListener(new UnityAction(component4.Dismiss));
GameObject val2 = MainMenuButton_US.CreateStandardWindowSurface(val.transform, "StartupNoticeWindow", new Vector2(760f, 344f), new Color(0f, 0f, 0f, 0.97f));
RectTransform component6 = val2.GetComponent();
component6.anchorMin = new Vector2(0.5f, 0.5f);
component6.anchorMax = new Vector2(0.5f, 0.5f);
component6.pivot = new Vector2(0.5f, 0.5f);
component6.anchoredPosition = Vector2.zero;
Button obj = val2.AddComponent();
((Selectable)obj).transition = (Transition)0;
ButtonClickedEvent onClick = obj.onClick;
object obj2 = <>c.<>9__20_0;
if (obj2 == null)
{
UnityAction val3 = delegate
{
};
<>c.<>9__20_0 = val3;
obj2 = (object)val3;
}
((UnityEvent)onClick).AddListener((UnityAction)obj2);
StartupNoticeCopy copy = GetCopy(noticeType);
RectTransform rectTransform = ((TMP_Text)CreateText(val2.transform, "Title", copy.Title, 28f, (FontStyles)1, (TextAlignmentOptions)257, mainMenu)).rectTransform;
rectTransform.anchorMin = new Vector2(0f, 1f);
rectTransform.anchorMax = new Vector2(1f, 1f);
rectTransform.pivot = new Vector2(0f, 1f);
rectTransform.offsetMin = new Vector2(18f, -44f);
rectTransform.offsetMax = new Vector2(-72f, -12f);
GameObject val4 = new GameObject("Divider", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val4.transform.SetParent(val2.transform, false);
RectTransform component7 = val4.GetComponent();
component7.anchorMin = new Vector2(0f, 1f);
component7.anchorMax = new Vector2(1f, 1f);
component7.pivot = new Vector2(0.5f, 1f);
component7.offsetMin = new Vector2(18f, -54f);
component7.offsetMax = new Vector2(-18f, -52f);
Image component8 = val4.GetComponent();
((Graphic)component8).color = Color.white;
((Graphic)component8).raycastTarget = false;
TextMeshProUGUI obj3 = CreateText(val2.transform, "Body", copy.Body, 18f, (FontStyles)0, (TextAlignmentOptions)257, mainMenu);
RectTransform rectTransform2 = ((TMP_Text)obj3).rectTransform;
rectTransform2.anchorMin = new Vector2(0f, 0f);
rectTransform2.anchorMax = new Vector2(1f, 1f);
rectTransform2.offsetMin = new Vector2(18f, 18f);
rectTransform2.offsetMax = new Vector2(-18f, -66f);
((TMP_Text)obj3).lineSpacing = 3f;
((TMP_Text)obj3).enableWordWrapping = true;
((TMP_Text)obj3).overflowMode = (TextOverflowModes)0;
((TMP_Text)obj3).margin = Vector4.zero;
Button obj4 = MainMenuButton_US.CreateWindowCloseButton(val2.transform, mainMenu);
RectTransform component9 = ((Component)obj4).GetComponent();
component9.anchorMin = new Vector2(1f, 1f);
component9.anchorMax = new Vector2(1f, 1f);
component9.pivot = new Vector2(1f, 1f);
component9.anchoredPosition = new Vector2(0f, 18f);
((UnityEvent)obj4.onClick).AddListener(new UnityAction(component4.Dismiss));
val.transform.SetAsLastSibling();
}
private static StartupNoticeCopy GetCopy(StartupNoticeType noticeType)
{
if (noticeType == StartupNoticeType.LegacyTransition)
{
return LegacyTransitionCopy;
}
return FreshInstallCopy;
}
private static TextMeshProUGUI CreateText(Transform parent, string name, string text, float fontSize, FontStyles fontStyle, TextAlignmentOptions alignment, Transform styleRoot)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: 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)
GameObject val = new GameObject(name, new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val.transform.SetParent(parent, false);
TextMeshProUGUI component = val.GetComponent();
MainMenuButton_US.ApplyPanelTextStyle(styleRoot, component);
((TMP_Text)component).text = text;
((TMP_Text)component).fontSize = fontSize;
((TMP_Text)component).fontStyle = fontStyle;
((TMP_Text)component).alignment = alignment;
((Graphic)component).color = Color.white;
((Graphic)component).raycastTarget = false;
((TMP_Text)component).margin = Vector4.zero;
return component;
}
}
internal sealed class UltraStatsStartupNoticeModal : MonoBehaviour
{
private StartupNoticeType _noticeType;
private bool _dismissed;
public void Initialize(StartupNoticeType noticeType)
{
_noticeType = noticeType;
}
private void Update()
{
if (!_dismissed && ((Component)this).gameObject.activeInHierarchy && Input.GetKeyDown((KeyCode)27))
{
Dismiss();
}
}
public void Dismiss()
{
if (!_dismissed)
{
_dismissed = true;
if (_noticeType == StartupNoticeType.FreshInstallWelcome)
{
Plugin.MarkFreshInstallWelcomeSeen();
}
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
internal static class BepInExLogs_US
{
private static bool DebugEnabled => Plugin.DebugLoggingEnabled;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void ModLoaded()
{
Plugin.Log.LogInfo((object)"[ULTRASTATS] : Mod loaded");
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Queue(string message)
{
Plugin.Log.LogInfo((object)("[Queue] : " + message));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void QueueCleared()
{
Queue("Queue has been cleared!");
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void QueueAppended(long id, string path)
{
Queue($"Run {id} has been appended to {path}");
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Debug(string message)
{
if (DebugEnabled)
{
Plugin.Log.LogDebug((object)message);
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Debug(Func messageFactory)
{
if (DebugEnabled)
{
Plugin.Log.LogDebug((object)messageFactory());
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void CaptureEvent(string message)
{
if (Plugin.CaptureLoggingEnabled)
{
Plugin.Log.LogInfo((object)("[ULTRASTATS] " + message));
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Warn(string message)
{
Plugin.Log.LogWarning((object)("[ULTRASTATS] : " + message));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Error(string message)
{
Plugin.Log.LogError((object)("[ULTRASTATS] : " + message));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Error(string context, Exception ex)
{
Plugin.Log.LogError((object)$"[ULTRASTATS] : {context}: {ex}");
}
}
internal static class InfoTab_US
{
private const string InfoTextBeforeImage = "\r\nFor any issues, suggestions, bugs, or complaints you have about ULTRASTATS, please contact me through discord. I'd prefer DMs but I am also active on the New Blood Discord server's ultrakill-modding channel and the ULTRAKILL legacy server's ultramodding channel so you can reach me there too. I'd love to hear from you! \r\n\r\n ULTRASTATS won Mod of the Month for March 2026!!!!!! :D I'm so happy that people liked my mod enough to download it and vote for it above several other (much better if I'm being honest) mods.\r\n";
private const string InfoTextAfterImage = "I'll keep improving ULTRASTATS to the best of my ability so it wins MotY 2026 too.\r\n\r\n The next major update will implement filtering. So you can filter out runs from different save files, only display runs with a certain rank, filter out flagged runs, etc.\r\n\r\n Thanks to each and everyone of you who choose to download ULTRASTATS, it means the world to me that people want to use my silly passion project.\r\n\r\n Thanks to my fellow modders for helping me with my questions and issues.\r\n\r\n Expect the next big update within a couple weeks, probably.\r\n\r\nP.S. You can change what tab is the default through PluginConfigurator, along with some other preference settings.\r\n\r\nKnown issues:\n -- Stuttering when spam clicking through the endscreen.\n -- UI is garbage... I tried my best okay :(\nIf you find any other issues DM me on discord.\n";
private const float WheelPixelsPerTick = 96f;
private const float ScrollbarWidth = 18f;
private const float ViewportScrollbarInset = 20f;
public static void Build(Transform parent, Transform styleRoot)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: 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_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("InfoTabRoot", new Type[1] { typeof(RectTransform) });
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
BuildHeader(val.transform, styleRoot);
BuildScrollView(val.transform, styleRoot);
}
private static void BuildHeader(Transform parent, Transform styleRoot)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: 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_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: Unknown result type (might be due to invalid IL or missing references)
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: 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_02df: 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_0309: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Unknown result type (might be due to invalid IL or missing references)
//IL_034b: Unknown result type (might be due to invalid IL or missing references)
//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
//IL_03aa: 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_03cd: Unknown result type (might be due to invalid IL or missing references)
//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
//IL_040c: Unknown result type (might be due to invalid IL or missing references)
//IL_0420: Unknown result type (might be due to invalid IL or missing references)
//IL_0430: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("Header", new Type[1] { typeof(RectTransform) });
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = new Vector2(0f, 1f);
component.anchorMax = new Vector2(1f, 1f);
component.pivot = new Vector2(0.5f, 1f);
component.sizeDelta = new Vector2(0f, 178f);
component.anchoredPosition = Vector2.zero;
GameObject val2 = new GameObject("ModIcon", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val2.transform.SetParent(val.transform, false);
RectTransform component2 = val2.GetComponent();
component2.anchorMin = new Vector2(0f, 1f);
component2.anchorMax = new Vector2(0f, 1f);
component2.pivot = new Vector2(0f, 1f);
component2.sizeDelta = new Vector2(152f, 152f);
component2.anchoredPosition = new Vector2(0f, -2f);
Image component3 = val2.GetComponent();
component3.sprite = MainMenuButton_US.LoadSpriteFromPluginFile("icon.png");
component3.type = (Type)0;
component3.preserveAspect = true;
((Graphic)component3).color = Color.white;
((Graphic)component3).raycastTarget = false;
GameObject val3 = new GameObject("Title", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val3.transform.SetParent(val.transform, false);
RectTransform component4 = val3.GetComponent();
component4.anchorMin = new Vector2(0f, 1f);
component4.anchorMax = new Vector2(1f, 1f);
component4.pivot = new Vector2(0f, 1f);
component4.offsetMin = new Vector2(178f, -92f);
component4.offsetMax = new Vector2(12f, 0f);
TextMeshProUGUI component5 = val3.GetComponent();
MainMenuButton_US.ApplyPanelTextStyle(styleRoot, component5);
((TMP_Text)component5).text = "ULTRASTATS";
((TMP_Text)component5).fontSize = 80f;
((TMP_Text)component5).characterSpacing = 2f;
((Graphic)component5).color = Color.white;
((TMP_Text)component5).alignment = (TextAlignmentOptions)257;
((TMP_Text)component5).enableWordWrapping = false;
((TMP_Text)component5).overflowMode = (TextOverflowModes)0;
((Graphic)component5).raycastTarget = false;
GameObject val4 = new GameObject("Meta", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val4.transform.SetParent(val.transform, false);
RectTransform component6 = val4.GetComponent();
component6.anchorMin = new Vector2(0f, 1f);
component6.anchorMax = new Vector2(1f, 1f);
component6.pivot = new Vector2(0f, 1f);
component6.offsetMin = new Vector2(182f, -164f);
component6.offsetMax = new Vector2(12f, -92f);
TextMeshProUGUI component7 = val4.GetComponent();
MainMenuButton_US.ApplyPanelTextStyle(styleRoot, component7);
((TMP_Text)component7).text = "Version 0.1.4\nDiscord: atomsmasher_1586";
((TMP_Text)component7).fontSize = 28f;
((Graphic)component7).color = Color.white;
((TMP_Text)component7).lineSpacing = 6f;
((TMP_Text)component7).alignment = (TextAlignmentOptions)257;
((TMP_Text)component7).enableWordWrapping = false;
((TMP_Text)component7).overflowMode = (TextOverflowModes)0;
((Graphic)component7).raycastTarget = false;
GameObject val5 = new GameObject("Divider", new Type[2]
{
typeof(RectTransform),
typeof(Image)
});
val5.transform.SetParent(val.transform, false);
RectTransform component8 = val5.GetComponent();
component8.anchorMin = new Vector2(0f, 0f);
component8.anchorMax = new Vector2(1f, 0f);
component8.pivot = new Vector2(0.5f, 0f);
component8.offsetMin = new Vector2(-38f, 0f);
component8.offsetMax = new Vector2(38f, 1f);
Image component9 = val5.GetComponent();
((Graphic)component9).color = Color.white;
((Graphic)component9).raycastTarget = false;
}
private static void BuildScrollView(Transform parent, Transform styleRoot)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Expected O, but got Unknown
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: 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_018d: Expected O, but got Unknown
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: 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_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_022a: Unknown result type (might be due to invalid IL or missing references)
//IL_022f: 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_0255: 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_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_0297: Unknown result type (might be due to invalid IL or missing references)
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
//IL_0358: Unknown result type (might be due to invalid IL or missing references)
//IL_035d: Unknown result type (might be due to invalid IL or missing references)
//IL_036f: Unknown result type (might be due to invalid IL or missing references)
//IL_0383: Unknown result type (might be due to invalid IL or missing references)
//IL_0399: 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_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
//IL_0413: 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_044f: Unknown result type (might be due to invalid IL or missing references)
//IL_0461: Unknown result type (might be due to invalid IL or missing references)
//IL_0475: Unknown result type (might be due to invalid IL or missing references)
//IL_048b: Unknown result type (might be due to invalid IL or missing references)
//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
//IL_04d9: 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)
GameObject val = new GameObject("InfoScrollRoot", new Type[1] { typeof(RectTransform) });
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = new Vector2(0f, 0f);
component.anchorMax = new Vector2(1f, 1f);
component.offsetMin = new Vector2(0f, 8f);
component.offsetMax = new Vector2(0f, -184f);
GameObject val2 = new GameObject("Viewport", new Type[5]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image),
typeof(RectMask2D),
typeof(UltraStatsFixedWheelScroll)
});
val2.transform.SetParent(val.transform, false);
RectTransform component2 = val2.GetComponent();
component2.anchorMin = new Vector2(0f, 0f);
component2.anchorMax = new Vector2(1f, 1f);
component2.offsetMin = Vector2.zero;
component2.offsetMax = new Vector2(-20f, 0f);
Image component3 = val2.GetComponent();
((Graphic)component3).color = new Color(1f, 1f, 1f, 0.001f);
((Graphic)component3).raycastTarget = true;
GameObject val3 = new GameObject("Content", new Type[2]
{
typeof(RectTransform),
typeof(UltraStatsInfoRichContentSizer)
});
val3.transform.SetParent(val2.transform, false);
RectTransform component4 = val3.GetComponent();
component4.anchorMin = new Vector2(0f, 1f);
component4.anchorMax = new Vector2(1f, 1f);
component4.pivot = new Vector2(0.5f, 1f);
component4.anchoredPosition = Vector2.zero;
component4.sizeDelta = new Vector2(0f, 0f);
GameObject val4 = new GameObject("InfoBodyTextTop", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val4.transform.SetParent(val3.transform, false);
RectTransform component5 = val4.GetComponent();
component5.anchorMin = new Vector2(0f, 1f);
component5.anchorMax = new Vector2(1f, 1f);
component5.pivot = new Vector2(0.5f, 1f);
component5.offsetMin = new Vector2(18f, 0f);
component5.offsetMax = new Vector2(-18f, 0f);
component5.anchoredPosition = Vector2.zero;
TextMeshProUGUI component6 = val4.GetComponent();
MainMenuButton_US.ApplyPanelTextStyle(styleRoot, component6);
((TMP_Text)component6).fontSize = 20f;
((Graphic)component6).color = Color.white;
((TMP_Text)component6).alignment = (TextAlignmentOptions)257;
((TMP_Text)component6).enableWordWrapping = true;
((TMP_Text)component6).overflowMode = (TextOverflowModes)0;
((TMP_Text)component6).lineSpacing = 8f;
((TMP_Text)component6).text = "\r\nFor any issues, suggestions, bugs, or complaints you have about ULTRASTATS, please contact me through discord. I'd prefer DMs but I am also active on the New Blood Discord server's ultrakill-modding channel and the ULTRAKILL legacy server's ultramodding channel so you can reach me there too. I'd love to hear from you! \r\n\r\n ULTRASTATS won Mod of the Month for March 2026!!!!!! :D I'm so happy that people liked my mod enough to download it and vote for it above several other (much better if I'm being honest) mods.\r\n";
((Graphic)component6).raycastTarget = false;
GameObject val5 = new GameObject("MotMImage", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val5.transform.SetParent(val3.transform, false);
RectTransform component7 = val5.GetComponent();
component7.anchorMin = new Vector2(0.5f, 1f);
component7.anchorMax = new Vector2(0.5f, 1f);
component7.pivot = new Vector2(0.5f, 1f);
component7.sizeDelta = new Vector2(0f, 0f);
component7.anchoredPosition = Vector2.zero;
Image component8 = val5.GetComponent();
component8.sprite = MainMenuButton_US.LoadSpriteFromPluginFile("images/MotM_March26.png") ?? MainMenuButton_US.LoadSpriteFromPluginFile("MotM_March26.png");
component8.type = (Type)0;
component8.preserveAspect = true;
((Graphic)component8).color = Color.white;
((Graphic)component8).raycastTarget = false;
GameObject val6 = new GameObject("InfoBodyTextBottom", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val6.transform.SetParent(val3.transform, false);
RectTransform component9 = val6.GetComponent();
component9.anchorMin = new Vector2(0f, 1f);
component9.anchorMax = new Vector2(1f, 1f);
component9.pivot = new Vector2(0.5f, 1f);
component9.offsetMin = new Vector2(18f, 0f);
component9.offsetMax = new Vector2(-18f, 0f);
component9.anchoredPosition = Vector2.zero;
TextMeshProUGUI component10 = val6.GetComponent();
MainMenuButton_US.ApplyPanelTextStyle(styleRoot, component10);
((TMP_Text)component10).fontSize = 20f;
((Graphic)component10).color = Color.white;
((TMP_Text)component10).alignment = (TextAlignmentOptions)257;
((TMP_Text)component10).enableWordWrapping = true;
((TMP_Text)component10).overflowMode = (TextOverflowModes)0;
((TMP_Text)component10).lineSpacing = 8f;
((TMP_Text)component10).text = "I'll keep improving ULTRASTATS to the best of my ability so it wins MotY 2026 too.\r\n\r\n The next major update will implement filtering. So you can filter out runs from different save files, only display runs with a certain rank, filter out flagged runs, etc.\r\n\r\n Thanks to each and everyone of you who choose to download ULTRASTATS, it means the world to me that people want to use my silly passion project.\r\n\r\n Thanks to my fellow modders for helping me with my questions and issues.\r\n\r\n Expect the next big update within a couple weeks, probably.\r\n\r\nP.S. You can change what tab is the default through PluginConfigurator, along with some other preference settings.\r\n\r\nKnown issues:\n -- Stuttering when spam clicking through the endscreen.\n -- UI is garbage... I tried my best okay :(\nIf you find any other issues DM me on discord.\n";
((Graphic)component10).raycastTarget = false;
UltraStatsInfoRichContentSizer component11 = val3.GetComponent();
component11.ContentRect = component4;
component11.TopTextRect = component5;
component11.TopText = component6;
component11.ImageRect = component7;
component11.Image = component8;
component11.BottomTextRect = component9;
component11.BottomText = component10;
component11.HorizontalPadding = 18f;
component11.ImageGapBefore = 18f;
component11.ImageGapAfter = 18f;
component11.BottomPadding = 24f;
component11.ImageMaxWidth = 960f;
Scrollbar scrollbar;
UltraStatsScrollbarDrag drag;
ScrollRect obj = UltraStatsScrollViewFactory.AttachChartStyleVerticalScroll(val, val2, component4, "ScrollbarTrack", 18f, 0f, 0f, 96f, out scrollbar, out drag);
Canvas.ForceUpdateCanvases();
obj.verticalNormalizedPosition = 1f;
drag.RefreshHandle();
}
}
internal sealed class UltraStatsInfoRichContentSizer : MonoBehaviour
{
public RectTransform ContentRect;
public RectTransform TopTextRect;
public TextMeshProUGUI TopText;
public RectTransform ImageRect;
public Image Image;
public RectTransform BottomTextRect;
public TextMeshProUGUI BottomText;
public float HorizontalPadding = 18f;
public float ImageGapBefore = 18f;
public float ImageGapAfter = 18f;
public float BottomPadding;
public float ImageMaxWidth = 960f;
private float _lastTopHeight = -1f;
private float _lastBottomHeight = -1f;
private float _lastImageWidth = -1f;
private float _lastImageHeight = -1f;
private void LateUpdate()
{
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: 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_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_020f: Unknown result type (might be due to invalid IL or missing references)
//IL_0276: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)ContentRect == (Object)null || (Object)(object)TopTextRect == (Object)null || (Object)(object)TopText == (Object)null || (Object)(object)ImageRect == (Object)null || (Object)(object)Image == (Object)null || (Object)(object)BottomTextRect == (Object)null || (Object)(object)BottomText == (Object)null)
{
return;
}
Canvas.ForceUpdateCanvases();
float num = Mathf.Ceil(((TMP_Text)TopText).preferredHeight);
float num2 = Mathf.Ceil(((TMP_Text)BottomText).preferredHeight);
float num3 = 0f;
float num4 = 0f;
if ((Object)(object)Image.sprite != (Object)null)
{
Rect rect = ContentRect.rect;
float num5 = Mathf.Max(0f, ((Rect)(ref rect)).width - HorizontalPadding * 2f);
num3 = Mathf.Min(ImageMaxWidth, num5);
Rect rect2 = Image.sprite.rect;
if (num3 > 0f && ((Rect)(ref rect2)).width > 0f && ((Rect)(ref rect2)).height > 0f)
{
num4 = num3 * (((Rect)(ref rect2)).height / ((Rect)(ref rect2)).width);
}
}
if (!(Mathf.Abs(num - _lastTopHeight) < 0.5f) || !(Mathf.Abs(num2 - _lastBottomHeight) < 0.5f) || !(Mathf.Abs(num3 - _lastImageWidth) < 0.5f) || !(Mathf.Abs(num4 - _lastImageHeight) < 0.5f))
{
_lastTopHeight = num;
_lastBottomHeight = num2;
_lastImageWidth = num3;
_lastImageHeight = num4;
TopTextRect.SetSizeWithCurrentAnchors((Axis)1, num);
TopTextRect.anchoredPosition = Vector2.zero;
float num6 = num;
if ((Object)(object)Image.sprite != (Object)null && num3 > 0f && num4 > 0f)
{
num6 += ImageGapBefore;
ImageRect.anchoredPosition = new Vector2(0f, 0f - num6);
ImageRect.sizeDelta = new Vector2(num3, num4);
((Behaviour)Image).enabled = true;
num6 += num4 + ImageGapAfter;
}
else
{
((Behaviour)Image).enabled = false;
ImageRect.sizeDelta = Vector2.zero;
ImageRect.anchoredPosition = new Vector2(0f, 0f - num6);
}
BottomTextRect.anchoredPosition = new Vector2(0f, 0f - num6);
BottomTextRect.SetSizeWithCurrentAnchors((Axis)1, num2);
float num7 = num6 + num2 + BottomPadding;
ContentRect.SetSizeWithCurrentAnchors((Axis)1, num7);
}
}
}
internal static class MainMenuButton_US
{
private enum MenuCorner
{
BottomRight,
BottomLeft,
TopRight,
TopLeft
}
[CompilerGenerated]
private sealed class d__25 : IEnumerator, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Scene scene;
private int 5__2;
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public d__25(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
_injecting = true;
5__2 = 0;
break;
case 1:
<>1__state = -1;
5__2++;
break;
}
if (5__2 < 600)
{
if (!((Scene)(ref scene)).isLoaded)
{
_injecting = false;
return false;
}
GameObject val = FindRootCanvasObject(scene);
if ((Object)(object)val != (Object)null)
{
Transform val2 = val.transform.Find("Main Menu (1)");
Transform val3 = ((val2 != null) ? val2.Find("LeftSide") : null);
if ((Object)(object)val2 != (Object)null && (Object)(object)val3 != (Object)null)
{
Inject(val3, val2);
_injecting = false;
return false;
}
}
<>2__current = null;
<>1__state = 1;
return true;
}
BepInExLogs_US.Warn("ULTRASTATS could not find Canvas/Main Menu (1)/LeftSide.");
_injecting = false;
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private const string MenuSceneName = "b3e7f2f8052488a45b35549efb98d902";
private const string ButtonObjectName = "ULTRASTATS_MenuButton";
private const string PanelObjectName = "ULTRASTATS_MenuPanel";
private const string BlockerObjectName = "ULTRASTATS_MenuBlocker";
private static readonly Dictionary BevelSpriteCache = new Dictionary();
private const float PanelWidth = 1200f;
private const float PanelHeight = 770f;
private const float BorderThickness = 4f;
private const float TabWidth = 186f;
private const float TabHeight = 44f;
private const float TabSpacing = -2f;
private const float TabOverlapIntoPanel = 16f;
internal static readonly Color DestructiveTextColor = new Color(0.92f, 0.2f, 0.2f, 1f);
private static readonly Color DefaultBeveledButtonColor = new Color(0.07f, 0.07f, 0.07f, 0.96f);
private static readonly Color DefaultBeveledButtonHoverColor = new Color(0.18f, 0.18f, 0.18f, 0.98f);
private static readonly Color DefaultBeveledButtonPressedColor = new Color(0.28f, 0.28f, 0.28f, 1f);
private static readonly Color DefaultBeveledButtonActiveColor = new Color(0.61f, 0.12f, 0.12f, 1f);
private static bool _subscribed;
private static bool _injecting;
public static void Init()
{
if (!_subscribed)
{
_subscribed = true;
SceneManager.activeSceneChanged += OnActiveSceneChanged;
BepInExLogs_US.Debug("MainMenuButtonInjector.Init called");
}
}
public static void Shutdown()
{
if (_subscribed)
{
_subscribed = false;
SceneManager.activeSceneChanged -= OnActiveSceneChanged;
}
}
public static void RefreshButtonPosition()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
GameObject? obj = FindRootCanvasObject(SceneManager.GetActiveScene());
Transform obj2 = ((obj != null) ? obj.transform.Find("Main Menu (1)") : null);
Transform val = ((obj2 != null) ? obj2.Find("ULTRASTATS_MenuButton") : null);
if ((Object)(object)val != (Object)null)
{
ApplyButtonPosition(((Component)val).GetComponent());
}
}
private static void ApplyButtonPosition(RectTransform rect)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_0073: 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_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: 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_0108: 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_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: 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)
if (!((Object)(object)rect == (Object)null))
{
switch ((MenuCorner)Plugin.MainMenuButtonCorner)
{
case MenuCorner.BottomLeft:
rect.anchorMin = new Vector2(0f, 0f);
rect.anchorMax = new Vector2(0f, 0f);
rect.pivot = new Vector2(0f, 0f);
rect.anchoredPosition = new Vector2(28f, 28f);
break;
case MenuCorner.TopRight:
rect.anchorMin = new Vector2(1f, 1f);
rect.anchorMax = new Vector2(1f, 1f);
rect.pivot = new Vector2(1f, 1f);
rect.anchoredPosition = new Vector2(-28f, -28f);
break;
case MenuCorner.TopLeft:
rect.anchorMin = new Vector2(0f, 1f);
rect.anchorMax = new Vector2(0f, 1f);
rect.pivot = new Vector2(0f, 1f);
rect.anchoredPosition = new Vector2(28f, -28f);
break;
default:
rect.anchorMin = new Vector2(1f, 0f);
rect.anchorMax = new Vector2(1f, 0f);
rect.pivot = new Vector2(1f, 0f);
rect.anchoredPosition = new Vector2(-28f, 28f);
break;
}
}
}
private static void OnActiveSceneChanged(Scene oldScene, Scene newScene)
{
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
BepInExLogs_US.Debug("Scene changed: '" + ((Scene)(ref oldScene)).name + "' -> '" + ((Scene)(ref newScene)).name + "'");
if (!((Object)(object)Plugin.Instance == (Object)null) && !(((Scene)(ref newScene)).name != "b3e7f2f8052488a45b35549efb98d902") && !_injecting)
{
((MonoBehaviour)Plugin.Instance).StartCoroutine(InjectIntoMenuScene(newScene));
}
}
[IteratorStateMachine(typeof(d__25))]
private static IEnumerator InjectIntoMenuScene(Scene scene)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new d__25(0)
{
scene = scene
};
}
private static GameObject? FindRootCanvasObject(Scene scene)
{
GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects();
foreach (GameObject val in rootGameObjects)
{
if (((Object)val).name == "Canvas")
{
return val;
}
}
return null;
}
private static void TogglePanel(Transform mainMenu)
{
Transform val = mainMenu.Find("ULTRASTATS_MenuPanel");
Transform val2 = mainMenu.Find("ULTRASTATS_MenuBlocker");
if ((Object)(object)val == (Object)null)
{
BuildPanel(mainMenu);
val = mainMenu.Find("ULTRASTATS_MenuPanel");
val2 = mainMenu.Find("ULTRASTATS_MenuBlocker");
}
if ((Object)(object)val != (Object)null)
{
bool flag = !((Component)val).gameObject.activeSelf;
((Component)val).gameObject.SetActive(flag);
if ((Object)(object)val2 != (Object)null)
{
((Component)val2).gameObject.SetActive(flag);
}
if (flag)
{
ApplyConfiguredDefaults(((Component)val).gameObject);
}
}
}
private static int GetConfiguredDefaultTabIndex()
{
return Plugin.DefaultMainMenuTab switch
{
Plugin.DefaultMainMenuTabOption.Stats => 1,
Plugin.DefaultMainMenuTabOption.Plots => 2,
_ => 0,
};
}
private static void ApplyConfiguredDefaults(GameObject panel)
{
if (!((Object)(object)panel == (Object)null))
{
panel.GetComponent()?.ShowTab(GetConfiguredDefaultTabIndex());
}
}
private static void BuildPanel(Transform mainMenu)
{
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Expected O, but got Unknown
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: 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)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Expected O, but got Unknown
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: 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)
//IL_0264: Unknown result type (might be due to invalid IL or missing references)
//IL_0293: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: Expected O, but got Unknown
//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_0334: Unknown result type (might be due to invalid IL or missing references)
//IL_033e: Expected O, but got Unknown
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
Transform val = mainMenu.Find("LeftSide");
if ((Object)(object)val == (Object)null)
{
BepInExLogs_US.Warn("Could not find LeftSide while building ULTRASTATS panel.");
return;
}
ResolveButtonTemplates(val, out GameObject inactiveTemplate, out GameObject activeTemplate);
CreateScreenBlocker(mainMenu);
GameObject val2 = new GameObject("ULTRASTATS_MenuPanel", new Type[3]
{
typeof(RectTransform),
typeof(UltraStatsMenuPanelCloser),
typeof(UltraStatsTabbedPanelController)
});
val2.transform.SetParent(mainMenu, false);
RectTransform component = val2.GetComponent();
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.anchoredPosition = new Vector2(0f, 5f);
RectTransform val3 = (RectTransform)(object)((mainMenu is RectTransform) ? mainMenu : null);
float num = 1200f;
float num2 = 770f;
if ((Object)(object)val3 != (Object)null)
{
Rect rect = val3.rect;
num = Mathf.Max(640f, ((Rect)(ref rect)).width - 80f);
rect = val3.rect;
num2 = Mathf.Max(420f, ((Rect)(ref rect)).height - 80f);
}
float num3 = Mathf.Min(1200f, num);
float num4 = Mathf.Min(770f, num2);
component.sizeDelta = new Vector2(num3, num4);
UltraStatsTabbedPanelController tabs = val2.GetComponent();
GameObject val4 = CreatePanelBody(val2.transform, "PanelBody");
RectTransform component2 = val4.GetComponent();
component2.anchorMin = new Vector2(0.5f, 1f);
component2.anchorMax = new Vector2(0.5f, 1f);
component2.pivot = new Vector2(0.5f, 1f);
component2.sizeDelta = new Vector2(num3, num4 - 36f);
component2.anchoredPosition = new Vector2(0f, -36f);
GameObject val5 = new GameObject("ContentRoot", new Type[1] { typeof(RectTransform) });
val5.transform.SetParent(val4.transform, false);
RectTransform component3 = val5.GetComponent();
component3.anchorMin = Vector2.zero;
component3.anchorMax = Vector2.one;
component3.offsetMin = new Vector2(18f, 30f);
component3.offsetMax = new Vector2(-18f, -30f);
GameObject val6 = new GameObject("TabBar", new Type[2]
{
typeof(RectTransform),
typeof(HorizontalLayoutGroup)
});
val6.transform.SetParent(val2.transform, false);
RectTransform component4 = val6.GetComponent();
component4.anchorMin = new Vector2(0f, 1f);
component4.anchorMax = new Vector2(1f, 1f);
component4.pivot = new Vector2(0f, 1f);
component4.offsetMin = new Vector2(0f, -52f);
component4.offsetMax = new Vector2(-52f, -8f);
HorizontalLayoutGroup component5 = val6.GetComponent();
((HorizontalOrVerticalLayoutGroup)component5).spacing = -2f;
((LayoutGroup)component5).padding = new RectOffset(0, 0, 0, 0);
((HorizontalOrVerticalLayoutGroup)component5).childForceExpandWidth = false;
((HorizontalOrVerticalLayoutGroup)component5).childForceExpandHeight = false;
((HorizontalOrVerticalLayoutGroup)component5).childControlWidth = true;
((HorizontalOrVerticalLayoutGroup)component5).childControlHeight = false;
((LayoutGroup)component5).childAlignment = (TextAnchor)0;
CreateCloseButton(val2.transform, val2, mainMenu);
GameObject val7 = CreateTabPage(val5.transform, "InfoPage");
GameObject val8 = CreateTabPage(val5.transform, "StatsPage");
GameObject val9 = CreateTabPage(val5.transform, "PlotsPage");
InfoTab_US.Build(val7.transform, mainMenu);
StatsTab_US.Build(val8.transform, mainMenu);
PlotsTab_US.Build(val9.transform, mainMenu);
float num5 = Mathf.Floor((num3 - 52f - -4f) / 3f);
num5 = Mathf.Clamp(num5, 120f, 186f);
tabs.AddTab(CreateTabButton(val6.transform, inactiveTemplate, activeTemplate, "INFO", num5, delegate
{
tabs.ShowTab(0);
}), val7);
tabs.AddTab(CreateTabButton(val6.transform, inactiveTemplate, activeTemplate, "STATS", num5, delegate
{
tabs.ShowTab(1);
}), val8);
tabs.AddTab(CreateTabButton(val6.transform, inactiveTemplate, activeTemplate, "PLOTS", num5, delegate
{
tabs.ShowTab(2);
}), val9);
ApplyConfiguredDefaults(val2);
val2.SetActive(false);
Transform val10 = mainMenu.Find("ULTRASTATS_MenuBlocker");
if ((Object)(object)val10 != (Object)null)
{
((Component)val10).gameObject.SetActive(false);
}
}
private static GameObject CreatePanelBody(Transform parent, string name)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: 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_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Expected O, but got Unknown
GameObject val = new GameObject(name, new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val.transform.SetParent(parent, false);
Image component = val.GetComponent();
((Graphic)component).color = new Color(0f, 0f, 0f, 0.975f);
((Graphic)component).raycastTarget = true;
CreateBorderStrip(val.transform, "TopBorder", new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(0f, -4f), new Vector2(0f, 0f));
CreateBorderStrip(val.transform, "BottomBorder", new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0f, 0f), new Vector2(0f, 0f), new Vector2(0f, 4f));
CreateBorderStrip(val.transform, "LeftBorder", new Vector2(0f, 0f), new Vector2(0f, 1f), new Vector2(0f, 0f), new Vector2(0f, 0f), new Vector2(4f, 0f));
CreateBorderStrip(val.transform, "RightBorder", new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(1f, 0f), new Vector2(-4f, 0f), new Vector2(0f, 0f));
return val;
}
private static void CreateScreenBlocker(Transform mainMenu)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)mainMenu.Find("ULTRASTATS_MenuBlocker") != (Object)null))
{
GameObject val = new GameObject("ULTRASTATS_MenuBlocker", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val.transform.SetParent(mainMenu, false);
RectTransform component = val.GetComponent();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
Image component2 = val.GetComponent();
((Graphic)component2).color = new Color(0f, 0f, 0f, 0.001f);
((Graphic)component2).raycastTarget = true;
val.SetActive(false);
}
}
internal static GameObject CreateBeveledFrame(Transform parent, string name, Vector2 size, Color fillColor, int borderThickness, int bevelSize, bool interceptClicks)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: 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_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name, new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val.transform.SetParent(parent, false);
val.GetComponent().sizeDelta = size;
int num = Mathf.Max(1, Mathf.RoundToInt(size.x));
int num2 = Mathf.Max(1, Mathf.RoundToInt(size.y));
int width = Mathf.Max(1, num - borderThickness * 2);
int height = Mathf.Max(1, num2 - borderThickness * 2);
int bevelSize2 = Mathf.Max(0, bevelSize - borderThickness);
Image component = val.GetComponent();
component.sprite = GetBevelSprite(num, num2, bevelSize);
component.type = (Type)0;
((Graphic)component).color = Color.white;
((Graphic)component).raycastTarget = interceptClicks;
GameObject val2 = new GameObject("Fill", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val2.transform.SetParent(val.transform, false);
RectTransform component2 = val2.GetComponent();
component2.anchorMin = Vector2.zero;
component2.anchorMax = Vector2.one;
component2.offsetMin = new Vector2((float)borderThickness, (float)borderThickness);
component2.offsetMax = new Vector2((float)(-borderThickness), (float)(-borderThickness));
Image component3 = val2.GetComponent();
component3.sprite = GetBevelSprite(width, height, bevelSize2);
component3.type = (Type)0;
((Graphic)component3).color = fillColor;
((Graphic)component3).raycastTarget = false;
return val;
}
internal static Button CreateStyledBeveledButton(Transform parent, Transform styleRoot, string name, Vector2 size, string? label, Sprite? iconSprite, out UltraStatsBeveledButtonTint tint, Color? fillColor = null, float fontSize = 18f, int borderThickness = 2, int bevelSize = 8, bool iconOnly = false)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: 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_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: 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_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: 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_0220: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: 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_027a: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: 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_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: 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_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
GameObject val = CreateBeveledFrame(parent, name, size, (Color)(((??)fillColor) ?? DefaultBeveledButtonColor), borderThickness, bevelSize, interceptClicks: true);
Transform obj = val.transform.Find("Fill");
Image val2 = ((obj != null) ? ((Component)obj).GetComponent() : null);
Button val3 = val.AddComponent();
((Selectable)val3).transition = (Transition)0;
Navigation navigation = ((Selectable)val3).navigation;
((Navigation)(ref navigation)).mode = (Mode)0;
((Selectable)val3).navigation = navigation;
tint = val.AddComponent();
tint.FillImage = val2 ?? val.GetComponent();
tint.NormalColor = (Color)(((??)fillColor) ?? DefaultBeveledButtonColor);
tint.HoverColor = DefaultBeveledButtonHoverColor;
tint.PressedColor = DefaultBeveledButtonPressedColor;
tint.ActiveColor = DefaultBeveledButtonActiveColor;
tint.SetActiveVisual(active: false);
if ((Object)(object)iconSprite != (Object)null)
{
GameObject val4 = new GameObject("Icon", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val4.transform.SetParent(val.transform, false);
RectTransform component = val4.GetComponent();
component.anchorMin = (iconOnly ? new Vector2(0.18f, 0.18f) : new Vector2(0.1f, 0.16f));
component.anchorMax = (iconOnly ? new Vector2(0.82f, 0.82f) : new Vector2(0.34f, 0.84f));
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
Image component2 = val4.GetComponent();
component2.sprite = iconSprite;
component2.type = (Type)0;
((Graphic)component2).material = null;
component2.preserveAspect = true;
((Graphic)component2).color = Color.white;
((Graphic)component2).raycastTarget = false;
}
if (!string.IsNullOrWhiteSpace(label))
{
GameObject val5 = new GameObject("Label", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val5.transform.SetParent(val.transform, false);
RectTransform component3 = val5.GetComponent();
component3.anchorMin = Vector2.zero;
component3.anchorMax = Vector2.one;
component3.offsetMin = (((Object)(object)iconSprite != (Object)null && !iconOnly) ? new Vector2(size.y * 0.85f, 0f) : new Vector2(8f, 0f));
component3.offsetMax = new Vector2(-8f, 0f);
TextMeshProUGUI component4 = val5.GetComponent();
ApplyPanelTextStyle(styleRoot, component4);
((TMP_Text)component4).text = label;
((TMP_Text)component4).alignment = (TextAlignmentOptions)(((Object)(object)iconSprite != (Object)null && !iconOnly) ? 4097 : 514);
((Graphic)component4).color = Color.white;
((TMP_Text)component4).fontSize = fontSize;
((TMP_Text)component4).fontStyle = (FontStyles)1;
((TMP_Text)component4).enableWordWrapping = false;
((TMP_Text)component4).overflowMode = (TextOverflowModes)1;
((Graphic)component4).raycastTarget = false;
}
return val3;
}
internal static Button CreateVanillaStyledButton(Transform parent, Transform styleRoot, string name, Vector2 size, string? label, Sprite? iconSprite, out UltraStatsVanillaButtonState state, bool iconOnly = false)
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
if (!TryResolveButtonTemplates(styleRoot, out GameObject inactiveTemplate, out GameObject activeTemplate))
{
bool iconOnly2 = iconOnly;
UltraStatsBeveledButtonTint tint;
Button val = CreateStyledBeveledButton(parent, styleRoot, name, size, label, iconSprite, out tint, null, 18f, 2, 8, iconOnly2);
state = ((Component)val).gameObject.AddComponent();
state.InactiveVisual = ((Component)val).gameObject;
state.ActiveVisual = ((Component)val).gameObject;
return val;
}
return CreateVanillaStyledButtonFromTemplates(parent, name, size, label, iconSprite, out state, inactiveTemplate, activeTemplate, iconOnly);
}
private static Button CreateVanillaStyledButtonFromTemplates(Transform parent, string name, Vector2 size, string? label, Sprite? iconSprite, out UltraStatsVanillaButtonState state, GameObject inactiveTemplate, GameObject activeTemplate, bool iconOnly = false)
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: 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)
//IL_00ca: 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_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name, new Type[6]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image),
typeof(Button),
typeof(LayoutElement),
typeof(UltraStatsVanillaButtonState)
});
val.transform.SetParent(parent, false);
val.GetComponent().sizeDelta = size;
Image component = val.GetComponent();
((Graphic)component).color = new Color(0f, 0f, 0f, 0f);
((Graphic)component).raycastTarget = true;
LayoutElement component2 = val.GetComponent();
component2.preferredWidth = size.x;
component2.minWidth = size.x;
component2.preferredHeight = size.y;
component2.minHeight = size.y;
component2.flexibleWidth = 0f;
component2.flexibleHeight = 0f;
string text = (string.IsNullOrWhiteSpace(label) ? string.Empty : label);
GameObject val2 = CloneVanillaButtonVisual(inactiveTemplate, val.transform, "InactiveVisual", text);
GameObject val3 = CloneVanillaButtonVisual(activeTemplate, val.transform, "ActiveVisual", text);
StretchToFill(val2.GetComponent());
StretchToFill(val3.GetComponent());
if (string.IsNullOrWhiteSpace(text))
{
HideButtonLabelVisuals(val2);
HideButtonLabelVisuals(val3);
}
else
{
ConfigureButtonLabelVisuals(val2);
ConfigureButtonLabelVisuals(val3);
}
if ((Object)(object)iconSprite != (Object)null)
{
CreateButtonIcon(val.transform, iconSprite, iconOnly);
}
Button component3 = val.GetComponent();
((Selectable)component3).transition = (Transition)0;
Navigation navigation = ((Selectable)component3).navigation;
((Navigation)(ref navigation)).mode = (Mode)0;
((Selectable)component3).navigation = navigation;
state = val.GetComponent();
state.InactiveVisual = val2;
state.ActiveVisual = val3;
state.SetActiveVisual(active: false);
return component3;
}
internal static Button CreateVanillaStyledCloseButton(Transform parent, Transform styleRoot, string name = "CloseButton")
{
//IL_003d: 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)
GameObject inactiveTemplate;
GameObject activeTemplate;
UltraStatsVanillaButtonState state;
Button val = ((!TryResolveButtonTemplates(styleRoot, out inactiveTemplate, out activeTemplate)) ? CreateVanillaStyledButton(parent, styleRoot, name, new Vector2(42f, 42f), "X", null, out state) : CreateVanillaStyledButtonFromTemplates(parent, name, new Vector2(42f, 42f), "X", null, out state, inactiveTemplate, activeTemplate));
LayoutElement component = ((Component)val).GetComponent();
if ((Object)(object)component != (Object)null)
{
component.preferredWidth = 42f;
component.minWidth = 42f;
component.preferredHeight = 42f;
component.minHeight = 42f;
component.flexibleWidth = 0f;
component.flexibleHeight = 0f;
}
ApplyCloseButtonLabelStyle(((Component)val).gameObject);
return val;
}
internal static Button CreateWindowCloseButton(Transform parent, Transform styleRoot, string name = "CloseButton")
{
//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_0018: Unknown result type (might be due to invalid IL or missing references)
Button obj = CreateVanillaStyledCloseButton(parent, styleRoot, name);
Navigation navigation = ((Selectable)obj).navigation;
((Navigation)(ref navigation)).mode = (Mode)0;
((Selectable)obj).navigation = navigation;
return obj;
}
internal static GameObject CreateStandardWindowSurface(Transform parent, string name, Vector2 size, Color fillColor, float borderThickness = 3f, bool raycastTarget = true)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: 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_0073: Expected O, but got Unknown
GameObject val = new GameObject(name, new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val.transform.SetParent(parent, false);
val.GetComponent().sizeDelta = size;
Image component = val.GetComponent();
((Graphic)component).color = fillColor;
((Graphic)component).raycastTarget = raycastTarget;
CreateSimpleOutline(val.transform, borderThickness, Color.white);
return val;
}
internal static void CreateSimpleOutline(Transform parent, float thickness, Color color)
{
//IL_0010: 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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
CreateSimpleBorder(parent, "Top", new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, 0f - thickness), Vector2.zero, color);
CreateSimpleBorder(parent, "Bottom", new Vector2(0f, 0f), new Vector2(1f, 0f), Vector2.zero, new Vector2(0f, thickness), color);
CreateSimpleBorder(parent, "Left", new Vector2(0f, 0f), new Vector2(0f, 1f), Vector2.zero, new Vector2(thickness, 0f), color);
CreateSimpleBorder(parent, "Right", new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(0f - thickness, 0f), Vector2.zero, color);
}
private static void ApplyCloseButtonLabelStyle(GameObject root)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: 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_00f5: 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_010a: Unknown result type (might be due to invalid IL or missing references)
TMP_Text[] componentsInChildren = root.GetComponentsInChildren(true);
foreach (TMP_Text obj in componentsInChildren)
{
((Graphic)obj).color = DestructiveTextColor;
obj.fontStyle = (FontStyles)1;
obj.enableAutoSizing = false;
obj.fontSize = 22f;
obj.alignment = (TextAlignmentOptions)514;
obj.enableWordWrapping = false;
obj.overflowMode = (TextOverflowModes)0;
obj.margin = Vector4.zero;
obj.rectTransform.anchorMin = Vector2.zero;
obj.rectTransform.anchorMax = Vector2.one;
obj.rectTransform.offsetMin = Vector2.zero;
obj.rectTransform.offsetMax = Vector2.zero;
}
Text[] componentsInChildren2 = root.GetComponentsInChildren(true);
foreach (Text obj2 in componentsInChildren2)
{
((Graphic)obj2).color = DestructiveTextColor;
obj2.fontStyle = (FontStyle)1;
obj2.resizeTextForBestFit = false;
obj2.fontSize = 22;
obj2.alignment = (TextAnchor)4;
obj2.horizontalOverflow = (HorizontalWrapMode)1;
RectTransform rectTransform = ((Graphic)obj2).rectTransform;
rectTransform.anchorMin = Vector2.zero;
rectTransform.anchorMax = Vector2.one;
rectTransform.offsetMin = Vector2.zero;
rectTransform.offsetMax = Vector2.zero;
}
}
private static void CreateSimpleBorder(Transform parent, string name, Vector2 anchorMin, Vector2 anchorMax, Vector2 offsetMin, Vector2 offsetMax, Color color)
{
//IL_0038: 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_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: 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)
GameObject val = new GameObject(name + "Border", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = anchorMin;
component.anchorMax = anchorMax;
component.offsetMin = offsetMin;
component.offsetMax = offsetMax;
Image component2 = val.GetComponent();
((Graphic)component2).color = color;
((Graphic)component2).raycastTarget = false;
}
private static Sprite GetBevelSprite(int width, int height, int bevelSize)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Expected O, but got Unknown
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: 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)
string key = $"{width}x{height}x{bevelSize}";
if (BevelSpriteCache.TryGetValue(key, out Sprite value))
{
return value;
}
int bevel = Mathf.Clamp(bevelSize, 0, Mathf.Min(width, height) / 2);
Texture2D val = new Texture2D(width, height, (TextureFormat)4, false);
((Texture)val).filterMode = (FilterMode)0;
((Texture)val).wrapMode = (TextureWrapMode)1;
Color32[] array = (Color32[])(object)new Color32[width * height];
Vector2[] polygon = BuildBevelPolygon(width, height, bevel);
float num = 0.0625f;
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
int num2 = 0;
for (int k = 0; k < 4; k++)
{
for (int l = 0; l < 4; l++)
{
if (PointInPolygon(new Vector2((float)j + ((float)l + 0.5f) / 4f, (float)i + ((float)k + 0.5f) / 4f), polygon))
{
num2++;
}
}
}
byte b = (byte)Mathf.RoundToInt(255f * (float)num2 * num);
array[i * width + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, b);
}
}
val.SetPixels32(array);
val.Apply(false, false);
Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)width, (float)height), new Vector2(0.5f, 0.5f), 100f);
BevelSpriteCache[key] = val2;
return val2;
}
private static Vector2[] BuildBevelPolygon(int width, int height, int bevel)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: 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_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_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_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_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
float num = width;
float num2 = height;
return (Vector2[])(object)new Vector2[8]
{
new Vector2(0f, (float)bevel),
new Vector2((float)bevel, 0f),
new Vector2(num - (float)bevel, 0f),
new Vector2(num, (float)bevel),
new Vector2(num, num2 - (float)bevel),
new Vector2(num - (float)bevel, num2),
new Vector2((float)bevel, num2),
new Vector2(0f, num2 - (float)bevel)
};
}
private static bool PointInPolygon(Vector2 point, IReadOnlyList polygon)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: 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_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: 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_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
bool flag = false;
int index = polygon.Count - 1;
for (int i = 0; i < polygon.Count; i++)
{
Vector2 val = polygon[i];
Vector2 val2 = polygon[index];
if (val.y > point.y != val2.y > point.y && point.x < (val2.x - val.x) * (point.y - val.y) / (val2.y - val.y + float.Epsilon) + val.x)
{
flag = !flag;
}
index = i;
}
return flag;
}
private static void CreateBorderStrip(Transform parent, string name, Vector2 anchorMin, Vector2 anchorMax, Vector2 pivot, Vector2 offsetMin, Vector2 offsetMax)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: 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_0064: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name, new Type[2]
{
typeof(RectTransform),
typeof(Image)
});
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = anchorMin;
component.anchorMax = anchorMax;
component.pivot = pivot;
component.offsetMin = offsetMin;
component.offsetMax = offsetMax;
Image component2 = val.GetComponent();
((Graphic)component2).color = Color.white;
((Graphic)component2).raycastTarget = false;
}
private static void CreateCloseButton(Transform parent, GameObject panel, Transform styleRoot)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: 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_0068: 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_0089: Expected O, but got Unknown
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
GameObject panel2 = panel;
Button obj = CreateWindowCloseButton(parent, styleRoot);
RectTransform component = ((Component)obj).GetComponent();
component.anchorMin = new Vector2(1f, 1f);
component.anchorMax = new Vector2(1f, 1f);
component.pivot = new Vector2(1f, 1f);
component.anchoredPosition = new Vector2(-0f, -10f);
((UnityEvent)obj.onClick).AddListener((UnityAction)delegate
{
panel2.SetActive(false);
Transform val = (((Object)(object)panel2.transform.parent != (Object)null) ? panel2.transform.parent.Find("ULTRASTATS_MenuBlocker") : null);
if ((Object)(object)val != (Object)null)
{
((Component)val).gameObject.SetActive(false);
}
});
Navigation navigation = ((Selectable)obj).navigation;
((Navigation)(ref navigation)).mode = (Mode)0;
((Selectable)obj).navigation = navigation;
}
private static bool TryResolveButtonTemplates(Transform styleRoot, out GameObject inactiveTemplate, out GameObject activeTemplate)
{
inactiveTemplate = null;
activeTemplate = null;
Transform val = (Transform)(((Object)(object)styleRoot == (Object)null) ? null : (string.Equals(((Object)styleRoot).name, "LeftSide", StringComparison.Ordinal) ? ((object)styleRoot) : ((object)styleRoot.Find("LeftSide"))));
if ((Object)(object)val == (Object)null)
{
return false;
}
ResolveButtonTemplates(val, out inactiveTemplate, out activeTemplate);
if ((Object)(object)inactiveTemplate != (Object)null)
{
return (Object)(object)activeTemplate != (Object)null;
}
return false;
}
private static void StretchToFill(RectTransform? rect)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: 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)
if (!((Object)(object)rect == (Object)null))
{
rect.anchorMin = Vector2.zero;
rect.anchorMax = Vector2.one;
rect.offsetMin = Vector2.zero;
rect.offsetMax = Vector2.zero;
}
}
private static void HideButtonLabelVisuals(GameObject root)
{
TMP_Text[] componentsInChildren = root.GetComponentsInChildren(true);
foreach (TMP_Text obj in componentsInChildren)
{
obj.text = string.Empty;
((Behaviour)obj).enabled = false;
}
Text[] componentsInChildren2 = root.GetComponentsInChildren(true);
foreach (Text obj2 in componentsInChildren2)
{
obj2.text = string.Empty;
((Behaviour)obj2).enabled = false;
}
}
private static void ConfigureButtonLabelVisuals(GameObject root)
{
TMP_Text[] componentsInChildren = root.GetComponentsInChildren(true);
foreach (TMP_Text obj in componentsInChildren)
{
obj.enableAutoSizing = true;
obj.fontSizeMin = 10f;
obj.fontSizeMax = Mathf.Max(obj.fontSize, 16f);
obj.enableWordWrapping = false;
obj.overflowMode = (TextOverflowModes)1;
}
Text[] componentsInChildren2 = root.GetComponentsInChildren(true);
foreach (Text obj2 in componentsInChildren2)
{
obj2.resizeTextForBestFit = true;
obj2.resizeTextMinSize = 10;
obj2.resizeTextMaxSize = Mathf.Max(obj2.fontSize, 16);
obj2.horizontalOverflow = (HorizontalWrapMode)1;
}
}
private static void CreateButtonIcon(Transform parent, Sprite sprite, bool iconOnly)
{
//IL_0032: 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_0044: 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_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: 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)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("Icon", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = (iconOnly ? new Vector2(0.12f, 0.1f) : new Vector2(0.12f, 0.2f));
component.anchorMax = (iconOnly ? new Vector2(0.88f, 0.9f) : new Vector2(0.32f, 0.8f));
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
Image component2 = val.GetComponent();
component2.sprite = sprite;
component2.type = (Type)0;
((Graphic)component2).color = Color.white;
component2.preserveAspect = true;
((Graphic)component2).raycastTarget = false;
}
private static GameObject CreateTabPage(Transform parent, string name)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: 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_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Expected O, but got Unknown
GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) });
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
return val;
}
private static void CreateBodyText(Transform parent, Transform styleRoot, string text)
{
//IL_0025: 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_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_005e: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("BodyText", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
TextMeshProUGUI component2 = val.GetComponent();
ApplyPanelTextStyle(styleRoot, component2);
((TMP_Text)component2).fontSize = 18f;
((TMP_Text)component2).alignment = (TextAlignmentOptions)257;
((TMP_Text)component2).enableWordWrapping = true;
((TMP_Text)component2).overflowMode = (TextOverflowModes)0;
((TMP_Text)component2).lineSpacing = 8f;
((TMP_Text)component2).text = text;
((Graphic)component2).raycastTarget = false;
}
private static Button CreateTabButton(Transform parent, GameObject inactiveTemplate, GameObject activeTemplate, string text, float width, Action onClick)
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: 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_0123: 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_0138: 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_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Expected O, but got Unknown
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
Action onClick2 = onClick;
GameObject val = new GameObject(text + "_TabButton", new Type[5]
{
typeof(RectTransform),
typeof(Image),
typeof(Button),
typeof(LayoutElement),
typeof(UltraStatsVanillaTabState)
});
val.transform.SetParent(parent, false);
val.GetComponent().sizeDelta = new Vector2(width, 44f);
Image component = val.GetComponent();
((Graphic)component).color = new Color(0f, 0f, 0f, 0f);
((Graphic)component).raycastTarget = true;
LayoutElement component2 = val.GetComponent();
component2.preferredWidth = width;
component2.minWidth = width;
component2.preferredHeight = 44f;
component2.minHeight = 44f;
component2.flexibleWidth = 0f;
GameObject val2 = CloneVanillaButtonVisual(inactiveTemplate, val.transform, "InactiveVisual", text);
GameObject val3 = CloneVanillaButtonVisual(activeTemplate, val.transform, "ActiveVisual", text);
RectTransform component3 = val2.GetComponent();
component3.anchorMin = Vector2.zero;
component3.anchorMax = Vector2.one;
component3.offsetMin = Vector2.zero;
component3.offsetMax = Vector2.zero;
RectTransform component4 = val3.GetComponent();
component4.anchorMin = Vector2.zero;
component4.anchorMax = Vector2.one;
component4.offsetMin = Vector2.zero;
component4.offsetMax = Vector2.zero;
UltraStatsVanillaTabState component5 = val.GetComponent();
component5.InactiveVisual = val2;
component5.ActiveVisual = val3;
Button component6 = val.GetComponent();
((Selectable)component6).transition = (Transition)0;
((UnityEvent)component6.onClick).AddListener((UnityAction)delegate
{
onClick2();
});
Navigation navigation = ((Selectable)component6).navigation;
((Navigation)(ref navigation)).mode = (Mode)0;
((Selectable)component6).navigation = navigation;
return component6;
}
private static GameObject CloneVanillaButtonVisual(GameObject template, Transform parent, string name, string text)
{
GameObject val = Object.Instantiate(template, parent, false);
((Object)val).name = name;
Graphic[] componentsInChildren = val.GetComponentsInChildren(true);
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].raycastTarget = false;
}
Button[] componentsInChildren2 = val.GetComponentsInChildren(true);
for (int i = 0; i < componentsInChildren2.Length; i++)
{
((Behaviour)componentsInChildren2[i]).enabled = false;
}
MonoBehaviour[] componentsInChildren3 = val.GetComponentsInChildren(true);
foreach (MonoBehaviour val2 in componentsInChildren3)
{
if (((object)val2).GetType().Name == "HudOpenEffect")
{
((Behaviour)val2).enabled = false;
}
}
SetButtonLabelText(val, text);
return val;
}
private static void ResolveButtonTemplates(Transform leftSide, out GameObject inactiveTemplate, out GameObject activeTemplate)
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Expected O, but got Unknown
inactiveTemplate = FindNamedDirectChild(leftSide, "Options") ?? FindFirstButtonTemplate(leftSide) ?? throw new InvalidOperationException("Could not find a vanilla menu button template.");
activeTemplate = FindNamedDirectChild(leftSide, "Continue") ?? inactiveTemplate;
if (LooksDifferent(activeTemplate, inactiveTemplate))
{
return;
}
foreach (Transform item in leftSide)
{
Transform val = item;
if (!((Object)(object)((Component)val).gameObject == (Object)(object)inactiveTemplate) && !((Object)(object)((Component)val).GetComponent() == (Object)null) && !((Object)(object)((Component)val).GetComponent() == (Object)null) && LooksDifferent(((Component)val).gameObject, inactiveTemplate))
{
activeTemplate = ((Component)val).gameObject;
break;
}
}
}
private static bool LooksDifferent(GameObject a, GameObject b)
{
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
Image component = a.GetComponent();
Image component2 = b.GetComponent();
if ((Object)(object)component != (Object)null && (Object)(object)component2 != (Object)null)
{
if ((Object)(object)component.sprite != (Object)(object)component2.sprite)
{
return true;
}
if (((Graphic)component).color != ((Graphic)component2).color)
{
return true;
}
if (Math.Abs(component.pixelsPerUnitMultiplier - component2.pixelsPerUnitMultiplier) > 0.001f)
{
return true;
}
}
Graphic val = FindLabelGraphic(a);
Graphic val2 = FindLabelGraphic(b);
if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null && val.color != val2.color)
{
return true;
}
return false;
}
private static GameObject? FindNamedDirectChild(Transform parent, string name)
{
Transform val = parent.Find(name);
if (!((Object)(object)val != (Object)null))
{
return null;
}
return ((Component)val).gameObject;
}
private static GameObject? FindFirstButtonTemplate(Transform parent)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Expected O, but got Unknown
foreach (Transform item in parent)
{
Transform val = item;
if ((Object)(object)((Component)val).GetComponent() != (Object)null && (Object)(object)((Component)val).GetComponent() != (Object)null)
{
return ((Component)val).gameObject;
}
}
return null;
}
private static Graphic? FindLabelGraphic(GameObject root)
{
TMP_Text val = root.GetComponentsInChildren(true).FirstOrDefault();
if ((Object)(object)val != (Object)null)
{
return (Graphic?)(object)val;
}
return (Graphic?)(object)root.GetComponentsInChildren(true).FirstOrDefault();
}
private static void SetButtonLabelText(GameObject root, string value)
{
TMP_Text val = root.GetComponentsInChildren(true).FirstOrDefault();
if ((Object)(object)val != (Object)null)
{
val.text = value;
return;
}
Text val2 = root.GetComponentsInChildren(true).FirstOrDefault();
if ((Object)(object)val2 != (Object)null)
{
val2.text = value;
}
}
internal static void ApplyPanelTextStyle(Transform root, TextMeshProUGUI target)
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
TextMeshProUGUI val = ((IEnumerable)((Component)root).GetComponentsInChildren(true)).FirstOrDefault((Func)delegate(TextMeshProUGUI t)
{
string text = (((TMP_Text)t).text ?? string.Empty).Trim().ToUpperInvariant();
switch (text)
{
default:
return text == "QUIT";
case "PLAY":
case "CONTINUE":
case "OPTIONS":
case "CREDITS":
return true;
}
});
if ((Object)(object)val != (Object)null)
{
((TMP_Text)target).font = ((TMP_Text)val).font;
((TMP_Text)target).fontSharedMaterial = ((TMP_Text)val).fontSharedMaterial;
((Graphic)target).color = ((Graphic)val).color;
((TMP_Text)target).characterSpacing = ((TMP_Text)val).characterSpacing;
}
((TMP_Text)target).enableWordWrapping = true;
}
private static void ApplyImageStyleFromTemplate(GameObject template, Image target)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
Image component = template.GetComponent();
if (!((Object)(object)component == (Object)null))
{
target.sprite = component.sprite;
target.overrideSprite = component.overrideSprite;
target.type = component.type;
((Graphic)target).material = ((Graphic)component).material;
((Graphic)target).color = ((Graphic)component).color;
target.fillCenter = component.fillCenter;
target.fillMethod = component.fillMethod;
target.fillOrigin = component.fillOrigin;
target.fillClockwise = component.fillClockwise;
target.fillAmount = component.fillAmount;
target.preserveAspect = component.preserveAspect;
target.pixelsPerUnitMultiplier = component.pixelsPerUnitMultiplier;
target.useSpriteMesh = component.useSpriteMesh;
((MaskableGraphic)target).maskable = ((MaskableGraphic)component).maskable;
}
}
private static void Inject(Transform leftSide, Transform mainMenu)
{
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Expected O, but got Unknown
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Expected O, but got Unknown
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
Transform mainMenu2 = mainMenu;
if ((Object)(object)mainMenu2.Find("ULTRASTATS_MenuButton") != (Object)null)
{
BepInExLogs_US.Debug("ULTRASTATS button already exists.");
return;
}
ResolveButtonTemplates(leftSide, out GameObject inactiveTemplate, out GameObject _);
GameObject val = new GameObject("ULTRASTATS_MenuButton", new Type[4]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image),
typeof(Button)
});
val.transform.SetParent(mainMenu2, false);
RectTransform component = val.GetComponent();
component.sizeDelta = new Vector2(96f, 96f);
ApplyButtonPosition(component);
Image component2 = val.GetComponent();
ApplyImageStyleFromTemplate(inactiveTemplate, component2);
((Graphic)component2).raycastTarget = true;
Button component3 = val.GetComponent();
((Selectable)component3).transition = (Transition)0;
((UnityEvent)component3.onClick).AddListener((UnityAction)delegate
{
TogglePanel(mainMenu2);
});
Navigation navigation = ((Selectable)component3).navigation;
((Navigation)(ref navigation)).mode = (Mode)0;
((Selectable)component3).navigation = navigation;
GameObject val2 = new GameObject("Icon", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val2.transform.SetParent(val.transform, false);
RectTransform component4 = val2.GetComponent();
component4.anchorMin = new Vector2(0.14f, 0.14f);
component4.anchorMax = new Vector2(0.86f, 0.86f);
component4.pivot = new Vector2(0.5f, 0.5f);
component4.offsetMin = Vector2.zero;
component4.offsetMax = Vector2.zero;
Image component5 = val2.GetComponent();
component5.sprite = LoadButtonSprite();
component5.type = (Type)0;
((Graphic)component5).material = null;
component5.preserveAspect = true;
((Graphic)component5).color = Color.white;
((Graphic)component5).raycastTarget = false;
if ((Object)(object)mainMenu2.Find("ULTRASTATS_MenuPanel") == (Object)null)
{
BuildPanel(mainMenu2);
}
UltraStatsStartupNoticeController.TryShowIfNeeded(mainMenu2);
BepInExLogs_US.Debug("ULTRASTATS menu button injected.");
}
private static Sprite? LoadButtonSprite()
{
return LoadSpriteFromPluginFile("images/sigma.png");
}
internal static Sprite? LoadSpriteFromPluginFile(string fileName)
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Expected O, but got Unknown
//IL_008a: 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)
try
{
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), fileName);
if (!File.Exists(text))
{
BepInExLogs_US.Warn(fileName + " not found at: " + text);
return null;
}
byte[] array = File.ReadAllBytes(text);
Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
((Texture)val).filterMode = (FilterMode)0;
if (!ImageConversion.LoadImage(val, array, false))
{
BepInExLogs_US.Warn("Failed to load " + fileName + " into Texture2D.");
return null;
}
return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f);
}
catch (Exception arg)
{
BepInExLogs_US.Warn($"Failed to create sprite from {fileName}: {arg}");
return null;
}
}
}
internal sealed class UltraStatsMenuPanelCloser : MonoBehaviour
{
private void Update()
{
if (!((Component)this).gameObject.activeInHierarchy || !Input.GetKeyDown((KeyCode)27))
{
return;
}
StatsTabController_US componentInChildren = ((Component)this).GetComponentInChildren(true);
if (!((Object)(object)componentInChildren != (Object)null) || !componentInChildren.HandleEscapeKey())
{
((Component)this).gameObject.SetActive(false);
Transform val = (((Object)(object)((Component)this).transform.parent != (Object)null) ? ((Component)this).transform.parent.Find("ULTRASTATS_MenuBlocker") : null);
if ((Object)(object)val != (Object)null)
{
((Component)val).gameObject.SetActive(false);
}
}
}
}
internal sealed class UltraStatsVanillaButtonState : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
{
public GameObject InactiveVisual;
public GameObject ActiveVisual;
private bool _hovered;
private bool _pressed;
private bool _active;
public void SetActiveVisual(bool active)
{
_active = active;
Refresh();
}
public void OnPointerEnter(PointerEventData eventData)
{
_hovered = true;
Refresh();
}
public void OnPointerExit(PointerEventData eventData)
{
_hovered = false;
_pressed = false;
Refresh();
}
public void OnPointerDown(PointerEventData eventData)
{
_pressed = true;
Refresh();
}
public void OnPointerUp(PointerEventData eventData)
{
_pressed = false;
Refresh();
}
private void Refresh()
{
bool flag = _active || _hovered || _pressed;
if ((Object)(object)InactiveVisual != (Object)null)
{
InactiveVisual.SetActive(!flag);
}
if ((Object)(object)ActiveVisual != (Object)null)
{
ActiveVisual.SetActive(flag);
}
}
}
internal sealed class UltraStatsVanillaTabState : MonoBehaviour
{
public GameObject InactiveVisual;
public GameObject ActiveVisual;
public void SetActiveState(bool active)
{
if ((Object)(object)InactiveVisual != (Object)null)
{
InactiveVisual.SetActive(!active);
}
if ((Object)(object)ActiveVisual != (Object)null)
{
ActiveVisual.SetActive(active);
}
}
}
internal sealed class UltraStatsTabbedPanelController : MonoBehaviour
{
private readonly List _tabButtons = new List();
private readonly List _tabPages = new List();
public void AddTab(Button button, GameObject page)
{
_tabButtons.Add(button);
_tabPages.Add(page);
}
public void ShowTab(int index)
{
for (int i = 0; i < _tabPages.Count; i++)
{
bool flag = i == index;
_tabPages[i].SetActive(flag);
UltraStatsVanillaTabState component = ((Component)_tabButtons[i]).GetComponent();
if ((Object)(object)component != (Object)null)
{
component.SetActiveState(flag);
}
}
}
}
internal static class PlotsTab_US
{
private const string PlotText = "PLOTS TAB\n\nTHIS FEATURE IS CURRENTLY IN DEVELOPMENT.\n\nThe long-term plan is for this tab to hold ULTRASTATS visualizations such as:\n- run history plots\n- performance trends\n- weapon usage breakdowns\n- comparison charts\n other useful graphs\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
private const float WheelPixelsPerTick = 96f;
private const float ScrollbarWidth = 18f;
private const float ViewportScrollbarInset = 20f;
public static void Build(Transform parent, Transform styleRoot)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: 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_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("PlotsTabRoot", new Type[1] { typeof(RectTransform) });
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
BuildScrollView(val.transform, styleRoot);
}
private static void BuildScrollView(Transform parent, Transform styleRoot)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
//IL_0032: 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_0048: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Expected O, but got Unknown
//IL_00c7: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: 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_0151: Expected O, but got Unknown
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: 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_01bf: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: 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_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_0271: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
//IL_031c: Unknown result type (might be due to invalid IL or missing references)
//IL_0321: 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_0347: Unknown result type (might be due to invalid IL or missing references)
//IL_035d: Unknown result type (might be due to invalid IL or missing references)
//IL_0373: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: 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_03d7: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("PlotsScrollRoot", new Type[1] { typeof(RectTransform) });
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.offsetMin = Vector2.zero;
component.offsetMax = Vector2.zero;
GameObject val2 = new GameObject("Viewport", new Type[5]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image),
typeof(RectMask2D),
typeof(UltraStatsFixedWheelScroll)
});
val2.transform.SetParent(val.transform, false);
RectTransform component2 = val2.GetComponent();
component2.anchorMin = Vector2.zero;
component2.anchorMax = Vector2.one;
component2.offsetMin = Vector2.zero;
component2.offsetMax = new Vector2(-20f, 0f);
Image component3 = val2.GetComponent();
((Graphic)component3).color = new Color(1f, 1f, 1f, 0.001f);
((Graphic)component3).raycastTarget = true;
GameObject val3 = new GameObject("Content", new Type[2]
{
typeof(RectTransform),
typeof(UltraStatsPlotsContentSizer)
});
val3.transform.SetParent(val2.transform, false);
RectTransform component4 = val3.GetComponent();
component4.anchorMin = new Vector2(0f, 1f);
component4.anchorMax = new Vector2(1f, 1f);
component4.pivot = new Vector2(0.5f, 1f);
component4.anchoredPosition = Vector2.zero;
component4.sizeDelta = new Vector2(0f, 0f);
GameObject val4 = new GameObject("PlotsBodyText", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val4.transform.SetParent(val3.transform, false);
RectTransform component5 = val4.GetComponent();
component5.anchorMin = new Vector2(0f, 1f);
component5.anchorMax = new Vector2(1f, 1f);
component5.pivot = new Vector2(0.5f, 1f);
component5.offsetMin = new Vector2(18f, 0f);
component5.offsetMax = new Vector2(-18f, 0f);
component5.anchoredPosition = Vector2.zero;
TextMeshProUGUI component6 = val4.GetComponent();
MainMenuButton_US.ApplyPanelTextStyle(styleRoot, component6);
((TMP_Text)component6).fontSize = 22f;
((Graphic)component6).color = Color.white;
((TMP_Text)component6).alignment = (TextAlignmentOptions)257;
((TMP_Text)component6).enableWordWrapping = true;
((TMP_Text)component6).overflowMode = (TextOverflowModes)0;
((TMP_Text)component6).lineSpacing = 8f;
((TMP_Text)component6).text = "PLOTS TAB\n\nTHIS FEATURE IS CURRENTLY IN DEVELOPMENT.\n\nThe long-term plan is for this tab to hold ULTRASTATS visualizations such as:\n- run history plots\n- performance trends\n- weapon usage breakdowns\n- comparison charts\n other useful graphs\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
((Graphic)component6).raycastTarget = false;
GameObject val5 = new GameObject("DoomahImage", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val5.transform.SetParent(val3.transform, false);
RectTransform component7 = val5.GetComponent();
component7.anchorMin = new Vector2(0.5f, 1f);
component7.anchorMax = new Vector2(0.5f, 1f);
component7.pivot = new Vector2(0.5f, 1f);
component7.sizeDelta = new Vector2(1080f, 1080f);
component7.anchoredPosition = Vector2.zero;
Image component8 = val5.GetComponent();
component8.sprite = MainMenuButton_US.LoadSpriteFromPluginFile("images/doomah.png") ?? MainMenuButton_US.LoadSpriteFromPluginFile("doomah.png");
component8.type = (Type)0;
component8.preserveAspect = true;
((Graphic)component8).color = Color.white;
((Graphic)component8).raycastTarget = false;
Scrollbar scrollbar;
UltraStatsScrollbarDrag drag;
ScrollRect obj = UltraStatsScrollViewFactory.AttachChartStyleVerticalScroll(val, val2, component4, "ScrollbarTrack", 18f, 0f, 0f, 96f, out scrollbar, out drag);
UltraStatsPlotsContentSizer component9 = val3.GetComponent();
component9.ContentRect = component4;
component9.TextRect = component5;
component9.Text = component6;
component9.ImageRect = component7;
component9.Image = component8;
component9.TopPadding = 12f;
component9.RevealSpacer = 100f;
component9.ImageGap = 28f;
component9.BottomPadding = 24f;
component9.ImageMaxHeight = 1080f;
component9.ImageMaxWidth = 1080f;
Canvas.ForceUpdateCanvases();
obj.verticalNormalizedPosition = 1f;
drag.RefreshHandle();
}
}
internal sealed class UltraStatsPlotsContentSizer : MonoBehaviour
{
public RectTransform ContentRect;
public RectTransform TextRect;
public TextMeshProUGUI Text;
public RectTransform ImageRect;
public Image Image;
public float TopPadding = 12f;
public float RevealSpacer = 220f;
public float ImageGap = 28f;
public float BottomPadding = 24f;
public float ImageMaxHeight = 1080f;
public float ImageMaxWidth = 1080f;
private void LateUpdate()
{
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: 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)
if ((Object)(object)ContentRect == (Object)null || (Object)(object)TextRect == (Object)null || (Object)(object)Text == (Object)null || (Object)(object)ImageRect == (Object)null || (Object)(object)Image == (Object)null)
{
return;
}
Canvas.ForceUpdateCanvases();
float num = Mathf.Ceil(((TMP_Text)Text).preferredHeight);
TextRect.SetSizeWithCurrentAnchors((Axis)1, num);
float num2 = 0f;
float num3 = 0f;
if ((Object)(object)Image.sprite != (Object)null)
{
num2 = ImageMaxWidth;
num3 = ImageMaxHeight;
Rect rect = Image.sprite.rect;
if (((Rect)(ref rect)).width > 0f && ((Rect)(ref rect)).height > 0f)
{
float num4 = ((Rect)(ref rect)).width / ((Rect)(ref rect)).height;
if (num4 >= 1f)
{
num3 = num2 / num4;
}
else
{
num2 = num3 * num4;
}
}
}
ImageRect.anchoredPosition = new Vector2(0f, 0f - (TopPadding + num + RevealSpacer + ((num3 > 0f) ? ImageGap : 0f)));
ImageRect.sizeDelta = new Vector2(num2, num3);
((Behaviour)Image).enabled = (Object)(object)Image.sprite != (Object)null;
float num5 = TopPadding + num + RevealSpacer + ((num3 > 0f) ? (ImageGap + num3) : 0f) + BottomPadding;
ContentRect.SetSizeWithCurrentAnchors((Axis)1, num5);
}
}
internal sealed class UltraStatsScrollbarDrag : MonoBehaviour
{
public ScrollRect ScrollRect;
public Scrollbar Scrollbar;
public RectTransform TrackRect;
public RectTransform HandleRect;
public float MinHandleHeight = 72f;
private void LateUpdate()
{
RefreshHandle();
}
public void RefreshHandle()
{
//IL_0082: 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_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: 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_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0258: 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_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)ScrollRect == (Object)null || (Object)(object)TrackRect == (Object)null || (Object)(object)HandleRect == (Object)null || (Object)(object)ScrollRect.content == (Object)null || (Object)(object)ScrollRect.viewport == (Object)null)
{
return;
}
Transform parent = ((Transform)HandleRect).parent;
RectTransform val = (RectTransform)(object)((parent is RectTransform) ? parent : null);
Rect rect;
float height;
if (!((Object)(object)val != (Object)null))
{
rect = TrackRect.rect;
height = ((Rect)(ref rect)).height;
}
else
{
rect = val.rect;
height = ((Rect)(ref rect)).height;
}
float num = height;
if (num <= 0f)
{
return;
}
rect = ScrollRect.viewport.rect;
float num2 = Mathf.Max(1f, ((Rect)(ref rect)).height);
rect = ScrollRect.content.rect;
float num3 = Mathf.Max(num2, ((Rect)(ref rect)).height);
float num4 = Mathf.Max(0f, num3 - num2);
float num5 = ((num4 <= 0f) ? 1f : Mathf.Clamp01(num2 / num3));
float num6 = Mathf.Clamp01(MinHandleHeight / num);
float num7 = ((num4 <= 0f) ? 1f : Mathf.Clamp01(Mathf.Max(num5, num6)));
float num8 = ((num4 <= 0f) ? 1f : Mathf.Clamp01(ScrollRect.verticalNormalizedPosition));
if ((Object)(object)Scrollbar != (Object)null)
{
if (!Mathf.Approximately(ScrollRect.verticalNormalizedPosition, num8))
{
ScrollRect.verticalNormalizedPosition = num8;
}
ScrollRect.velocity = Vector2.zero;
Scrollbar.size = num7;
Scrollbar.SetValueWithoutNotify(num8);
HandleRect.offsetMin = Vector2.zero;
HandleRect.offsetMax = Vector2.zero;
HandleRect.anchoredPosition = Vector2.zero;
}
else
{
float num9 = Mathf.Clamp(num * num7, 0f, num);
float num10 = Mathf.Max(0f, num - num9);
HandleRect.anchorMin = new Vector2(0f, 0f);
HandleRect.anchorMax = new Vector2(1f, 0f);
HandleRect.pivot = new Vector2(0.5f, 0f);
HandleRect.sizeDelta = new Vector2(0f, num9);
HandleRect.anchoredPosition = new Vector2(0f, num10 * num8);
}
}
}
internal sealed class UltraStatsFixedWheelScroll : MonoBehaviour, IScrollHandler, IEventSystemHandler
{
public ScrollRect ScrollRect;
public float PixelsPerWheelTick = 96f;
public void OnScroll(PointerEventData eventData)
{
if (!((Object)(object)ScrollRect == (Object)null) && !((Object)(object)ScrollRect.content == (Object)null) && !((Object)(object)ScrollRect.viewport == (Object)null) && UltraStatsScrollUtility.TryApplyWheel(ScrollRect, PixelsPerWheelTick, eventData))
{
((AbstractEventData)eventData).Use();
}
}
}
internal sealed class UltraStatsScrollRelay : MonoBehaviour, IScrollHandler, IEventSystemHandler
{
public ScrollRect ScrollRect;
public float PixelsPerWheelTick = 96f;
public void OnScroll(PointerEventData eventData)
{
if (!((Object)(object)ScrollRect == (Object)null) && UltraStatsScrollUtility.TryApplyWheel(ScrollRect, PixelsPerWheelTick, eventData))
{
((AbstractEventData)eventData).Use();
}
}
}
internal sealed class UltraStatsRunDeleteScrollRelay : MonoBehaviour, IScrollHandler, IEventSystemHandler
{
public StatsTabController_US? Controller;
public ScrollRect ScrollRect;
public float PixelsPerWheelTick = 96f;
public void OnScroll(PointerEventData eventData)
{
Controller?.DismissRunDeleteContextMenuFromScroll();
if (!((Object)(object)ScrollRect == (Object)null) && UltraStatsScrollUtility.TryApplyWheel(ScrollRect, PixelsPerWheelTick, eventData))
{
((AbstractEventData)eventData).Use();
}
}
}
internal static class UltraStatsScrollUtility
{
public static bool TryApplyWheel(ScrollRect scrollRect, float pixelsPerWheelTick, PointerEventData eventData)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: 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_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_00b5: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)scrollRect == (Object)null || (Object)(object)scrollRect.content == (Object)null || (Object)(object)scrollRect.viewport == (Object)null)
{
return false;
}
float num = Mathf.Sign(eventData.scrollDelta.y);
if (Mathf.Approximately(num, 0f))
{
return false;
}
Rect rect = scrollRect.viewport.rect;
float height = ((Rect)(ref rect)).height;
rect = scrollRect.content.rect;
float num2 = Mathf.Max(height, ((Rect)(ref rect)).height);
float num3 = Mathf.Max(0f, num2 - height);
if (num3 <= 0f)
{
return false;
}
float num4 = Mathf.Max(1f, pixelsPerWheelTick) / num3;
scrollRect.verticalNormalizedPosition = Mathf.Clamp01(scrollRect.verticalNormalizedPosition + num * num4);
scrollRect.velocity = Vector2.zero;
return true;
}
}
internal static class UltraStatsScrollViewFactory
{
private static readonly Color TrackColor = new Color(1f, 1f, 1f, 0.18f);
private static readonly Color HandleColor = new Color(0.86f, 0.86f, 0.86f, 1f);
private const float DefaultMinHandleHeight = 72f;
internal static ScrollRect AttachChartStyleVerticalScroll(GameObject scrollRoot, GameObject viewport, RectTransform contentRect, string trackName, float scrollbarWidth, float topInset, float bottomInset, float pixelsPerWheelTick, out Scrollbar scrollbar, out UltraStatsScrollbarDrag drag)
{
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Expected O, but got Unknown
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Expected O, but got Unknown
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: 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_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
RectTransform component = viewport.GetComponent();
GameObject val = new GameObject(trackName, new Type[6]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image),
typeof(Scrollbar),
typeof(UltraStatsScrollbarDrag),
typeof(UltraStatsFixedWheelScroll)
});
val.transform.SetParent(scrollRoot.transform, false);
RectTransform component2 = val.GetComponent();
component2.anchorMin = new Vector2(1f, 0f);
component2.anchorMax = new Vector2(1f, 1f);
component2.pivot = new Vector2(1f, 0.5f);
component2.offsetMin = new Vector2(0f - scrollbarWidth, bottomInset);
component2.offsetMax = new Vector2(0f, 0f - topInset);
Image component3 = val.GetComponent();
((Graphic)component3).color = TrackColor;
((Graphic)component3).raycastTarget = true;
GameObject val2 = new GameObject("SlidingArea", new Type[1] { typeof(RectTransform) });
val2.transform.SetParent(val.transform, false);
RectTransform component4 = val2.GetComponent();
component4.anchorMin = Vector2.zero;
component4.anchorMax = Vector2.one;
component4.offsetMin = new Vector2(2f, 2f);
component4.offsetMax = new Vector2(-2f, -2f);
GameObject val3 = new GameObject("Handle", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
});
val3.transform.SetParent(val2.transform, false);
RectTransform component5 = val3.GetComponent();
component5.anchorMin = new Vector2(0f, 0f);
component5.anchorMax = new Vector2(1f, 1f);
component5.pivot = new Vector2(0.5f, 0.5f);
component5.sizeDelta = Vector2.zero;
component5.anchoredPosition = Vector2.zero;
Image component6 = val3.GetComponent();
((Graphic)component6).color = HandleColor;
((Graphic)component6).raycastTarget = true;
scrollbar = val.GetComponent();
scrollbar.handleRect = component5;
((Selectable)scrollbar).targetGraphic = (Graphic)(object)component6;
scrollbar.direction = (Direction)2;
scrollbar.numberOfSteps = 0;
scrollbar.size = 1f;
((Selectable)scrollbar).transition = (Transition)0;
ScrollRect val4 = scrollRoot.GetComponent();
if ((Object)(object)val4 == (Object)null)
{
val4 = scrollRoot.AddComponent();
}
val4.content = contentRect;
val4.viewport = component;
val4.horizontal = false;
val4.vertical = true;
val4.movementType = (MovementType)2;
val4.scrollSensitivity = 0f;
val4.inertia = false;
val4.verticalScrollbar = scrollbar;
val4.verticalScrollbarVisibility = (ScrollbarVisibility)0;
val4.verticalScrollbarSpacing = 0f;
drag = val.GetComponent();
drag.ScrollRect = val4;
drag.Scrollbar = scrollbar;
drag.TrackRect = component2;
drag.HandleRect = component5;
drag.MinHandleHeight = 72f;
UltraStatsFixedWheelScroll ultraStatsFixedWheelScroll = viewport.GetComponent();
if ((Object)(object)ultraStatsFixedWheelScroll == (Object)null)
{
ultraStatsFixedWheelScroll = viewport.AddComponent();
}
ultraStatsFixedWheelScroll.ScrollRect = val4;
ultraStatsFixedWheelScroll.PixelsPerWheelTick = pixelsPerWheelTick;
UltraStatsFixedWheelScroll component7 = val.GetComponent();
component7.ScrollRect = val4;
component7.PixelsPerWheelTick = pixelsPerWheelTick;
return val4;
}
}
internal static class StatsTab_US
{
private const float MainWindowContentHorizontalInset = 18f;
internal const float MainWindowBorderThickness = 4f;
private const float LeftOutset = 14f;
private const float RightOutset = 10f;
private const float TopOutset = 0f;
private const float BottomOutset = 0f;
public static void Build(Transform parent, Transform styleRoot)
{
//IL_0025: 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_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_0072: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("StatsTabRoot", new Type[2]
{
typeof(RectTransform),
typeof(StatsTabController_US)
});
val.transform.SetParent(parent, false);
RectTransform component = val.GetComponent();
component.anchorMin = Vector2.zero;
component.anchorMax = Vector2.one;
component.offsetMin = new Vector2(-14f, -0f);
component.offsetMax = new Vector2(10f, 0f);
val.GetComponent().Build(styleRoot);
}
}
internal sealed class StatsDropdown_US : MonoBehaviour
{
private static StatsDropdown_US? _openDropdown;
private readonly List _options = new List();
private readonly List _itemImages = new List();
private Transform _styleRoot;
private RectTransform _rootRect;
private Button _rootButton;
private TextMeshProUGUI _captionText;
private RectTransform _popupRect;
private RectTransform _contentRect;
private ScrollRect _popupScrollRect;
private RectTransform _overlayRect;
private Color _itemNormalColor;
private Color _itemSelectedColor;
private Color _itemHoverColor;
private int _value;
private float _lastPopupNormalizedPosition = 1f;
private bool _hasPopupScrollPosition;
public int MaxVisibleItems = 4;
public int value => _value;
public bool IsPopupOpen
{
get
{
if ((Object)(object)_popupRect != (Object)null)
{
return ((Component)_popupRect).gameObject.activeSelf;
}
return false;
}
}
public IReadOnlyList Options => _options;
public string SelectedText
{
get
{
if (_options.Count != 0)
{
return _options[Mathf.Clamp(_value, 0, _options.Count - 1)];
}
return "-";
}
}
public event Action? OnValueChanged;
public void Initialize(Transform styleRoot, Button rootButton, TextMeshProUGUI captionText, RectTransform popupRect, RectTransform contentRect, ScrollRect popupScrollRect, RectTransform overlayRect, Color itemNormalColor, Color itemSelectedColor, Color itemHoverColor)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_0051: 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_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Expected O, but got Unknown
_styleRoot = styleRoot;
_rootRect = (RectTransform)((Component)this).transform;
_rootButton = rootButton;
_captionText = captionText;
_popupRect = popupRect;
_contentRect = contentRect;
_popupScrollRect = popupScrollRect;
_overlayRect = overlayRect;
_itemNormalColor = itemNormalColor;
_itemSelectedColor = itemSelectedColor;
_itemHoverColor = itemHoverColor;
((UnityEvent)(object)_popupScrollRect.onValueChanged).AddListener((UnityAction)delegate
{
CapturePopupScrollPosition();
});
SetPopupNormalizedPosition(1f);
((UnityEvent)_rootButton.onClick).AddListener(new UnityAction(TogglePopup));
HidePopupImmediate();
}
private void Update()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)_popupRect == (Object)null) && ((Component)_popupRect).gameObject.activeSelf && Input.GetMouseButtonDown(0))
{
bool num = RectTransformUtility.RectangleContainsScreenPoint(_rootRect, Vector2.op_Implicit(Input.mousePosition), (Camera)null);
bool flag = RectTransformUtility.RectangleContainsScreenPoint(_popupRect, Vector2.op_Implicit(Input.mousePosition), (Camera)null);
if (!num && !flag)
{
HidePopupImmediate();
}
}
}
private void OnDisable()
{
HidePopupImmediate();
}
public void SetOptions(IEnumerable values, int defaultIndex)
{
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
bool isPopupOpen = IsPopupOpen;
float popupNormalizedPosition = (((Object)(object)_popupScrollRect != (Object)null) ? Mathf.Clamp01(_popupScrollRect.verticalNormalizedPosition) : 1f);
List list = new List();
foreach (string value in values)
{
list.Add(value);
}
if (list.Count == 0)
{
list.Add("-");
}
int num = Mathf.Clamp(defaultIndex, 0, list.Count - 1);
if (AreOptionsEquivalent(list, _options))
{
bool flag = _value == num;
SetValueWithoutNotify(num);
if (!isPopupOpen)
{
return;
}
PositionPopup();
if (!((Object)(object)_popupScrollRect == (Object)null))
{
if (_options.Count <= GetVisibleItemCount())
{
SetPopupNormalizedPosition(1f);
}
else if (flag)
{
SetPopupNormalizedPosition(popupNormalizedPosition);
}
else
{
ScrollPopupToSelection(onlyIfNeeded: true, popupNormalizedPosition);
}
}
return;
}
string[] left = _options.ToArray();
int num2 = _value;
string a = ((_options.Count == 0) ? string.Empty : SelectedText);
foreach (Transform item in (Transform)_contentRect)
{
Object.Destroy((Object)(object)((Component)item).gameObject);
}
_itemImages.Clear();
_options.Clear();
foreach (string item2 in list)
{
_options.Add(item2);
}
for (int i = 0; i < _options.Count; i++)
{
CreateOptionButton(i, _options[i]);
}
SetValueWithoutNotify(num);
RefreshShownValue();
RefreshPopupHeight();
if (!isPopupOpen)
{
return;
}
PositionPopup();
if (!((Object)(object)_popupScrollRect == (Object)null))
{
if (_options.Count <= GetVisibleItemCount())
{
SetPopupNormalizedPosition(1f);
}
else if (AreOptionsEquivalent(left, _options) && num2 == _value && string.Equals(a, SelectedText, StringComparison.Ordinal))
{
SetPopupNormalizedPosition(popupNormalizedPosition);
}
else
{
ScrollPopupToSelection(onlyIfNeeded: true, popupNormalizedPosition);
}
}
}
public void SetValueWithoutNotify(int index)
{
if (_options.Count == 0)
{
_value = 0;
((TMP_Text)_captionText).text = "-";
}
else
{
_value = Mathf.Clamp(index, 0, _options.Count - 1);
RefreshShownValue();
RefreshSelectionVisuals();
}
}
public void RefreshShownValue()
{
((TMP_Text)_captionText).text = SelectedText;
}
private void TogglePopup()
{
bool num = !IsPopupOpen;
if ((Object)(object)_openDropdown != (Object)null && (Object)(object)_openDropdown != (Object)(object)this)
{
_openDropdown.HidePopupImmediate();
}
if (!num)
{
HidePopupImmediate();
return;
}
_openDropdown = this;
((Component)_popupRect).gameObject.SetActive(true);
RefreshPopupHeight();
PositionPopup();
((Transform)_popupRect).SetAsLastSibling();
ScrollPopupToSelection(onlyIfNeeded: true, _hasPopupScrollPosition ? new float?(_lastPopupNormalizedPosition) : null);
}
private void PositionPopup()
{
//IL_0036: 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_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)_overlayRect == (Object)null) && !((Object)(object)_rootRect == (Object)null) && !((Object)(object)_popupRect == (Object)null))
{
Rect rect = _rootRect.rect;
float num = Mathf.Max(1f, ((Rect)(ref rect)).width);
_popupRect.SetSizeWithCurrentAnchors((Axis)0, num);
Canvas.ForceUpdateCanvases();
rect = _popupRect.rect;
float num2 = Mathf.Max(1f, ((Rect)(ref rect)).height);
Vector3[] array = (Vector3[])(object)new Vector3[4];
Vector3[] array2 = (Vector3[])(object)new Vector3[4];
_rootRect.GetWorldCorners(array);
_overlayRect.GetWorldCorners(array2);
float x = array2[0].x;
float x2 = array2[3].x;
float y = array2[0].y;
float y2 = array2[1].y;
float num3 = Mathf.Clamp(array[0].x, x, x2 - num);
float num4 = array[0].y - y;
float num5 = y2 - array[1].y;
float num6 = ((num2 + 2f > num4 && num5 > num4) ? (array[1].y + num2 + 2f) : (array[0].y - 2f));
num6 = Mathf.Clamp(num6, y + num2, y2);
((Transform)_popupRect).position = new Vector3(num3, num6, array[0].z);
}
}
private void HidePopupImmediate()
{
if ((Object)(object)_openDropdown == (Object)(object)this)
{
_openDropdown = null;
}
CapturePopupScrollPosition();
if ((Object)(object)_popupRect != (Object)null)
{
((Component)_popupRect).gameObject.SetActive(false);
}
}
private void OnOptionClicked(int index)
{
SetValueWithoutNotify(index);
HidePopupImmediate();
this.OnValueChanged?.Invoke(_value);
}
private void RefreshPopupHeight()
{
LayoutRebuilder.ForceRebuildLayoutImmediate(_contentRect);
Canvas.ForceUpdateCanvases();
int visibleItemCount = GetVisibleItemCount();
VerticalLayoutGroup component = ((Component)_contentRect).GetComponent();
float num = Mathf.Max(0f, (component != null) ? ((HorizontalOrVerticalLayoutGroup)component).spacing : 0f);
float num2 = (float)visibleItemCount * 28f + Mathf.Max(0f, (float)(visibleItemCount - 1)) * num;
_popupRect.SetSizeWithCurrentAnchors((Axis)1, num2 + 4f);
_popupScrollRect.vertical = _options.Count > visibleItemCount;
}
private int GetVisibleItemCount()
{
return Mathf.Min(Mathf.Max(1, MaxVisibleItems), Mathf.Max(1, _options.Count));
}
private void ScrollPopupToSelection(bool onlyIfNeeded = false, float? preferredNormalizedPosition = null)
{
if ((Object)(object)_popupScrollRect == (Object)null)
{
return;
}
int visibleItemCount = GetVisibleItemCount();
if (_options.Count <= visibleItemCount)
{
SetPopupNormalizedPosition(1f);
return;
}
Canvas.ForceUpdateCanvases();
int num = GetStartIndexForNormalizedPosition(preferredNormalizedPosition ?? _popupScrollRect.verticalNormalizedPosition);
if (!onlyIfNeeded)
{
num = Mathf.Clamp(_value - visibleItemCount / 2, 0, GetMaxPopupStartIndex());
}
else if (_value < num)
{
num = _value;
}
else if (_value >= num + visibleItemCount)
{
num = _value - visibleItemCount + 1;
}
SetPopupNormalizedPosition(GetNormalizedPositionForStartIndex(num));
}
private void CapturePopupScrollPosition()
{
if (!((Object)(object)_popupScrollRect == (Object)null))
{
_lastPopupNormalizedPosition = Mathf.Clamp01(_popupScrollRect.verticalNormalizedPosition);
_hasPopupScrollPosition = true;
}
}
private void SetPopupNormalizedPosition(float normalizedPosition)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)_popupScrollRect == (Object)null))
{
float num = Mathf.Clamp01(normalizedPosition);
_popupScrollRect.verticalNormalizedPosition = num;
_popupScrollRect.velocity = Vector2.zero;
_lastPopupNormalizedPosition = num;
_hasPopupScrollPosition = true;
}
}
private int GetMaxPopupStartIndex()
{
return Mathf.Max(0, _options.Count - GetVisibleItemCount());
}
private int GetStartIndexForNormalizedPosition(float normalizedPosition)
{
int maxPopupStartIndex = GetMaxPopupStartIndex();
if (maxPopupStartIndex <= 0)
{
return 0;
}
return Mathf.Clamp(Mathf.RoundToInt((1f - Mathf.Clamp01(normalizedPosition)) * (float)maxPopupStartIndex), 0, maxPopupStartIndex);
}
private float GetNormalizedPositionForStartIndex(int startIndex)
{
int maxPopupStartIndex = GetMaxPopupStartIndex();
if (maxPopupStartIndex <= 0)
{
return 1f;
}
int num = Mathf.Clamp(startIndex, 0, maxPopupStartIndex);
return 1f - (float)num / (float)maxPopupStartIndex;
}
private static bool AreOptionsEquivalent(IReadOnlyList left, IReadOnlyList right)
{
if (left.Count != right.Count)
{
return false;
}
for (int i = 0; i < left.Count; i++)
{
if (!string.Equals(left[i], right[i], StringComparison.Ordinal))
{
return false;
}
}
return true;
}
private void RefreshSelectionVisuals()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < _itemImages.Count; i++)
{
if ((Object)(object)_itemImages[i] != (Object)null)
{
((Graphic)_itemImages[i]).color = ((i == _value) ? _itemSelectedColor : _itemNormalColor);
}
}
}
private void CreateOptionButton(int index, string value)
{
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: 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_0137: 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_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: 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_0192: 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_01ae: Expected O, but got Unknown
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: 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_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("Item_" + index, new Type[5]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image),
typeof(Button),
typeof(LayoutElement)
});
val.transform.SetParent((Transform)(object)_contentRect, false);
RectTransform component = val.GetComponent();
component.anchorMin = new Vector2(0f, 1f);
component.anchorMax = new Vector2(1f, 1f);
component.pivot = new Vector2(0.5f, 1f);
component.sizeDelta = new Vector2(0f, 28f);
Image component2 = val.GetComponent();
((Graphic)component2).color = _itemNormalColor;
((Graphic)component2).raycastTarget = true;
_itemImages.Add(component2);
LayoutElement component3 = val.GetComponent();
component3.preferredHeight = 28f;
component3.minHeight = 28f;
Button component4 = val.GetComponent();
((Selectable)component4).transition = (Transition)1;
((Selectable)component4).targetGraphic = (Graphic)(object)component2;
ColorBlock colors = ((Selectable)component4).colors;
((ColorBlock)(ref colors)).normalColor = _itemNormalColor;
((ColorBlock)(ref colors)).highlightedColor = _itemHoverColor;
((ColorBlock)(ref colors)).pressedColor = _itemHoverColor;
((ColorBlock)(ref colors)).selectedColor = _itemHoverColor;
((ColorBlock)(ref colors)).disabledColor = new Color(0.12f, 0.12f, 0.12f, 0.5f);
((Selectable)component4).colors = colors;
((UnityEvent)component4.onClick).AddListener((UnityAction)delegate
{
OnOptionClicked(index);
});
GameObject val2 = new GameObject("Label", new Type[2]
{
typeof(RectTransform),
typeof(TextMeshProUGUI)
});
val2.transform.SetParent(val.transform, false);
RectTransform component5 = val2.GetComponent();
component5.anchorMin = Vector2.zero;
component5.anchorMax = Vector2.one;
component5.offsetMin = new Vector2(10f, 0f);
component5.offsetMax = new Vector2(-10f, 0f);
TextMeshProUGUI component6 = val2.GetComponent();
MainMenuButton_US.ApplyPanelTextStyle(_styleRoot, component6);
((TMP_Text)component6).richText = true;
((TMP_Text)component6).text = value;
((TMP_Text)component6).fontSize = 16f;
((Graphic)component6).color = Color.white;
((TMP_Text)component6).alignment = (TextAlignmentOptions)4097;
((TMP_Text)component6).enableWordWrapping = false;
((TMP_Text)component6).overflowMode = (TextOverflowModes)1;
((Graphic)component6).raycastTarget = false;
}
}
internal sealed class UltraStatsBeveledButtonTint : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
{
public Image FillImage;
public Color NormalColor = Color.black;
public Color HoverColor = Color.gray;
public Color PressedColor = Color.white;
public Color ActiveColor = Color.red;
private bool _hovered;
private bool _pressed;
private bool _active;
public void SetActiveVisual(bool active)
{
_active = active;
Refresh();
}
public void OnPointerEnter(PointerEventData eventData)
{
_hovered = true;
Refresh();
}
public void OnPointerExit(PointerEventData eventData)
{
_hovered = false;
_pressed = false;
Refresh();
}
public void OnPointerDown(PointerEventData eventData)
{
_pressed = true;
Refresh();
}
public void OnPointerUp(PointerEventData eventData)
{
_pressed = false;
Refresh();
}
private void Refresh()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)FillImage == (Object)null))
{
((Graphic)FillImage).color = (_active ? ActiveColor : (_pressed ? PressedColor : (_hovered ? HoverColor : NormalColor)));
}
}
}
internal sealed class UltraStatsRunRowContextClickHandler : MonoBehaviour, IPointerClickHandler, IEventSystemHandler
{
public StatsTabController_US Controller;
public int RowIndex = -1;
public void OnPointerClick(PointerEventData eventData)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Invalid comparison between Unknown and I4
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
if ((int)eventData.button == 1 && !((Object)(object)Controller == (Object)null))
{
Transform transform = ((Component)this).transform;
RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
if (!((Object)(object)val == (Object)null) && Controller.HandleRunRowRightClick(RowIndex, val, eventData.position, eventData.pressEventCamera))
{
((AbstractEventData)eventData).Use();
}
}
}
}
internal sealed class UltraStatsButtonVisualTint : MonoBehaviour
{
private Graphic[] _inactiveTextGraphics = Array.Empty();
private Color[] _inactiveTextOriginalColors = Array.Empty();
public void CaptureOriginalColors()
{
//IL_00a4: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
Transform val = ((Component)this).transform.Find("InactiveVisual");
if ((Object)(object)val == (Object)null)
{
_inactiveTextGraphics = Array.Empty();
_inactiveTextOriginalColors = Array.Empty();
return;
}
_inactiveTextGraphics = (from graphic in ((Component)val).GetComponentsInChildren(true)
where graphic is TMP_Text || graphic is Text
select graphic).ToArray();
_inactiveTextOriginalColors = (Color[])(object)new Color[_inactiveTextGraphics.Length];
for (int i = 0; i < _inactiveTextGraphics.Length; i++)
{
_inactiveTextOriginalColors[i] = (((Object)(object)_inactiveTextGraphics[i] != (Object)null) ? _inactiveTextGraphics[i].color : Color.white);
}
}
public void RestoreOriginalColors()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < _inactiveTextGraphics.Length; i++)
{
if ((Object)(object)_inactiveTextGraphics[i] != (Object)null)
{
_inactiveTextGraphics[i].color = _inactiveTextOriginalColors[i];
}
}
}
public void SetTextTint(Color color)
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < _inactiveTextGraphics.Length; i++)
{
if ((Object)(object)_inactiveTextGraphics[i] != (Object)null)
{
_inactiveTextGraphics[i].color = color;
}
}
}
}
internal sealed class StatsTabController_US : MonoBehaviour
{
private enum StatsMode
{
Cybergrind,
Campaign,
Custom
}
private enum StatsSortField
{
Id,
Date,
Time,
Kills,
Style,
Deaths,
Wave,
Rank
}
private sealed class ChartDefinition
{
public string[] Headers = Array.Empty();
public float[] WidthFractions = Array.Empty();
}
private sealed class StatsRowData
{
public long RunId;
public long? LocalRunNo;
public long SortId;
public UltraStatsMode Mode;
public int Difficulty;
public string LevelId = string.Empty;
public string LevelDisplayName = string.Empty;
public string BundleKey = string.Empty;
public string BundleDisplayName = string.Empty;
public string Version = "-";
public string[] Cells = Array.Empty();
public string TimeRank = string.Empty;
public string KillsRank = string.Empty;
public string StyleRank = string.Empty;
public string TotalRank = string.Empty;
public long Flags;
public bool ChallengeComplete;
public bool IsSummaryRow;
public bool HasStrongBottomSeparator;
public long DateUnixSort = long.MinValue;
public long TimeMilliseconds = long.MinValue;
public int KillsValue = int.MinValue;
public int StyleValue = int.MinValue;
public int DeathsValue = int.MinValue;
public int WaveHundredthsValue = int.MinValue;
public int TotalRankScore = int.MinValue;
}
private sealed class StatsLoadBatch
{
public int Generation;
public StatsMode Mode;
public string RequestKey = string.Empty;
public List Rows = new List();
}
private sealed class StatsLoadCompletion
{
public int Generation;
public StatsMode Mode;
public string RequestKey = string.Empty;
public List SummaryRows = new List();
public string VersionsText = "-";
public int TotalRunCount;
}
private sealed class RunDeleteResult
{
public long RunId;
public bool Deleted;
public Exception? Error;
}
private sealed class CachedStatsView
{
public long DataRevision;
public string RequestKey = string.Empty;
public StatsMode Mode;
public List RunRows = new List();
public List SummaryRows = new List();
public string VersionsText = "-";
}
private sealed class VirtualRowView
{
public GameObject Root;
public RectTransform Rect;
public Image Background;
public UltraStatsRunRowContextClickHandler ContextClickHandler;
public Image BottomLine;
public RectTransform BottomLineRect;
public Image StrongBottomLine;
public RectTransform StrongBottomLineRect;
public List CellBackgrounds { get; } = new List();
public List CellBackgroundRects { get; } = new List();
public List CellTexts { get; } = new List();
public List CellTextRects { get; } = new List();
public List ColumnSeparators { get; } = new List();
public List ColumnSeparatorRects { get; } = new List();
}
private sealed class SummaryAccumulator
{
public int RunCount;
public int TimeCount;
public long TimeSum;
public long BestTime = long.MaxValue;
public int KillsCount;
public long KillsSum;
public int BestKills = int.MinValue;
public int StyleCount;
public long StyleSum;
public int BestStyle = int.MinValue;
public int RestartsCount;
public long RestartsSum;
public int BestRestarts = int.MaxValue;
public int WaveCount;
public long WaveSum;
public int BestWave = int.MinValue;
public int BestRankScore = int.MinValue;
public string BestRank = "-";
public void Add(StatsMode mode, StatsRowData row)
{
RunCount++;
if (row.TimeMilliseconds >= 0)
{
TimeCount++;
TimeSum += row.TimeMilliseconds;
if (row.TimeMilliseconds < BestTime)
{
BestTime = row.TimeMilliseconds;
}
}
if (row.KillsValue != int.MinValue)
{
KillsCount++;
KillsSum += row.KillsValue;
if (row.KillsValue > BestKills)
{
BestKills = row.KillsValue;
}
}
if (row.StyleValue != int.MinValue)
{
StyleCount++;
StyleSum += row.StyleValue;
if (row.StyleValue > BestStyle)
{
BestStyle = row.StyleValue;
}
}
if (mode == StatsMode.Cybergrind)
{
if (row.WaveHundredthsValue != int.MinValue)
{
WaveCount++;
WaveSum += row.WaveHundredthsValue;
if (row.WaveHundredthsValue > BestWave)
{
BestWave = row.WaveHundredthsValue;
}
}
return;
}
if (row.DeathsValue != int.MinValue)
{
RestartsCount++;
RestartsSum += row.DeathsValue;
if (row.DeathsValue < BestRestarts)
{
BestRestarts = row.DeathsValue;
}
}
if (!string.IsNullOrWhiteSpace(row.TotalRank) && row.TotalRankScore > BestRankScore)
{
BestRankScore = row.TotalRankScore;
BestRank = NormalizeRankLetter(row.TotalRank);
}
}
public List BuildSummaryRows(StatsMode mode)
{
if (RunCount <= 0)
{
return new List();
}
List list = new List
{
BuildCountSummaryRow(mode, RunCount),
BuildAverageSummaryRow(mode, this),
BuildBestSummaryRow(mode, this)
};
if (list.Count > 0)
{
list[list.Count - 1].HasStrongBottomSeparator = true;
}
return list;
}
}
[Serializable]
private sealed class AngryLevelCatalogData
{
public AngryLevelCatalogBundle[] Levels = Array.Empty();
}
[Serializable]
private sealed class AngryLevelCatalogBundle
{
public string Name = string.Empty;
public string Guid = string.Empty;
public string Hash = string.Empty;
public string buildHash = string.Empty;
public string bundleGuid = string.Empty;
public string bundleDataPath = string.Empty;
public AngryLevelCatalogLevel[] Levels = Array.Empty();
}
[Serializable]
private sealed class AngryLocalBundleData
{
public string bundleName = string.Empty;
public string bundleAuthor = string.Empty;
public string bundleGuid = string.Empty;
public string buildHash = string.Empty;
public string bundleDataPath = string.Empty;
}
[Serializable]
private sealed class AngryLevelCatalogLevel
{
public string LevelName = string.Empty;
public string LevelId = string.Empty;
}
private sealed class CustomBundleCatalogEntry
{
public string Guid = string.Empty;
public string Hash = string.Empty;
public string DisplayName = string.Empty;
public readonly Dictionary LevelDisplayNames = new Dictionary(StringComparer.OrdinalIgnoreCase);
public readonly Dictionary LevelOrder = new Dictionary(StringComparer.OrdinalIgnoreCase);
}
private sealed class CustomLevelFileInfo
{
public string DisplayName = string.Empty;
public string Path = string.Empty;
public int CatalogOrder = int.MaxValue;
}
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static UnityAction <>9__275_1;
public static UnityAction <>9__276_0;
public static UnityAction <>9__277_0;
public static UnityAction <>9__277_1;
public static Func <>9__312_0;
public static Func <>9__312_1;
public static Func <>9__312_2;
public static Func <>9__312_3;
public static Func <>9__312_4;
public static Func <>9__312_5;
public static Func <>9__312_6;
public static Func <>9__312_7;
public static Func <>9__312_8;
public static Func <>9__312_9;
public static Func <>9__312_10;
public static Func <>9__312_11;
public static Func