Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of ExperienceBar v1.0.4
Mods/ExperienceBar_IL2Cpp.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using ExperienceBar; using Il2CppScheduleOne.DevUtilities; using Il2CppScheduleOne.Levelling; using Il2CppScheduleOne.UI; using Il2CppScheduleOne.UI.Phone; using Il2CppTMPro; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using UnityEngine; 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: MelonInfo(typeof(Core), "ExperienceBar", "1.0.4", "j0ckinjz", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: AssemblyMetadata("NexusModID", "1002")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("ExperienceBar_IL2Cpp")] [assembly: AssemblyConfiguration("IL2CPP")] [assembly: AssemblyFileVersion("1.0.4")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ExperienceBar_IL2Cpp")] [assembly: AssemblyTitle("ExperienceBar_IL2Cpp")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ExperienceBar { public class Core : MelonMod { [CompilerGenerated] private sealed class <Init>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Core <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Init>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if ((Object)(object)Singleton<HUD>.Instance == (Object)null || (Object)(object)NetworkSingleton<LevelManager>.Instance == (Object)null || (Object)(object)Singleton<HUD>.Instance.canvasRect == (Object)null) { <>2__current = null; <>1__state = 1; return true; } <>4__this.xpBar = new XPBar(); <>4__this.xpBar.Init((Transform)(object)Singleton<HUD>.Instance.canvasRect); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private XPBar xpBar; private float lastXP = -1f; private float lastMaxXP = -1f; private bool _lastPhoneOpen; public override void OnInitializeMelon() { Prefs.Init(); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { if (sceneName == "Main") { Log.Msg("Mod Initialized. Version " + ((MelonBase)this).Info.Version); MelonCoroutines.Start(Init()); } } [IteratorStateMachine(typeof(<Init>d__6))] private IEnumerator Init() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Init>d__6(0) { <>4__this = this }; } public override void OnUpdate() { //IL_0044: 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_008b: Unknown result type (might be due to invalid IL or missing references) Phone instance = PlayerSingleton<Phone>.Instance; bool flag = instance != null && instance.IsOpen; LevelManager instance2 = NetworkSingleton<LevelManager>.Instance; if (xpBar == null || !((Object)(object)instance2 != (Object)null)) { return; } float num = instance2.XP; float xPToNextTier = instance2.XPToNextTier; ERank rank = instance2.Rank; int tier = instance2.Tier; if (num != lastXP || xPToNextTier != lastMaxXP) { lastXP = num; lastMaxXP = xPToNextTier; xpBar.UpdateXP(num, xPToNextTier, rank, tier); if (Prefs.ShowOnXP.Value || flag) { xpBar.Show(); } } xpBar.Update(flag); _lastPhoneOpen = flag; } } internal static class Log { public static void Msg(string msg) { Melon<Core>.Logger.Msg(msg); } public static void Warn(string warn) { Melon<Core>.Logger.Warning(warn); } public static void Error(string error) { Melon<Core>.Logger.Error(error); } } public static class Prefs { public static MelonPreferences_Category Category; public static MelonPreferences_Entry<bool> FadeBar; public static MelonPreferences_Entry<bool> FadeRank; public static MelonPreferences_Entry<bool> ShowOnXP; public static void Init() { Category = MelonPreferences.CreateCategory("ExperienceBar_ExperienceBar", "Experience Bar"); FadeBar = Category.CreateEntry<bool>("FadeBar", true, "Fade XP Bar", "Fade out the XP bar after inactivity", false, false, (ValueValidator)null, (string)null); FadeRank = Category.CreateEntry<bool>("FadeRank", true, "Fade Rank / XP Text", "Fade out the rank text after inactivity", false, false, (ValueValidator)null, (string)null); ShowOnXP = Category.CreateEntry<bool>("ShowOnXP", true, "Show XP Bar on XP Earned", "Show ExperienceBar when XP is earned", false, false, (ValueValidator)null, (string)null); } } public class XPBar { private GameObject _barGO; private Slider _slider; private Image _fillImage; private TextMeshProUGUI _xpText; private TextMeshProUGUI _rankText; private CanvasGroup _textGroup; private float _lastXPUpdateTime; private float _currentFill = 0f; private ERank _lastRank; private int _lastTier; private const float FadeDelay = 5f; private const float FadeSpeed = 2f; private const float LerpSpeed = 5f; private const float BarHeight = 2f; private const float BarOffsetY = 8f; private const float LabelX = 5f; private const float RankY = 38f; private const float XPY = 20f; private const float LabelWidth = 400f; private const float LabelHeight = 20f; private const int FontSize = 16; private bool _lastPhoneOpen = false; private float _pauseStartTime = 0f; private float _pauseAccumulated = 0f; public void Init(Transform hudCanvas) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0058: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_016e: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_0219: Expected O, but got Unknown //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0259: 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_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_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Expected O, but got Unknown //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) _barGO = new GameObject("ExperienceBar"); _barGO.transform.SetParent(hudCanvas, false); _barGO.AddComponent<RectTransform>(); _slider = _barGO.AddComponent<Slider>(); RectTransform component = _barGO.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(1f, 0f); component.anchoredPosition = new Vector2(0f, 8f); component.sizeDelta = new Vector2(0f, 2f); _slider.minValue = 0f; _slider.maxValue = 1f; _slider.value = 0f; GameObject val = new GameObject("Fill"); val.transform.SetParent(_barGO.transform, false); val.AddComponent<RectTransform>(); _fillImage = val.AddComponent<Image>(); ((Graphic)_fillImage).color = Color.green; RectTransform component2 = val.GetComponent<RectTransform>(); component2.anchorMin = Vector2.zero; component2.anchorMax = Vector2.one; component2.offsetMin = Vector2.zero; component2.offsetMax = Vector2.zero; _slider.fillRect = component2; GameObject val2 = new GameObject("TextGroup"); val2.transform.SetParent(_barGO.transform, false); _textGroup = val2.AddComponent<CanvasGroup>(); RectTransform val3 = val2.AddComponent<RectTransform>(); val3.anchorMin = new Vector2(0f, 1f); val3.anchorMax = new Vector2(0f, 1f); val3.pivot = new Vector2(0f, 1f); val3.anchoredPosition = new Vector2(0f, 0f); val3.sizeDelta = new Vector2(0f, 0f); GameObject val4 = new GameObject("RankText"); val4.transform.SetParent(val2.transform, false); RectTransform val5 = val4.AddComponent<RectTransform>(); val5.anchorMin = new Vector2(0f, 1f); val5.anchorMax = new Vector2(0f, 1f); val5.pivot = new Vector2(0f, 1f); val5.anchoredPosition = new Vector2(5f, 38f); val5.sizeDelta = new Vector2(400f, 20f); _rankText = val4.AddComponent<TextMeshProUGUI>(); ((TMP_Text)_rankText).alignment = (TextAlignmentOptions)513; ((TMP_Text)_rankText).fontSize = 16f; ApplyTextShadow(_rankText); GameObject val6 = new GameObject("XPText"); val6.transform.SetParent(val2.transform, false); RectTransform val7 = val6.AddComponent<RectTransform>(); val7.anchorMin = new Vector2(0f, 1f); val7.anchorMax = new Vector2(0f, 1f); val7.pivot = new Vector2(0f, 1f); val7.anchoredPosition = new Vector2(5f, 20f); val7.sizeDelta = new Vector2(400f, 20f); _xpText = val6.AddComponent<TextMeshProUGUI>(); ((TMP_Text)_xpText).alignment = (TextAlignmentOptions)513; ((TMP_Text)_xpText).fontSize = 16f; ApplyTextShadow(_xpText); } public void Update(bool phoneOpen) { //IL_0044: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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) if (phoneOpen) { if (!_lastPhoneOpen) { _pauseStartTime = Time.time; } _lastPhoneOpen = true; if ((Object)(object)_fillImage != (Object)null) { Color color = ((Graphic)_fillImage).color; color.a = 1f; ((Graphic)_fillImage).color = color; } if ((Object)(object)_textGroup != (Object)null) { _textGroup.alpha = 1f; } return; } if (_lastPhoneOpen) { _pauseAccumulated += Time.time - _pauseStartTime; _lastPhoneOpen = false; } float num = Time.time - _lastXPUpdateTime - _pauseAccumulated; _slider.value = Mathf.Lerp(_slider.value, _currentFill, Time.deltaTime * 5f); float num2 = 1f; if (Prefs.FadeBar.Value) { num2 = ((Prefs.ShowOnXP.Value || phoneOpen) ? ((num > 5f) ? 0f : 1f) : 0f); } if ((Object)(object)_fillImage != (Object)null) { Color color2 = ((Graphic)_fillImage).color; color2.a = Mathf.Lerp(color2.a, num2, Time.deltaTime * 2f); ((Graphic)_fillImage).color = color2; } float num3 = 1f; if (Prefs.FadeRank.Value) { num3 = ((Prefs.ShowOnXP.Value || phoneOpen) ? ((num > 5f) ? 0f : 1f) : 0f); } if ((Object)(object)_textGroup != (Object)null) { _textGroup.alpha = Mathf.Lerp(_textGroup.alpha, num3, Time.deltaTime * 2f); } } public void UpdateXP(float xp, float maxXP, ERank rank, int tier) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) _currentFill = ((maxXP > 0f) ? (xp / maxXP) : 0f); string text = $"{xp} / {maxXP} XP"; if (((TMP_Text)_xpText).text != text) { ((TMP_Text)_xpText).text = text; if (Prefs.ShowOnXP.Value || _lastPhoneOpen) { _lastXPUpdateTime = Time.time; _pauseAccumulated = 0f; } } if ((Object)(object)_rankText != (Object)null && (rank != _lastRank || tier != _lastTier)) { _lastRank = rank; _lastTier = tier; ((TMP_Text)_rankText).text = $"{rank} ({tier})"; } } public void Show() { //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_0046: Unknown result type (might be due to invalid IL or missing references) _lastXPUpdateTime = Time.time; _pauseAccumulated = 0f; if ((Object)(object)_fillImage != (Object)null) { Color color = ((Graphic)_fillImage).color; color.a = 1f; ((Graphic)_fillImage).color = color; } if ((Object)(object)_textGroup != (Object)null) { _textGroup.alpha = 1f; } } private void ApplyTextShadow(TextMeshProUGUI text) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)text).fontMaterial = Object.Instantiate<Material>(((TMP_Asset)((TMP_Text)text).font).material); Material fontMaterial = ((TMP_Text)text).fontMaterial; fontMaterial.EnableKeyword("UNDERLAY_ON"); fontMaterial.SetFloat(ShaderUtilities.ID_UnderlaySoftness, 0.2f); fontMaterial.SetFloat(ShaderUtilities.ID_UnderlayDilate, 0.8f); fontMaterial.SetColor(ShaderUtilities.ID_UnderlayColor, Color.black); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }
Mods/ExperienceBar_Mono.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using ExperienceBar; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using ScheduleOne.DevUtilities; using ScheduleOne.Levelling; using ScheduleOne.UI; using ScheduleOne.UI.Phone; using TMPro; using UnityEngine; 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: MelonInfo(typeof(Core), "ExperienceBar", "1.0.4", "j0ckinjz", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: AssemblyMetadata("NexusModID", "1002")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("ExperienceBar_Mono")] [assembly: AssemblyConfiguration("MONO")] [assembly: AssemblyFileVersion("1.0.4")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ExperienceBar_Mono")] [assembly: AssemblyTitle("ExperienceBar_Mono")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ExperienceBar { public class Core : MelonMod { [CompilerGenerated] private sealed class <Init>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Core <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Init>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if ((Object)(object)Singleton<HUD>.Instance == (Object)null || (Object)(object)NetworkSingleton<LevelManager>.Instance == (Object)null || (Object)(object)Singleton<HUD>.Instance.canvasRect == (Object)null) { <>2__current = null; <>1__state = 1; return true; } <>4__this.xpBar = new XPBar(); <>4__this.xpBar.Init((Transform)(object)Singleton<HUD>.Instance.canvasRect); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private XPBar xpBar; private float lastXP = -1f; private float lastMaxXP = -1f; private bool _lastPhoneOpen; public override void OnInitializeMelon() { Prefs.Init(); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { if (sceneName == "Main") { Log.Msg("Mod Initialized. Version " + ((MelonBase)this).Info.Version); MelonCoroutines.Start(Init()); } } [IteratorStateMachine(typeof(<Init>d__6))] private IEnumerator Init() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Init>d__6(0) { <>4__this = this }; } public override void OnUpdate() { //IL_0044: 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_008b: Unknown result type (might be due to invalid IL or missing references) Phone instance = PlayerSingleton<Phone>.Instance; bool flag = instance != null && instance.IsOpen; LevelManager instance2 = NetworkSingleton<LevelManager>.Instance; if (xpBar == null || !((Object)(object)instance2 != (Object)null)) { return; } float num = instance2.XP; float xPToNextTier = instance2.XPToNextTier; ERank rank = instance2.Rank; int tier = instance2.Tier; if (num != lastXP || xPToNextTier != lastMaxXP) { lastXP = num; lastMaxXP = xPToNextTier; xpBar.UpdateXP(num, xPToNextTier, rank, tier); if (Prefs.ShowOnXP.Value || flag) { xpBar.Show(); } } xpBar.Update(flag); _lastPhoneOpen = flag; } } internal static class Log { public static void Msg(string msg) { Melon<Core>.Logger.Msg(msg); } public static void Warn(string warn) { Melon<Core>.Logger.Warning(warn); } public static void Error(string error) { Melon<Core>.Logger.Error(error); } } public static class Prefs { public static MelonPreferences_Category Category; public static MelonPreferences_Entry<bool> FadeBar; public static MelonPreferences_Entry<bool> FadeRank; public static MelonPreferences_Entry<bool> ShowOnXP; public static void Init() { Category = MelonPreferences.CreateCategory("ExperienceBar_ExperienceBar", "Experience Bar"); FadeBar = Category.CreateEntry<bool>("FadeBar", true, "Fade XP Bar", "Fade out the XP bar after inactivity", false, false, (ValueValidator)null, (string)null); FadeRank = Category.CreateEntry<bool>("FadeRank", true, "Fade Rank / XP Text", "Fade out the rank text after inactivity", false, false, (ValueValidator)null, (string)null); ShowOnXP = Category.CreateEntry<bool>("ShowOnXP", true, "Show XP Bar on XP Earned", "Show ExperienceBar when XP is earned", false, false, (ValueValidator)null, (string)null); } } public class XPBar { private GameObject _barGO; private Slider _slider; private Image _fillImage; private TextMeshProUGUI _xpText; private TextMeshProUGUI _rankText; private CanvasGroup _textGroup; private float _lastXPUpdateTime; private float _currentFill = 0f; private ERank _lastRank; private int _lastTier; private const float FadeDelay = 5f; private const float FadeSpeed = 2f; private const float LerpSpeed = 5f; private const float BarHeight = 2f; private const float BarOffsetY = 8f; private const float LabelX = 5f; private const float RankY = 38f; private const float XPY = 20f; private const float LabelWidth = 400f; private const float LabelHeight = 20f; private const int FontSize = 16; private bool _lastPhoneOpen = false; private float _pauseStartTime = 0f; private float _pauseAccumulated = 0f; public void Init(Transform hudCanvas) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0058: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_016e: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_0219: Expected O, but got Unknown //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0259: 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_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_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Expected O, but got Unknown //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) _barGO = new GameObject("ExperienceBar"); _barGO.transform.SetParent(hudCanvas, false); _barGO.AddComponent<RectTransform>(); _slider = _barGO.AddComponent<Slider>(); RectTransform component = _barGO.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(1f, 0f); component.anchoredPosition = new Vector2(0f, 8f); component.sizeDelta = new Vector2(0f, 2f); _slider.minValue = 0f; _slider.maxValue = 1f; _slider.value = 0f; GameObject val = new GameObject("Fill"); val.transform.SetParent(_barGO.transform, false); val.AddComponent<RectTransform>(); _fillImage = val.AddComponent<Image>(); ((Graphic)_fillImage).color = Color.green; RectTransform component2 = val.GetComponent<RectTransform>(); component2.anchorMin = Vector2.zero; component2.anchorMax = Vector2.one; component2.offsetMin = Vector2.zero; component2.offsetMax = Vector2.zero; _slider.fillRect = component2; GameObject val2 = new GameObject("TextGroup"); val2.transform.SetParent(_barGO.transform, false); _textGroup = val2.AddComponent<CanvasGroup>(); RectTransform val3 = val2.AddComponent<RectTransform>(); val3.anchorMin = new Vector2(0f, 1f); val3.anchorMax = new Vector2(0f, 1f); val3.pivot = new Vector2(0f, 1f); val3.anchoredPosition = new Vector2(0f, 0f); val3.sizeDelta = new Vector2(0f, 0f); GameObject val4 = new GameObject("RankText"); val4.transform.SetParent(val2.transform, false); RectTransform val5 = val4.AddComponent<RectTransform>(); val5.anchorMin = new Vector2(0f, 1f); val5.anchorMax = new Vector2(0f, 1f); val5.pivot = new Vector2(0f, 1f); val5.anchoredPosition = new Vector2(5f, 38f); val5.sizeDelta = new Vector2(400f, 20f); _rankText = val4.AddComponent<TextMeshProUGUI>(); ((TMP_Text)_rankText).alignment = (TextAlignmentOptions)513; ((TMP_Text)_rankText).fontSize = 16f; ApplyTextShadow(_rankText); GameObject val6 = new GameObject("XPText"); val6.transform.SetParent(val2.transform, false); RectTransform val7 = val6.AddComponent<RectTransform>(); val7.anchorMin = new Vector2(0f, 1f); val7.anchorMax = new Vector2(0f, 1f); val7.pivot = new Vector2(0f, 1f); val7.anchoredPosition = new Vector2(5f, 20f); val7.sizeDelta = new Vector2(400f, 20f); _xpText = val6.AddComponent<TextMeshProUGUI>(); ((TMP_Text)_xpText).alignment = (TextAlignmentOptions)513; ((TMP_Text)_xpText).fontSize = 16f; ApplyTextShadow(_xpText); } public void Update(bool phoneOpen) { //IL_0044: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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) if (phoneOpen) { if (!_lastPhoneOpen) { _pauseStartTime = Time.time; } _lastPhoneOpen = true; if ((Object)(object)_fillImage != (Object)null) { Color color = ((Graphic)_fillImage).color; color.a = 1f; ((Graphic)_fillImage).color = color; } if ((Object)(object)_textGroup != (Object)null) { _textGroup.alpha = 1f; } return; } if (_lastPhoneOpen) { _pauseAccumulated += Time.time - _pauseStartTime; _lastPhoneOpen = false; } float num = Time.time - _lastXPUpdateTime - _pauseAccumulated; _slider.value = Mathf.Lerp(_slider.value, _currentFill, Time.deltaTime * 5f); float num2 = 1f; if (Prefs.FadeBar.Value) { num2 = ((Prefs.ShowOnXP.Value || phoneOpen) ? ((num > 5f) ? 0f : 1f) : 0f); } if ((Object)(object)_fillImage != (Object)null) { Color color2 = ((Graphic)_fillImage).color; color2.a = Mathf.Lerp(color2.a, num2, Time.deltaTime * 2f); ((Graphic)_fillImage).color = color2; } float num3 = 1f; if (Prefs.FadeRank.Value) { num3 = ((Prefs.ShowOnXP.Value || phoneOpen) ? ((num > 5f) ? 0f : 1f) : 0f); } if ((Object)(object)_textGroup != (Object)null) { _textGroup.alpha = Mathf.Lerp(_textGroup.alpha, num3, Time.deltaTime * 2f); } } public void UpdateXP(float xp, float maxXP, ERank rank, int tier) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) _currentFill = ((maxXP > 0f) ? (xp / maxXP) : 0f); string text = $"{xp} / {maxXP} XP"; if (((TMP_Text)_xpText).text != text) { ((TMP_Text)_xpText).text = text; if (Prefs.ShowOnXP.Value || _lastPhoneOpen) { _lastXPUpdateTime = Time.time; _pauseAccumulated = 0f; } } if ((Object)(object)_rankText != (Object)null && (rank != _lastRank || tier != _lastTier)) { _lastRank = rank; _lastTier = tier; ((TMP_Text)_rankText).text = $"{rank} ({tier})"; } } public void Show() { //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_0046: Unknown result type (might be due to invalid IL or missing references) _lastXPUpdateTime = Time.time; _pauseAccumulated = 0f; if ((Object)(object)_fillImage != (Object)null) { Color color = ((Graphic)_fillImage).color; color.a = 1f; ((Graphic)_fillImage).color = color; } if ((Object)(object)_textGroup != (Object)null) { _textGroup.alpha = 1f; } } private void ApplyTextShadow(TextMeshProUGUI text) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)text).fontMaterial = Object.Instantiate<Material>(((TMP_Asset)((TMP_Text)text).font).material); Material fontMaterial = ((TMP_Text)text).fontMaterial; fontMaterial.EnableKeyword("UNDERLAY_ON"); fontMaterial.SetFloat(ShaderUtilities.ID_UnderlaySoftness, 0.2f); fontMaterial.SetFloat(ShaderUtilities.ID_UnderlayDilate, 0.8f); fontMaterial.SetColor(ShaderUtilities.ID_UnderlayColor, Color.black); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }