Decompiled source of TabStyle v1.0.5
TabStyle.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Photon.Pun; using Photon.Realtime; using TMPro; using TabInfo; using TabInfo.Utils; using UnboundLib; using UnboundLib.Extensions; using UnboundLib.GameModes; using UnboundLib.Utils; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = "")] [assembly: AssemblyVersion("0.0.0.0")] namespace TabStyle; internal static class CatInfoBridge { private static PropertyInfo setting; private static readonly List<object> flagHolders = new List<object>(); private static FieldInfo flagField; private static bool searched; internal static bool Available { get { Find(); if (setting != null) { return flagHolders.Count > 0; } return false; } } internal static bool Value { get { if (!Available) { return false; } try { return (bool)setting.GetValue(null, null); } catch { return false; } } } internal static void Set(bool value) { if (Available) { try { setting.SetValue(null, value, null); } catch (Exception ex) { TabStyle.Log.LogWarning((object)("Couldn't save CatInfo's setting: " + ex.Message)); } Apply(value); } } internal static void Sync() { if (Available) { Apply(Value); } } private static void Apply(bool value) { foreach (object flagHolder in flagHolders) { try { flagField.SetValue(flagHolder, value); } catch { } } } private static void Find() { if (searched) { return; } try { Type type = AccessTools.TypeByName("CatInfo.CatInfo"); if (type == null) { searched = true; return; } setting = AccessTools.Property(type, "AllwaysShowStats"); if (setting == null || setting.PropertyType != typeof(bool)) { setting = null; searched = true; return; } FieldInfo fieldInfo = AccessTools.Field(typeof(Stat), "displayCondition"); if (fieldInfo == null) { searched = true; return; } Assembly assembly = type.Assembly; HashSet<object> hashSet = new HashSet<object>(); bool flag = false; foreach (StatCategory value in TabInfoManager.Categories.Values) { foreach (Stat value2 in value.Stats.Values) { if (!(fieldInfo.GetValue(value2) is Delegate obj)) { continue; } object target = obj.Target; if (target == null || target.GetType().Assembly != assembly) { continue; } flag = true; FieldInfo fieldInfo2 = AccessTools.Field(target.GetType(), "ASS"); if (!(fieldInfo2 == null) && !(fieldInfo2.FieldType != typeof(bool)) && !fieldInfo2.IsStatic) { flagField = fieldInfo2; if (hashSet.Add(target)) { flagHolders.Add(target); } } } } if (flag) { searched = true; } if (flag && flagHolders.Count == 0) { TabStyle.Log.LogInfo((object)"CatInfo found, but its 'Always Show Stats' switch couldn't be reached. The ALL STATS toggle is hidden."); } } catch (Exception ex) { searched = true; setting = null; flagHolders.Clear(); TabStyle.Log.LogWarning((object)("CatInfo hookup skipped: " + ex.Message)); } } } internal static class Mode { internal static bool Styled { get { if (TabStyleUI.Ready) { return TabStyle.LayoutSetting.Value != LayoutKind.Original; } return false; } } } [HarmonyPatch(typeof(TabInfoManager), "ToggleTabFrame")] internal static class ToggleTabFramePatch { [HarmonyPriority(800)] private static bool Prefix() { if (!Mode.Styled) { return true; } TabStyleUI.Instance.Toggle(); return false; } private static void Postfix() { if (TabStyleUI.Ready && TabStyle.LayoutSetting.Value == LayoutKind.Original) { OriginalMode.Attach(); } } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] internal static class IsLockingInputPatch { [HarmonyPriority(800)] private static bool Prefix(ref bool __result) { if (!Mode.Styled) { return true; } __result = TabStyleUI.Instance.IsOpen || TabStyleUI.Instance.ClosedByEscThisFrame; return false; } } [HarmonyPatch(typeof(EscapeMenuHandler), "ToggleEsc")] internal static class EscapeMenuPatch { [HarmonyPriority(800)] private static bool Prefix() { if (TabStyleUI.Ready && TabStyleUI.Instance.IsOpen) { TabStyleUI.Instance.CloseFromEsc(); return false; } return true; } } internal sealed class StatRow { public string Name; public string Value; } internal sealed class CategoryBlock { public string Name; public bool IsBasic; public readonly List<StatRow> Stats = new List<StatRow>(); } internal sealed class PlayerInfo { public Player Player; public int Id; public int Team; public string Name; public string Tag; public bool Local; public float Hp; public float MaxHp; public Color TeamColor; public string TeamName; public int Rounds; public int Points; public readonly List<CardInfo> Cards = new List<CardInfo>(); public readonly List<CategoryBlock> Categories = new List<CategoryBlock>(); public readonly Dictionary<string, string> Basic = new Dictionary<string, string>(); public float HpPct { get { if (!(MaxHp > 0f)) { return 0f; } return Mathf.Clamp01(Hp / MaxHp); } } public string Initial { get { string text = Name ?? ""; foreach (char c in text) { if (!char.IsLetterOrDigit(c)) { continue; } char c2 = char.ToUpperInvariant(c); try { if ((Object)(object)UIKit.Font != (Object)null && !UIKit.Font.HasCharacter(c2)) { continue; } } catch { } return c2.ToString(); } return "?"; } } } internal sealed class TeamInfo { public int Team; public string Name; public Color Color; public int Rounds; public int Points; public readonly List<PlayerInfo> Players = new List<PlayerInfo>(); } internal sealed class Snapshot { public string ModeName = ""; public int Round; public int Point; public int RoundsToWin; public int PointsToWin; public readonly List<PlayerInfo> Players = new List<PlayerInfo>(); public readonly List<TeamInfo> Teams = new List<TeamInfo>(); public bool Grouped; public string StructureKey = ""; public bool YouFirst; public PlayerInfo FirstLocal => Players.FirstOrDefault((PlayerInfo p) => p.Local) ?? Players.FirstOrDefault(); public PlayerInfo Find(int id) { foreach (PlayerInfo player in Players) { if (player.Id == id) { return player; } } return null; } internal static Snapshot Take(bool youFirst) { //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) Snapshot snapshot = new Snapshot { YouFirst = youFirst }; PlayerManager instance = PlayerManager.instance; if ((Object)(object)instance == (Object)null || instance.players == null) { return snapshot; } IGameModeHandler val = SafeHandler(); try { snapshot.ModeName = ((val != null) ? val.Name : null) ?? ""; } catch { } try { snapshot.Round = TabInfoManager.CurrentRound; } catch { } try { snapshot.Point = TabInfoManager.CurrentPoint; } catch { } try { snapshot.RoundsToWin = TabInfoManager.RoundsToWin; } catch { } try { snapshot.PointsToWin = TabInfoManager.PointsToWin; } catch { } List<Player> list = instance.players.Where((Player p) => (Object)(object)p != (Object)null && (Object)(object)p.data != (Object)null).ToList(); List<Player> list2 = list.Where(IsLocal).ToList(); List<Player> list3 = list2.Where((Player p) => p.data.playerActions != null).ToList(); if (list3.Count > 0) { list2 = list3; } List<StatCategory> list4 = TabInfoBridge.OrderedCategories(); Dictionary<StatCategory, List<Stat>> dictionary = list4.ToDictionary((StatCategory c) => c, TabInfoBridge.OrderedStats); string basicCategoryName = TabInfoBridge.BasicCategoryName; foreach (Player item in list) { PlayerInfo playerInfo = new PlayerInfo { Player = item, Id = item.playerID, Team = item.teamID, Local = list2.Contains(item) }; playerInfo.Name = PlayerName(item); try { playerInfo.Hp = item.data.health; playerInfo.MaxHp = item.data.maxHealth; } catch { } int colorId = item.teamID; try { colorId = PlayerExtensions.colorID(item); } catch { } playerInfo.TeamColor = TeamColor(colorId); playerInfo.TeamName = TeamName(colorId, item.teamID); if (val != null) { try { TeamScore teamScore = val.GetTeamScore(item.teamID); playerInfo.Rounds = teamScore.rounds; playerInfo.Points = teamScore.points; } catch { } } try { if (item.data.currentCards != null) { playerInfo.Cards.AddRange(item.data.currentCards.Where((CardInfo c) => (Object)(object)c != (Object)null)); } } catch { } foreach (StatCategory item2 in list4) { if (!TabInfoBridge.CategoryVisible(item2, item)) { continue; } CategoryBlock categoryBlock = new CategoryBlock { Name = (item2.name ?? "Stats"), IsBasic = (item2.name == basicCategoryName) }; foreach (Stat item3 in dictionary[item2]) { if (TabInfoBridge.StatVisible(item3, item)) { StatRow statRow = new StatRow { Name = (item3.name ?? ""), Value = TabInfoBridge.StatValue(item3, item) }; categoryBlock.Stats.Add(statRow); if (categoryBlock.IsBasic) { playerInfo.Basic[statRow.Name] = statRow.Value; } } } if (categoryBlock.Stats.Count > 0) { playerInfo.Categories.Add(categoryBlock); } } snapshot.Players.Add(playerInfo); } List<PlayerInfo> list5 = snapshot.Players.Where((PlayerInfo p) => p.Local).ToList(); foreach (PlayerInfo item4 in list5) { item4.Tag = ((list5.Count == 1) ? "YOU" : ("P" + (item4.Id + 1))); } snapshot.Players.Sort(delegate(PlayerInfo a, PlayerInfo b) { if (youFirst && a.Local != b.Local) { if (!a.Local) { return 1; } return -1; } return (a.Team != b.Team) ? a.Team.CompareTo(b.Team) : a.Id.CompareTo(b.Id); }); int localTeam = ((youFirst && list5.Count > 0) ? list5.Min((PlayerInfo p) => p.Team) : int.MinValue); foreach (IGrouping<int, PlayerInfo> item5 in from p in snapshot.Players group p by p.Team into g orderby (g.Key != localTeam) ? 1 : 0, g.Key select g) { PlayerInfo playerInfo2 = item5.First(); TeamInfo teamInfo = new TeamInfo { Team = item5.Key, Name = playerInfo2.TeamName, Color = playerInfo2.TeamColor, Rounds = playerInfo2.Rounds, Points = playerInfo2.Points }; teamInfo.Players.AddRange(from p in item5 orderby (!youFirst || !p.Local) ? 1 : 0, p.Id select p); snapshot.Teams.Add(teamInfo); } snapshot.Grouped = snapshot.Teams.Any((TeamInfo t) => t.Players.Count > 1); snapshot.StructureKey = BuildKey(snapshot); return snapshot; } private static IGameModeHandler SafeHandler() { try { return GameModeManager.CurrentHandler; } catch { return null; } } private static bool IsLocal(Player p) { try { return PhotonNetwork.OfflineMode || ((Object)(object)p.data.view != (Object)null && p.data.view.IsMine); } catch { return false; } } private static string PlayerName(Player p) { string text = null; try { PhotonView view = p.data.view; object obj; if (view == null) { obj = null; } else { Player owner = view.Owner; obj = ((owner != null) ? owner.NickName : null); } text = (string)obj; } catch { } if (string.IsNullOrWhiteSpace(text)) { text = "Player " + (p.playerID + 1); } text = text.Trim(); if (text.Length <= 32) { return text; } return text.Substring(0, 32); } private static Color TeamColor(int colorId) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) try { PlayerSkin playerSkinColors = ExtraPlayerSkins.GetPlayerSkinColors(colorId); if ((Object)(object)playerSkinColors != (Object)null) { Color winText = playerSkinColors.winText; winText.a = 1f; return winText; } } catch { } return new Color(0.6f, 0.6f, 0.6f, 1f); } private static string TeamName(int colorId, int teamId) { try { string teamColorName = ExtraPlayerSkins.GetTeamColorName(colorId); if (!string.IsNullOrEmpty(teamColorName)) { return teamColorName; } } catch { } return "Team " + (teamId + 1); } private static string BuildKey(Snapshot s) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(256); stringBuilder.Append(s.Grouped ? 'G' : 'F').Append('|'); foreach (PlayerInfo player in s.Players) { stringBuilder.Append(player.Id).Append(',').Append(player.Team) .Append(',') .Append(player.Name) .Append(',') .Append(player.Tag) .Append(','); stringBuilder.Append(player.TeamName).Append(',').Append(ColorUtility.ToHtmlStringRGB(player.TeamColor)) .Append('['); foreach (CardInfo card in player.Cards) { stringBuilder.Append(((Object)card).GetInstanceID()).Append(';'); } stringBuilder.Append("]{"); foreach (CategoryBlock category in player.Categories) { stringBuilder.Append(category.Name).Append(':'); foreach (StatRow stat in category.Stats) { stringBuilder.Append(stat.Name).Append(';'); } stringBuilder.Append('/'); } stringBuilder.Append("}\n"); } return stringBuilder.ToString(); } } internal static class TabInfoBridge { private static Func<Stat, Player, bool> statVisible; private static Func<Stat, Player, string> statValue; private static Func<StatCategory, Player, bool> categoryVisible; private static FieldInfo canvasField; private static FieldInfo cardHolderField; private static FieldInfo statObjectField; private static FieldInfo hiddenModesField; private static bool initialized; internal static bool Ready { get; private set; } internal static GameObject Canvas => Get<GameObject>(canvasField); internal static GameObject CardHolderTemplate => Get<GameObject>(cardHolderField); internal static string BasicCategoryName { get { try { return TabInfoManager.basicStats?.name ?? "Basic Stats"; } catch { return "Basic Stats"; } } } internal static void Init() { if (initialized) { return; } initialized = true; try { statVisible = MakeDelegate<Func<Stat, Player, bool>>(typeof(Stat), "DisplayCondition"); statValue = MakeDelegate<Func<Stat, Player, string>>(typeof(Stat), "DisplayValue"); categoryVisible = MakeDelegate<Func<StatCategory, Player, bool>>(typeof(StatCategory), "DisplayCondition"); canvasField = AccessTools.Field(typeof(TabInfoManager), "canvas"); cardHolderField = AccessTools.Field(typeof(TabInfoManager), "cardHolderTemplate"); statObjectField = AccessTools.Field(typeof(TabInfoManager), "statObjectTemplate"); hiddenModesField = AccessTools.Field(typeof(TabInfoManager), "hiddenGameModes"); Ready = statVisible != null && statValue != null && categoryVisible != null; if (!Ready) { TabStyle.Log.LogError((object)"Could not hook TabInfo's stat methods. TabStyle will leave TabInfo's own UI in place."); } } catch (Exception ex) { Ready = false; TabStyle.Log.LogError((object)("Failed to read TabInfo. TabStyle will leave TabInfo's own UI in place.\n" + ex)); } } private static T MakeDelegate<T>(Type type, string name) where T : class { MethodInfo method = AccessTools.Method(type, name, new Type[1] { typeof(Player) }, (Type[])null); if (method == null) { return null; } try { return Delegate.CreateDelegate(typeof(T), method) as T; } catch { if (typeof(T) == typeof(Func<Stat, Player, bool>)) { return (T)(object)(Func<Stat, Player, bool>)((Stat s, Player p) => (bool)method.Invoke(s, new object[1] { p })); } if (typeof(T) == typeof(Func<Stat, Player, string>)) { return (T)(object)(Func<Stat, Player, string>)((Stat s, Player p) => (string)method.Invoke(s, new object[1] { p })); } if (typeof(T) == typeof(Func<StatCategory, Player, bool>)) { return (T)(object)(Func<StatCategory, Player, bool>)((StatCategory c, Player p) => (bool)method.Invoke(c, new object[1] { p })); } return null; } } private static T Get<T>(FieldInfo f) where T : class { try { return f?.GetValue(null) as T; } catch { return null; } } internal static TMP_FontAsset FindFont() { try { GameObject val = Get<GameObject>(statObjectField); TextMeshProUGUI val2 = (((Object)(object)val != (Object)null) ? val.GetComponentInChildren<TextMeshProUGUI>(true) : null); if ((Object)(object)val2 != (Object)null && (Object)(object)((TMP_Text)val2).font != (Object)null) { return ((TMP_Text)val2).font; } } catch { } if ((Object)(object)TMP_Settings.defaultFontAsset != (Object)null) { return TMP_Settings.defaultFontAsset; } return Resources.FindObjectsOfTypeAll<TMP_FontAsset>().FirstOrDefault(); } internal static bool IsHiddenGameMode() { try { List<string> list = Get<List<string>>(hiddenModesField); string currentHandlerID = GameModeManager.CurrentHandlerID; return list != null && currentHandlerID != null && list.Contains(currentHandlerID); } catch { return false; } } internal static bool StatVisible(Stat s, Player p) { try { return statVisible(s, p); } catch { return false; } } internal static string StatValue(Stat s, Player p) { try { return statValue(s, p) ?? ""; } catch { return ""; } } internal static bool CategoryVisible(StatCategory c, Player p) { try { return categoryVisible(c, p); } catch { return false; } } internal static List<StatCategory> OrderedCategories() { try { return (from c in TabInfoManager.Categories.Values where c != null orderby c.priority, (c.name ?? "").ToLowerInvariant() select c).ToList(); } catch { return new List<StatCategory>(); } } internal static List<Stat> OrderedStats(StatCategory c) { try { return (from s in c.Stats.Values where s != null orderby s.name ?? "" select s).ToList(); } catch { return new List<Stat>(); } } } public enum LayoutKind { Split, Compare, Scoreboard, Dock, Classic, Original } public enum PaletteKind { Midnight, Ember, Neon, Arctic, Crimson, Mono } internal sealed class Palette { public PaletteKind Kind; public string Name; public Color Bg; public Color Surf; public Color Surf2; public Color Line; public Color Text; public Color Muted; public Color Accent; public Color AccText; public Palette(PaletteKind kind, string bg, string surf, string surf2, string line, string text, string muted, string accent, string accText) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) Kind = kind; Name = kind.ToString(); Bg = Hex(bg); Surf = Hex(surf); Surf2 = Hex(surf2); Line = Hex(line); Text = Hex(text); Muted = Hex(muted); Accent = Hex(accent); AccText = Hex(accText); } internal static Color Hex(string hex) { //IL_0010: 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) Color result = default(Color); if (!ColorUtility.TryParseHtmlString(hex, ref result)) { return Color.magenta; } return result; } } internal static class Themes { internal static readonly Palette[] Palettes = new Palette[6] { new Palette(PaletteKind.Midnight, "#0F131B", "#171C26", "#202736", "#2B3344", "#E8ECF4", "#8F99AB", "#7FA2FF", "#0F131B"), new Palette(PaletteKind.Ember, "#15100D", "#1F1813", "#2A2019", "#3A2D23", "#F5EBE3", "#AE9C90", "#FF8F45", "#15100D"), new Palette(PaletteKind.Neon, "#0D0A18", "#161127", "#201936", "#30264D", "#EFEAFF", "#A398C9", "#3BE8D5", "#0D0A18"), new Palette(PaletteKind.Crimson, "#0D0808", "#170E0F", "#231416", "#3B1D20", "#F4E7E8", "#B5999B", "#E63946", "#0D0808"), new Palette(PaletteKind.Mono, "#0B0B0B", "#151515", "#202020", "#2E2E2E", "#F2F2F2", "#969696", "#FFFFFF", "#0B0B0B"), new Palette(PaletteKind.Arctic, "#F3F5F9", "#FFFFFF", "#E6ECF6", "#D6DCE6", "#131A26", "#566173", "#2459D6", "#FFFFFF") }; internal static readonly LayoutKind[] Layouts = new LayoutKind[6] { LayoutKind.Split, LayoutKind.Compare, LayoutKind.Scoreboard, LayoutKind.Dock, LayoutKind.Classic, LayoutKind.Original }; internal static readonly Color HpGood = Palette.Hex("#3FBF7F"); internal static readonly Color HpMid = Palette.Hex("#E5A93A"); internal static readonly Color HpLow = Palette.Hex("#E5484D"); internal static readonly KeyValuePair<string, string>[] QuickStats = new KeyValuePair<string, string>[6] { new KeyValuePair<string, string>("Damage", "DMG"), new KeyValuePair<string, string>("Attack Speed", "ATK SPD"), new KeyValuePair<string, string>("Block Cooldown", "BLOCK"), new KeyValuePair<string, string>("Reload Time", "RELOAD"), new KeyValuePair<string, string>("Ammo", "AMMO"), new KeyValuePair<string, string>("Movespeed", "MOVE") }; internal static readonly KeyValuePair<string, string>[] DockExtraStats = new KeyValuePair<string, string>[2] { new KeyValuePair<string, string>("Bullets", "BULLETS"), new KeyValuePair<string, string>("Bounces", "BOUNCES") }; internal static Palette Get(PaletteKind kind) { Palette[] palettes = Palettes; foreach (Palette palette in palettes) { if (palette.Kind == kind) { return palette; } } return Palettes[0]; } internal static string LayoutLabel(LayoutKind k) { return k switch { LayoutKind.Split => "Split", LayoutKind.Compare => "Compare", LayoutKind.Scoreboard => "Scoreboard", LayoutKind.Dock => "Dock", LayoutKind.Classic => "Classic", LayoutKind.Original => "Original TabInfo", _ => k.ToString(), }; } internal static Color HpColor(float pct) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!(pct > 0.5f)) { if (!(pct > 0.25f)) { return HpLow; } return HpMid; } return HpGood; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.zen.rounds.tabstyle", "TabStyle", "1.0.5")] [BepInProcess("Rounds.exe")] public class TabStyle : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static OnLeftDelegate <>9__19_0; internal void <Start>b__19_0() { TabStyleUI.Instance?.Close(); } } public const string ModId = "com.zen.rounds.tabstyle"; public const string ModName = "TabStyle"; public const string Version = "1.0.5"; public const string ModInitials = "Zen"; internal const string TabInfoGuid = "com.willuwontu.rounds.tabinfo"; internal static ConfigEntry<LayoutKind> LayoutSetting; internal static ConfigEntry<PaletteKind> PaletteSetting; internal static ConfigEntry<bool> ShowCardsSetting; internal static ConfigEntry<bool> YouFirstSetting; internal static ConfigEntry<string> CollapsedSetting; internal static TabStyle Instance { get; private set; } internal static ManualLogSource Log { get; private set; } private void Awake() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) Instance = this; Log = ((BaseUnityPlugin)this).Logger; LayoutSetting = ((BaseUnityPlugin)this).Config.Bind<LayoutKind>("Theme", "Layout", LayoutKind.Split, "Which layout the Tab screen uses. You can also change this with the buttons in the top right of the Tab screen."); PaletteSetting = ((BaseUnityPlugin)this).Config.Bind<PaletteKind>("Theme", "Colors", PaletteKind.Midnight, "Which color palette the Tab screen uses. You can also change this with the color dots in the top right of the Tab screen."); ShowCardsSetting = ((BaseUnityPlugin)this).Config.Bind<bool>("Theme", "ShowCards", false, "Show each player's cards. Toggle it with the CARDS button in the top right of the Tab screen."); YouFirstSetting = ((BaseUnityPlugin)this).Config.Bind<bool>("Theme", "YouFirst", true, "Put you at the top (or left) of every list so you never have to scroll to find yourself. Toggle it with the YOU FIRST button in the top right of the Tab screen."); CollapsedSetting = ((BaseUnityPlugin)this).Config.Bind<string>("Theme", "CollapsedSections", "", "Stat sections you collapsed (remembered between games). Managed by the mod."); new Harmony("com.zen.rounds.tabstyle").PatchAll(typeof(TabStyle).Assembly); } private void Start() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown Unbound.RegisterClientSideMod("com.zen.rounds.tabstyle"); Unbound.RegisterCredits("TabStyle", new string[2] { "Zen", "Built on TabInfo by willuwontu" }, new string[1] { "Thunderstore" }, new string[1] { "https://thunderstore.io/c/rounds/p/Zenith/" }); ((Component)this).gameObject.AddComponent<TabStyleUI>(); GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)CloseHook); GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)CloseHook); object obj = <>c.<>9__19_0; if (obj == null) { OnLeftDelegate val = delegate { TabStyleUI.Instance?.Close(); }; <>c.<>9__19_0 = val; obj = (object)val; } Unbound.OnLeftRoom += (OnLeftDelegate)obj; } private static IEnumerator CloseHook(IGameModeHandler gm) { TabStyleUI.Instance?.Close(); yield break; } } internal static class CardPreview { private static GameObject current; private static CardChip owner; internal static void Show(CardChip chip) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) Hide(); if ((Object)(object)chip == (Object)null || (Object)(object)chip.Card == (Object)null) { return; } GameObject val = (((Object)(object)TabStyleUI.Instance != (Object)null) ? TabStyleUI.Instance.CanvasObject : null); if ((Object)(object)val == (Object)null) { return; } try { GameObject cardHolderTemplate = TabInfoBridge.CardHolderTemplate; GameObject val2; if ((Object)(object)cardHolderTemplate != (Object)null) { val2 = Object.Instantiate<GameObject>(cardHolderTemplate, val.transform); } else { val2 = new GameObject("TabStyle Card Holder", new Type[1] { typeof(RectTransform) }); val2.transform.SetParent(val.transform, false); } ((Object)val2).name = "TabStyle Card Preview"; val2.transform.SetAsLastSibling(); val2.transform.position = ((Component)chip).transform.position; CanvasGroup obj = val2.GetComponent<CanvasGroup>() ?? val2.AddComponent<CanvasGroup>(); obj.blocksRaycasts = false; obj.interactable = false; Graphic[] componentsInChildren = val2.GetComponentsInChildren<Graphic>(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].raycastTarget = false; } GameObject val3 = Object.Instantiate<GameObject>(((Component)chip.Card).gameObject, val2.transform); val3.transform.localPosition = Vector3.zero; CardVisuals componentInChildren = val3.GetComponentInChildren<CardVisuals>(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.firstValueToSet = true; } Collider2D[] componentsInChildren2 = val2.GetComponentsInChildren<Collider2D>(true); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Behaviour)componentsInChildren2[i]).enabled = false; } Canvas componentInChildren2 = val3.GetComponentInChildren<Canvas>(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.sortingLayerName = "MostFront"; } GraphicRaycaster[] componentsInChildren3 = val2.GetComponentsInChildren<GraphicRaycaster>(true); for (int i = 0; i < componentsInChildren3.Length; i++) { ((Behaviour)componentsInChildren3[i]).enabled = false; } componentsInChildren = val2.GetComponentsInChildren<Graphic>(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].raycastTarget = false; } SetScaleToZero componentInChildren3 = val3.GetComponentInChildren<SetScaleToZero>(); if ((Object)(object)componentInChildren3 != (Object)null) { ((Behaviour)componentInChildren3).enabled = false; ((Component)componentInChildren3).transform.localScale = Vector3.one * 1.15f; } current = val2; owner = chip; ((MonoBehaviour)TabStyleUI.Instance).StartCoroutine(ScaleNextFrame(val2, val3)); } catch (Exception ex) { TabStyle.Log.LogWarning((object)("Card preview failed: " + ex.Message)); Hide(); } } private static IEnumerator ScaleNextFrame(GameObject holder, GameObject cardObj) { yield return null; if ((Object)(object)holder != (Object)null && (Object)(object)cardObj != (Object)null && (Object)(object)current == (Object)(object)holder) { cardObj.transform.localScale = Vector3.one * 25f; } } internal static void Hide(CardChip onlyIfOwner = null) { if (!((Object)(object)onlyIfOwner != (Object)null) || !((Object)(object)owner != (Object)(object)onlyIfOwner)) { if ((Object)(object)current != (Object)null) { Object.Destroy((Object)(object)current); } current = null; owner = null; } } } internal class CardChip : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { internal CardInfo Card; public void OnPointerEnter(PointerEventData e) { CardPreview.Show(this); } public void OnPointerExit(PointerEventData e) { CardPreview.Hide(this); } private void OnDisable() { CardPreview.Hide(this); } private void OnDestroy() { CardPreview.Hide(this); } } internal static class OriginalMode { private static FieldInfo tabFrameField; private static FieldInfo toggledField; internal static TabFrame CurrentFrame { get { Init(); try { object? obj = tabFrameField?.GetValue(null); TabFrame val = (TabFrame)((obj is TabFrame) ? obj : null); return ((Object)(object)val != (Object)null) ? val : null; } catch { return null; } } } internal static bool TabInfoOpen { get { TabFrame currentFrame = CurrentFrame; if ((Object)(object)currentFrame != (Object)null) { return ((Component)currentFrame).gameObject.activeSelf; } return false; } } private static void Init() { if (tabFrameField == null) { tabFrameField = AccessTools.Field(typeof(TabInfoManager), "tabFrame"); } if (toggledField == null) { toggledField = AccessTools.Field(typeof(TabFrame), "toggled"); } } internal static void OpenTabInfo() { try { if (!TabInfoOpen) { TabInfoManager.ToggleTabFrame(); } Attach(); } catch (Exception ex) { TabStyle.Log.LogWarning((object)("Couldn't open TabInfo's window: " + ex.Message)); } } internal static void CloseTabInfo() { Init(); TabFrame currentFrame = CurrentFrame; if (!((Object)(object)currentFrame == (Object)null)) { try { toggledField?.SetValue(currentFrame, false); } catch { } ((Component)currentFrame).gameObject.SetActive(false); Object.Destroy((Object)(object)((Component)currentFrame).gameObject); } } internal static void Attach() { TabFrame currentFrame = CurrentFrame; if (!((Object)(object)currentFrame == (Object)null) && ((Component)currentFrame).gameObject.activeSelf && !((Object)(object)((Component)currentFrame).GetComponent<OriginalSwitcher>() != (Object)null)) { ((Component)currentFrame).gameObject.AddComponent<OriginalSwitcher>(); } } } internal class OriginalSwitcher : MonoBehaviour { private static readonly Color Bg = new Color(0.16f, 0.16f, 0.16f, 0.92f); private static readonly Color Hover = new Color(0.32f, 0.32f, 0.32f, 1f); private static readonly Color Icon = new Color(0.86f, 0.86f, 0.86f, 1f); private static readonly Color ActiveIcon = new Color(1f, 0.62f, 0.35f, 1f); private void Start() { try { Build(); } catch (Exception ex) { TabStyle.Log.LogWarning((object)("Couldn't add theme buttons to TabInfo: " + ex.Message)); } } private void Build() { //IL_0037: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00bf: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) Transform obj = ((Component)this).transform.Find("Title Bar"); RectTransform val = (RectTransform)(object)((obj is RectTransform) ? obj : null); if ((Object)(object)val == (Object)null) { return; } Transform obj2 = ((Transform)val).Find("Close"); RectTransform val2 = (RectTransform)(object)((obj2 is RectTransform) ? obj2 : null); Rect rect = val.rect; float num = Mathf.Max(16f, ((Rect)(ref rect)).height * 0.78f); float num2; if (!((Object)(object)val2 != (Object)null)) { num2 = num; } else { rect = val2.rect; num2 = ((Rect)(ref rect)).width; } float num3 = num2; Image val3 = UIKit.Box((Transform)(object)val, Bg, Mathf.RoundToInt(num * 0.22f), "TabStyle Themes", raycast: true); RectTransform rectTransform = ((Graphic)val3).rectTransform; Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(1f, 0.5f); rectTransform.anchorMax = val4; rectTransform.anchorMin = val4; rectTransform.pivot = new Vector2(1f, 0.5f); rectTransform.anchoredPosition = new Vector2(0f - (num3 + num * 0.4f), 0f); ContentSizeFitter obj3 = ((Component)val3).gameObject.AddComponent<ContentSizeFitter>(); obj3.horizontalFit = (FitMode)2; obj3.verticalFit = (FitMode)2; int num4 = Mathf.RoundToInt(num * 0.1f); UIKit.HL((Component)(object)val3, num4, num4, num4, num4, num4, (TextAnchor)4); float num5 = num - (float)num4 * 2f; LayoutKind[] layouts = Themes.Layouts; foreach (LayoutKind layoutKind in layouts) { LayoutKind k = layoutKind; bool flag = k == LayoutKind.Original; Image val5 = UIKit.Box(((Component)val3).transform, (Color)(flag ? Hover : new Color(0f, 0f, 0f, 0f)), Mathf.RoundToInt(num5 * 0.2f), "Layout " + k, raycast: true); UIKit.LE((Component)(object)val5, num5 * 1.25f, num5 * 1.25f, 0f, num5, num5, 0f); RectTransform obj4 = UIKit.Rect(((Component)val5).transform, "Icon"); ((Vector2)(ref val4))..ctor(0.5f, 0.5f); obj4.anchorMax = val4; obj4.anchorMin = val4; obj4.sizeDelta = new Vector2(num5 * 0.75f, num5 * 0.53f); TabStyleUI.LayoutIcon(obj4, k, flag ? ActiveIcon : Icon); if (flag) { continue; } UIKit.MakeButton((Graphic)(object)val5, delegate { TabStyleUI instance = TabStyleUI.Instance; if ((Object)(object)instance != (Object)null) { instance.SwitchFromOriginal(k); } }, ((Graphic)val5).color, Hover); } ((Component)val3).transform.SetAsLastSibling(); } } internal class TabStyleUI : MonoBehaviour { private sealed class HpBind { public int Id; public RectTransform Fill; public Image FillImage; public TextMeshProUGUI Text; public float Current; public float Target; } private const float RefreshInterval = 0.2f; private const float DesignW = 1920f; private const float DesignH = 1080f; private GameObject ownCanvas; private RectTransform root; private RectTransform frame; private RectTransform content; private CanvasGroup frameGroup; private AudioSource audioSource; private static readonly Random rng = new Random(); private Snapshot snap; private Palette pal; private float nextRefresh; private bool dirty; private string builtKey; private Vector2 designSize = new Vector2(1920f, 1080f); private float openTime; private readonly Dictionary<string, List<TextMeshProUGUI>> texts = new Dictionary<string, List<TextMeshProUGUI>>(); private readonly List<HpBind> hpBinds = new List<HpBind>(); private readonly Dictionary<string, SmartScroll> scrolls = new Dictionary<string, SmartScroll>(); private readonly Dictionary<string, Vector2> scrollMemory = new Dictionary<string, Vector2>(); private int selectedId = int.MinValue; private readonly HashSet<int> expanded = new HashSet<int>(); private bool expandedInitialized; private int dockOpenId = int.MinValue; private bool dockAllStats; private readonly HashSet<int> classicCollapsed = new HashSet<int>(); private readonly HashSet<string> collapsed = new HashSet<string>(); private TextMeshProUGUI hint; private string hintDefault = ""; private int escCloseFrame = -1; private const float SbHp = 230f; private const float SbStat = 118f; private const float SbCards = 120f; private static readonly Color AvatarText = new Color(0.07f, 0.07f, 0.07f, 1f); private static MethodInfo rarityDataMethod; private static bool rarityLookupDone; internal static TabStyleUI Instance { get; private set; } internal GameObject CanvasObject { get; private set; } internal bool IsOpen { get; private set; } internal static bool Ready { get { if ((Object)(object)Instance != (Object)null) { return TabInfoBridge.Ready; } return false; } } internal bool ClosedByEscThisFrame => escCloseFrame == Time.frameCount; private void BuildClassic() { float width; float height; RectTransform parent = CenteredPanel(1560f, 1010f, out width, out height); Header((Transform)(object)parent, compact: false); Divider((Transform)(object)parent); RectTransform parent2 = VList((Transform)(object)parent, "classic", 22, 22, 18, 26, 12f); int columns = ((width >= 1300f) ? 4 : 3); foreach (TeamInfo team in snap.Teams) { ClassicTeamBanner((Transform)(object)parent2, team); foreach (PlayerInfo player in team.Players) { ClassicPlayer((Transform)(object)parent2, player, columns); } } } private void ClassicTeamBanner(Transform parent, TeamInfo team) { //IL_0002: 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_00b3: Unknown result type (might be due to invalid IL or missing references) Image obj = UIKit.Box(parent, team.Color, 12, "Team " + team.Team); UIKit.HL((Component)(object)obj, 14f, 22, 22, 12, 12, (TextAnchor)3); TextMeshProUGUI obj2 = UIKit.Text(((Component)obj).transform, team.Name.ToUpperInvariant(), 26f, AvatarText, (FontStyles)1, (TextAlignmentOptions)4097, rich: false, "Name"); ((TMP_Text)obj2).characterSpacing = 4f; UIKit.LE((Component)(object)obj2, 60f, -1f, 1f); TextMeshProUGUI val = UIKit.Text(((Component)obj).transform, ScoreText(team.Rounds, team.Points, compact: false), 18f, AvatarText, (FontStyles)1, (TextAlignmentOptions)4100, rich: false, "Score"); UIKit.LE((Component)(object)val, 60f, -1f, 0f); Bind("tscore|" + team.Team, val); } private void ClassicPlayer(Transform parent, PlayerInfo p, int columns) { //IL_002e: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) bool open = !classicCollapsed.Contains(p.Id); Image val = UIKit.Bordered(parent, pal.Surf, p.Local ? pal.Accent : pal.Line, 14, (!p.Local) ? 1 : 2, "Player " + p.Id); UIKit.VL((Component)(object)val, 0f, 0, 0, 0, 0, (TextAnchor)0); Image val2 = UIKit.Box(((Component)val).transform, Alpha(pal.Surf2, 0f), 12, "Head", raycast: true); UIKit.HL((Component)(object)val2, 16f, 16, 20, 12, 12, (TextAnchor)3); Avatar(((Component)val2).transform, p, 48f); NameLine(((Component)val2).transform, p, 26f); RectTransform val3 = UIKit.Rect(((Component)val2).transform, "Hp"); UIKit.HL((Component)(object)val3, 12f, 0, 0, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val3, 300f, 300f, 0f); TextMeshProUGUI val4 = UIKit.Text((Transform)(object)val3, HpText(p), 16f, pal.Muted, (FontStyles)0, (TextAlignmentOptions)4100, rich: false, "HpText"); HpBar((Transform)(object)val3, p, 7f, val4); UIKit.LE((Component)(object)val4, 96f, 96f, 0f); ((TMP_Text)val4).transform.SetAsLastSibling(); TextMeshProUGUI obj = Muted(((Component)val2).transform, p.Cards.Count + ((p.Cards.Count == 1) ? " card" : " cards"), 16f); ((TMP_Text)obj).alignment = (TextAlignmentOptions)4100; UIKit.LE((Component)(object)obj, 80f, 80f, 0f); UIKit.Chevron(((Component)val2).transform, 16f, pal.Muted, open ? 180f : 0f); int id = p.Id; UIKit.MakeButton((Graphic)(object)val2, delegate { ToggleClassic(id); }, ((Graphic)val2).color, Alpha(pal.Surf2, 0.8f), delegate { SetHint(open ? "Collapse player" : "Expand player"); }, ResetHint); if (open) { RectTransform val5 = UIKit.Rect(((Component)val).transform, "Body"); UIKit.VL((Component)(object)val5, 14f, 20, 20, 2, 20, (TextAnchor)0); CardsSection((Transform)(object)val5, p, "classic|" + p.Id); CategoryGrid((Transform)(object)val5, p, p.Categories, columns, pal.Surf2); } } private void Awake() { Instance = this; TabInfoBridge.Init(); string[] array = (TabStyle.CollapsedSetting.Value ?? "").Split(new char[1] { '|' }); foreach (string text in array) { if (!string.IsNullOrEmpty(text)) { collapsed.Add(text); } } } private void OnDestroy() { if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } } internal void Toggle() { if (IsOpen) { Close(); } else { Open(); } } internal void Open() { if (TabInfoBridge.Ready && !IsOpen && TabStyle.LayoutSetting.Value != LayoutKind.Original && GameIsRunning() && !TabInfoBridge.IsHiddenGameMode() && EnsureCanvas()) { EnsureEventSystem(); if ((Object)(object)UIKit.Font == (Object)null) { UIKit.Font = TabInfoBridge.FindFont(); } CatInfoBridge.Sync(); snap = Snapshot.Take(TabStyle.YouFirstSetting.Value); if (snap.Players.Count != 0) { IsOpen = true; ((Component)root).gameObject.SetActive(true); ((Transform)root).SetAsLastSibling(); openTime = Time.unscaledTime; frameGroup.alpha = 0f; UpdateScale(); Rebuild(); nextRefresh = Time.unscaledTime + 0.2f; } } } internal void Close() { CardPreview.Hide(); if (IsOpen) { IsOpen = false; if ((Object)(object)root != (Object)null) { RememberScrolls(); ClearContent(); ((Component)root).gameObject.SetActive(false); } } } internal void CloseFromEsc() { escCloseFrame = Time.frameCount; Close(); } private static bool GameIsRunning() { try { PlayerManager instance = PlayerManager.instance; return (Object)(object)instance != (Object)null && instance.players != null && instance.players.Count > 0 && GameModeManager.CurrentHandler != null; } catch { return false; } } private void Update() { //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) if (!IsOpen) { return; } if ((Object)(object)root == (Object)null || (Object)(object)CanvasObject == (Object)null || !GameIsRunning() || TabInfoBridge.IsHiddenGameMode()) { Close(); return; } UpdateScale(); float num = Mathf.Clamp01((Time.unscaledTime - openTime) / 0.14f); float alpha = 1f - (1f - num) * (1f - num); frameGroup.alpha = alpha; if (dirty || Time.unscaledTime >= nextRefresh) { nextRefresh = Time.unscaledTime + 0.2f; try { Refresh(); } catch (Exception ex) { TabStyle.Log.LogError((object)("Refresh failed: " + ex)); } } float unscaledDeltaTime = Time.unscaledDeltaTime; for (int i = 0; i < hpBinds.Count; i++) { HpBind hpBind = hpBinds[i]; if (!((Object)(object)hpBind.Fill == (Object)null) && !Mathf.Approximately(hpBind.Current, hpBind.Target)) { hpBind.Current = Mathf.MoveTowards(hpBind.Current, hpBind.Target, Mathf.Max(0.02f, Mathf.Abs(hpBind.Target - hpBind.Current)) * unscaledDeltaTime * 10f); hpBind.Fill.anchorMax = new Vector2(hpBind.Current, 1f); ((Graphic)hpBind.FillImage).color = Themes.HpColor(hpBind.Current); } } } private bool EnsureCanvas() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown GameObject canvas = TabInfoBridge.Canvas; if ((Object)(object)canvas == (Object)null) { if ((Object)(object)ownCanvas == (Object)null) { ownCanvas = new GameObject("TabStyle Canvas", new Type[4] { typeof(RectTransform), typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster) }); Canvas component = ownCanvas.GetComponent<Canvas>(); component.renderMode = (RenderMode)0; component.sortingOrder = 30000; ownCanvas.GetComponent<CanvasScaler>().uiScaleMode = (ScaleMode)0; Object.DontDestroyOnLoad((Object)(object)ownCanvas); } canvas = ownCanvas; } if ((Object)(object)CanvasObject != (Object)(object)canvas || (Object)(object)root == (Object)null) { if ((Object)(object)root != (Object)null) { Object.Destroy((Object)(object)((Component)root).gameObject); } CanvasObject = canvas; BuildRoot(); } return (Object)(object)root != (Object)null; } private void BuildRoot() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) root = UIKit.Rect(CanvasObject.transform, "TabStyle"); UIKit.Stretch(root); audioSource = ((Component)root).gameObject.AddComponent<AudioSource>(); audioSource.playOnAwake = false; audioSource.spatialBlend = 0f; frame = UIKit.Rect((Transform)(object)root, "Frame"); RectTransform obj = frame; RectTransform obj2 = frame; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0.5f); obj2.anchorMax = val; obj.anchorMin = val; frame.pivot = new Vector2(0.5f, 0.5f); frame.sizeDelta = new Vector2(1920f, 1080f); frameGroup = ((Component)frame).gameObject.AddComponent<CanvasGroup>(); ((Component)root).gameObject.SetActive(false); } private static void EnsureEventSystem() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown if (!((Object)(object)EventSystem.current != (Object)null) && !((Object)(object)Object.FindObjectOfType<EventSystem>() != (Object)null)) { Object.DontDestroyOnLoad((Object)new GameObject("TabStyle EventSystem", new Type[2] { typeof(EventSystem), typeof(StandaloneInputModule) })); } } private void UpdateScale() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_004c: 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_006e: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00e6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null || (Object)(object)frame == (Object)null) { return; } Rect rect = root.rect; Vector2 size = ((Rect)(ref rect)).size; if (size.x < 2f || size.y < 2f) { return; } float num = ((size.x / size.y >= 1.7777778f) ? (size.y / 1080f) : (size.x / 1920f)); if (!(num <= 0.0001f)) { Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(Mathf.Round(size.x / num), Mathf.Round(size.y / num)); ((Transform)frame).localScale = new Vector3(num, num, 1f); frame.sizeDelta = val; Vector2 val2 = val - designSize; if (((Vector2)(ref val2)).sqrMagnitude > 4f) { designSize = val; dirty = true; } } } private string ViewKey() { return string.Concat(TabStyle.LayoutSetting.Value, "|", TabStyle.PaletteSetting.Value, "|", TabStyle.ShowCardsSetting.Value, "|", TabStyle.YouFirstSetting.Value, "|", CatInfoBridge.Value, "|", selectedId, "|", string.Join(",", expanded.OrderBy((int x) => x)), "|", dockOpenId, "|", dockAllStats, "|", string.Join(",", classicCollapsed.OrderBy((int x) => x)), "|", string.Join(",", collapsed.OrderBy((string x) => x)), "|", designSize.x, "x", designSize.y, "|", snap.StructureKey); } private void Refresh() { snap = Snapshot.Take(TabStyle.YouFirstSetting.Value); if (snap.Players.Count == 0) { Close(); return; } FixState(); if (dirty || ViewKey() != builtKey) { Rebuild(); } else { UpdateValues(); } } private void FixState() { if (snap.Find(selectedId) == null) { selectedId = snap.FirstLocal.Id; } if (!expandedInitialized) { expandedInitialized = true; foreach (PlayerInfo item in snap.Players.Where((PlayerInfo p) => p.Local)) { expanded.Add(item.Id); } } expanded.RemoveWhere((int id) => snap.Find(id) == null); if (dockOpenId != int.MinValue && snap.Find(dockOpenId) == null) { dockOpenId = int.MinValue; } classicCollapsed.RemoveWhere((int id) => snap.Find(id) == null); } private void RememberScrolls() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<string, SmartScroll> scroll in scrolls) { if ((Object)(object)scroll.Value != (Object)null && (Object)(object)((ScrollRect)scroll.Value).content != (Object)null) { scrollMemory[scroll.Key] = ((ScrollRect)scroll.Value).content.anchoredPosition; } } } private void ClearContent() { CardPreview.Hide(); texts.Clear(); hpBinds.Clear(); scrolls.Clear(); hint = null; if ((Object)(object)content != (Object)null) { ((Component)content).gameObject.SetActive(false); Object.Destroy((Object)(object)((Component)content).gameObject); content = null; } } private void Rebuild() { //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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_01d0: Unknown result type (might be due to invalid IL or missing references) dirty = false; FixState(); RememberScrolls(); ClearContent(); pal = Themes.Get(TabStyle.PaletteSetting.Value); content = UIKit.Rect((Transform)(object)frame, "Content"); UIKit.Stretch(content); try { switch (TabStyle.LayoutSetting.Value) { case LayoutKind.Compare: BuildCompare(); break; case LayoutKind.Scoreboard: BuildScoreboard(); break; case LayoutKind.Dock: BuildDock(); break; case LayoutKind.Classic: BuildClassic(); break; default: BuildSplit(); break; } } catch (Exception ex) { TabStyle.Log.LogError((object)("Building the Tab screen failed: " + ex)); } builtKey = ViewKey(); Canvas.ForceUpdateCanvases(); LayoutRebuilder.ForceRebuildLayoutImmediate(content); foreach (KeyValuePair<string, SmartScroll> scroll in scrolls) { SmartScroll value = scroll.Value; if (!((Object)(object)value == (Object)null) && scrollMemory.TryGetValue(scroll.Key, out var value2)) { Rect rect = ((ScrollRect)value).viewport.rect; Vector2 size = ((Rect)(ref rect)).size; rect = ((ScrollRect)value).content.rect; Vector2 size2 = ((Rect)(ref rect)).size; value2.x = Mathf.Clamp(value2.x, 0f - Mathf.Max(0f, size2.x - size.x), 0f); value2.y = Mathf.Clamp(value2.y, 0f, Mathf.Max(0f, size2.y - size.y)); ((ScrollRect)value).content.anchoredPosition = value2; } } } private void UpdateValues() { SetText("title", TitleText()); SetText("subtitle", SubtitleText()); foreach (TeamInfo team in snap.Teams) { SetText("tscore|" + team.Team, ScoreText(team.Rounds, team.Points, compact: false)); } foreach (PlayerInfo player in snap.Players) { SetText("pscore|" + player.Id, ScoreText(player.Rounds, player.Points, compact: true)); SetText("pteam|" + player.Id, TeamLine(player)); foreach (CategoryBlock category in player.Categories) { foreach (StatRow stat in category.Stats) { SetText(StatKey(player.Id, category.Name, stat.Name), stat.Value); } } } foreach (HpBind hpBind in hpBinds) { PlayerInfo playerInfo = snap.Find(hpBind.Id); if (playerInfo != null) { hpBind.Target = playerInfo.HpPct; if ((Object)(object)hpBind.Text != (Object)null) { SetTmp(hpBind.Text, HpText(playerInfo)); } } } } private static string StatKey(int id, string cat, string stat) { return id + "|" + cat + "|" + stat; } private void Bind(string key, TextMeshProUGUI tmp) { if (!texts.TryGetValue(key, out var value)) { value = (texts[key] = new List<TextMeshProUGUI>()); } value.Add(tmp); } private void SetText(string key, string value) { if (!texts.TryGetValue(key, out var value2)) { return; } foreach (TextMeshProUGUI item in value2) { SetTmp(item, value); } } private static void SetTmp(TextMeshProUGUI t, string value) { if ((Object)(object)t != (Object)null && ((TMP_Text)t).text != value) { ((TMP_Text)t).text = value ?? ""; } } private string TitleText() { return (string.IsNullOrEmpty(snap.ModeName) ? "Game" : snap.ModeName).ToUpperInvariant(); } private string SubtitleText() { string text = "Round " + snap.Round + " Point " + snap.Point + " " + snap.Players.Count + ((snap.Players.Count == 1) ? " player" : " players"); if (snap.RoundsToWin > 0) { text = text + " First to " + snap.RoundsToWin + " rounds"; } return text; } private string ScoreText(int rounds, int points, bool compact) { if (compact) { return rounds + "R " + points + "P"; } return rounds + "/" + snap.RoundsToWin + " Rounds " + points + "/" + snap.PointsToWin + " Points"; } private string TeamLine(PlayerInfo p) { return p.TeamName + " " + ScoreText(p.Rounds, p.Points, compact: false); } private static string HpText(PlayerInfo p) { return $"{Mathf.Max(0f, p.Hp):F0} / {Mathf.Max(0f, p.MaxHp):F0}"; } internal static void PlayClick() { try { TabStyleUI instance = Instance; List<AudioClip> list = (((Object)(object)TabInfo.instance != (Object)null) ? TabInfo.instance.click : null); if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.audioSource == (Object)null) && list != null && list.Count != 0) { AudioClip val = list[rng.Next(list.Count)]; if ((Object)(object)val != (Object)null) { instance.audioSource.PlayOneShot(val, 0.8f); } } } catch { } } private void SetLayout(LayoutKind k) { if (TabStyle.LayoutSetting.Value != k) { TabStyle.LayoutSetting.Value = k; if (k == LayoutKind.Original) { Close(); OriginalMode.OpenTabInfo(); } else { dirty = true; } } } internal void SwitchFromOriginal(LayoutKind k) { TabStyle.LayoutSetting.Value = k; OriginalMode.CloseTabInfo(); Open(); } private void SetPalette(PaletteKind k) { if (TabStyle.PaletteSetting.Value != k) { TabStyle.PaletteSetting.Value = k; dirty = true; } } private void ToggleCards() { TabStyle.ShowCardsSetting.Value = !TabStyle.ShowCardsSetting.Value; dirty = true; } private void ToggleAllStats() { CatInfoBridge.Set(!CatInfoBridge.Value); dirty = true; } private void ToggleYouFirst() { TabStyle.YouFirstSetting.Value = !TabStyle.YouFirstSetting.Value; dirty = true; } private void ToggleCollapsed(string category) { if (!collapsed.Remove(category)) { collapsed.Add(category); } TabStyle.CollapsedSetting.Value = string.Join("|", collapsed.OrderBy((string x) => x)); dirty = true; } private void Select(int id) { selectedId = id; dirty = true; } private void ToggleExpanded(int id) { if (!expanded.Remove(id)) { expanded.Add(id); } dirty = true; } private void ToggleDockOpen(int id) { dockOpenId = ((dockOpenId == id) ? int.MinValue : id); dirty = true; } private void ToggleDockAllStats() { dockAllStats = !dockAllStats; dirty = true; } private void ToggleClassic(int id) { if (!classicCollapsed.Remove(id)) { classicCollapsed.Add(id); } dirty = true; } private void BuildSplit() { //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) float width; float height; RectTransform parent = CenteredPanel(1720f, 960f, out width, out height); Header((Transform)(object)parent, compact: false); Divider((Transform)(object)parent); RectTransform val = UIKit.Rect((Transform)(object)parent, "Body"); UIKit.HL((Component)(object)val, 0f, 0, 0, 0, 0, (TextAnchor)0, expandW: false, expandH: true); UIKit.LE((Component)(object)val, 0f, -1f, 1f, 0f, -1f, 1f); RectTransform val2 = UIKit.Rect((Transform)(object)val, "Players"); UIKit.LE((Component)(object)val2, 420f, 420f, 0f, 0f, -1f, 1f); UIKit.VL((Component)(object)val2, 0f, 0, 0, 0, 0, (TextAnchor)0, expandW: true, expandH: true); RectTransform parent2 = VList((Transform)(object)val2, "split.list", 14, 8, 14, 14, 4f); if (snap.Grouped) { foreach (TeamInfo team in snap.Teams) { TeamHeader((Transform)(object)parent2, team); foreach (PlayerInfo player in team.Players) { SplitRow((Transform)(object)parent2, player); } } } else { foreach (PlayerInfo player2 in snap.Players) { SplitRow((Transform)(object)parent2, player2); } } ((TMP_Text)Muted((Transform)(object)parent2, "Click a player to see their stats", 14f)).margin = new Vector4(10f, 10f, 0f, 0f); Divider((Transform)(object)val, vertical: true); RectTransform val3 = UIKit.Rect((Transform)(object)val, "Details"); UIKit.LE((Component)(object)val3, 0f, -1f, 1f, 0f, -1f, 1f); UIKit.VL((Component)(object)val3, 0f, 0, 0, 0, 0, (TextAnchor)0, expandW: true, expandH: true); RectTransform parent3 = VList((Transform)(object)val3, "split.detail|" + selectedId, 30, 22, 26, 30, 22f); PlayerInfo playerInfo = snap.Find(selectedId) ?? snap.FirstLocal; if (playerInfo != null) { RectTransform val4 = UIKit.Rect((Transform)(object)parent3, "Head"); UIKit.HL((Component)(object)val4, 18f, 0, 0, 0, 0, (TextAnchor)3); Avatar((Transform)(object)val4, playerInfo, 72f); RectTransform val5 = UIKit.Rect((Transform)(object)val4, "Who"); UIKit.VL((Component)(object)val5, 6f, 0, 0, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val5, 120f, -1f, 1f); NameLine((Transform)(object)val5, playerInfo, 38f); Muted((Transform)(object)val5, TeamLine(playerInfo), 17f, "pteam|" + playerInfo.Id); RectTransform val6 = UIKit.Rect((Transform)(object)val4, "HpHolder"); UIKit.VL((Component)(object)val6, 0f, 0, 0, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val6, 300f, 320f, 0f); HpBlock((Transform)(object)val6, playerInfo, 10f, 20f); CardsSection((Transform)(object)parent3, playerInfo, "split|" + playerInfo.Id); CategoryGrid((Transform)(object)parent3, playerInfo, playerInfo.Categories, 3, pal.Surf); } } private void TeamHeader(Transform parent, TeamInfo team) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) RectTransform val = UIKit.Rect(parent, "Team"); UIKit.HL((Component)(object)val, 10f, 10, 10, 12, 4, (TextAnchor)3); UIKit.LE((Component)(object)UIKit.Box((Transform)(object)val, team.Color, 5, "Dot"), 10f, 10f, 0f, 10f, 10f, 0f); UIKit.LE((Component)(object)Label((Transform)(object)val, team.Name), 20f, -1f, 1f); ((TMP_Text)Muted((Transform)(object)val, ScoreText(team.Rounds, team.Points, compact: false), 13f, "tscore|" + team.Team)).alignment = (TextAlignmentOptions)4100; } private void SplitRow(Transform parent, PlayerInfo p) { //IL_0033: 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_004e: 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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) bool flag = p.Id == selectedId; Image val = UIKit.Bordered(parent, flag ? pal.Surf2 : pal.Bg, flag ? pal.Accent : pal.Bg, 12, 2, "Player " + p.Id); UIKit.HL((Component)(object)val, 14f, 12, 14, 10, 10, (TextAnchor)3); Avatar(((Component)val).transform, p, 46f); RectTransform val2 = UIKit.Rect(((Component)val).transform, "Mid"); UIKit.VL((Component)(object)val2, 8f, 0, 0, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val2, 60f, -1f, 1f); NameLine((Transform)(object)val2, p, 21f); HpBar((Transform)(object)val2, p, 6f); RectTransform val3 = UIKit.Rect(((Component)val).transform, "Right"); UIKit.VL((Component)(object)val3, 4f, 0, 0, 0, 0, (TextAnchor)5); UIKit.LE((Component)(object)val3, 70f, -1f, 0f); ((TMP_Text)Muted((Transform)(object)val3, p.Cards.Count + ((p.Cards.Count == 1) ? " card" : " cards"), 14f)).alignment = (TextAlignmentOptions)4100; if (!snap.Grouped) { ((TMP_Text)Muted((Transform)(object)val3, ScoreText(p.Rounds, p.Points, compact: true), 14f, "pscore|" + p.Id)).alignment = (TextAlignmentOptions)4100; } int id = p.Id; UIKit.MakeButton((Graphic)(object)val, delegate { Select(id); }, ((Graphic)val).color, flag ? pal.Surf2 : pal.Surf); } private void BuildCompare() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) float width; float height; RectTransform parent = CenteredPanel(1860f, 1010f, out width, out height); Header((Transform)(object)parent, compact: false); Divider((Transform)(object)parent); SmartScroll scroll; RectTransform val = UIKit.Scroll((Transform)(object)parent, vertical: true, horizontal: true, pal.Muted, out scroll, "Board"); UIKit.LE((Component)(object)scroll, 0f, -1f, 1f, 0f, -1f, 1f); scrolls["compare"] = scroll; UIKit.HL((Component)(object)val, 14f, 16, 16, 16, 20, (TextAnchor)0); int count = snap.Players.Count; float num = width - 2f - 32f - 14f - 14f * (float)(count - 1); float num2 = ((count <= 4) ? Mathf.Floor(num / (float)Mathf.Max(1, count)) : 400f); num2 = Mathf.Max(330f, num2); foreach (PlayerInfo player in snap.Players) { Image val2 = UIKit.Bordered((Transform)(object)val, pal.Surf, player.Local ? pal.Accent : pal.Line, 14, (!player.Local) ? 1 : 2, "Column " + player.Id); UIKit.LE((Component)(object)((Component)((Component)val2).transform.parent).GetComponent<Image>(), num2, num2, 0f); UIKit.VL((Component)(object)val2, 14f, 18, 18, 16, 18, (TextAnchor)0); RectTransform val3 = UIKit.Rect(((Component)val2).transform, "Head"); UIKit.HL((Component)(object)val3, 12f, 0, 0, 0, 0, (TextAnchor)3); Avatar((Transform)(object)val3, player, 50f); RectTransform val4 = UIKit.Rect((Transform)(object)val3, "Who"); UIKit.VL((Component)(object)val4, 4f, 0, 0, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val4, 60f, -1f, 1f); NameLine((Transform)(object)val4, player, 24f); Muted((Transform)(object)val4, TeamLine(player), 14f, "pteam|" + player.Id); HpBlock(((Component)val2).transform, player, 7f, 16f); CardsSection(((Component)val2).transform, player, "compare|" + player.Id); if (player.Categories.Count == 0) { Muted(((Component)val2).transform, "No stats to show", 15f); } foreach (CategoryBlock category in player.Categories) { CategoryCard(((Component)val2).transform, player, category, pal.Surf2, 16f); } } } private void BuildScoreboard() { //IL_027d: Unknown result type (might be due to invalid IL or missing references) float width; float height; RectTransform parent = CenteredPanel(1860f, 1010f, out width, out height); Header((Transform)(object)parent, compact: false); Divider((Transform)(object)parent); List<KeyValuePair<string, string>> list = PresentQuickStats(Themes.QuickStats, snap.Players); RectTransform val = UIKit.Rect((Transform)(object)parent, "Columns"); UIKit.HL((Component)(object)val, 0f, 36, 56, 14, 8, (TextAnchor)3); UIKit.LE((Component)(object)Label((Transform)(object)val, "Player"), 280f, -1f, 1f); UIKit.LE((Component)(object)Label((Transform)(object)val, "HP"), 230f, 230f, 0f); foreach (KeyValuePair<string, string> item in list) { TextMeshProUGUI obj = Label((Transform)(object)val, item.Value); ((TMP_Text)obj).alignment = (TextAlignmentOptions)4100; UIKit.LE((Component)(object)obj, 118f, 118f, 0f); } TextMeshProUGUI obj2 = Label((Transform)(object)val, "Cards"); ((TMP_Text)obj2).alignment = (TextAlignmentOptions)4100; UIKit.LE((Component)(object)obj2, 120f, 120f, 0f); RectTransform parent2 = VList((Transform)(object)parent, "board", 18, 18, 4, 22, 6f); if (snap.Grouped) { foreach (TeamInfo team in snap.Teams) { BoardTeamHeader((Transform)(object)parent2, team); foreach (PlayerInfo player in team.Players) { BoardRow((Transform)(object)parent2, player, list); } } } else { foreach (PlayerInfo player2 in snap.Players) { BoardRow((Transform)(object)parent2, player2, list); } } ((TMP_Text)Muted((Transform)(object)parent2, "Click a row to show cards and every stat", 14f)).margin = new Vector4(14f, 10f, 0f, 0f); } private void BoardTeamHeader(Transform parent, TeamInfo team) { //IL_0057: 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) RectTransform obj = UIKit.Rect(parent, "Team"); UIKit.VL((Component)(object)obj, 6f, 0, 0, 12, 4, (TextAnchor)0); RectTransform val = UIKit.Rect((Transform)(object)obj, "Row"); UIKit.HL((Component)(object)val, 12f, 14, 14, 0, 0, (TextAnchor)3); TextMeshProUGUI obj2 = UIKit.Text((Transform)(object)val, team.Name.ToUpperInvariant(), 18f, pal.Text, (FontStyles)1, (TextAlignmentOptions)4097, rich: false, "Name"); ((TMP_Text)obj2).characterSpacing = 4f; UIKit.LE((Component)(object)obj2, 40f, -1f, 0f); UIKit.LE((Component)(object)Muted((Transform)(object)val, ScoreText(team.Rounds, team.Points, compact: false), 15f, "tscore|" + team.Team), 40f, -1f, 1f); UIKit.LE((Component)(object)UIKit.Box((Transform)(object)obj, team.Color, 1, "Line"), 0f, -1f, 1f, 2f, 2f, 0f); } private void BoardRow(Transform parent, PlayerInfo p, List<KeyValuePair<string, string>> quick) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) bool open = expanded.Contains(p.Id); Image val = UIKit.Bordered(parent, p.Local ? pal.Surf2 : pal.Surf, p.Local ? pal.Accent : pal.Surf, 12, 2, "Row " + p.Id); UIKit.VL((Component)(object)val, 0f, 0, 0, 0, 0, (TextAnchor)0); Image val2 = UIKit.Box(((Component)val).transform, Alpha(pal.Line, 0f), 10, "Main", raycast: true); UIKit.HL((Component)(object)val2, 0f, 16, 26, 10, 10, (TextAnchor)3); RectTransform val3 = UIKit.Rect(((Component)val2).transform, "Who"); UIKit.HL((Component)(object)val3, 12f, 0, 12, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val3, 280f, -1f, 1f); Avatar((Transform)(object)val3, p, 38f); NameLine((Transform)(object)val3, p, 20f); if (!snap.Grouped) { Muted((Transform)(object)val3, ScoreText(p.Rounds, p.Points, compact: true), 14f, "pscore|" + p.Id); } RectTransform val4 = UIKit.Rect(((Component)val2).transform, "Hp"); UIKit.HL((Component)(object)val4, 10f, 0, 18, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val4, 230f, 230f, 0f); TextMeshProUGUI val5 = UIKit.Text((Transform)(object)val4, HpText(p), 15f, pal.Muted, (FontStyles)0, (TextAlignmentOptions)4100, rich: false, "HpText"); HpBar((Transform)(object)val4, p, 6f, val5); UIKit.LE((Component)(object)val5, 86f, 86f, 0f); ((TMP_Text)val5).transform.SetAsLastSibling(); string basicCategoryName = TabInfoBridge.BasicCategoryName; foreach (KeyValuePair<string, string> item in quick) { p.Basic.TryGetValue(item.Key, out var value); TextMeshProUGUI val6 = UIKit.Text(((Component)val2).transform, value ?? "-", 19f, pal.Text, (FontStyles)1, (TextAlignmentOptions)4100, rich: true, "Stat"); UIKit.LE((Component)(object)val6, 118f, 118f, 0f); Bind(StatKey(p.Id, basicCategoryName, item.Key), val6); } RectTransform val7 = UIKit.Rect(((Component)val2).transform, "Cards"); UIKit.HL((Component)(object)val7, 10f, 0, 0, 0, 0, (TextAnchor)5); UIKit.LE((Component)(object)val7, 120f, 120f, 0f); ((TMP_Text)Muted((Transform)(object)val7, p.Cards.Count.ToString(), 17f)).alignment = (TextAlignmentOptions)4100; UIKit.Chevron((Transform)(object)val7, 14f, pal.Muted, open ? 180f : 0f); int id = p.Id; UIKit.MakeButton((Graphic)(object)val2, delegate { ToggleExpanded(id); }, ((Graphic)val2).color, Alpha(pal.Line, 0.35f), delegate { SetHint(open ? "Hide details" : "Show cards and every stat"); }, ResetHint); if (!open) { return; } RectTransform val8 = UIKit.Rect(((Component)val).transform, "Details"); UIKit.VL((Component)(object)val8, 14f, 66, 22, 4, 18, (TextAnchor)0); CardsSection((Transform)(object)val8, p, "board|" + p.Id); HashSet<string> shown = new HashSet<string>(quick.Select((KeyValuePair<string, string> q) => q.Key)) { "HP" }; List<CategoryBlock> list = new List<CategoryBlock>(); foreach (CategoryBlock category in p.Categories) { if (!category.IsBasic) { list.Add(category); continue; } CategoryBlock categoryBlock = new CategoryBlock { Name = category.Name, IsBasic = true }; categoryBlock.Stats.AddRange(category.Stats.Where((StatRow s) => !shown.Contains(s.Name))); if (categoryBlock.Stats.Count > 0) { list.Add(categoryBlock); } } if (list.Count > 0) { CategoryGrid((Transform)(object)val8, p, list, 3, p.Local ? pal.Surf : pal.Surf2); } } private void BuildDock() { //IL_002e: 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_0057: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0241: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min(600f, designSize.x - 40f); Image val = UIKit.Bordered((Transform)(object)content, pal.Bg, pal.Line, 18, 1, "Dock"); RectTransform val2 = (RectTransform)((Component)val).transform.parent; val2.anchorMin = new Vector2(1f, 0f); val2.anchorMax = new Vector2(1f, 1f); val2.pivot = new Vector2(1f, 0.5f); val2.sizeDelta = new Vector2(num, -28f); val2.anchoredPosition = new Vector2(-14f, 0f); ((Graphic)val).raycastTarget = true; UIKit.VL((Component)(object)val, 0f, 0, 0, 0, 0, (TextAnchor)0); Header(((Component)val).transform, compact: true); Divider(((Component)val).transform); RectTransform parent = VList(((Component)val).transform, "dock", 20, 14, 18, 24, 16f); PlayerInfo me = snap.FirstLocal; List<KeyValuePair<string, string>> list = PresentQuickStats(Themes.QuickStats.Concat(Themes.DockExtraStats), snap.Players); if (me != null) { RectTransform val3 = UIKit.Rect((Transform)(object)parent, "Me"); UIKit.HL((Component)(object)val3, 14f, 0, 0, 0, 0, (TextAnchor)3); Avatar((Transform)(object)val3, me, 58f); RectTransform val4 = UIKit.Rect((Transform)(object)val3, "Who"); UIKit.VL((Component)(object)val4, 4f, 0, 0, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val4, 60f, -1f, 1f); NameLine((Transform)(object)val4, me, 28f); Muted((Transform)(object)val4, TeamLine(me), 14f, "pteam|" + me.Id); HpBlock((Transform)(object)parent, me, 10f, 18f); StatTiles((Transform)(object)parent, me, list, 4, 22f, pal.Surf); CardsSection((Transform)(object)parent, me, "dock|" + me.Id); Image val5 = UIKit.Bordered((Transform)(object)parent, pal.Surf, pal.Line, 10, 1, "All Stats"); UIKit.HL((Component)(object)val5, 8f, 14, 14, 10, 10, (TextAnchor)3); UIKit.LE((Component)(object)Label(((Component)val5).transform, dockAllStats ? "Hide stat sections" : "Stat sections"), 20f, -1f, 1f); UIKit.Chevron(((Component)val5).transform, 14f, pal.Muted, dockAllStats ? 180f : 0f); UIKit.MakeButton((Graphic)(object)val5, ToggleDockAllStats, ((Graphic)val5).color, pal.Surf2); if (dockAllStats) { if (me.Categories.Count == 0) { Muted((Transform)(object)parent, "No stats to show", 15f); } foreach (CategoryBlock category in me.Categories) { CategoryCard((Transform)(object)parent, me, category, pal.Surf); } } } List<PlayerInfo> list2 = snap.Players.Where((PlayerInfo p) => me == null || p.Id != me.Id).ToList(); if (list2.Count == 0) { return; } ((TMP_Text)Label((Transform)(object)parent, "Other players")).margin = new Vector4(4f, 8f, 0f, 0f); foreach (PlayerInfo item in list2) { DockRow((Transform)(object)parent, item, list); } } private void DockRow(Transform parent, PlayerInfo p, List<KeyValuePair<string, string>> tiles) { //IL_003d: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) bool flag = dockOpenId == p.Id; Image val = UIKit.Box(parent, flag ? pal.Surf : Alpha(pal.Surf, 0f), 12, "Player " + p.Id, raycast: true); UIKit.VL((Component)(object)val, 0f, 0, 0, 0, 0, (TextAnchor)0); Image val2 = UIKit.Box(((Component)val).transform, Alpha(pal.Surf2, 0f), 12, "Main", raycast: true); UIKit.HL((Component)(object)val2, 12f, 10, 14, 9, 9, (TextAnchor)3); Avatar(((Component)val2).transform, p, 38f); RectTransform val3 = UIKit.Rect(((Component)val2).transform, "Who"); UIKit.VL((Component)(object)val3, 2f, 0, 0, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)val3, 80f, 170f, 0f); NameLine((Transform)(object)val3, p, 18f); Muted((Transform)(object)val3, snap.Grouped ? p.TeamName : ScoreText(p.Rounds, p.Points, compact: true), 13f, snap.Grouped ? null : ("pscore|" + p.Id)); HpBar(((Component)val2).transform, p, 6f); TextMeshProUGUI obj = Muted(((Component)val2).transform, p.Cards.Count + ((p.Cards.Count == 1) ? " card" : " cards"), 14f); ((TMP_Text)obj).alignment = (TextAlignmentOptions)4100; UIKit.LE((Component)(object)obj, 70f, 70f, 0f); UIKit.Chevron(((Component)val2).transform, 14f, pal.Muted, flag ? 180f : 0f); int id = p.Id; UIKit.MakeButton((Graphic)(object)val2, delegate { ToggleDockOpen(id); }, ((Graphic)val2).color, Alpha(pal.Surf2, flag ? 0.6f : 1f)); if (!flag) { return; } RectTransform val4 = UIKit.Rect(((Component)val).transform, "Details"); UIKit.VL((Component)(object)val4, 12f, 14, 14, 2, 14, (TextAnchor)0); StatTiles((Transform)(object)val4, p, tiles, 4, 18f, pal.Surf2); CardsSection((Transform)(object)val4, p, "dockrow|" + p.Id); foreach (CategoryBlock category in p.Categories) { CategoryCard((Transform)(object)val4, p, category, pal.Surf2, 16f); } } internal static Color Alpha(Color c, float a) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) c.a = a; return c; } private void Dim(float alpha) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) UIKit.Stretch(((Graphic)UIKit.Box((Transform)(object)content, new Color(0f, 0f, 0f, alpha), 0, "Dim")).rectTransform); } private RectTransform CenteredPanel(float maxW, float maxH, out float width, out float height) { //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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00a1: 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_00b1: 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) Dim(0.35f); width = Mathf.Min(maxW, designSize.x - 80f); height = Mathf.Min(maxH, designSize.y - 70f); Image obj = UIKit.Bordered((Transform)(object)content, pal.Bg, pal.Line, 18, 1, "Panel"); RectTransform val = (RectTransform)((Component)obj).transform.parent; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); val.anchorMax = val2; val.anchorMin = val2; val.pivot = new Vector2(0.5f, 0.5f); val.sizeDelta = new Vector2(width, height); val.anchoredPosition = Vector2.zero; ((Graphic)obj).raycastTarget = true; UIKit.VL((Component)(object)obj, 0f, 0, 0, 0, 0, (TextAnchor)0); return ((Graphic)obj).rectTransform; } private void Divider(Transform parent, bool vertical = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Image c = UIKit.Box(parent, pal.Line, 0, "Divider"); if (vertical) { UIKit.LE((Component)(object)c, 1f, 1f, 0f, 0f, -1f, 1f); } else { UIKit.LE((Component)(object)c, 0f, -1f, 1f, 1f, 1f, 0f); } } private void Header(Transform parent, bool compact) { //IL_01ed: 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) hintDefault = Themes.LayoutLabel(TabStyle.LayoutSetting.Value) + " / " + pal.Name; if (!compact) { RectTransform val = UIKit.Rect(parent, "Header"); UIKit.HL((Component)(object)val, 14f, 26, 18, 14, 14, (TextAnchor)3); UIKit.LE((Component)(object)val, -1f, -1f, -1f, 78f, 78f, 0f); TitleBlock((Transform)(object)val); UIKit.Spacer((Transform)(object)val); hint = UIKit.Text((Transform)(object)val, hintDefault, 15f, pal.Muted, (FontStyles)0, (TextAlignmentOptions)4100, rich: false, "Hint"); UIKit.LE((Component)(object)hint, 0f, 240f, 0f); YouFirstToggle((Transform)(object)val); AllStatsToggle((Transform)(object)val); CardsToggle((Transform)(object)val); LayoutButtons((Transform)(object)val); PaletteButtons((Transform)(object)val); CloseButton((Transform)(object)val); } else { RectTransform obj = UIKit.Rect(parent, "Header"); UIKit.VL((Component)(object)obj, 12f, 20, 14, 14, 14, (TextAnchor)0); UIKit.LE((Component)(object)obj, -1f, -1f, -1f, -1f, -1f, 0f); RectTransform val2 = UIKit.Rect((Transform)(object)obj, "Top"); UIKit.HL((Component)(object)val2, 10f, 0, 0, 0, 0, (TextAnchor)3); TitleBlock((Transform)(object)val2); UIKit.Spacer((Transform)(object)val2); CloseButton((Transform)(object)val2); RectTransform val3 = UIKit.Rect((Transform)(object)obj, "Toggles"); UIKit.HL((Component)(object)val3, 10f, 0, 0, 0, 0, (TextAnchor)3); YouFirstToggle((Transform)(object)val3); AllStatsToggle((Transform)(object)val3); CardsToggle((Transform)(object)val3); UIKit.Spacer((Transform)(object)val3); hint = UIKit.Text((Transform)(object)val3, hintDefault, 14f, pal.Muted, (FontStyles)0, (TextAlignmentOptions)4100, rich: false, "Hint"); UIKit.LE((Component)(object)hint, 0f, 160f, 0f); RectTransform val4 = UIKit.Rect((Transform)(object)obj, "Buttons"); UIKit.HL((Component)(object)val4, 10f, 0, 0, 0, 0, (TextAnchor)3); LayoutButtons((Transform)(object)val4); UIKit.Spacer((Transform)(object)val4); PaletteButtons((Transform)(object)val4); } } private void TitleBlock(Transform parent) { //IL_0055: 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) RectTransform obj = UIKit.Rect(parent, "Title"); UIKit.VL((Component)(object)obj, 2f, 0, 0, 0, 0, (TextAnchor)3); UIKit.LE((Component)(object)obj, 150f, -1f, 0f); TextMeshProUGUI val = UIKit.Text((Transform)(object)obj, TitleText(), 28f, pal.Text, (FontStyles)1, (TextAlignmentOptions)4097, rich: false, "Mode"); ((TMP_Text)val).characterSpacing = 4f; Bind("title", val); TextMeshProUGUI tmp = UIKit.Text((Transform)(object)obj, SubtitleText(), 15f, pal.Muted, (FontStyles)0, (TextAlignmentOptions)4097, rich: false, "Sub"); Bind("subtitle", tmp); } private void SetHint(string s) { if ((Object)(object)hint != (Object)null) { ((TMP_Text)hint).text = s; } } private void ResetHint() { if ((Object)(object)hint != (Object)null) { ((TMP_Text)hint).text = hintDefault; } } private RectTransform Segment(Transform parent) { //IL_0007: 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) Image obj = UIKit.Bordered(parent, pal.Surf, pal.Line, 10, 1, "Segment"); UIKit.HL((Component)(object)obj, 2f, 4, 4, 4, 4, (TextAnchor)4); return ((Graphic)obj).rectTransform; } private void LayoutButtons(Transform parent) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) RectTransform parent2 = Segment(parent); LayoutKind[] layouts = Themes.Layouts; Vector2 val2 = default(Vector2); foreach (LayoutKind layoutKind in layouts) { LayoutKind k = layoutKind; bool flag = TabStyle.LayoutSetting.Value == k; Image val = UIKit.Box((Transform)(object)parent2, flag ? pal.Surf2 : Alpha(pal.Surf2, 0f), 7, "Layout " + k, raycast: true); UIKit.LE((Component)(object)val, 40f, 40f, 0f, 34f, 34f, 0f); RectTransform obj = UIKit.Rect(((Component)val).transform, "Icon"); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); obj.anchorMax = val2; obj.anchorMin = val2; obj.sizeDelta = new Vector2(24f, 17f); LayoutIcon(obj, k, flag ? pal.Accent : pal.Muted); UIKit.MakeButton((Graphic)(object)val, delegate { SetLayout(k); }, ((Graphic)val).color, flag ? pal.Surf2 : Alpha(pal.Surf2, 0.7f), delegate { SetHint((k == LayoutKind.Original) ? "Original TabInfo" : (Themes.LayoutLabel(k) + " layout")); }, ResetHint); } } internal static void LayoutIcon(RectTransform icon, LayoutKind k, Color c) { //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_000b: 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_0049: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) Color color = Alpha(c, 0.45f); switch (k) { case LayoutKind.Split: UIKit.Block((Transform)(object)icon, c, 0f, 0f, 0.34f, 1f); UIKit.Block((Transform)(object)icon, color, 0.42f, 0f, 1f, 1f); break; case LayoutKind.Compare: UIKit.Block((Transform)(object)icon, c, 0f, 0f, 0.28f, 1f); UIKit.Block((Transform)(object)icon, color, 0.36f, 0f, 0.64f, 1f); UIKit.Block((Transform)(object)icon, color, 0.72f, 0f, 1f, 1f); break; case LayoutKind.Scoreboard: UIKit.Block((Transform)(object)icon, c, 0f, 0.7f, 1f, 1f, 1); UIKit.Block((Transform)(object)icon, color, 0f, 0.35f, 1f, 0.62f, 1); UIKit.Block((Transform)(object)icon, color, 0f, 0f, 1f, 0.27f, 1); break; case LayoutKind.Dock: UIKit.Block((Transform)(object)icon, Alpha(c, 0.22f), 0f, 0f, 0.58f, 1f); UIKit.Block((Transform)(object)icon, c, 0.66f, 0f, 1f, 1f); break; case LayoutKind.Classic: UIKit.Block((Transform)(object)icon, c, 0f, 0.72f, 1f, 1f, 1); UIKit.Block((Transform)(object)icon, color, 0.2f, 0.38f, 1f, 0.6f, 1); UIKit.Block((Transform)(object)icon, color, 0.2f, 0f, 1f, 0.26f, 1); break; case LayoutKind.Original: UIKit.Block((Transform)(object)icon, Alpha(c, 0.3f), 0f, 0f, 1f, 1f, 0); UIKit.Block((Transform)(object)icon, Alpha(c, 0.75f), 0f, 0.8f, 1f, 1f, 0); UIKit.Block((Transform)(object)icon, new Color(0.86f, 0.42f, 0.2f, 1f), 0f, 0.5f, 1f, 0.72f, 0); break; } } private void PaletteButtons(Transform parent) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_01b3: 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_01c8: Unknown result type (might be due to invalid IL or missing references) RectTransform parent2 = Segment(parent); Palette[] palettes = Themes.Palettes; foreach (Palette p in palettes) { PaletteKind k = p.Kind; bool flag = TabStyle.PaletteSetting.Value == k; Image val = UIKit.Box((Transform)(object)parent2, Alpha(pal.Surf2, 0f), 7, "Colors " + p.Name, raycast: true); UIKit.LE((Component)(object)val, 32f, 32f, 0f, 34f, 34f, 0f); Image obj = UIKit.Box(((Component)val).transform, flag ? pal.Text : Alpha(pal.Text, 0f), 14, "Ring"); Center(((Graphic)obj).rectTransform, 28f); Image obj2 = UIKit.Box(((Component)obj).transform, pal.Surf, 12, "Gap"); Center(((Graphic)obj2).rectTransform, 24f); Image obj3 = UIKit.Box(((Component)obj2).transform, p.Bg, 10, "Swatch"); Center(((Graphic)obj3).rectTransform, 20f); Center(((Graphic)UIKit.Box(((Component)obj3).transform, p.Accent, 7, "Accent")).rectTransform, 13f); UIKit.MakeButton((Graphic)(object)val, delegate { SetPalette(k); }, ((Graphic)val).color, Alpha(pal.Surf2, 0.8f), delegate { SetHint(p.Name + " colors"); }, ResetHint); } } private static void Center(RectTransform rt, float size) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0.5f); rt.anchorMax = val; rt.anchorMin = val; rt.pivot = new Vector2(0.5f, 0.5f); rt.sizeDelta = new Vector2(size, size); rt.anchoredPosition = Vector2.zero; } private void CardsToggle(Transform parent) { Switch(parent, "CARDS", TabStyle.ShowCardsSetting.Value, ToggleCards, "Hide cards", "Show cards"); } private void YouFirstToggle(Transform parent) { Switch(parent, "YOU FIRST", TabStyle.YouFirstSetting.Value, ToggleYouFirst, "Sort everyone normally", "Put you at the top / left"); } private void AllStatsToggle(Transform parent) { if (CatInfoBridge.Available) { Switch(parent, "ALL STATS", CatInfoBridge.Value, ToggleAllStats, "Only show stats that apply", "Show every stat (CatInfo)"); } } private void Switch(Transform parent, string text, bool on, Action toggle, string hintWhenOn, string hintWhenOff) { //IL_002b: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: