Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of StatusGroups v1.0.5
StatusGroups.dll
Decompiled 5 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JoksterCube.StatusGroups.Common; using JoksterCube.StatusGroups.Domain; using JoksterCube.StatusGroups.Settings; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("StatusGroups")] [assembly: AssemblyDescription("Tidy status effects: smaller icons, sorted into groups like buffs, cooldowns, negatives and rites. Pick a layout: Icons, Stacked or Vanilla.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("JoksterCube")] [assembly: AssemblyProduct("StatusGroups")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("6f0f5d52-3a2e-4b8c-9d61-0b7a8f3e2c41")] [assembly: AssemblyFileVersion("1.0.5")] [assembly: InternalsVisibleTo("StatusGroups.Tests")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.5.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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 JoksterCube.StatusGroups { [BepInPlugin("JoksterCube.StatusGroups", "StatusGroups", "1.0.5")] public class Plugin : BaseUnityPlugin { internal static readonly ManualLogSource ModLogger = Logger.CreateLogSource("StatusGroups"); private readonly string _configFileFullPath = Path.Combine(Paths.ConfigPath, "JoksterCube.StatusGroups.cfg"); private const float ConfigCheckInterval = 2f; private FileSystemWatcher? _configWatcher; private DateTime _lastConfigWrite; private long _lastConfigSize = -1L; private float _nextConfigCheck; private readonly Harmony _harmony = new Harmony("JoksterCube.StatusGroups"); private void Awake() { PluginConfig.Build(((BaseUnityPlugin)this).Config); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); RememberConfigFile(); SetupWatcher(); } private void Update() { if (Time.unscaledTime >= _nextConfigCheck) { _nextConfigCheck = Time.unscaledTime + 2f; ReloadConfigIfChanged(); } } private void OnDestroy() { _harmony.UnpatchSelf(); _configWatcher?.Dispose(); StatusBoard.Dispose(); } private void SetupWatcher() { try { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, "*.cfg") { NotifyFilter = (NotifyFilters.FileName | NotifyFilters.Size | NotifyFilters.LastWrite | NotifyFilters.CreationTime) }; fileSystemWatcher.Changed += OnConfigFolderChanged; fileSystemWatcher.Created += OnConfigFolderChanged; fileSystemWatcher.Renamed += OnConfigFolderChanged; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; _configWatcher = fileSystemWatcher; fileSystemWatcher.EnableRaisingEvents = true; } catch (Exception ex) { ModLogger.LogWarning((object)string.Format("Config file watcher unavailable, checking {0} every {1} s instead: {2}", "JoksterCube.StatusGroups.cfg", 2f, ex.Message)); } } private void OnConfigFolderChanged(object sender, FileSystemEventArgs e) { ReloadConfigIfChanged(); } private void RememberConfigFile() { try { FileInfo fileInfo = new FileInfo(_configFileFullPath); if (fileInfo.Exists) { _lastConfigWrite = fileInfo.LastWriteTimeUtc; _lastConfigSize = fileInfo.Length; } } catch (IOException) { } } private void ReloadConfigIfChanged() { FileInfo fileInfo; try { fileInfo = new FileInfo(_configFileFullPath); if (!fileInfo.Exists || (fileInfo.LastWriteTimeUtc == _lastConfigWrite && fileInfo.Length == _lastConfigSize)) { return; } } catch (IOException) { return; } _lastConfigWrite = fileInfo.LastWriteTimeUtc; _lastConfigSize = fileInfo.Length; try { ModLogger.LogDebug((object)"ReadConfigValues called"); ((BaseUnityPlugin)this).Config.Reload(); ModLogger.LogInfo((object)"JoksterCube.StatusGroups.cfg changed, settings reloaded."); } catch { _lastConfigWrite = default(DateTime); _lastConfigSize = -1L; ModLogger.LogError((object)"There was an issue loading your JoksterCube.StatusGroups.cfg"); ModLogger.LogError((object)"Please check your config entries for spelling and format!"); } } } public static class StatusGroupsApi { public const int Version = 2; public static void AddGroup(string id, Func<string> name, int order) { Safe(delegate { GroupRegistry.Add(id, name, order); }); } public static void AddGroup(string id, string name, int order) { AddGroup(id, () => name, order); } public static void SetGroupIcon(string groupId, Func<Sprite?> icon, bool pale) { Safe(delegate { StatusGroup statusGroup = GroupRegistry.Get(groupId); statusGroup.IconSource = icon; statusGroup.IconTinted = pale; GroupRegistry.Touch(); }); } public static void SetGroupIcon(string groupId, Func<Sprite?> icon) { SetGroupIcon(groupId, icon, pale: false); } public static void Assign(string statusName, string groupId) { Safe(delegate { StatusClassifier.Assign(statusName, groupId); }); } public static void AssignPrefix(string prefix, string groupId) { Safe(delegate { StatusClassifier.AssignPrefix(prefix, groupId); }); } private static void Safe(Action action) { try { action(); } catch (Exception ex) { Plugin.ModLogger.LogWarning((object)("Another mod's StatusGroups call failed: " + ex.Message)); } } } } namespace JoksterCube.StatusGroups.Settings { internal sealed class ConfigInfo<T> { internal string Group { get; } internal string Name { get; } internal ConfigDescription Description { get; } internal T DefaultValue { get; } internal bool IsAdvanced { get; set; } internal ConfigInfo(string group, string name, string description, T defaultValue) : this(group, name, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), defaultValue) { }//IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown internal ConfigInfo(string group, string name, ConfigDescription description, T defaultValue) { Group = group; Name = name; Description = description; DefaultValue = defaultValue; } } internal static class ConfigOptions { private static ConfigFile? _configFile; private static readonly Dictionary<string, int> NextOrder = new Dictionary<string, int>(); internal static ConfigFile File => _configFile ?? throw new InvalidOperationException("ConfigOptions is not initialized."); internal static void Initialize(ConfigFile config) { _configFile = config; } internal static ConfigEntry<T> Config<T>(string group, string name, T value, ConfigDescription description, bool advanced = false) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown int value2; int num = (NextOrder.TryGetValue(group, out value2) ? value2 : 1000); NextOrder[group] = num - 1; ConfigurationManagerAttributes element = new ConfigurationManagerAttributes { Order = num, IsAdvanced = (advanced ? new bool?(true) : ((bool?)null)) }; ConfigDescription val = new ConfigDescription(description.Description, description.AcceptableValues, (description.Tags ?? Array.Empty<object>()).Append(element).ToArray()); return File.Bind<T>(group, name, value, val); } internal static ConfigEntry<T> Config<T>(ConfigInfo<T> configInfo) { return Config(configInfo.Group, configInfo.Name, configInfo.DefaultValue, configInfo.Description, configInfo.IsAdvanced); } } internal sealed class ConfigurationManagerAttributes { public int? Order; public bool? IsAdvanced; public bool? ReadOnly; public bool? Browsable; public string? DispName; public string? Category; } internal static class Constants { internal static class Plugin { internal const string ModName = "StatusGroups"; internal const string ModVersion = "1.0.5"; internal const string Author = "JoksterCube"; internal const string ModGUID = "JoksterCube.StatusGroups"; internal const string Description = "Tidy status effects: smaller icons, sorted into groups like buffs, cooldowns, negatives and rites. Pick a layout: Icons, Stacked or Vanilla."; internal const string Copyright = "Copyright © 2026"; internal const string Guid = "6f0f5d52-3a2e-4b8c-9d61-0b7a8f3e2c41"; internal const string ConfigFileName = "JoksterCube.StatusGroups.cfg"; } internal static class DebugMessages { internal const string ReadConfigCalled = "ReadConfigValues called"; internal const string ErrorLoadingConfig = "There was an issue loading your JoksterCube.StatusGroups.cfg"; internal const string RequestCheckConfig = "Please check your config entries for spelling and format!"; } internal static class Groups { internal static class Layout { internal const string Group = "1 - Layout"; internal static readonly ConfigInfo<StatusLayout> Style = new ConfigInfo<StatusLayout>("1 - Layout", "Layout", "How status effects are shown. Icons: small icons in rows, the time under each. Stacked: the same, but one icon per group, with how many it holds and the time of the one ending first. Vanilla: the game's own list.", StatusLayout.Icons); internal static readonly ConfigInfo<Toggle> SplitByGroup = new ConfigInfo<Toggle>("1 - Layout", "Split By Group", "Give each group its own block of icons, with the group's name above it (see Show Group Names). Stacked groups share one block at the start. Off: every status in one block.", Toggle.On); internal static readonly ConfigInfo<Toggle> SortByGroup = new ConfigInfo<Toggle>("1 - Layout", "Sort By Group", "Without Split By Group: keep the statuses of a group together, in group order. Off keeps the game's order.", Toggle.On); internal static readonly ConfigInfo<Toggle> BiggestFirst = new ConfigInfo<Toggle>("1 - Layout", "Longest Groups First", "Put the groups with the longest row first (on top with Split By Group), the shortest last. A group split over two rows counts its longer one. Of groups as long, the one whose first status runs out latest (so it stays that long longest) comes first, then by Order. A stacked group counts as one. Off: groups go by their Order only.", Toggle.On); internal static readonly ConfigInfo<float> IconSize = new ConfigInfo<float>("1 - Layout", "Icon Size", new ConfigDescription("Size of the status icons compared to the game's (1 is the game's size). Texts keep their Font Size and Time Font Size.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 1.5f), Array.Empty<object>()), 0.75f); internal static readonly ConfigInfo<int> PerLine = new ConfigInfo<int>("1 - Layout", "Statuses Per Line", new ConfigDescription("How many statuses a row holds before the next row starts.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>()), 18); internal static readonly ConfigInfo<Toggle> ShowNames = new ConfigInfo<Toggle>("1 - Layout", "Show Names", "Show each status's name under its time. A stacked group shows the group's name.", Toggle.Off); internal static readonly ConfigInfo<float> NameWidth = new ConfigInfo<float>("1 - Layout", "Name Width", new ConfigDescription("The widest a status's name gets, in screen units. Longer names go on to the next line.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 400f), Array.Empty<object>()), 30f); internal static readonly ConfigInfo<Toggle> ShowGroupNames = new ConfigInfo<Toggle>("1 - Layout", "Show Group Names", "With Split By Group: show the group's name above its block.", Toggle.Off); internal static readonly ConfigInfo<Toggle> ShowGroupIcons = new ConfigInfo<Toggle>("1 - Layout", "Show Group Icons", "With Split By Group: an icon at the right of each group's block, so you see which group is which. Pick each group's icon in the Groups settings.", Toggle.On); internal static readonly ConfigInfo<Toggle> StatusBoxes = new ConfigInfo<Toggle>("1 - Layout", "Status Boxes", "Icons and Stacked layouts: each status in a small square with its time on the bottom of its icon, and each group's icon (Show Group Icons) smaller, on a banner as tall as the group. Off: times under the icons, no squares.", Toggle.On); internal static readonly ConfigInfo<Toggle> ExpandInMenu = new ConfigInfo<Toggle>("1 - Layout", "Expand In Menu", "While the menu (Esc) is open, stacked groups show every status, so you can see what they hold. They stack again when the menu closes. Hidden groups stay hidden.", Toggle.On); internal static readonly ConfigInfo<float> FontSize = new ConfigInfo<float>("1 - Layout", "Font Size", new ConfigDescription("Size of the status names, whatever the icon size. Group names and times have their own sizes.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(8f, 32f), Array.Empty<object>()), 8f); internal static readonly ConfigInfo<float> GroupFontSize = new ConfigInfo<float>("1 - Layout", "Group Font Size", new ConfigDescription("Size of the group names (Show Group Names), whatever the icon size.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(8f, 32f), Array.Empty<object>()), 14f); internal static readonly ConfigInfo<float> TimeFontSize = new ConfigInfo<float>("1 - Layout", "Time Font Size", new ConfigDescription("Size of the times and stack counts, whatever the icon size. Under a minute left, a time in a Status Box grows (Ending Soon Font Size).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(8f, 32f), Array.Empty<object>()), 16f); internal static readonly ConfigInfo<float> EndingSoonFontSize = new ConfigInfo<float>("1 - Layout", "Ending Soon Font Size", new ConfigDescription("Status Boxes: size of a time with under a minute left, shown big in the middle of its square. 0: grows to fill the square.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 64f), Array.Empty<object>()), 24f); internal static readonly ConfigInfo<Color> TextColor = new ConfigInfo<Color>("1 - Layout", "Text Color", "Color of every text. Times under a minute show in red.", Color.white); internal static readonly ConfigInfo<int> SecondsUnder = new ConfigInfo<int>("1 - Layout", "Seconds Under", new ConfigDescription("Times show whole minutes only (\"27m\") until this many minutes are left, then the game's time with seconds (\"4:59\", \"59\"). 0: always with seconds, like the game.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 60), Array.Empty<object>()), 1); internal static readonly ConfigInfo<Vector2> Position = new ConfigInfo<Vector2>("1 - Layout", "Position", "How far the status icons are moved from the game's spot, in screen units. Open the menu (Esc) and drag them to move them; right-click them there to put them back.", new Vector2(24.75f, 26f)); } internal static class GroupSettings { internal const string Group = "2 - Groups"; internal static ConfigDescription Display(string name) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return new ConfigDescription("How the " + name + " group shows. Default: as the layout shows groups. Expanded: every status on its own. Stacked: one icon for the whole group. Hidden: not shown at all.", (AcceptableValueBase)null, Array.Empty<object>()); } internal static ConfigDescription Name(string name) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return new ConfigDescription("Your own name for the " + name + " group, shown above its block (Show Group Names) and on its stacked icon. Empty: its usual name. Custom Rules still call it by its setting name.", (AcceptableValueBase)null, Array.Empty<object>()); } internal static ConfigDescription Icon(string name) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return new ConfigDescription("The status whose icon marks the " + name + " group (Show Group Icons): its name as shown in game (Rested) or its internal name. Empty: the group's own icon, or else the icon of its first status.", (AcceptableValueBase)null, Array.Empty<object>()); } internal static ConfigDescription Order(string name) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown return new ConfigDescription("Place of the " + name + " group: lower numbers come first.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10000), Array.Empty<object>()); } } internal static class Rules { internal const string Group = "3 - Rules"; internal static readonly ConfigInfo<string> CustomRules = new ConfigInfo<string>("3 - Rules", "Custom Rules", "Put statuses into groups yourself; these come before every other rule. A comma separated list of status=group, where status is the status's name as shown in game (Rested) or its internal name (SE_TempestRite_CryptDelver), * matches anything (SE_MyMod_*), and group is a group's name from the Groups settings or a new one. Example: Wishbone=Buffs, SE_MyMod_*=My Mod", string.Empty); internal static readonly ConfigInfo<Toggle> LogStatuses = new ConfigInfo<Toggle>("3 - Rules", "Log Statuses", "Write each status you get to the BepInEx log once, with its internal name and group. Handy for writing Custom Rules.", Toggle.Off) { IsAdvanced = true }; } } } internal static class PluginConfig { internal static ConfigEntry<StatusLayout> Layout; internal static ConfigEntry<Toggle> SplitByGroup; internal static ConfigEntry<Toggle> SortByGroup; internal static ConfigEntry<Toggle> BiggestFirst; internal static ConfigEntry<float> IconSize; internal static ConfigEntry<int> PerLine; internal static ConfigEntry<Toggle> ShowNames; internal static ConfigEntry<float> NameWidth; internal static ConfigEntry<Toggle> ShowGroupNames; internal static ConfigEntry<Toggle> ShowGroupIcons; internal static ConfigEntry<Toggle> StatusBoxes; internal static ConfigEntry<Toggle> ExpandInMenu; internal static ConfigEntry<float> FontSize; internal static ConfigEntry<float> GroupFontSize; internal static ConfigEntry<float> TimeFontSize; internal static ConfigEntry<float> EndingSoonFontSize; internal static ConfigEntry<Color> TextColor; internal static ConfigEntry<int> SecondsUnder; internal static ConfigEntry<Vector2> Position; internal static ConfigEntry<string> CustomRules; internal static ConfigEntry<Toggle> LogStatuses; internal static void Build(ConfigFile config) { ConfigOptions.Initialize(config); Layout = ConfigOptions.Config(Constants.Groups.Layout.Style); SplitByGroup = ConfigOptions.Config(Constants.Groups.Layout.SplitByGroup); SortByGroup = ConfigOptions.Config(Constants.Groups.Layout.SortByGroup); BiggestFirst = ConfigOptions.Config(Constants.Groups.Layout.BiggestFirst); IconSize = ConfigOptions.Config(Constants.Groups.Layout.IconSize); PerLine = ConfigOptions.Config(Constants.Groups.Layout.PerLine); ShowNames = ConfigOptions.Config(Constants.Groups.Layout.ShowNames); NameWidth = ConfigOptions.Config(Constants.Groups.Layout.NameWidth); ShowGroupNames = ConfigOptions.Config(Constants.Groups.Layout.ShowGroupNames); ShowGroupIcons = ConfigOptions.Config(Constants.Groups.Layout.ShowGroupIcons); StatusBoxes = ConfigOptions.Config(Constants.Groups.Layout.StatusBoxes); ExpandInMenu = ConfigOptions.Config(Constants.Groups.Layout.ExpandInMenu); FontSize = ConfigOptions.Config(Constants.Groups.Layout.FontSize); GroupFontSize = ConfigOptions.Config(Constants.Groups.Layout.GroupFontSize); TimeFontSize = ConfigOptions.Config(Constants.Groups.Layout.TimeFontSize); EndingSoonFontSize = ConfigOptions.Config(Constants.Groups.Layout.EndingSoonFontSize); TextColor = ConfigOptions.Config(Constants.Groups.Layout.TextColor); SecondsUnder = ConfigOptions.Config(Constants.Groups.Layout.SecondsUnder); Position = ConfigOptions.Config(Constants.Groups.Layout.Position); CustomRules = ConfigOptions.Config(Constants.Groups.Rules.CustomRules); LogStatuses = ConfigOptions.Config(Constants.Groups.Rules.LogStatuses); GroupRegistry.AddBuiltIn(); StatusClassifier.SetRules(CustomRules.Value); CustomRules.SettingChanged += delegate { StatusClassifier.SetRules(CustomRules.Value); }; } } } namespace JoksterCube.StatusGroups.Patches { internal static class HudPatches { [HarmonyPatch(typeof(Hud), "UpdateStatusEffects")] private static class UpdateStatusEffectsPatch { [HarmonyPriority(200)] private static bool Prefix(Hud __instance, List<StatusEffect> statusEffects) { return StatusBoard.Draw(__instance, statusEffects); } } [HarmonyPatch(typeof(Hud), "OnDestroy")] private static class OnDestroyPatch { private static void Prefix() { StatusBoard.Dispose(); } } } } namespace JoksterCube.StatusGroups.Domain { internal sealed class BoardMover : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IDragHandler, IPointerUpHandler, IPointerClickHandler { internal RectTransform Handle; private RectTransform _board; private Vector2 _grab; private Vector2 _start; private static readonly Vector3[] Corners = (Vector3[])(object)new Vector3[4]; internal bool Dragging { get; private set; } internal static bool CanMove => Menu.IsVisible(); private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown _board = (RectTransform)((Component)this).transform; } public void OnPointerDown(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0 && CanMove && ToParent(eventData.position, out _grab)) { _start = _board.anchoredPosition; Dragging = true; } } public void OnDrag(PointerEventData eventData) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_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) if (Dragging && (int)eventData.button == 0 && ToParent(eventData.position, out var point)) { _board.anchoredPosition = KeepOnScreen(_start + point - _grab); } } public void OnPointerUp(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button == 0) { Finish(); } } 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_0017: 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) if ((int)eventData.button == 1 && CanMove) { _board.anchoredPosition = Vector2.zero; PluginConfig.Position.Value = Vector2.zero; } } internal void Finish() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //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) if (Dragging) { Dragging = false; Vector2 anchoredPosition = _board.anchoredPosition; if (PluginConfig.Position.Value != anchoredPosition) { PluginConfig.Position.Value = anchoredPosition; } } } private bool ToParent(Vector2 screen, out Vector2 point) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown return RectTransformUtility.ScreenPointToLocalPointInRectangle((RectTransform)((Transform)_board).parent, screen, Camera(), ref point); } private Camera? Camera() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) Canvas componentInParent = ((Component)this).GetComponentInParent<Canvas>(); if (!Object.op_Implicit((Object)(object)componentInParent)) { return null; } componentInParent = componentInParent.rootCanvas; if ((int)componentInParent.renderMode != 0) { return componentInParent.worldCamera; } return null; } private Vector2 KeepOnScreen(Vector2 wanted) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0033: 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_004e: 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_007a: 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_0084: 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_0086: 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_009a: 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_00a4: 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_00a7: 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_00ae: 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_00b1: 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_00b8: 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) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_00d9: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00ec: 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_00f3: 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_0117: 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_0125: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_0135: 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_016a: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_0192: 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_0182: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Handle) || !((Component)Handle).gameObject.activeInHierarchy) { return wanted; } RectTransform val = (RectTransform)((Transform)_board).parent; if (!ToParent(Vector2.zero, out var point) || !ToParent(new Vector2((float)Screen.width, (float)Screen.height), out var point2)) { return wanted; } Handle.GetWorldCorners(Corners); Vector2 val2 = Vector2.op_Implicit(((Transform)val).InverseTransformPoint(Corners[0])); Vector2 val3 = val2; for (int i = 1; i < 4; i++) { Vector2 val4 = Vector2.op_Implicit(((Transform)val).InverseTransformPoint(Corners[i])); val2 = Vector2.Min(val2, val4); val3 = Vector2.Max(val3, val4); } Vector2 val5 = wanted - _board.anchoredPosition; val2 += val5; val3 += val5; Vector2 zero = Vector2.zero; if (val3.x > point2.x) { zero.x = point2.x - val3.x; } if (val2.x + zero.x < point.x) { zero.x = point.x - val2.x; } if (val2.y < point.y) { zero.y = point.y - val2.y; } if (val3.y + zero.y > point2.y) { zero.y = point2.y - val3.y; } return wanted + zero; } } internal readonly record struct PlannedGroup(string Id, int Order, GroupDisplay Display); internal sealed class PlannedTile<T>(string groupId, bool stacked) { internal string GroupId { get; } = groupId; internal bool Stacked { get; } = stacked; internal List<T> Members { get; } = new List<T>(); } internal sealed class PlannedSection<T>(string? caption) { internal string? Caption { get; } = caption; internal List<PlannedTile<T>> Tiles { get; } = new List<PlannedTile<T>>(); } internal static class BoardPlan { internal const string ShortestTimePattern = "00:00"; internal static GroupDisplay Resolve(GroupDisplay display, StatusLayout layout) { if (display == GroupDisplay.Default) { display = ((layout != StatusLayout.Stacked) ? GroupDisplay.Expanded : GroupDisplay.Stacked); } return display; } internal static List<PlannedSection<T>> Plan<T>(IReadOnlyList<T> effects, Func<T, PlannedGroup> groupOf, bool perGroup, bool sortByGroup, bool biggestFirst = false, Func<T, float?>? timeLeft = null, int perLine = int.MaxValue) { List<PlannedGroup> list = new List<PlannedGroup>(); Dictionary<string, List<T>> members = new Dictionary<string, List<T>>(); foreach (T effect in effects) { PlannedGroup item = groupOf(effect); if (item.Display != GroupDisplay.Hidden) { if (!members.TryGetValue(item.Id, out List<T> value)) { value = (members[item.Id] = new List<T>()); list.Add(item); } value.Add(effect); } } if (perGroup || sortByGroup) { list.Sort(delegate(PlannedGroup a, PlannedGroup b) { if (biggestFirst) { int num5 = Width(Shown(b, members), perLine).CompareTo(Width(Shown(a, members), perLine)); if (num5 != 0) { return num5; } int num6 = Lasting(members[b.Id], timeLeft).CompareTo(Lasting(members[a.Id], timeLeft)); if (num6 != 0) { return num6; } } int num7 = a.Order.CompareTo(b.Order); return (num7 == 0) ? string.CompareOrdinal(a.Id, b.Id) : num7; }); } List<PlannedSection<T>> list3 = new List<PlannedSection<T>>(); if (perGroup) { PlannedSection<T> plannedSection = new PlannedSection<T>(null); foreach (PlannedGroup item2 in list) { if (item2.Display == GroupDisplay.Stacked) { plannedSection.Tiles.Add(Stack(item2.Id, members[item2.Id])); } } if (plannedSection.Tiles.Count > 0) { list3.Add(plannedSection); } foreach (PlannedGroup item3 in list) { if (item3.Display != GroupDisplay.Stacked) { PlannedSection<T> plannedSection2 = new PlannedSection<T>(item3.Id); AddSingles(plannedSection2, item3.Id, members[item3.Id]); list3.Add(plannedSection2); } } if (biggestFirst) { for (int num = 1; num < list3.Count; num++) { PlannedSection<T> plannedSection3 = list3[num]; float num2 = Lasting(plannedSection3, timeLeft); int num3 = Width(plannedSection3.Tiles.Count, perLine); int num4 = num - 1; while (num4 >= 0 && (Width(list3[num4].Tiles.Count, perLine) < num3 || (Width(list3[num4].Tiles.Count, perLine) == num3 && Lasting(list3[num4], timeLeft) < num2))) { list3[num4 + 1] = list3[num4]; num4--; } list3[num4 + 1] = plannedSection3; } } return list3; } PlannedSection<T> plannedSection4 = new PlannedSection<T>(null); if (sortByGroup) { foreach (PlannedGroup item4 in list) { if (item4.Display == GroupDisplay.Stacked) { plannedSection4.Tiles.Add(Stack(item4.Id, members[item4.Id])); } else { AddSingles(plannedSection4, item4.Id, members[item4.Id]); } } } else { Dictionary<string, GroupDisplay> dictionary = new Dictionary<string, GroupDisplay>(); foreach (PlannedGroup item5 in list) { dictionary[item5.Id] = item5.Display; } HashSet<string> hashSet = new HashSet<string>(); foreach (T effect2 in effects) { PlannedGroup plannedGroup = groupOf(effect2); if (dictionary.TryGetValue(plannedGroup.Id, out var value2)) { if (value2 != GroupDisplay.Stacked) { PlannedTile<T> plannedTile = new PlannedTile<T>(plannedGroup.Id, stacked: false); plannedTile.Members.Add(effect2); plannedSection4.Tiles.Add(plannedTile); } else if (hashSet.Add(plannedGroup.Id)) { plannedSection4.Tiles.Add(Stack(plannedGroup.Id, members[plannedGroup.Id])); } } } } if (plannedSection4.Tiles.Count > 0) { list3.Add(plannedSection4); } return list3; } internal static void SortByTimeLeft<T>(List<PlannedSection<T>> sections, Func<T, float?> timeLeft, bool keepGroups, Func<T, bool>? worn = null) { foreach (PlannedSection<T> section in sections) { List<PlannedTile<T>> tiles = section.Tiles; for (int i = 1; i < tiles.Count; i++) { PlannedTile<T> plannedTile = tiles[i]; float num = TimeLeft(plannedTile, timeLeft, worn); int num2 = i - 1; while (num2 >= 0 && (!keepGroups || tiles[num2].GroupId == plannedTile.GroupId) && TimeLeft(tiles[num2], timeLeft, worn) > num) { tiles[num2 + 1] = tiles[num2]; num2--; } tiles[num2 + 1] = plannedTile; } } } internal static int LineCount(int count, int perLine) { if (count > 0) { return (count - 1) / Math.Max(1, perLine) + 1; } return 0; } internal static int LineSize(int count, int lines, int line) { return count / lines + ((line < count % lines) ? 1 : 0); } internal static string? MinutesOnly(float secondsLeft, int secondsUnderMinutes) { if (secondsUnderMinutes <= 0 || secondsLeft <= (float)secondsUnderMinutes * 60f) { return null; } return Math.Ceiling(secondsLeft / 60f) + "m"; } internal static string TimePattern(string time) { char[] array = time.ToCharArray(); for (int i = 0; i < array.Length; i++) { if (char.IsDigit(array[i])) { array[i] = '0'; } } string text = new string(array); if (text.Length >= "00:00".Length) { return text; } return "00:00"; } private static float TimeLeft<T>(PlannedTile<T> tile, Func<T, float?> timeLeft, Func<T, bool>? worn) { float num = float.PositiveInfinity; foreach (T member in tile.Members) { float num2 = timeLeft(member) ?? ((worn != null && worn(member)) ? float.PositiveInfinity : float.MaxValue); if (num2 < num) { num = num2; } } return num; } private static float Lasting<T>(List<T> statuses, Func<T, float?>? timeLeft) { if (timeLeft == null) { return 0f; } float num = float.MaxValue; foreach (T status in statuses) { num = Math.Min(num, timeLeft(status) ?? float.MaxValue); } return num; } private static float Lasting<T>(PlannedSection<T> section, Func<T, float?>? timeLeft) { if (timeLeft == null) { return 0f; } float num = float.MaxValue; foreach (PlannedTile<T> tile in section.Tiles) { float num2 = float.MinValue; foreach (T member in tile.Members) { num2 = Math.Max(num2, timeLeft(member) ?? float.MaxValue); } num = Math.Min(num, num2); } return num; } private static int Width(int count, int perLine) { if (count > 0) { return LineSize(count, LineCount(count, perLine), 0); } return 0; } private static int Shown<T>(PlannedGroup group, Dictionary<string, List<T>> members) { if (group.Display != GroupDisplay.Stacked) { return members[group.Id].Count; } return 1; } private static PlannedTile<T> Stack<T>(string groupId, List<T> effects) { PlannedTile<T> plannedTile = new PlannedTile<T>(groupId, effects.Count > 1); plannedTile.Members.AddRange(effects); return plannedTile; } private static void AddSingles<T>(PlannedSection<T> section, string groupId, List<T> effects) { foreach (T effect in effects) { PlannedTile<T> plannedTile = new PlannedTile<T>(groupId, stacked: false); plannedTile.Members.Add(effect); section.Tiles.Add(plannedTile); } } } internal static class GroupIcons { private const int Size = 64; internal static readonly Color Tint = new Color(0.95f, 0.92f, 0.85f, 1f); private static readonly Dictionary<string, Sprite> Cache = new Dictionary<string, Sprite>(StringComparer.OrdinalIgnoreCase); private static Sprite? _box; private static Sprite? _banner; internal const float BackDensity = 1.5f; private static readonly Vector2[] GlassTop = (Vector2[])(object)new Vector2[4] { new Vector2(17f, 11f), new Vector2(47f, 11f), new Vector2(34f, 32f), new Vector2(30f, 32f) }; private static readonly Vector2[] GlassBottom = (Vector2[])(object)new Vector2[4] { new Vector2(30f, 32f), new Vector2(34f, 32f), new Vector2(47f, 53f), new Vector2(17f, 53f) }; private static readonly Vector2[] SandTop = (Vector2[])(object)new Vector2[3] { new Vector2(25f, 22f), new Vector2(39f, 22f), new Vector2(32f, 31f) }; private static readonly Vector2[] SandBottom = (Vector2[])(object)new Vector2[3] { new Vector2(32f, 41f), new Vector2(42f, 53f), new Vector2(22f, 53f) }; internal static Sprite BoxSprite { get { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_box)) { return _box = Panel("StatusGroups_Box", new Color(0.2f, 0.2f, 0.2f, 0.5f)); } return _box; } } internal static Sprite BannerSprite { get { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_banner)) { return _banner = Panel("StatusGroups_Banner", new Color(0.12f, 0.12f, 0.12f, 0.6f)); } return _banner; } } internal static bool Has(string groupId) { return ShapeOf(groupId) != null; } internal static Sprite? Get(string groupId) { if (Cache.TryGetValue(groupId, out Sprite value) && Object.op_Implicit((Object)(object)value)) { return value; } Color[] array = Render(groupId); if (array == null) { return null; } value = ToSprite(array, "StatusGroups_" + groupId); Cache[groupId] = value; return value; } internal static Color[]? Render(string groupId) { Func<float, float, float> func = ShapeOf(groupId); if (func != null) { return Emblem(func); } return null; } private static Func<float, float, float>? ShapeOf(string groupId) { return groupId switch { "Buffs" => BottleShape, "Cooldowns" => HourglassShape, "Negatives" => ShieldShape, "Passive" => CampfireShape, _ => null, }; } private static Color[] Emblem(Func<float, float, float> shape) { //IL_0090: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) Color[] array = (Color[])(object)new Color[4096]; float[] array2 = new float[4096]; float[] array3 = new float[4096]; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { int num = i * 64 + j; array3[num] = shape((float)j + 0.5f, (float)i + 0.5f); array2[num] = Mathf.Clamp01(0.5f - array3[num]); } } float[] array4 = Blur(array2, 1); for (int k = 64; k < array4.Length; k++) { array[k] = Over(array[k], new Color(0f, 0f, 0f, array4[k - 64] * 0.7f)); } for (int l = 0; l < array2.Length; l++) { if (!(array2[l] <= 0f)) { float num2 = (float)(l / 64) + 0.5f; float num3 = Mathf.Lerp(1f, 0.78f, Mathf.Clamp01((num2 - 8f) / 48f)); num3 *= 0.8f + 0.2f * Mathf.Clamp01((0f - array3[l]) / 2.5f); array[l] = Over(array[l], new Color(num3, num3, num3, array2[l])); } } return array; } private static float BottleShape(float x, float y) { float num = Circle(x, y, 32f, 40f, 20.5f); float num2 = Box(x, y, 25.5f, 8f, 38.5f, 24f, 1.5f); float num3 = Box(x, y, 22f, 3f, 42f, 9.5f, 2.5f); float num4 = Mathf.Min(Mathf.Min(num, num2), num3); float num5 = Capsule(x, y, 20f, 24f, 44f, 24f, 1.3f); float num6 = Mathf.Max(Mathf.Max(Mathf.Abs(Circle(x, y, 32f, 40f, 14f)) - 1.6f, x - 29f), y - 39f); return Mathf.Max(num4, 0f - Mathf.Min(num5, num6)); } private static float HourglassShape(float x, float y) { float num = Mathf.Min(Box(x, y, 11f, 4f, 53f, 11f, 2f), Box(x, y, 11f, 53f, 53f, 60f, 2f)); float num2 = Mathf.Abs(Mathf.Min(Polygon(x, y, GlassTop), Polygon(x, y, GlassBottom))) - 1.8f; float num3 = Mathf.Min(Polygon(x, y, SandTop), Polygon(x, y, SandBottom)); float num4 = Capsule(x, y, 32f, 31f, 32f, 42f, 0.9f); return Mathf.Min(Mathf.Min(num, num2), Mathf.Min(num3, num4)); } private static float ShieldShape(float x, float y) { float num = Circle(x, y, 32f, 32f, 26f); float num2 = Mathf.Abs(Circle(x, y, 32f, 32f, 20f)) - 1.1f; float num3 = Mathf.Abs(Circle(x, y, 32f, 32f, 7f)) - 1.1f; float num4 = Mathf.Min(Mathf.Min(Capsule(x, y, 29f, 4f, 36f, 17f, 1.7f), Capsule(x, y, 36f, 17f, 27f, 29f, 1.7f)), Mathf.Min(Capsule(x, y, 27f, 29f, 37f, 43f, 1.7f), Capsule(x, y, 37f, 43f, 31f, 61f, 1.7f))); return Mathf.Max(num, 0f - Mathf.Min(Mathf.Min(num2, num3), num4)); } private static float CampfireShape(float x, float y) { float num = Flame(x, y, 32f, 37f, 13f, 5f); float num2 = Flame(x, y, 32f, 41f, 5.5f, 25f); float num3 = Mathf.Max(num, 0f - num2); float num4 = Mathf.Min(Capsule(x, y, 11f, 57f, 53f, 46f, 4f), Capsule(x, y, 11f, 46f, 53f, 57f, 4f)); num4 = Mathf.Max(num4, 0f - (Flame(x, y, 32f, 37f, 13f, 5f) - 2.5f)); return Mathf.Min(num3, num4); } private static float Flame(float x, float y, float cx, float cy, float r, float tip) { float num = Circle(x, y, cx, cy, r); if (y >= cy) { return num; } float num2 = Mathf.Clamp01((cy - y) / (cy - tip)); float num3 = r * Mathf.Sqrt(1f - num2) * (1f - 0.25f * num2); float num4 = Mathf.Sin(num2 * (float)Math.PI) * r * 0.15f; float num5 = Mathf.Abs(x - cx - num4) - num3; return Mathf.Max(Mathf.Min(num, num5), tip - y); } private static float Box(float x, float y, float x0, float y0, float x1, float y1, float r = 0f) { float num = Mathf.Abs(x - (x0 + x1) / 2f) - ((x1 - x0) / 2f - r); float num2 = Mathf.Abs(y - (y0 + y1) / 2f) - ((y1 - y0) / 2f - r); float num3 = Mathf.Max(num, 0f); float num4 = Mathf.Max(num2, 0f); return Mathf.Sqrt(num3 * num3 + num4 * num4) + Mathf.Min(Mathf.Max(num, num2), 0f) - r; } private static float Circle(float x, float y, float cx, float cy, float r) { return Mathf.Sqrt((x - cx) * (x - cx) + (y - cy) * (y - cy)) - r; } private static float Capsule(float x, float y, float ax, float ay, float bx, float by, float r) { float num = bx - ax; float num2 = by - ay; float num3 = num * num + num2 * num2; float num4 = ((num3 > 0f) ? Mathf.Clamp01(((x - ax) * num + (y - ay) * num2) / num3) : 0f); float num5 = ax + num4 * num - x; float num6 = ay + num4 * num2 - y; return Mathf.Sqrt(num5 * num5 + num6 * num6) - r; } private static float Polygon(float x, float y, Vector2[] points) { //IL_0017: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_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_0038: 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_0056: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) float num = float.MaxValue; bool flag = false; int num2 = 0; int num3 = points.Length - 1; while (num2 < points.Length) { Vector2 val = points[num3]; Vector2 val2 = points[num2]; num = Math.Min(num, Capsule(x, y, val.x, val.y, val2.x, val2.y, 0f)); if (val2.y > y != val.y > y && x < (val.x - val2.x) * (y - val2.y) / (val.y - val2.y) + val2.x) { flag = !flag; } num3 = num2++; } if (!flag) { return num; } return 0f - num; } private static Color Over(Color below, Color above) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0034: 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_0043: 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_0055: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0086: 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) float num = above.a + below.a * (1f - above.a); if (num <= 0f) { return Color.clear; } float num2 = below.a * (1f - above.a); return new Color((above.r * above.a + below.r * num2) / num, (above.g * above.a + below.g * num2) / num, (above.b * above.a + below.b * num2) / num, num); } private static float[] Blur(float[] values, int radius) { float[] array = values; for (int i = 0; i < 2; i++) { float[] array2 = new float[array.Length]; float[] array3 = new float[array.Length]; for (int j = 0; j < 64; j++) { for (int k = 0; k < 64; k++) { float num = 0f; for (int l = -radius; l <= radius; l++) { num += array[j * 64 + Mathf.Clamp(k + l, 0, 63)]; } array2[j * 64 + k] = num / (float)(2 * radius + 1); } } for (int m = 0; m < 64; m++) { for (int n = 0; n < 64; n++) { float num2 = 0f; for (int num3 = -radius; num3 <= radius; num3++) { num2 += array2[Mathf.Clamp(m + num3, 0, 63) * 64 + n]; } array3[m * 64 + n] = num2 / (float)(2 * radius + 1); } } array = array3; } return array; } private static Sprite Panel(string name, Color fill) { //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_008e: 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_009c: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0042: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) Color[] array = (Color[])(object)new Color[576]; for (int i = 0; i < 24; i++) { for (int j = 0; j < 24; j++) { float num = Box((float)j + 0.5f, (float)i + 0.5f, 0f, 0f, 24f, 24f, 5f); Color val = fill; val.a *= Mathf.Clamp01(0.5f - num); array[i * 24 + j] = val; } } Texture2D val2 = new Texture2D(24, 24, (TextureFormat)4, false) { name = name, filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)61 }; val2.SetPixels(array); val2.Apply(false, true); Sprite obj = Sprite.Create(val2, new Rect(0f, 0f, 24f, 24f), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, new Vector4(8f, 8f, 8f, 8f)); ((Object)obj).name = name; ((Object)obj).hideFlags = (HideFlags)61; return obj; } private static Sprite ToSprite(Color[] pixels, string name) { //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_003c: 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_004a: 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_0059: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown Color[] array = (Color[])(object)new Color[pixels.Length]; for (int i = 0; i < 64; i++) { Array.Copy(pixels, i * 64, array, (63 - i) * 64, 64); } Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false) { name = name, filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)61 }; val.SetPixels(array); val.Apply(false, true); Sprite obj = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f), 100f); ((Object)obj).name = name; ((Object)obj).hideFlags = (HideFlags)61; return obj; } } internal static class GroupRegistry { internal const string Buffs = "Buffs"; internal const string Cooldowns = "Cooldowns"; internal const string Negatives = "Negatives"; internal const string Passive = "Passive"; internal const int RuleGroupOrder = 5000; private static readonly Dictionary<string, int> KnownOrders = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase) { ["TempestRite Domain"] = 200, ["TempestRite World"] = 500 }; private static readonly Dictionary<string, StatusGroup> ById = new Dictionary<string, StatusGroup>(StringComparer.OrdinalIgnoreCase); internal static int Version { get; private set; } internal static void AddBuiltIn() { Add("Buffs", () => "Buffs", 100); Add("Cooldowns", () => "Cooldowns", 800); Add("Negatives", () => "Negatives", 1000); Add("Passive", () => "Passive", 400); string[] array = new string[4] { "Buffs", "Cooldowns", "Negatives", "Passive" }; foreach (string id in array) { StatusGroup statusGroup = ById[id]; statusGroup.IconSource = () => GroupIcons.Get(id); statusGroup.IconTinted = true; } } internal static StatusGroup Add(string id, Func<string> name, int order, GroupDisplay display = GroupDisplay.Default) { id = CleanId(id); if (ById.TryGetValue(id, out StatusGroup value)) { value.NameSource = name; Version++; return value; } if (KnownOrders.TryGetValue(id, out var value2)) { order = value2; } ConfigEntry<GroupDisplay> val = ConfigOptions.Config("2 - Groups", id + " Display", display, Constants.Groups.GroupSettings.Display(id)); ConfigEntry<string> val2 = ConfigOptions.Config("2 - Groups", id + " Name", string.Empty, Constants.Groups.GroupSettings.Name(id)); ConfigEntry<int> val3 = ConfigOptions.Config("2 - Groups", id + " Order", order, Constants.Groups.GroupSettings.Order(id)); ConfigEntry<string> val4 = ConfigOptions.Config("2 - Groups", id + " Icon", string.Empty, Constants.Groups.GroupSettings.Icon(id)); val.SettingChanged += delegate { Version++; }; val2.SettingChanged += delegate { Version++; }; val3.SettingChanged += delegate { Version++; }; val4.SettingChanged += delegate { Version++; }; StatusGroup statusGroup = new StatusGroup(id, name, order, val, val2, val3, val4); ById[id] = statusGroup; Version++; return statusGroup; } internal static StatusGroup Get(string id) { id = CleanId(id); if (ById.TryGetValue(id, out StatusGroup value)) { return value; } string name = id; return Add(id, () => name, 5000); } internal static bool Exists(string id) { return ById.ContainsKey(CleanId(id)); } internal static void Touch() { Version++; } internal static string CleanId(string id) { char[] array = id.Trim().ToCharArray(); for (int i = 0; i < array.Length; i++) { bool flag; switch (array[i]) { case '\t': case '\n': case '\r': case '"': case '\'': case '=': case '[': case '\\': case ']': flag = true; break; default: flag = false; break; } if (flag) { array[i] = '_'; } } string text = new string(array).Trim(); if (text.Length != 0) { return text; } return "Passive"; } } internal static class StatusBoard { private struct Style { internal float Scale; internal int PerLine; internal bool Names; internal float NameWidth; internal bool Captions; internal bool Markers; internal bool Boxes; internal float FontSize; internal float GroupFontSize; internal float TimeFontSize; internal float EndingSoonFontSize; internal Color Color; } private sealed class SlotLook { private static readonly Color SlotTint = new Color(0f, 0f, 0f, 0.45f); private static readonly Color BannerTint = new Color(0f, 0f, 0f, 0.6f); internal Sprite Sprite; internal Type Type; internal Color Color; internal Color BannerColor; internal float Density; internal float Size; internal static SlotLook? Find(Hud hud) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00d7: Unknown result type (might be due to invalid IL or missing references) HotkeyBar componentInChildren = ((Component)hud).GetComponentInChildren<HotkeyBar>(true); GameObject val = (Object.op_Implicit((Object)(object)componentInChildren) ? componentInChildren.m_elementPrefab : null); if (!Object.op_Implicit((Object)(object)val)) { return null; } Image val2 = val.GetComponent<Image>(); if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)val2.sprite)) { val2 = null; Image[] componentsInChildren = val.GetComponentsInChildren<Image>(true); foreach (Image val3 in componentsInChildren) { if (Object.op_Implicit((Object)(object)val3.sprite) && ((Object)val3).name.IndexOf("icon", StringComparison.OrdinalIgnoreCase) < 0) { val2 = val3; break; } } } if (!Object.op_Implicit((Object)(object)val2)) { return null; } Rect rect = ((Graphic)val2).rectTransform.rect; return new SlotLook { Sprite = val2.sprite, Type = (Type)(((int)val2.type != 0) ? 1 : 0), Color = SlotTint, BannerColor = BannerTint, Density = val2.pixelsPerUnitMultiplier, Size = ((Mathf.Min(((Rect)(ref rect)).width, ((Rect)(ref rect)).height) > 8f) ? Mathf.Min(((Rect)(ref rect)).width, ((Rect)(ref rect)).height) : 70f) }; } } private sealed class Caption(TMP_Text text) { private string? _measured; internal float Width { get; private set; } internal float Height { get; private set; } internal void Set(string value, float fontSize, Color color, TextAlignmentOptions alignment) { //IL_003f: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0082: Unknown result type (might be due to invalid IL or missing references) if (!((Component)text).gameObject.activeSelf) { ((Component)text).gameObject.SetActive(true); } if (SetFontSize(text, fontSize)) { _measured = null; } SetText(text, value, color); SetAlignment(text, alignment); if (!(_measured == value)) { _measured = value; Vector2 val = Measure(text, value); Width = val.x; Height = val.y; } } internal void Place(Vector2 position, Vector2 size, float pivotX) { //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_0041: 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_0030: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(pivotX, 0f); if (text.rectTransform.pivot != val) { text.rectTransform.pivot = val; } SetPosition(text.rectTransform, position); SetSize(text.rectTransform, size); } internal void Hide() { if (((Component)text).gameObject.activeSelf) { ((Component)text).gameObject.SetActive(false); } } } private sealed class Label(TMP_Text name, TMP_Text time) { private bool _measured; private string? _measuredName; private string? _lastTime; private string? _measuredPattern; private float _heightFor = -1f; private float _height; private float? _endingSoonSize; private float _timeFontSize; internal float NameWidth { get; private set; } internal float TimeWidth { get; private set; } internal float TimeHeight { get; private set; } internal void Set(string? text, string? timeText, float fontSize, float timeFontSize, Color color, Color timeColor, float? endingSoonSize) { //IL_00d3: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) _endingSoonSize = endingSoonSize; _timeFontSize = timeFontSize; if (((Component)name).gameObject.activeSelf != (text != null)) { ((Component)name).gameObject.SetActive(text != null); } if (((Component)time).gameObject.activeSelf != (timeText != null)) { ((Component)time).gameObject.SetActive(timeText != null); } if ((SetFontSize(name, fontSize) | SetFontSize(time, timeFontSize)) || !_measured) { _measured = true; _measuredName = (_measuredPattern = (_lastTime = null)); float nameWidth = (TimeWidth = 0f); NameWidth = nameWidth; _heightFor = -1f; TimeHeight = Measure(time, "00:00").y; } SetText(name, text ?? string.Empty, color); SetText(time, timeText ?? string.Empty, timeColor); if (_measuredName != text) { _measuredName = text; NameWidth = ((text == null) ? 0f : Measure(name, text).x); _heightFor = -1f; } if (_lastTime != timeText) { _lastTime = timeText; string text2 = ((timeText == null) ? null : BoardPlan.TimePattern(timeText)); if (_measuredPattern != text2) { _measuredPattern = text2; TimeWidth = ((text2 == null) ? 0f : Measure(time, text2).x); } } } internal float Height(float width) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!Mathf.Approximately(_heightFor, width)) { _heightFor = width; _height = ((_measuredName == null) ? 0f : Mathf.Ceil(name.GetPreferredValues(name.text, width, 0f).y)); } return _height; } internal void PlaceUnder(float center, float top, float width, float timeHeight, float nameHeight) { //IL_004c: 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_006e: 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) float num = center - width * 0.5f; SetScale(time.rectTransform, 1f); SetAlignment(time, (TextAlignmentOptions)258); SetAlignment(name, (TextAlignmentOptions)258); Fit(time.rectTransform, new Vector2(num, top), new Vector2(width, timeHeight)); Fit(name.rectTransform, new Vector2(num, top - timeHeight), new Vector2(width, nameHeight)); } internal void PlaceOn(float center, float boxBottom, float width, float timeHeight, float nameHeight, float boxWidth, float boxHeight) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) float num = center - width * 0.5f; SetAlignment(name, (TextAlignmentOptions)258); Fit(name.rectTransform, new Vector2(num, boxBottom), new Vector2(width, nameHeight)); float num2 = boxWidth * 0.06f; float num3 = boxWidth - num2 * 2f; float? endingSoonSize = _endingSoonSize; if (endingSoonSize.HasValue) { float valueOrDefault = endingSoonSize.GetValueOrDefault(); if (TimeWidth > 0f && TimeHeight > 0f) { float num4 = ((valueOrDefault > 0f && _timeFontSize > 0f) ? (valueOrDefault / _timeFontSize) : Mathf.Max(1f, Mathf.Min(num3 / TimeWidth, (boxHeight - num2 * 2f) / TimeHeight))); SetAlignment(time, (TextAlignmentOptions)514); SetScale(time.rectTransform, num4); float num5 = boxBottom + boxHeight * 0.5f; Fit(time.rectTransform, new Vector2(center - TimeWidth * num4 * 0.5f, num5 + TimeHeight * num4 * 0.5f), new Vector2(TimeWidth, TimeHeight)); return; } } float num6 = ((TimeWidth > 0f) ? Mathf.Min(1f, num3 / TimeWidth) : 1f); SetScale(time.rectTransform, num6); SetAlignment(time, (TextAlignmentOptions)1026); Fit(time.rectTransform, new Vector2(center - boxWidth * 0.5f, boxBottom + num2 + timeHeight * num6), new Vector2(boxWidth / num6, timeHeight)); } private static void SetScale(RectTransform rect, float scale) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(scale, scale, 1f); if (((Transform)rect).localScale != val) { ((Transform)rect).localScale = val; } } internal void Hide() { if (((Component)name).gameObject.activeSelf) { ((Component)name).gameObject.SetActive(false); } if (((Component)time).gameObject.activeSelf) { ((Component)time).gameObject.SetActive(false); } } private static void Fit(RectTransform rect, Vector2 position, Vector2 size) { //IL_0001: 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) SetPosition(rect, position); SetSize(rect, size); } } private sealed class TileView { internal RectTransform Root; internal Image Icon; internal GameObject? Cooldown; internal TMP_Text? Name; internal TMP_Text? Time; internal TMP_Text? Count; internal TMP_Text? Shield; internal Animator? Animator; internal static TileView Create(Hud hud, RectTransform parent) { //IL_001f: 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_002f: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0088: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: 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_01eb: Unknown result type (might be due to invalid IL or missing references) RectTransform statusEffectTemplate = hud.m_statusEffectTemplate; RectTransform val = (RectTransform)new GameObject("StatusGroups_Tile", new Type[1] { typeof(RectTransform) }).transform; ((Transform)val).SetParent((Transform)(object)parent, false); val.anchorMin = statusEffectTemplate.anchorMin; val.anchorMax = statusEffectTemplate.anchorMax; val.pivot = statusEffectTemplate.pivot; val.sizeDelta = statusEffectTemplate.sizeDelta; RectTransform val2 = Object.Instantiate<RectTransform>(statusEffectTemplate, (Transform)(object)val); ((Object)((Component)val2).gameObject).name = "StatusGroups_Status"; Vector2 anchorMin = (val2.anchorMax = statusEffectTemplate.pivot); val2.anchorMin = anchorMin; val2.anchoredPosition = Vector2.zero; ((Transform)val2).localScale = Vector3.one; ((Component)val2).gameObject.SetActive(true); TileView obj = new TileView { Root = val, Icon = ((Component)((Transform)val2).Find("Icon")).GetComponent<Image>() }; Transform val3 = ((Transform)val2).Find("Cooldown"); obj.Cooldown = ((val3 != null) ? ((Component)val3).gameObject : null); Transform val4 = ((Transform)val2).Find("TimeText"); obj.Time = ((val4 != null) ? ((Component)val4).GetComponent<TMP_Text>() : null); obj.Animator = ((Component)val2).GetComponentInChildren<Animator>(true); TileView tileView = obj; if (Object.op_Implicit((Object)(object)tileView.Animator)) { tileView.Animator.keepAnimatorStateOnDisable = true; } tileView.Icon.preserveAspect = true; Transform val5 = ((Transform)val2).Find("Name"); TMP_Text? name; if (val5 != null) { TMP_Text component = ((Component)val5).GetComponent<TMP_Text>(); if (component != null) { name = component; goto IL_017e; } } name = FirstTextBut((Transform)(object)val2, tileView.Time); goto IL_017e; IL_017e: tileView.Name = name; tileView.Count = Badge(tileView, "StatusGroups_Count", Vector2.one, new Vector2(4f, 4f), new Vector2(32f, 20f), (TextAlignmentOptions)260); tileView.Shield = Badge(tileView, "StatusGroups_Shield", new Vector2(0.5f, 1f), new Vector2(0f, 4f), new Vector2(64f, 20f), (TextAlignmentOptions)258); return tileView; } private static TMP_Text? FirstTextBut(Transform root, TMP_Text? not) { TMP_Text[] componentsInChildren = ((Component)root).GetComponentsInChildren<TMP_Text>(true); foreach (TMP_Text val in componentsInChildren) { if ((Object)(object)val != (Object)(object)not) { return val; } } return null; } private static TMP_Text? Badge(TileView tile, string name, Vector2 corner, Vector2 offset, Vector2 size, TextAlignmentOptions alignment) { //IL_0058: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_0097: 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_00a6: 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_00b4: 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) TMP_Text val = (Object.op_Implicit((Object)(object)tile.Time) ? tile.Time : tile.Name); if (!Object.op_Implicit((Object)(object)val)) { return null; } TMP_Text val2 = Object.Instantiate<TMP_Text>(val, ((Component)tile.Icon).transform); ((Object)((Component)val2).gameObject).name = name; foreach (Transform item in val2.transform) { Object.Destroy((Object)(object)((Component)item).gameObject); } RectTransform rectTransform = val2.rectTransform; Vector2 val3 = (rectTransform.pivot = corner); Vector2 anchorMin = (rectTransform.anchorMax = val3); rectTransform.anchorMin = anchorMin; rectTransform.anchoredPosition = offset; rectTransform.sizeDelta = size; ((Transform)rectTransform).localScale = Vector3.one; val2.enableAutoSizing = false; val2.alignment = alignment; val2.textWrappingMode = (TextWrappingModes)0; val2.overflowMode = (TextOverflowModes)0; ((Graphic)val2).raycastTarget = false; val2.text = string.Empty; ((Component)val2).gameObject.SetActive(false); return val2; } } private sealed class Metrics { internal Rect Icon; internal Vector2 Anchor; internal TMP_FontAsset? Font; internal Material? FontMaterial; private static readonly Vector3[] Corners = (Vector3[])(object)new Vector3[4]; internal static Metrics Measure(TileView tile, Hud hud) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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) RectTransform root = tile.Root; ((Transform)root).localScale = Vector3.one; TMP_Text val = null; if (hud.m_foodTime != null) { TMP_Text[] foodTime = hud.m_foodTime; foreach (TMP_Text val2 in foodTime) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.font)) { val = val2; break; } } } if (!Object.op_Implicit((Object)(object)val)) { val = (Object.op_Implicit((Object)(object)tile.Name) ? tile.Name : tile.Time); } return new Metrics { Icon = Local(root, ((Graphic)tile.Icon).rectTransform), Anchor = root.anchorMin, Font = (Object.op_Implicit((Object)(object)val) ? val.font : null), FontMaterial = (Object.op_Implicit((Object)(object)val) ? val.fontSharedMaterial : null) }; } private static Rect Local(RectTransform root, RectTransform part) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_0022: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_003f: 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_0041: 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_0047: 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_0049: 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_0057: 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_0063: 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_006f: Unknown result type (might be due to invalid IL or missing references) part.GetWorldCorners(Corners); Vector2 val = Vector2.op_Implicit(((Transform)root).InverseTransformPoint(Corners[0])); Vector2 val2 = val; for (int i = 1; i < 4; i++) { Vector2 val3 = Vector2.op_Implicit(((Transform)root).InverseTransformPoint(Corners[i])); val = Vector2.Min(val, val3); val2 = Vector2.Max(val2, val3); } return Rect.MinMaxRect(val.x, val.y, val2.x, val2.y); } } private const string Feature = "Status layout"; private const string RootName = "StatusGroups_Board"; private const float RightPad = 4f; private const float IconGap = 4f; private const float SectionGap = 8f; private const float CaptionGap = 2f; private const float MarkerScale = 0.8f; private const float MarkerGap = 6f; private const float BoxPad = 0.14f; private const float BoxTextInset = 0.06f; private const float BoxBadgeInset = 0.03f; private const float BannerIconScale = 0.6f; private static readonly Color FlashColor = new Color(1f, 0.5f, 0.5f, 1f); private const float EndingSoon = 60f; private static readonly Color EndingSoonColor = new Color(1f, 0.25f, 0.25f, 1f); private static readonly Color ShieldColor = new Color(1f, 0.3f, 0.3f, 1f); private static readonly Color HandleColor = new Color(0f, 0f, 0f, 0.4f); private static readonly Color HandleBorder = new Color(1f, 0.8f, 0.45f, 0.6f); private const float HandlePad = 4f; private static Hud? _hud; private static RectTransform? _root; private static Metrics? _metrics; private static BoardMover? _mover; private static RectTransform? _handle; private static readonly List<TileView> Tiles = new List<TileView>(); private static readonly List<Label> Labels = new List<Label>(); private static readonly List<Caption> Captions = new List<Caption>(); private static readonly List<TileView> Markers = new List<TileView>(); private static RectTransform? _backs; private static readonly List<Image> Backs = new List<Image>(); private static SlotLook? _slot; private static readonly Dictionary<string, StatusEffect?> IconStatuses = new Dictionary<string, StatusEffect>(StringComparer.OrdinalIgnoreCase); private static ObjectDB? _iconDb; private static int _iconDbCount = -1; private static List<PlannedSection<StatusEffect>> _plan = new List<PlannedSection<StatusEffect>>(); private static readonly List<StatusEffect> PlannedFor = new List<StatusEffect>(); private static int _planKey = int.MinValue; private static readonly Dictionary<TMP_Text, float> BadgeRoom = new Dictionary<TMP_Text, float>(); internal static bool Draw(Hud hud, List<StatusEffect> effects) { if (PatchGuard.IsDisabled("Status layout")) { return true; } StatusLayout value = PluginConfig.Layout.Value; if (value == StatusLayout.Vanilla) { if (Object.op_Implicit((Object)(object)_root)) { Dispose(); } return true; } try { Render(hud, effects, value); return false; } catch (Exception exception) { PatchGuard.Fail("Status layout", exception); Dispose(); return true; } } internal static void Dispose() { if (Object.op_Implicit((Object)(object)_root)) { Object.Destroy((Object)(object)((Component)_root).gameObject); } _root = null; _hud = null; _metrics = null; _mover = null; _handle = null; Tiles.Clear(); Labels.Clear(); Captions.Clear(); Markers.Clear(); Backs.Clear(); _backs = null; _slot = null; BadgeRoom.Clear(); _plan = new List<PlannedSection<StatusEffect>>(); PlannedFor.Clear(); _planKey = int.MinValue; } private static void Render(Hud hud, List<StatusEffect> effects, StatusLayout layout) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_hud != (Object)(object)hud || !Object.op_Implicit((Object)(object)_root)) { Create(hud); } RemoveGameList(hud); if (!BoardMover.CanMove) { _mover.Finish(); } if (!_mover.Dragging) { SetPosition(_root, PluginConfig.Position.Value); } Player player = Player.m_localPlayer; if (!Object.op_Implicit((Object)(object)player)) { return; } bool flag = PluginConfig.SortByGroup.IsOn(); bool flag2 = PluginConfig.SplitByGroup.IsOn(); bool flag3 = PluginConfig.BiggestFirst.IsOn(); int num = Mathf.Max(1, PluginConfig.PerLine.Value); bool expand = PluginConfig.ExpandInMenu.IsOn() && Menu.IsVisible(); int num2 = PlanKey(layout, flag, flag2, flag3, expand) * 31 + num; if (num2 != _planKey || !SameEffects(effects)) { _planKey = num2; PlannedFor.Clear(); PlannedFor.AddRange(effects); _plan = BoardPlan.Plan(effects, delegate(StatusEffect effect) { StatusGroup statusGroup = StatusClassifier.GroupOf(effect, player); GroupDisplay groupDisplay = BoardPlan.Resolve(statusGroup.Display.Value, layout); if (expand && groupDisplay == GroupDisplay.Stacked) { groupDisplay = GroupDisplay.Expanded; } return new PlannedGroup(statusGroup.Id, statusGroup.Order.Value, groupDisplay); }, flag2, flag, flag3, TimeLeft, num); _planKey = PlanKey(layout, flag, flag2, flag3, expand) * 31 + num; } BoardPlan.SortByTimeLeft(_plan, TimeLeft, flag && !flag2, StatusClassifier.IsWorn); PlaceIcons(new Style { Scale = PluginConfig.IconSize.Value, PerLine = Mathf.Max(1, PluginConfig.PerLine.Value), Names = PluginConfig.ShowNames.IsOn(), NameWidth = PluginConfig.NameWidth.Value, Captions = (flag2 && PluginConfig.ShowGroupNames.IsOn()), Markers = (flag2 && PluginConfig.ShowGroupIcons.IsOn()), Boxes = PluginConfig.StatusBoxes.IsOn(), FontSize = PluginConfig.FontSize.Value, GroupFontSize = PluginConfig.GroupFontSize.Value, TimeFontSize = PluginConfig.TimeFontSize.Value, EndingSoonFontSize = PluginConfig.EndingSoonFontSize.Value, Color = PluginConfig.TextColor.Value }); } private static float? TimeLeft(StatusEffect effect) { if (!(effect.m_ttl > 0f)) { return null; } return effect.GetRemaningTime(); } private static int PlanKey(StatusLayout layout, bool sort, bool split, bool biggest, bool expand) { return (((((int)layout * 2 + (sort ? 1 : 0)) * 2 + (split ? 1 : 0)) * 2 + (biggest ? 1 : 0)) * 2 + (expand ? 1 : 0)) * 7919 + StatusClassifier.Version; } private static bool SameEffects(List<StatusEffect> effects) { if (effects.Count != PlannedFor.Count) { return false; } for (int i = 0; i < effects.Count; i++) { if (effects[i] != PlannedFor[i]) { return false; } } return true; } private static int ShowAll(Style style) { //IL_0065: 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) int num = 0; foreach (PlannedSection<StatusEffect> item in _plan) { foreach (PlannedTile<StatusEffect> tile in item.Tiles) { Show(Tile(num), tile, style, out string name, out string time, out Color timeColor, out bool endingSoon); LabelAt(num).Set(style.Names ? name : null, time, style.FontSize, style.TimeFontSize, style.Color, timeColor, endingSoon ? new float?(style.EndingSoonFontSize) : ((float?)null)); num++; } } return num; } private static void PlaceIcons(Style style) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: 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_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_033a: 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_03d0: Unknown result type (might be due to invalid IL or missing references) Rect icon = _metrics.Icon; float scale = style.Scale; float num = ((Rect)(ref icon)).width * scale; float num2 = ((Rect)(ref icon)).height * scale; int num3 = ShowAll(style); bool boxes = style.Boxes; float num4 = (boxes ? (0.14f * num) : 0f); float num5 = num + num4 * 2f; float num6 = num2 + num4 * 2f; float num7 = num5; float num8 = 0f; for (int i = 0; i < num3; i++) { Label label = Labels[i]; num7 = Mathf.Max(new float[3] { num7, boxes ? 0f : label.TimeWidth, Mathf.Min(label.NameWidth, style.NameWidth) }); num8 = Mathf.Max(num8, label.TimeHeight); } float num9 = num7 + 4f * scale; float num10 = -4f + ((Rect)(ref icon)).xMax * scale; float num11 = scale * (boxes ? 0.6f : 0.8f); float num12 = ((Rect)(ref icon)).width * num11; float num13 = (boxes ? (num12 + num4 * 2f) : num12); bool flag = style.Markers && _plan.Exists((PlannedSection<StatusEffect> section) => section.Caption != null && section.Tiles.Count > 0); float num14 = (flag ? (num10 - num13 - 6f) : num10); float num15 = ((Rect)(ref icon)).yMax * scale; Rect bounds = default(Rect); bool any = false; int num16 = 0; int captionIndex = 0; int markerIndex = 0; int backIndex = 0; Vector2 center = default(Vector2); foreach (PlannedSection<StatusEffect> item in _plan) { int count = item.Tiles.Count; if (count == 0) { continue; } int num17 = BoardPlan.LineCount(count, style.PerLine); if (style.Captions && item.Caption != null) { Caption caption = CaptionAt(captionIndex++, item.Caption, style, (TextAlignmentOptions)1028); float num18 = Mathf.Max((float)BoardPlan.LineSize(count, num17, 0) * num9 - 4f * scale, caption.Width); float num19 = num15 - caption.Height; caption.Place(new Vector2(num14, num19), new Vector2(num18, caption.Height), 1f); Grow(ref bounds, ref any, Rect.MinMaxRect(num14 - num18, num19, num14, num15)); num15 = num19 - 2f; } float num20 = num15; for (int num21 = 0; num21 < num17; num21++) { int num22 = BoardPlan.LineSize(count, num17, num21); float num23 = 0f; if (style.Names) { for (int num24 = 0; num24 < num22; num24++) { num23 = Mathf.Max(num23, Labels[num16 + num24].Height(num7)); } } float num25 = (boxes ? (num6 + num23) : (num2 + num8 + num23)); for (int num26 = 0; num26 < num22; num26++) { float num27 = num14 - (float)(num22 - 1 - num26) * num9; float num28 = num27 - num7 * 0.5f; PlaceTile(Tiles[num16], new Vector2(num28 - ((Rect)(ref icon)).center.x * scale, num15 - num4 - ((Rect)(ref icon)).yMax * scale), scale); if (boxes) { PlaceBack(BackAt(backIndex++, banner: false), Rect.MinMaxRect(num28 - num5 * 0.5f, num15 - num6, num28 + num5 * 0.5f, num15)); Labels[num16].PlaceOn(num28, num15 - num6, num7, num8, num23, num5, num6); } else { Labels[num16].PlaceUnder(num28, num15 - num2, num7, num8, num23); } Grow(ref bounds, ref any, Rect.MinMaxRect(num27 - num7, num15 - num25, num27, num15)); num16++; } num15 -= num25 + 4f * scale; } float num29 = num15 + 4f * scale; if (flag && item.Caption != null) { if (boxes) { Rect val = Rect.MinMaxRect(num10 - num13, num29, num10, num20); PlaceBack(BackAt(backIndex++, banner: true), val); Grow(ref bounds, ref any, val); center = ((Rect)(ref val)).center; } else { ((Vector2)(ref center))..ctor(num10 - num12 * 0.5f, num20 - num2 * 0.5f); } PlaceMarker(MarkerAt(markerIndex++), item, center, num11); Grow(ref bounds, ref any, Rect.MinMaxRect(center.x - num12 * 0.5f, center.y - num12 * 0.5f, center.x + num12 * 0.5f, center.y + num12 * 0.5f)); } num15 -= 8f; } HideRest(num16, captionIndex, markerIndex, backIndex); PlaceHandle(any && (BoardMover.CanMove || _mover.Dragging), bounds, 4f); } private static void PlaceTile(TileView tile, Vector2 position, float scale) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0031: Unknown result type (might be due to invalid IL or missing references) SetPosition(tile.Root, position); Vector3 val = Vector3.one * scale; if (((Transform)tile.Root).localScale != val) { ((Transform)tile.Root).localScale = val; } } private static void HideRest(int tileIndex, int captionIndex, int markerIndex, int backIndex) { for (int i = backIndex; i < Backs.Count; i++) { if (((Component)Backs[i]).gameObject.activeSelf) { ((Component)Backs[i]).gameObject.SetActive(false); } } for (int j = markerIndex; j < Markers.Count; j++) { if (((Component)Markers[j].Root).gameObject.activeSelf) { ((Component)Markers[j].Root).gameObject.SetActive(false); } } for (int k = tileIndex; k < Tiles.Count; k++) { if (((Component)Tiles[k].Root).gameObject.activeSelf) { ((Component)Tiles[k].Root).gameObject.SetActive(false); } } for (int l = tileIndex; l < Labels.Count; l++) { Labels[l].Hide(); } for (int m = captionIndex; m < Captions.Count; m++) { Captions[m].Hide(); } } private static void Grow(ref Rect bounds, ref bool any, Rect part) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) bounds = (any ? Rect.MinMaxRect(Mathf.Min(((Rect)(ref bounds)).xMin, ((Rect)(ref part)).xMin), Mathf.Min(((Rect)(ref bounds)).yMin, ((Rect)(ref part)).yMin), Mathf.Max(((Rect)(ref bounds)).xMax, ((Rect)(ref part)).xMax), Mathf.Max(((Rect)(ref bounds)).yMax, ((Rect)(ref part)).yMax)) : part); any = true; } private static void PlaceHandle(bool show, Rect bounds, float pad) { //IL_0037: 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_0075: Unknown result type (might be due to invalid IL or missing references) RectTransform handle = _handle; if (((Component)handle).gameObject.activeSelf != show) { ((Component)handle).gameObject.SetActive(show); } if (show) { SetPosition(handle, new Vector2(((Rect)(ref bounds)).xMin - pad, ((Rect)(ref bounds)).yMin - pad)); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(((Rect)(ref bounds)).width + pad * 2f, ((Rect)(ref bounds)).height + pad * 2f); if (handle.sizeDelta != val) { handle.sizeDelta = val; } } } private static void PlaceMarker(TileView tile, PlannedSection<StatusEffect> section, Vector2 center, float scale) { //IL_00e3: 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_00e8: 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_00f5: 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_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0222: 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_022b: 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) Sprite val = null; bool flag = false; bool flag2 = false; StatusGroup statusGroup = GroupRegistry.Get(section.Caption); string text = statusGroup.Icon.Value.Trim(); if (text.Length > 0) { StatusEffect val2 = FindStatus(text); if (val2 != null && Object.op_Implicit((Object)(object)val2.m_icon)) { val = val2.m_icon; flag = val2.m_cooldownIcon; } } if (!Object.op_Implicit((Object)(object)val) && statusGroup.IconSource != null) { try { val = statusGroup.IconSource(); } catch (Exception) { val = null; } flag2 = Object.op_Implicit((Object)(object)val) && statusGroup.IconTinted; } if (!Object.op_Implicit((Object)(object)val)) { StatusEffect obj = section.Tiles[0].Members[0]; val = obj.m_icon; flag = obj.m_cooldownIcon; } if ((Object)(object)tile.Icon.sprite != (Object)(object)val) { tile.Icon.sprite = val; } Color val3 = (flag2 ? GroupIcons.Tint : Color.white); if (((Graphic)tile.Icon).color != va