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.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using On.RoR2; using On.RoR2.UI; using RoR2; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RiskyStats")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RiskyStats")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e2f06f9f-3a70-4624-ba24-44bb1f34c38f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace RiskyStats; public static class ProgressSettings { public static KeyCode ToggleKey = (KeyCode)98; private static ConfigEntry toggleKeyEntry; public static void Init(ConfigFile config) { //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) toggleKeyEntry = config.Bind("General", "Progress Toggle Key", (KeyCode)98, "Key to hold to show the run progress panel"); ToggleKey = toggleKeyEntry.Value; } } public static class RunProgressStats { public static float TotalDamage; public static float TotalDamageTaken; public static float TotalHealing; public static float MaxSpeed; public static float BiggestHit; public static bool BiggestHitCrit; private static bool hooked; public static void Init() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown if (!hooked) { hooked = true; GlobalEventManager.onServerDamageDealt += OnDamageDealt; HealthComponent.TakeDamage += new hook_TakeDamage(OnDamageTaken); HealthComponent.Heal += new hook_Heal(OnHealing); Run.onRunStartGlobal += OnRunStart; } } private static void OnRunStart(Run run) { ResetStats(); } public static void ResetStats() { TotalDamage = 0f; TotalDamageTaken = 0f; TotalHealing = 0f; MaxSpeed = 0f; BiggestHit = 0f; BiggestHitCrit = false; } private static void OnDamageDealt(DamageReport report) { LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); CharacterBody val = ((firstLocalUser != null) ? firstLocalUser.cachedBody : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)report.attackerBody != (Object)(object)val)) { TotalDamage += report.damageDealt; if (report.damageDealt > BiggestHit) { BiggestHit = report.damageDealt; BiggestHitCrit = report.damageInfo.crit; } } } private static void OnDamageTaken(orig_TakeDamage orig, HealthComponent self, DamageInfo info) { orig.Invoke(self, info); LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); CharacterBody val = ((firstLocalUser != null) ? firstLocalUser.cachedBody : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)self.body != (Object)(object)val)) { TotalDamageTaken += info.damage; } } private static float OnHealing(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) float num = orig.Invoke(self, amount, procChainMask, nonRegen); LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); CharacterBody val = ((firstLocalUser != null) ? firstLocalUser.cachedBody : null); if ((Object)(object)val != (Object)null && (Object)(object)self.body == (Object)(object)val) { TotalHealing += num; } return num; } public static void TrackSpeed(CharacterBody body) { if (!((Object)(object)body == (Object)null) && !((Object)(object)body.characterMotor == (Object)null)) { float magnitude = ((Vector3)(ref body.characterMotor.velocity)).magnitude; if (magnitude > MaxSpeed) { MaxSpeed = magnitude; } } } public static string FormatNumber(float number) { if (number >= 1E+12f) { return (number / 1E+12f).ToString("0.0") + "t"; } if (number >= 1E+09f) { return (number / 1E+09f).ToString("0.0") + "b"; } if (number >= 1000000f) { return (number / 1000000f).ToString("0.0") + "m"; } if (number >= 1000f) { return (number / 1000f).ToString("0.0") + "k"; } return number.ToString("0"); } } public class RunProgressUI : MonoBehaviour { private GameObject panelObject; private TextMeshProUGUI damageText; private TextMeshProUGUI damageTakenText; private TextMeshProUGUI healingText; private TextMeshProUGUI maxSpeedText; private TextMeshProUGUI biggestHitText; private static readonly Color BackgroundColor = new Color(0.05f, 0.07f, 0.18f, 0.97f); private static readonly Color BorderColor = new Color(1f, 0.82f, 0.2f, 1f); private static readonly Color RowColor = new Color(0.09f, 0.11f, 0.24f, 1f); private static readonly Color RowColorAlt = new Color(0.11f, 0.13f, 0.27f, 1f); private static readonly Color AccentColor = new Color(1f, 0.82f, 0.2f, 1f); private static readonly Color SubTextColor = new Color(0.65f, 0.68f, 0.8f, 1f); private const float PanelWidth = 420f; private const float RowHeight = 34f; private const float RowSpacing = 6f; private void Awake() { RunProgressStats.Init(); } private void Update() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) HUD val = Object.FindObjectOfType(); if (!((Object)(object)val == (Object)null)) { LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); CharacterBody body = ((firstLocalUser != null) ? firstLocalUser.cachedBody : null); RunProgressStats.TrackSpeed(body); if ((Object)(object)panelObject == (Object)null) { CreatePanel(val); } bool key = UnityInput.Current.GetKey(ProgressSettings.ToggleKey); if (key != panelObject.activeSelf) { panelObject.SetActive(key); } if (key) { RefreshValues(); } } } private void CreatePanel(HUD hud) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown panelObject = new GameObject("RiskyStatsProgressPanel"); panelObject.transform.SetParent(hud.mainContainer.transform, false); RectTransform val = panelObject.AddComponent(); val.anchorMin = new Vector2(0.5f, 0.5f); val.anchorMax = new Vector2(0.5f, 0.5f); val.pivot = new Vector2(0.5f, 0.5f); val.anchoredPosition = Vector2.zero; val.sizeDelta = new Vector2(420f, 100f); Image val2 = panelObject.AddComponent(); ((Graphic)val2).color = BackgroundColor; Outline val3 = panelObject.AddComponent(); ((Shadow)val3).effectColor = BorderColor; ((Shadow)val3).effectDistance = new Vector2(2f, -2f); VerticalLayoutGroup val4 = panelObject.AddComponent(); ((LayoutGroup)val4).padding = new RectOffset(18, 18, 18, 18); ((HorizontalOrVerticalLayoutGroup)val4).spacing = 6f; ((LayoutGroup)val4).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)val4).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val4).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val4).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)val4).childForceExpandHeight = false; ContentSizeFitter val5 = panelObject.AddComponent(); val5.horizontalFit = (FitMode)0; val5.verticalFit = (FitMode)2; CreateTitle(panelObject.transform); CreateDivider(panelObject.transform); damageText = CreateStatRow(panelObject.transform, "Total Damage", alt: false); damageTakenText = CreateStatRow(panelObject.transform, "Total Damage Taken", alt: true); healingText = CreateStatRow(panelObject.transform, "Total Healing", alt: false); maxSpeedText = CreateStatRow(panelObject.transform, "Max Speed Achieved", alt: true); biggestHitText = CreateStatRow(panelObject.transform, "Biggest Hit", alt: false); panelObject.SetActive(false); } private void CreateTitle(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Title"); val.transform.SetParent(parent, false); TextMeshProUGUI val2 = val.AddComponent(); ((TMP_Text)val2).text = "RUN PROGRESS"; ((TMP_Text)val2).fontSize = 24f; ((Graphic)val2).color = AccentColor; ((TMP_Text)val2).alignment = (TextAlignmentOptions)514; ((TMP_Text)val2).fontStyle = (FontStyles)1; LayoutElement val3 = val.AddComponent(); val3.minHeight = 30f; val3.preferredHeight = 30f; val3.flexibleWidth = 1f; } private void CreateDivider(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Divider"); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); ((Graphic)val2).color = new Color(BorderColor.r, BorderColor.g, BorderColor.b, 0.35f); LayoutElement val3 = val.AddComponent(); val3.minHeight = 2f; val3.preferredHeight = 2f; val3.flexibleWidth = 1f; } private TextMeshProUGUI CreateStatRow(Transform parent, string labelText, bool alt) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_00b9: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Row_" + labelText.Replace(" ", "")); val.transform.SetParent(parent, false); LayoutElement val2 = val.AddComponent(); val2.minHeight = 34f; val2.preferredHeight = 34f; val2.flexibleWidth = 1f; HorizontalLayoutGroup val3 = val.AddComponent(); ((LayoutGroup)val3).padding = new RectOffset(12, 12, 4, 4); ((LayoutGroup)val3).childAlignment = (TextAnchor)3; ((HorizontalOrVerticalLayoutGroup)val3).spacing = 10f; ((HorizontalOrVerticalLayoutGroup)val3).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val3).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandHeight = true; Image val4 = val.AddComponent(); ((Graphic)val4).color = (alt ? RowColorAlt : RowColor); GameObject val5 = new GameObject("Label"); val5.transform.SetParent(val.transform, false); TextMeshProUGUI val6 = val5.AddComponent(); ((TMP_Text)val6).text = labelText; ((TMP_Text)val6).fontSize = 17f; ((Graphic)val6).color = SubTextColor; ((TMP_Text)val6).alignment = (TextAlignmentOptions)4097; LayoutElement val7 = val5.AddComponent(); val7.flexibleWidth = 1f; GameObject val8 = new GameObject("Value"); val8.transform.SetParent(val.transform, false); TextMeshProUGUI val9 = val8.AddComponent(); ((TMP_Text)val9).text = "0"; ((TMP_Text)val9).fontSize = 17f; ((Graphic)val9).color = Color.white; ((TMP_Text)val9).alignment = (TextAlignmentOptions)4100; ((TMP_Text)val9).fontStyle = (FontStyles)1; LayoutElement val10 = val8.AddComponent(); val10.preferredWidth = 120f; val10.minWidth = 120f; val10.flexibleWidth = 0f; return val9; } private void RefreshValues() { ((TMP_Text)damageText).text = "" + RunProgressStats.FormatNumber(RunProgressStats.TotalDamage) + ""; ((TMP_Text)damageTakenText).text = "" + RunProgressStats.FormatNumber(RunProgressStats.TotalDamageTaken) + ""; ((TMP_Text)healingText).text = "" + RunProgressStats.FormatNumber(RunProgressStats.TotalHealing) + ""; ((TMP_Text)maxSpeedText).text = $"{RunProgressStats.MaxSpeed:0.0} m/s"; string text = (RunProgressStats.BiggestHitCrit ? "FF0000" : "FFFFFF"); ((TMP_Text)biggestHitText).text = "" + RunProgressStats.FormatNumber(RunProgressStats.BiggestHit) + ""; } } public enum StatAlignment { Horizontal, Vertical } public enum StatTextAlign { Center, Left } public static class RSSettings { public static Dictionary StatVisibility = new Dictionary { { "AttackSpeed", true }, { "Armor", true }, { "Crit", true }, { "Healing", true }, { "Damage", true }, { "Streak", true }, { "DamageTaken", true }, { "DamageTakenStreak", true }, { "Speed", true } }; public static float StatFontSize = 27f; public static float StatSpacing = 40f; public static StatAlignment Alignment = StatAlignment.Horizontal; public static StatTextAlign TextAlign = StatTextAlign.Center; private static ConfigEntry textAlignEntry; public static bool PanelVisible = true; public static KeyCode ToggleKey = (KeyCode)118; private static ConfigFile config; private static Dictionary> visibilityEntries = new Dictionary>(); private static ConfigEntry fontSizeEntry; private static ConfigEntry spacingEntry; private static ConfigEntry alignmentEntry; private static ConfigEntry toggleKeyEntry; public static event Action OnSettingsChanged; public static void Init(ConfigFile cfg) { //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) config = cfg; foreach (string item in new List(StatVisibility.Keys)) { ConfigEntry val = config.Bind("Stats Visibility", item, true, "Show or hide the " + item + " stat"); visibilityEntries[item] = val; StatVisibility[item] = val.Value; } fontSizeEntry = config.Bind("Appearance", "Font Size", 27f, "Text size of each stat"); spacingEntry = config.Bind("Appearance", "Spacing", 40f, "Spacing between stats"); alignmentEntry = config.Bind("Appearance", "Alignment", StatAlignment.Horizontal, "Horizontal or vertical layout"); textAlignEntry = config.Bind("Appearance", "Text Alignment", StatTextAlign.Center, "Text alignment when using vertical layout"); toggleKeyEntry = config.Bind("General", "Toggle Key", (KeyCode)118, "Key used to show/hide the stats panel"); StatFontSize = fontSizeEntry.Value; StatSpacing = spacingEntry.Value; Alignment = alignmentEntry.Value; TextAlign = textAlignEntry.Value; ToggleKey = toggleKeyEntry.Value; } public static void SetVisibility(string key, bool value) { StatVisibility[key] = value; if (visibilityEntries.ContainsKey(key)) { visibilityEntries[key].Value = value; } RSSettings.OnSettingsChanged?.Invoke(); } public static void SetFontSize(float value) { StatFontSize = value; if (fontSizeEntry != null) { fontSizeEntry.Value = value; } RSSettings.OnSettingsChanged?.Invoke(); } public static void SetSpacing(float value) { StatSpacing = value; if (spacingEntry != null) { spacingEntry.Value = value; } RSSettings.OnSettingsChanged?.Invoke(); } public static void SetAlignment(StatAlignment value) { Alignment = value; if (alignmentEntry != null) { alignmentEntry.Value = value; } RSSettings.OnSettingsChanged?.Invoke(); } public static void SetTextAlign(StatTextAlign value) { TextAlign = value; if (textAlignEntry != null) { textAlignEntry.Value = value; } RSSettings.OnSettingsChanged?.Invoke(); } public static void TogglePanelVisible() { PanelVisible = !PanelVisible; RSSettings.OnSettingsChanged?.Invoke(); } public static void ResetToDefault() { foreach (string item in new List(StatVisibility.Keys)) { StatVisibility[item] = true; if (visibilityEntries.ContainsKey(item)) { visibilityEntries[item].Value = true; } } StatFontSize = 27f; if (fontSizeEntry != null) { fontSizeEntry.Value = 27f; } StatSpacing = 40f; if (spacingEntry != null) { spacingEntry.Value = 40f; } Alignment = StatAlignment.Horizontal; if (alignmentEntry != null) { alignmentEntry.Value = StatAlignment.Horizontal; } Alignment = StatAlignment.Horizontal; if (alignmentEntry != null) { alignmentEntry.Value = StatAlignment.Horizontal; } TextAlign = StatTextAlign.Center; if (textAlignEntry != null) { textAlignEntry.Value = StatTextAlign.Center; } RSSettings.OnSettingsChanged?.Invoke(); } } public class RSSettingsUI : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__17_0; public static Func <>9__17_2; public static UnityAction <>9__24_0; public static Action <>9__27_0; public static Action <>9__27_1; internal bool b__17_0(HGButton b) { return ((Component)b).gameObject.activeInHierarchy; } internal bool b__17_2(Transform t) { return ((Object)t).name.IndexOf("quit", StringComparison.OrdinalIgnoreCase) >= 0 || ((Object)t).name.IndexOf("exit", StringComparison.OrdinalIgnoreCase) >= 0; } internal void b__24_0() { StatAlignment alignment = ((RSSettings.Alignment == StatAlignment.Horizontal) ? StatAlignment.Vertical : StatAlignment.Horizontal); RSSettings.SetAlignment(alignment); Transform parent = panelObject.transform.parent; Object.DestroyImmediate((Object)(object)panelObject); BuildPanel(parent); } internal void b__27_0() { RSSettings.ResetToDefault(); Transform parent = panelObject.transform.parent; Object.DestroyImmediate((Object)(object)panelObject); BuildPanel(parent); } internal void b__27_1() { panelObject.SetActive(false); } } private static GameObject panelObject; private static readonly Color BackgroundColor = new Color(0.05f, 0.07f, 0.18f, 0.97f); private static readonly Color BorderColor = new Color(1f, 0.82f, 0.2f, 1f); private static readonly Color RowColor = new Color(0.09f, 0.11f, 0.24f, 1f); private static readonly Color RowColorAlt = new Color(0.11f, 0.13f, 0.27f, 1f); private static readonly Color AccentColor = new Color(1f, 0.82f, 0.2f, 1f); private static readonly Color OffColor = new Color(0.3f, 0.3f, 0.35f, 1f); private static readonly Color DarkTextColor = new Color(0.05f, 0.07f, 0.18f, 1f); private static readonly Color SubTextColor = new Color(0.65f, 0.68f, 0.8f, 1f); private const float PanelWidth = 480f; private const float RowHeight = 32f; private const float RowSpacing = 6f; private static readonly string[] StatOrder = new string[9] { "AttackSpeed", "Armor", "Crit", "Healing", "Damage", "Streak", "DamageTaken", "DamageTakenStreak", "Speed" }; private static readonly Dictionary StatLabels = new Dictionary { { "AttackSpeed", "Attack Speed" }, { "Armor", "Armor" }, { "Crit", "Crit" }, { "Healing", "Healing" }, { "Damage", "Damage" }, { "Streak", "Streak" }, { "DamageTaken", "Damage Taken" }, { "DamageTakenStreak", "Damage Taken Streak" }, { "Speed", "Speed" } }; private static readonly Color ResetColor = new Color(0.4f, 0.4f, 0.45f, 1f); private void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown PauseScreenController.Awake += new hook_Awake(PauseScreenController_Awake); } private void OnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown PauseScreenController.Awake -= new hook_Awake(PauseScreenController_Awake); } private void PauseScreenController_Awake(orig_Awake orig, PauseScreenController self) { orig.Invoke(self); Debug.Log((object)"[RiskyStats] PauseScreenController_Awake fired"); CreateSettingsButton(self); } private void CreateSettingsButton(PauseScreenController self) { //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown HGButton[] componentsInChildren = ((Component)self).GetComponentsInChildren(true); Debug.Log((object)$"[RiskyStats] Found {componentsInChildren.Length} buttons"); HGButton[] array = componentsInChildren; foreach (HGButton val in array) { string[] obj = new string[7] { "[RiskyStats] Button: ", ((Object)((Component)val).gameObject).name, " | Parent: ", null, null, null, null }; Transform parent = ((Component)val).transform.parent; obj[3] = ((parent != null) ? ((Object)parent).name : null); obj[4] = " | "; obj[5] = $"Sibling: {((Component)val).transform.GetSiblingIndex()} | "; obj[6] = $"Active: {((Component)val).gameObject.activeInHierarchy}"; Debug.Log((object)string.Concat(obj)); } HGButton val2 = ((IEnumerable)componentsInChildren).FirstOrDefault((Func)((HGButton b) => ((Component)b).gameObject.activeInHierarchy)); if ((Object)(object)val2 == (Object)null) { return; } Transform parent2 = ((Component)val2).transform.parent; GameObject val3 = Object.Instantiate(((Component)val2).gameObject, parent2); ((Object)val3).name = "RiskyStatsSettingsButton"; HGButton component = val3.GetComponent(); ((Button)component).onClick = new ButtonClickedEvent(); TextMeshProUGUI componentInChildren = val3.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).text = "Risky Stats"; LanguageTextMeshController component2 = ((Component)componentInChildren).GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.Destroy((Object)(object)component2); } LanguageTextMeshController component3 = val3.GetComponent(); if ((Object)(object)component3 != (Object)null) { Object.Destroy((Object)(object)component3); } } Canvas componentInParent = ((Component)self).GetComponentInParent(); Transform canvasTransform = (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).transform : ((Component)self).transform); ((UnityEvent)((Button)component).onClick).AddListener((UnityAction)delegate { TogglePanel(canvasTransform); EventSystem.current.SetSelectedGameObject((GameObject)null); }); Debug.Log((object)"========== CHILD ORDER =========="); for (int num = 0; num < parent2.childCount; num++) { Debug.Log((object)$"{num}: {((Object)parent2.GetChild(num)).name}"); } Transform val4 = ((IEnumerable)parent2).Cast().FirstOrDefault((Func)((Transform t) => ((Object)t).name.IndexOf("quit", StringComparison.OrdinalIgnoreCase) >= 0 || ((Object)t).name.IndexOf("exit", StringComparison.OrdinalIgnoreCase) >= 0)); if ((Object)(object)val4 != (Object)null) { Debug.Log((object)("[RiskyStats] Found quit button: " + ((Object)val4).name)); val3.transform.SetSiblingIndex(val4.GetSiblingIndex()); Debug.Log((object)$"[RiskyStats] Inserted at index {val3.transform.GetSiblingIndex()}"); } else { Debug.LogWarning((object)"[RiskyStats] Could not find Quit/Exit button, putting at end."); val3.transform.SetAsLastSibling(); } } private static void TogglePanel(Transform canvasTransform) { if ((Object)(object)panelObject == (Object)null) { BuildPanel(canvasTransform); } else { panelObject.SetActive(!panelObject.activeSelf); } } private static void BuildPanel(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0038: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown panelObject = new GameObject("RiskyStatsSettingsPanel"); panelObject.transform.SetParent(parent, false); RectTransform val = panelObject.AddComponent(); val.anchorMin = new Vector2(0.5f, 0.5f); val.anchorMax = new Vector2(0.5f, 0.5f); val.pivot = new Vector2(0.5f, 0.5f); val.anchoredPosition = Vector2.zero; val.sizeDelta = new Vector2(480f, 100f); Image val2 = panelObject.AddComponent(); ((Graphic)val2).color = BackgroundColor; Outline val3 = panelObject.AddComponent(); ((Shadow)val3).effectColor = BorderColor; ((Shadow)val3).effectDistance = new Vector2(2f, -2f); VerticalLayoutGroup val4 = panelObject.AddComponent(); ((LayoutGroup)val4).padding = new RectOffset(18, 18, 18, 18); ((HorizontalOrVerticalLayoutGroup)val4).spacing = 6f; ((LayoutGroup)val4).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)val4).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val4).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val4).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)val4).childForceExpandHeight = false; ContentSizeFitter val5 = panelObject.AddComponent(); val5.horizontalFit = (FitMode)0; val5.verticalFit = (FitMode)2; CreateTitle(panelObject.transform); CreateDivider(panelObject.transform); bool flag = false; string[] statOrder = StatOrder; foreach (string key in statOrder) { CreateToggleRow(panelObject.transform, key, StatLabels[key], flag); flag = !flag; } CreateDivider(panelObject.transform); CreateSliderRow(panelObject.transform, "Size", 14f, 48f, RSSettings.StatFontSize, RSSettings.SetFontSize); CreateSliderRow(panelObject.transform, "Spacing", 5f, 100f, RSSettings.StatSpacing, RSSettings.SetSpacing); CreateAlignmentRow(panelObject.transform); if (RSSettings.Alignment == StatAlignment.Vertical) { CreateTextAlignRow(panelObject.transform); } CreateBottomButtonsRow(panelObject.transform); } private static void CreateTitle(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Title"); val.transform.SetParent(parent, false); TextMeshProUGUI val2 = val.AddComponent(); ((TMP_Text)val2).text = "RISKY STATS SETTINGS"; ((TMP_Text)val2).fontSize = 24f; ((Graphic)val2).color = AccentColor; ((TMP_Text)val2).alignment = (TextAlignmentOptions)514; ((TMP_Text)val2).fontStyle = (FontStyles)1; LayoutElement val3 = val.AddComponent(); val3.minHeight = 30f; val3.preferredHeight = 30f; val3.flexibleWidth = 1f; } private static void CreateDivider(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Divider"); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); ((Graphic)val2).color = new Color(BorderColor.r, BorderColor.g, BorderColor.b, 0.35f); LayoutElement val3 = val.AddComponent(); val3.minHeight = 2f; val3.preferredHeight = 2f; val3.flexibleWidth = 1f; } private static void CreateToggleRow(Transform parent, string key, string labelText, bool alt) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Row_" + key); val.transform.SetParent(parent, false); LayoutElement val2 = val.AddComponent(); val2.minHeight = 32f; val2.preferredHeight = 32f; val2.flexibleWidth = 1f; HorizontalLayoutGroup val3 = val.AddComponent(); ((LayoutGroup)val3).padding = new RectOffset(12, 12, 4, 4); ((LayoutGroup)val3).childAlignment = (TextAnchor)3; ((HorizontalOrVerticalLayoutGroup)val3).spacing = 10f; ((HorizontalOrVerticalLayoutGroup)val3).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val3).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandHeight = true; Image val4 = val.AddComponent(); ((Graphic)val4).color = (alt ? RowColorAlt : RowColor); GameObject val5 = new GameObject("Label"); val5.transform.SetParent(val.transform, false); TextMeshProUGUI val6 = val5.AddComponent(); ((TMP_Text)val6).text = labelText; ((TMP_Text)val6).fontSize = 17f; ((Graphic)val6).color = Color.white; ((TMP_Text)val6).alignment = (TextAlignmentOptions)4097; LayoutElement val7 = val5.AddComponent(); val7.flexibleWidth = 1f; GameObject val8 = new GameObject("Toggle"); val8.transform.SetParent(val.transform, false); val8.AddComponent(); LayoutElement val9 = val8.AddComponent(); val9.preferredWidth = 46f; val9.minWidth = 46f; val9.preferredHeight = 22f; val9.minHeight = 22f; val9.flexibleWidth = 0f; Image toggleBg = val8.AddComponent(); bool flag = !RSSettings.StatVisibility.ContainsKey(key) || RSSettings.StatVisibility[key]; ((Graphic)toggleBg).color = (flag ? AccentColor : OffColor); Toggle val10 = val8.AddComponent(); ((Selectable)val10).targetGraphic = (Graphic)(object)toggleBg; val10.isOn = flag; ((UnityEvent)(object)val10.onValueChanged).AddListener((UnityAction)delegate(bool value) { //IL_0011: 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) ((Graphic)toggleBg).color = (value ? AccentColor : OffColor); RSSettings.SetVisibility(key, value); }); } private static void CreateSliderRow(Transform parent, string labelText, float min, float max, float startValue, Action onChanged) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_0104: 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_014f: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Expected O, but got Unknown //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Expected O, but got Unknown //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Expected O, but got Unknown //IL_02f6: 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_0324: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Expected O, but got Unknown //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0395: 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) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Expected O, but got Unknown //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("SliderRow_" + labelText); val.transform.SetParent(parent, false); LayoutElement val2 = val.AddComponent(); val2.minHeight = 44f; val2.preferredHeight = 44f; val2.flexibleWidth = 1f; VerticalLayoutGroup val3 = val.AddComponent(); ((HorizontalOrVerticalLayoutGroup)val3).spacing = 4f; ((HorizontalOrVerticalLayoutGroup)val3).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val3).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandHeight = false; GameObject val4 = new GameObject("Label"); val4.transform.SetParent(val.transform, false); TextMeshProUGUI label = val4.AddComponent(); ((TMP_Text)label).text = labelText + ": " + startValue.ToString("0"); ((TMP_Text)label).fontSize = 15f; ((Graphic)label).color = SubTextColor; ((TMP_Text)label).alignment = (TextAlignmentOptions)4097; LayoutElement val5 = val4.AddComponent(); val5.minHeight = 18f; val5.preferredHeight = 18f; GameObject val6 = new GameObject("Slider"); val6.transform.SetParent(val.transform, false); LayoutElement val7 = val6.AddComponent(); val7.minHeight = 20f; val7.preferredHeight = 20f; val6.AddComponent(); Slider val8 = val6.AddComponent(); val8.minValue = min; val8.maxValue = max; val8.direction = (Direction)0; GameObject val9 = new GameObject("Background"); val9.transform.SetParent(val6.transform, false); RectTransform val10 = val9.AddComponent(); val10.anchorMin = new Vector2(0f, 0.25f); val10.anchorMax = new Vector2(1f, 0.75f); val10.offsetMin = Vector2.zero; val10.offsetMax = Vector2.zero; Image val11 = val9.AddComponent(); ((Graphic)val11).color = RowColor; GameObject val12 = new GameObject("Fill Area"); val12.transform.SetParent(val6.transform, false); RectTransform val13 = val12.AddComponent(); val13.anchorMin = new Vector2(0f, 0.25f); val13.anchorMax = new Vector2(1f, 0.75f); val13.offsetMin = new Vector2(5f, 0f); val13.offsetMax = new Vector2(-5f, 0f); GameObject val14 = new GameObject("Fill"); val14.transform.SetParent(val12.transform, false); RectTransform val15 = val14.AddComponent(); val15.anchorMin = new Vector2(0f, 0f); val15.anchorMax = new Vector2(0f, 1f); val15.sizeDelta = new Vector2(10f, 0f); Image val16 = val14.AddComponent(); ((Graphic)val16).color = AccentColor; val8.fillRect = val15; GameObject val17 = new GameObject("Handle Slide Area"); val17.transform.SetParent(val6.transform, false); RectTransform val18 = val17.AddComponent(); val18.anchorMin = Vector2.zero; val18.anchorMax = Vector2.one; val18.offsetMin = Vector2.zero; val18.offsetMax = Vector2.zero; GameObject val19 = new GameObject("Handle"); val19.transform.SetParent(val17.transform, false); RectTransform val20 = val19.AddComponent(); val20.sizeDelta = new Vector2(14f, 22f); Image val21 = val19.AddComponent(); ((Graphic)val21).color = Color.white; val8.handleRect = val20; ((Selectable)val8).targetGraphic = (Graphic)(object)val21; val8.value = startValue; ((UnityEvent)(object)val8.onValueChanged).AddListener((UnityAction)delegate(float value) { ((TMP_Text)label).text = labelText + ": " + value.ToString("0"); onChanged(value); }); } private static void CreateAlignmentRow(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00ea: 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_0124: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Expected O, but got Unknown GameObject val = new GameObject("AlignmentRow"); val.transform.SetParent(parent, false); LayoutElement val2 = val.AddComponent(); val2.minHeight = 36f; val2.preferredHeight = 36f; val2.flexibleWidth = 1f; HorizontalLayoutGroup val3 = val.AddComponent(); ((LayoutGroup)val3).padding = new RectOffset(12, 12, 4, 4); ((LayoutGroup)val3).childAlignment = (TextAnchor)3; ((HorizontalOrVerticalLayoutGroup)val3).spacing = 10f; ((HorizontalOrVerticalLayoutGroup)val3).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val3).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)val3).childForceExpandHeight = true; Image val4 = val.AddComponent(); ((Graphic)val4).color = RowColor; GameObject val5 = new GameObject("Label"); val5.transform.SetParent(val.transform, false); TextMeshProUGUI val6 = val5.AddComponent(); ((TMP_Text)val6).text = "Alignment"; ((TMP_Text)val6).fontSize = 17f; ((Graphic)val6).color = Color.white; ((TMP_Text)val6).alignment = (TextAlignmentOptions)4097; LayoutElement val7 = val5.AddComponent(); val7.flexibleWidth = 1f; GameObject val8 = new GameObject("AlignmentButton"); val8.transform.SetParent(val.transform, false); val8.AddComponent(); LayoutElement val9 = val8.AddComponent(); val9.preferredWidth = 130f; val9.minWidth = 130f; val9.preferredHeight = 26f; val9.minHeight = 26f; val9.flexibleWidth = 0f; Image val10 = val8.AddComponent(); ((Graphic)val10).color = AccentColor; Button val11 = val8.AddComponent