Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of BankApp v2.0.4
BankApp.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BankApp; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne.DevUtilities; using Il2CppScheduleOne.Money; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(Core), "BankApp", "2.0.4", "svindler, Lalisa", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: MelonColor(0, 255, 0, 249)] [assembly: MelonAuthorColor(0, 234, 0, 255)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("BankApp")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+38782f7c3fd8910eb93430e05b0dd948ace95926")] [assembly: AssemblyProduct("BankApp")] [assembly: AssemblyTitle("BankApp")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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 BankApp { public class Core : MelonMod { private enum TabType { Withdraw, Deposit } [CompilerGenerated] private sealed class <AnimateProgressBar>d__50 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float duration; public float from; public float to; public Core <>4__this; private float <elapsed>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AnimateProgressBar>d__50(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0058: 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) int num = <>1__state; Core core = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <elapsed>5__2 = 0f; break; case 1: <>1__state = -1; break; } if (<elapsed>5__2 < duration) { float num2 = <elapsed>5__2 / duration; float num3 = Mathf.Lerp(from, to, num2); core._weeklyProgressFill.anchorMax = new Vector2(num3, 1f); <elapsed>5__2 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } core._weeklyProgressFill.anchorMax = new Vector2(to, 1f); 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(); } } [CompilerGenerated] private sealed class <SetActiveIconSprite>d__35 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Core <>4__this; public Image targetImage; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SetActiveIconSprite>d__35(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; Core core = <>4__this; if (num != 0) { return false; } <>1__state = -1; byte[] array = LoadEmbeddedIconBytes(); if (array == null || array.Length == 0) { MelonLogger.Error("Embedded icon resource not found: BankApp.bankappicon.png"); return false; } Texture2D val = core.CreatePersistentTexture(array); if ((Object)(object)val != (Object)null) { Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); targetImage.sprite = sprite; targetImage.preserveAspect = true; ((Graphic)targetImage).SetAllDirty(); } else { MelonLogger.Error("Failed to load icon texture."); } 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(); } } [CompilerGenerated] private sealed class <UpdateAppIconLabelAndSpriteCoroutine>d__34 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject iconGO; public Core <>4__this; private Transform <lbl>5__2; private int <i>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <UpdateAppIconLabelAndSpriteCoroutine>d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <lbl>5__2 = null; <>1__state = -2; } private bool MoveNext() { int num = <>1__state; Core core = <>4__this; Transform obj; Transform val; switch (num) { default: return false; case 0: <>1__state = -1; <lbl>5__2 = null; <i>5__3 = 0; goto IL_007d; case 1: <>1__state = -1; <i>5__3++; goto IL_007d; case 2: { <>1__state = -1; ((Object)iconGO).name = "BankingApp"; core._iconModified = true; return false; } IL_007d: if (<i>5__3 < 10 && (Object)(object)<lbl>5__2 == (Object)null) { <lbl>5__2 = iconGO.transform.Find("Label"); <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)<lbl>5__2 != (Object)null) { Text component = ((Component)<lbl>5__2).GetComponent<Text>(); if (component != null) { component.text = "Bank"; goto IL_00c9; } } MelonLogger.Error("Icon label text component not found."); goto IL_00c9; IL_00c9: obj = iconGO.transform.Find("Mask"); val = ((obj != null) ? obj.Find("Image") : null); if (!((Object)(object)val == (Object)null)) { Image component2 = ((Component)val).GetComponent<Image>(); if (component2 != null) { <>2__current = core.SetActiveIconSprite(component2); <>1__state = 2; return true; } } MelonLogger.Error("Icon Mask/Image missing."); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const string TEMPLATE_APP_NAME = "Messages"; private const string APP_OBJECT_NAME = "BankingApp"; private const string APP_LABEL_TEXT = "Bank"; private const string ICON_RESOURCE_NAME = "BankApp.bankappicon.png"; private bool _appCreated; private bool _appSetupAttempted; private GameObject _bankingAppPanel; private Text _cashBalanceText; private Button _confirmButton; private TabType _currentTab = TabType.Deposit; private GameObject _depositTab; private MelonPreferences_Entry<bool> _disableWeeklyDepositLimit; private bool _iconModified; private float _lastProgressRatio; private Button _maxButton; private Text _onlineBalanceText; private Button _resetButton; private float _selectedAmount; private Text _selectedAmountText; private float _timeSinceLastReset; private Text _weeklyAmountText; private readonly int _weeklyDepositLimit = (int)ATM.WEEKLY_DEPOSIT_LIMIT; private MelonPreferences_Entry<int> _WeeklyDepositResetInterval; private RectTransform _weeklyProgressFill; private GameObject _withdrawTab; private int[] amounts = new int[8] { 1, 5, 10, 25, 50, 100, 500, 1000 }; public override void OnInitializeMelon() { MelonLogger.Msg("BankingApp: Initializing mod..."); EnsureUserDataFolderExists(); loadPreferences(); ClassInjector.RegisterTypeInIl2Cpp<BankingAppComponent>(); MelonLogger.Msg("BankingApp: Successfully registered BankingAppComponent type"); } private static byte[] LoadEmbeddedIcon() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("BankApp.Assets.BankAppIcon.png"); if (stream == null) { return null; } using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); return memoryStream.ToArray(); } private void loadPreferences() { MelonLogger.Msg("Loading preferences..."); MelonPreferences_Category val = MelonPreferences.CreateCategory("BankApp", "Banking App"); val.SetFilePath("UserData/BankApp/BankApp.cfg", true); val.LoadFromFile(true); _disableWeeklyDepositLimit = val.CreateEntry<bool>("DisableWeeklyDepositLimit", false, "Disable Weekly Deposit Limit", "Disable the weekly deposit limit for the ATM and BankApp.", false, false, (ValueValidator)null, (string)null); _WeeklyDepositResetInterval = val.CreateEntry<int>("WeeklyDepositResetInterval", 10, "Weekly Deposit Reset Interval", "The interval in seconds after which the weekly deposit limit resets.", false, false, (ValueValidator)null, (string)null); val.SaveToFile(true); MelonLogger.Msg("Preferences loaded."); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { //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_0053: Expected O, but got Unknown if (sceneName.Equals("Main", StringComparison.OrdinalIgnoreCase)) { MelonLogger.Msg("Main scene loaded. Setting up BankingAppComponent."); _appSetupAttempted = (_appCreated = (_iconModified = false)); if ((Object)(object)GameObject.Find("BankingAppComponentHolder") == (Object)null) { GameObject val = new GameObject("BankingAppComponentHolder"); Object.DontDestroyOnLoad((Object)val); val.AddComponent<BankingAppComponent>(); } } } public override void OnUpdate() { if (!_appSetupAttempted && (Object)(object)GameObject.Find("Player_Local/CameraContainer/Camera/OverlayCamera/GameplayMenu/Phone/phone/AppsCanvas") != (Object)null) { MelonLogger.Msg("AppsCanvas found, creating app and icon."); _appSetupAttempted = true; CreateOrEnsureAppAndIcon(); } UpdateBalanceText(); ResetWeeklyDepositSum(); } private void EnsureUserDataFolderExists() { string text = Path.Combine("UserData", "BankApp"); if (!Directory.Exists(text)) { Directory.CreateDirectory(text); MelonLogger.Msg("Created missing directory at '" + text + "'."); } } private void ResetWeeklyDepositSum() { if (_disableWeeklyDepositLimit.Value) { _timeSinceLastReset += Time.deltaTime; int value = _WeeklyDepositResetInterval.Value; if (_timeSinceLastReset >= (float)value) { ATM.WeeklyDepositSum = 0f; _timeSinceLastReset = 0f; UpdateBalanceText(); } } } private void CreateOrEnsureAppAndIcon() { //IL_018f: Unknown result type (might be due to invalid IL or missing references) MelonLogger.Msg("Enter CreateOrEnsureAppAndIcon"); if (_appCreated && _iconModified) { MelonLogger.Msg("Already created & icon set—skipping."); return; } GameObject val = GameObject.Find("Player_Local/CameraContainer/Camera/OverlayCamera/GameplayMenu/Phone/phone/AppsCanvas"); if ((Object)(object)val == (Object)null) { MelonLogger.Error("AppsCanvas not found."); return; } Transform val2 = val.transform.Find("BankingApp"); if ((Object)(object)val2 != (Object)null) { MelonLogger.Msg("Found existing BankingApp—rebuilding UI if needed."); _bankingAppPanel = ((Component)val2).gameObject; EnsureAppPanelIsSetup(_bankingAppPanel); } else { MelonLogger.Msg("Cloning template 'Messages'..."); Transform val3 = val.transform.Find("Messages"); if ((Object)(object)val3 == (Object)null) { MelonLogger.Error("Template 'Messages' missing."); return; } _bankingAppPanel = Object.Instantiate<GameObject>(((Component)val3).gameObject, val.transform); ((Object)_bankingAppPanel).name = "BankingApp"; Transform obj = _bankingAppPanel.transform.Find("Container"); GameObject val4 = ((obj != null) ? ((Component)obj).gameObject : null); if ((Object)(object)val4 != (Object)null) { BankingAppBuilder bankingAppBuilder = new BankingAppBuilder(val4, delegate(int amt) { OnSelectAmount(amt); }, delegate { OnConfirmPressed(); }, delegate { MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; if (!((Object)(object)instance == (Object)null)) { if (_currentTab == TabType.Withdraw) { SetSelectedAmount((int)instance.onlineBalance); } else { SetSelectedAmount((int)Mathf.Min(instance.cashBalance, (float)DepositMax())); } } }, delegate { UpdateSelectedAmount(0); }, delegate { SetActiveTab(TabType.Deposit); }, delegate { SetActiveTab(TabType.Withdraw); }); bankingAppBuilder.BuildUI(); _weeklyAmountText = bankingAppBuilder.WeeklyAmountText; _weeklyProgressFill = bankingAppBuilder.WeeklyProgressFill; if ((Object)(object)_weeklyProgressFill != (Object)null) { _lastProgressRatio = _weeklyProgressFill.anchorMax.x; } _onlineBalanceText = bankingAppBuilder.OnlineBalanceText; _cashBalanceText = bankingAppBuilder.CashBalanceText; _selectedAmountText = bankingAppBuilder.SelectedAmountText; _confirmButton = bankingAppBuilder.ConfirmButton; _maxButton = bankingAppBuilder.MaxButton; _resetButton = bankingAppBuilder.ResetButton; _depositTab = bankingAppBuilder.DepositTab; _withdrawTab = bankingAppBuilder.WithdrawTab; } else { MelonLogger.Warning("No 'Container' under cloned app panel."); } GameObject val5 = GameObject.Find("Player_Local/CameraContainer/Camera/OverlayCamera/GameplayMenu/Phone/phone/HomeScreen/AppIcons"); if ((Object)(object)val5 != (Object)null && val5.transform.childCount > 7) { GameObject gameObject = ((Component)val5.transform.GetChild(7)).gameObject; MelonCoroutines.Start(UpdateAppIconLabelAndSpriteCoroutine(gameObject)); } else { MelonLogger.Error("Can't find BankingApp icon slot."); } AttachButtonClickEvent(_bankingAppPanel); _appCreated = true; MelonLogger.Msg("BankingApp created."); } MelonLogger.Msg("Exit CreateOrEnsureAppAndIcon"); } [IteratorStateMachine(typeof(<UpdateAppIconLabelAndSpriteCoroutine>d__34))] private IEnumerator UpdateAppIconLabelAndSpriteCoroutine(GameObject iconGO) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <UpdateAppIconLabelAndSpriteCoroutine>d__34(0) { <>4__this = this, iconGO = iconGO }; } [IteratorStateMachine(typeof(<SetActiveIconSprite>d__35))] private IEnumerator SetActiveIconSprite(Image targetImage) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SetActiveIconSprite>d__35(0) { <>4__this = this, targetImage = targetImage }; } private static byte[] LoadEmbeddedIconBytes() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("BankApp.bankappicon.png"); if (stream == null) { return null; } using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); return memoryStream.ToArray(); } private void EnsureAppPanelIsSetup(GameObject appPanel) { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (_appCreated) { return; } Transform obj = appPanel.transform.Find("Container"); GameObject val = ((obj != null) ? ((Component)obj).gameObject : null); if ((Object)(object)val != (Object)null) { BankingAppBuilder bankingAppBuilder = new BankingAppBuilder(val, delegate(int amt) { OnSelectAmount(amt); }, delegate { OnConfirmPressed(); }, delegate { MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; if (!((Object)(object)instance == (Object)null)) { if (_currentTab == TabType.Withdraw) { SetSelectedAmount(instance.onlineBalance); } else { SetSelectedAmount(Mathf.Min(instance.cashBalance, (float)DepositMax())); } } }, delegate { UpdateSelectedAmount(0); }, delegate { SetActiveTab(TabType.Deposit); }, delegate { SetActiveTab(TabType.Withdraw); }); bankingAppBuilder.BuildUI(); _weeklyAmountText = bankingAppBuilder.WeeklyAmountText; _weeklyProgressFill = bankingAppBuilder.WeeklyProgressFill; if ((Object)(object)_weeklyProgressFill != (Object)null) { _lastProgressRatio = _weeklyProgressFill.anchorMax.x; } _onlineBalanceText = bankingAppBuilder.OnlineBalanceText; _cashBalanceText = bankingAppBuilder.CashBalanceText; _selectedAmountText = bankingAppBuilder.SelectedAmountText; _confirmButton = bankingAppBuilder.ConfirmButton; _maxButton = bankingAppBuilder.MaxButton; _resetButton = bankingAppBuilder.ResetButton; _depositTab = bankingAppBuilder.DepositTab; _withdrawTab = bankingAppBuilder.WithdrawTab; } AttachButtonClickEvent(appPanel); _appCreated = true; } private void SetActiveTab(TabType tab) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_008d: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00e8: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) _currentTab = tab; Image component = _withdrawTab.GetComponent<Image>(); Image component2 = _depositTab.GetComponent<Image>(); ((Graphic)component).color = Color32.op_Implicit((tab == TabType.Withdraw) ? ColorPalette.TABBUTTON_ACTIVE : ColorPalette.TABBUTTON_DISABLED); ((Graphic)component2).color = Color32.op_Implicit((tab == TabType.Deposit) ? ColorPalette.TABBUTTON_ACTIVE : ColorPalette.TABBUTTON_DISABLED); Button component3 = _withdrawTab.GetComponent<Button>(); Button component4 = _depositTab.GetComponent<Button>(); ColorBlock colors = ((Selectable)component3).colors; ((ColorBlock)(ref colors)).normalColor = ((Graphic)component).color; ((ColorBlock)(ref colors)).highlightedColor = Color32.op_Implicit((tab == TabType.Withdraw) ? ColorPalette.TABBUTTON_ACTIVE_HOVER : ColorPalette.TABBUTTON_DISABLED_HOVER); ((ColorBlock)(ref colors)).pressedColor = Color32.op_Implicit((tab == TabType.Withdraw) ? ColorPalette.TABBUTTON_ACTIVE_HOVER : ColorPalette.TABBUTTON_DISABLED_HOVER); ((ColorBlock)(ref colors)).selectedColor = ((ColorBlock)(ref colors)).normalColor; ((Selectable)component3).colors = colors; ColorBlock colors2 = ((Selectable)component4).colors; ((ColorBlock)(ref colors2)).normalColor = ((Graphic)component2).color; ((ColorBlock)(ref colors2)).highlightedColor = Color32.op_Implicit((tab == TabType.Deposit) ? ColorPalette.TABBUTTON_ACTIVE_HOVER : ColorPalette.TABBUTTON_DISABLED_HOVER); ((ColorBlock)(ref colors2)).pressedColor = Color32.op_Implicit((tab == TabType.Deposit) ? ColorPalette.TABBUTTON_ACTIVE_HOVER : ColorPalette.TABBUTTON_DISABLED_HOVER); ((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).normalColor; ((Selectable)component4).colors = colors2; ((Selectable)component3).OnDeselect((BaseEventData)null); ((Selectable)component4).OnDeselect((BaseEventData)null); if ((Object)(object)EventSystem.current != (Object)null) { EventSystem.current.SetSelectedGameObject((GameObject)null); } UpdateUIForCurrentTab(); UpdateConfirmButtonLayout(); } private void UpdateUIForCurrentTab() { if (_currentTab == TabType.Withdraw) { _selectedAmountText.text = $"${_selectedAmount:N0}"; } else { _selectedAmountText.text = $"${_selectedAmount:N0}"; } UpdateSelectedAmount(0); } private void UpdateConfirmButtonLayout() { //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_confirmButton == (Object)null) { return; } Text componentInChildren = ((Component)_confirmButton).GetComponentInChildren<Text>(); MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; if (!((Object)(object)instance == (Object)null)) { if (_currentTab == TabType.Withdraw) { componentInChildren.text = "Withdraw"; bool flag = _selectedAmount > 0f && !Mathf.Approximately(_selectedAmount, 0f) && instance.onlineBalance >= _selectedAmount; ((Graphic)((Component)_confirmButton).GetComponent<Image>()).color = (flag ? Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_DEFAULT) : Color.gray); ColorBlock colors = ((Selectable)_confirmButton).colors; ((ColorBlock)(ref colors)).normalColor = (flag ? Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_DEFAULT) : Color.gray); ((ColorBlock)(ref colors)).highlightedColor = (flag ? Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_HOVERED) : Color.gray); ((ColorBlock)(ref colors)).pressedColor = (flag ? Color32.op_Implicit(new Color32((byte)164, (byte)37, (byte)37, byte.MaxValue)) : Color.gray); ((ColorBlock)(ref colors)).selectedColor = ((ColorBlock)(ref colors)).normalColor; ((Selectable)_confirmButton).colors = colors; ((Selectable)_confirmButton).interactable = flag; } else { componentInChildren.text = "Deposit"; int num = DepositMax(); bool flag2 = _selectedAmount > 0f && _selectedAmount <= (float)num && _selectedAmount <= instance.cashBalance; ((Graphic)((Component)_confirmButton).GetComponent<Image>()).color = (flag2 ? Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_DEFAULT) : Color.gray); ColorBlock colors2 = ((Selectable)_confirmButton).colors; ((ColorBlock)(ref colors2)).normalColor = (flag2 ? Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_DEFAULT) : Color.gray); ((ColorBlock)(ref colors2)).highlightedColor = (flag2 ? Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_HOVERED) : Color.gray); ((ColorBlock)(ref colors2)).pressedColor = (flag2 ? Color32.op_Implicit(new Color32((byte)3, (byte)89, (byte)64, byte.MaxValue)) : Color.gray); ((ColorBlock)(ref colors2)).selectedColor = ((ColorBlock)(ref colors2)).normalColor; ((Selectable)_confirmButton).colors = colors2; ((Selectable)_confirmButton).interactable = flag2; } } } private void OnConfirmPressed() { if (_currentTab == TabType.Withdraw) { OnWithdrawPressed(); } else { OnDepositPressed(); } } private void AttachButtonClickEvent(GameObject panel) { if ((Object)(object)panel == (Object)null) { return; } Button val = panel.GetComponent<Button>() ?? panel.AddComponent<Button>(); if ((Object)(object)((Selectable)val).targetGraphic == (Object)null) { Image val2 = panel.GetComponent<Image>() ?? panel.GetComponentInChildren<Image>(true); if ((Object)(object)val2 != (Object)null) { ((Selectable)val).targetGraphic = (Graphic)(object)val2; } } ((UnityEventBase)val.onClick).RemoveAllListeners(); ((UnityEvent)val.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { panel.SetActive(true); panel.transform.SetAsLastSibling(); MelonLogger.Msg("Bank app opened."); })); } private Texture2D CreatePersistentTexture(byte[] data) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown try { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, Il2CppStructArray<byte>.op_Implicit(data))) { ((Object)val).hideFlags = (HideFlags)32; return val; } } catch (Exception ex) { MelonLogger.Msg("Texture error: " + ex); } return null; } private void OnSelectAmount(int amt) { UpdateSelectedAmount(amt); } private void OnWithdrawPressed() { if (_selectedAmount <= 0f) { MelonLogger.Msg("[WITHDRAW] Zero not allowed."); return; } MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; if ((Object)(object)instance == (Object)null) { MelonLogger.Error("MoneyManager missing"); } else if (instance.onlineBalance >= _selectedAmount) { instance.CreateOnlineTransaction("ATM Withdrawal", 0f - _selectedAmount, 1f, "ATM out"); instance.ChangeCashBalance(_selectedAmount, true, true); MelonLogger.Msg($"[WITHDRAW] ${_selectedAmount:N0} done"); UpdateSelectedAmount(0); UpdateBalanceText(); } else { MelonLogger.Msg($"[WITHDRAW] Attempted withdrawal: {_selectedAmount:N0} | Insufficient Online Balance:{instance.onlineBalance:N0}"); } } private void OnDepositPressed() { if (_selectedAmount <= 0f) { MelonLogger.Msg("[DEPOSIT] Zero not allowed."); return; } int num = DepositMax(); if (_selectedAmount > (float)num) { MelonLogger.Msg($"[DEPOSIT] Exceeds weekly limit. You can only deposit up to ${num:N0} this week."); return; } MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; if ((Object)(object)instance == (Object)null) { MelonLogger.Error("MoneyManager missing"); } else if (instance.cashBalance >= _selectedAmount) { instance.CreateOnlineTransaction("ATM Deposit", _selectedAmount, 1f, "ATM in"); instance.ChangeCashBalance(0f - _selectedAmount, true, true); ATM.WeeklyDepositSum += _selectedAmount; MelonLogger.Msg($"[DEPOSIT] ${_selectedAmount:N0} done"); UpdateSelectedAmount(0); UpdateBalanceText(); } else { MelonLogger.Msg($"[DEPOSIT] Attempted deposit: {_selectedAmount:N0} | Insufficient cash:{instance.cashBalance:N0}"); } } private void UpdateSelectedAmount(int amt) { _selectedAmount = ((amt == 0) ? 0f : (_selectedAmount + (float)amt)); if (_currentTab == TabType.Deposit) { _selectedAmount = Mathf.Min(_selectedAmount, (float)DepositMax()); } if ((Object)(object)_selectedAmountText != (Object)null) { _selectedAmountText.text = $"${_selectedAmount:N0}"; } UpdateConfirmButtonLayout(); } private void SetSelectedAmount(float amt) { _selectedAmount = amt; UpdateConfirmButtonLayout(); if ((Object)(object)_selectedAmountText != (Object)null) { _selectedAmountText.text = $"${_selectedAmount:N0}"; } } private void UpdateBalanceText() { //IL_0121: Unknown result type (might be due to invalid IL or missing references) MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; if ((Object)(object)instance == (Object)null) { return; } if ((Object)(object)_onlineBalanceText != (Object)null) { _onlineBalanceText.text = $"${instance.onlineBalance:N0}"; } if ((Object)(object)_cashBalanceText != (Object)null) { _cashBalanceText.text = $"${instance.cashBalance:N0}"; } if ((Object)(object)_weeklyAmountText != (Object)null) { _weeklyAmountText.text = $"Weekly: ${ATM.WeeklyDepositSum}/{_weeklyDepositLimit}"; } if ((Object)(object)_weeklyProgressFill != (Object)null) { float num = Mathf.Clamp01(ATM.WeeklyDepositSum / (float)_weeklyDepositLimit); float x = _weeklyProgressFill.anchorMax.x; if (Mathf.Abs(num - x) > 0.001f) { MelonCoroutines.Start(AnimateProgressBar(x, num, 0.5f)); } } if (_currentTab == TabType.Deposit) { UpdateConfirmButtonLayout(); } } [IteratorStateMachine(typeof(<AnimateProgressBar>d__50))] private IEnumerator AnimateProgressBar(float from, float to, float duration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AnimateProgressBar>d__50(0) { <>4__this = this, from = from, to = to, duration = duration }; } private int DepositMax() { return _weeklyDepositLimit - (int)ATM.WeeklyDepositSum; } } [RegisterTypeInIl2Cpp] public class BankingAppComponent : MonoBehaviour { public BankingAppComponent(IntPtr ptr) : base(ptr) { } public void Start() { MelonLogger.Msg("BankingAppComponent: Starting"); } } public static class ColorPalette { public static readonly Color32 PROGRESSBAR_BG = new Color32((byte)31, (byte)41, (byte)55, byte.MaxValue); public static readonly Color32 PROGRESSBAR_FILL = new Color32((byte)8, (byte)145, (byte)178, byte.MaxValue); public static readonly Color32 ONLINEBAL = new Color32((byte)34, (byte)211, (byte)238, byte.MaxValue); public static readonly Color32 CASHBAL = new Color32((byte)52, (byte)211, (byte)153, byte.MaxValue); public static readonly Color32 TABBUTTON_ACTIVE = new Color32((byte)8, (byte)145, (byte)178, byte.MaxValue); public static readonly Color32 TABBUTTON_ACTIVE_HOVER = new Color32((byte)14, (byte)116, (byte)144, byte.MaxValue); public static readonly Color32 TABBUTTON_DISABLED = new Color32((byte)31, (byte)41, (byte)55, byte.MaxValue); public static readonly Color32 TABBUTTON_DISABLED_HOVER = new Color32((byte)55, (byte)65, (byte)81, byte.MaxValue); public static readonly Color32 AMOUNTBUTTONS_DEFAULT = new Color32((byte)31, (byte)41, (byte)55, byte.MaxValue); public static readonly Color32 AMOUNTBUTTONS_HOVER = new Color32((byte)55, (byte)65, (byte)81, byte.MaxValue); public static readonly Color32 AMOUNTBUTTONS_CLICKED = new Color32((byte)20, (byte)24, (byte)29, byte.MaxValue); public static readonly Color32 CONFIRMBUTTON_DEFAULT = new Color32((byte)5, (byte)150, (byte)105, byte.MaxValue); public static readonly Color32 CONFIRMBUTTON_HOVERED = new Color32((byte)4, (byte)120, (byte)87, byte.MaxValue); } public class BankingAppBuilder { private readonly int[] _amounts = new int[8] { 1, 5, 10, 25, 50, 100, 500, 1000 }; private readonly GameObject _container; private readonly Action<int> _onAmountSelected; private readonly Action _onConfirm; private readonly Action _onDepositTab; private readonly Action _onMax; private readonly Action _onReset; private readonly Action _onWithdrawTab; public Text WeeklyAmountText { get; private set; } public RectTransform WeeklyProgressFill { get; private set; } public Text OnlineBalanceText { get; private set; } public Text CashBalanceText { get; private set; } public Text SelectedAmountText { get; private set; } public Button ConfirmButton { get; private set; } public Button MaxButton { get; private set; } public Button ResetButton { get; private set; } public GameObject WithdrawTab { get; private set; } public GameObject DepositTab { get; private set; } public BankingAppBuilder(GameObject container, Action<int> onAmountSelected, Action onConfirm, Action onMax, Action onReset, Action onDepositTab, Action onWithdrawTab) { _container = container; _onAmountSelected = onAmountSelected; _onConfirm = onConfirm; _onMax = onMax; _onReset = onReset; _onDepositTab = onDepositTab; _onWithdrawTab = onWithdrawTab; } public void BuildUI() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00e4: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Expected O, but got Unknown //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Expected O, but got Unknown //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Expected O, but got Unknown //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Expected O, but got Unknown //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Expected O, but got Unknown //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: 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) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Expected O, but got Unknown //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Expected O, but got Unknown //IL_069b: Unknown result type (might be due to invalid IL or missing references) //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Expected O, but got Unknown //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07e8: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Expected O, but got Unknown //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_0894: Unknown result type (might be due to invalid IL or missing references) //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Unknown result type (might be due to invalid IL or missing references) //IL_08da: Unknown result type (might be due to invalid IL or missing references) //IL_08ef: Unknown result type (might be due to invalid IL or missing references) //IL_095b: Unknown result type (might be due to invalid IL or missing references) //IL_0962: Expected O, but got Unknown //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_0996: Unknown result type (might be due to invalid IL or missing references) //IL_09bc: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09c5: Unknown result type (might be due to invalid IL or missing references) //IL_09d1: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09e2: Unknown result type (might be due to invalid IL or missing references) //IL_09e7: Unknown result type (might be due to invalid IL or missing references) //IL_09f5: Unknown result type (might be due to invalid IL or missing references) //IL_0a00: Unknown result type (might be due to invalid IL or missing references) //IL_0a16: Unknown result type (might be due to invalid IL or missing references) //IL_0a88: Unknown result type (might be due to invalid IL or missing references) //IL_0a8f: Expected O, but got Unknown //IL_0ab4: Unknown result type (might be due to invalid IL or missing references) //IL_0ac9: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0af3: Unknown result type (might be due to invalid IL or missing references) //IL_0b07: Unknown result type (might be due to invalid IL or missing references) //IL_0b3c: Unknown result type (might be due to invalid IL or missing references) //IL_0b43: Expected O, but got Unknown //IL_0b72: Unknown result type (might be due to invalid IL or missing references) //IL_0ba8: Unknown result type (might be due to invalid IL or missing references) //IL_0bad: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Unknown result type (might be due to invalid IL or missing references) //IL_0bb6: Unknown result type (might be due to invalid IL or missing references) //IL_0bc2: Unknown result type (might be due to invalid IL or missing references) //IL_0bce: Unknown result type (might be due to invalid IL or missing references) //IL_0bd3: Unknown result type (might be due to invalid IL or missing references) //IL_0bdf: Unknown result type (might be due to invalid IL or missing references) //IL_0be4: Unknown result type (might be due to invalid IL or missing references) //IL_0bf4: Unknown result type (might be due to invalid IL or missing references) //IL_0c0a: Unknown result type (might be due to invalid IL or missing references) //IL_0c4b: Unknown result type (might be due to invalid IL or missing references) //IL_0c52: Expected O, but got Unknown //IL_0c81: Unknown result type (might be due to invalid IL or missing references) //IL_0cb7: Unknown result type (might be due to invalid IL or missing references) //IL_0cbc: Unknown result type (might be due to invalid IL or missing references) //IL_0cc0: Unknown result type (might be due to invalid IL or missing references) //IL_0cc5: Unknown result type (might be due to invalid IL or missing references) //IL_0cd1: Unknown result type (might be due to invalid IL or missing references) //IL_0cdd: Unknown result type (might be due to invalid IL or missing references) //IL_0ce2: Unknown result type (might be due to invalid IL or missing references) //IL_0cee: Unknown result type (might be due to invalid IL or missing references) //IL_0cf3: Unknown result type (might be due to invalid IL or missing references) //IL_0d03: Unknown result type (might be due to invalid IL or missing references) //IL_0d19: Unknown result type (might be due to invalid IL or missing references) //IL_0d5a: Unknown result type (might be due to invalid IL or missing references) //IL_0d61: Expected O, but got Unknown //IL_0d86: Unknown result type (might be due to invalid IL or missing references) //IL_0d9b: Unknown result type (might be due to invalid IL or missing references) //IL_0db0: Unknown result type (might be due to invalid IL or missing references) //IL_0dc4: Unknown result type (might be due to invalid IL or missing references) //IL_0de9: Unknown result type (might be due to invalid IL or missing references) //IL_0dee: Unknown result type (might be due to invalid IL or missing references) //IL_0e24: Unknown result type (might be due to invalid IL or missing references) //IL_0e29: Unknown result type (might be due to invalid IL or missing references) //IL_0e2d: Unknown result type (might be due to invalid IL or missing references) //IL_0e32: Unknown result type (might be due to invalid IL or missing references) //IL_0e3e: Unknown result type (might be due to invalid IL or missing references) //IL_0e43: Unknown result type (might be due to invalid IL or missing references) //IL_0e51: Unknown result type (might be due to invalid IL or missing references) //IL_0e5f: Unknown result type (might be due to invalid IL or missing references) //IL_0e6f: Unknown result type (might be due to invalid IL or missing references) //IL_0e85: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_container == (Object)null) { MelonLogger.Error("BankingAppBuilder: Container is null"); return; } for (int num = _container.transform.childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)_container.transform.GetChild(num)).gameObject); } Sprite builtinResource = Resources.GetBuiltinResource<Sprite>("UI/Skin/UISprite.psd"); Sprite val = GetGameSprite("Rectangle_RoundedEdges") ?? builtinResource; GameObject val2 = new GameObject("Card"); val2.transform.SetParent(_container.transform, false); RectTransform obj = val2.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0.5f, 0.5f); obj.anchorMax = new Vector2(0.5f, 0.5f); obj.sizeDelta = new Vector2(400f, 600f); obj.pivot = new Vector2(0.5f, 0.5f); obj.anchoredPosition = Vector2.zero; ((Transform)obj).localScale = new Vector3(1.6145f, 2.0618f, 1f); Image obj2 = val2.AddComponent<Image>(); ((Graphic)obj2).color = Color32.op_Implicit(new Color32((byte)18, (byte)18, (byte)18, byte.MaxValue)); ((Graphic)obj2).raycastTarget = true; obj2.m_PixelsPerUnitMultiplier = 40f; GameObject val3 = new GameObject("Header"); val3.transform.SetParent(val2.transform, false); RectTransform obj3 = val3.AddComponent<RectTransform>(); obj3.anchorMin = new Vector2(0f, 0.7f); obj3.anchorMax = new Vector2(1f, 1f); Vector2 offsetMin = (obj3.offsetMax = Vector2.zero); obj3.offsetMin = offsetMin; obj3.pivot = new Vector2(0.5f, 1f); VerticalLayoutGroup obj4 = val3.AddComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)obj4).spacing = 10f; ((LayoutGroup)obj4).padding = new RectOffset(20, 20, 20, 20); ((LayoutGroup)obj4).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)obj4).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj4).childForceExpandHeight = false; GameObject val4 = new GameObject("Progress"); val4.transform.SetParent(val3.transform, false); HorizontalLayoutGroup obj5 = val4.AddComponent<HorizontalLayoutGroup>(); ((LayoutGroup)obj5).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj5).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj5).childForceExpandHeight = false; Text obj6 = CreateText("ProgressText", val4.transform, 16, Color32.op_Implicit(new Color32((byte)209, (byte)213, (byte)219, byte.MaxValue))); obj6.text = "Weekly Progress"; obj6.alignment = (TextAnchor)3; Text val5 = CreateText("ProgressAmount", val4.transform, 16, Color32.op_Implicit(new Color32((byte)209, (byte)213, (byte)219, byte.MaxValue))); val5.text = $"${ATM.WeeklyDepositSum} / ${ATM.WEEKLY_DEPOSIT_LIMIT}"; val5.alignment = (TextAnchor)5; WeeklyAmountText = val5; GameObject val6 = new GameObject("ProgressBar"); val6.transform.SetParent(val3.transform, false); LayoutElement obj7 = val6.AddComponent<LayoutElement>(); obj7.minHeight = 8f; obj7.preferredHeight = 8f; Image obj8 = val6.AddComponent<Image>(); obj8.sprite = builtinResource; obj8.type = (Type)1; ((Graphic)obj8).color = Color32.op_Implicit(ColorPalette.PROGRESSBAR_BG); obj8.m_PixelsPerUnitMultiplier = 40f; GameObject val7 = new GameObject("ProgressFill"); val7.transform.SetParent(val6.transform, false); RectTransform val8 = val7.AddComponent<RectTransform>(); val8.anchorMin = Vector2.zero; float num2 = Mathf.Clamp01(ATM.WeeklyDepositSum / ATM.WEEKLY_DEPOSIT_LIMIT); val8.anchorMax = new Vector2(num2, 1f); offsetMin = (val8.offsetMax = Vector2.zero); val8.offsetMin = offsetMin; WeeklyProgressFill = val8; Image obj9 = val7.AddComponent<Image>(); obj9.sprite = builtinResource; obj9.type = (Type)0; ((Graphic)obj9).color = Color32.op_Implicit(ColorPalette.PROGRESSBAR_FILL); obj9.m_PixelsPerUnitMultiplier = 1f; GameObject val9 = new GameObject("Balance"); val9.transform.SetParent(val3.transform, false); RectTransform obj10 = val9.AddComponent<RectTransform>(); obj10.sizeDelta = new Vector2(0f, 60f); Canvas.ForceUpdateCanvases(); obj10.anchorMin = new Vector2(0.5f, 0.5f); obj10.anchorMax = new Vector2(0.5f, 0.5f); obj10.pivot = new Vector2(0.5f, 0.5f); obj10.anchoredPosition = new Vector2(0f, 40f); HorizontalLayoutGroup obj11 = val9.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)obj11).spacing = 20f; ((LayoutGroup)obj11).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj11).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj11).childForceExpandHeight = true; GameObject val10 = new GameObject("CashBalance"); val10.transform.SetParent(val9.transform, false); VerticalLayoutGroup obj12 = val10.AddComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)obj12).spacing = 5f; ((LayoutGroup)obj12).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj12).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)obj12).childForceExpandHeight = false; Text obj13 = CreateText("CashLabel", val10.transform, 20, Color32.op_Implicit(new Color32((byte)139, (byte)145, (byte)155, byte.MaxValue))); obj13.text = "Cash Balance"; obj13.alignment = (TextAnchor)4; CashBalanceText = CreateText("CashBalanceText", val10.transform, 20, Color32.op_Implicit(ColorPalette.CASHBAL)); CashBalanceText.text = "$0.00"; CashBalanceText.alignment = (TextAnchor)4; CashBalanceText.fontStyle = (FontStyle)1; GameObject val11 = new GameObject("OnlineBalance"); val11.transform.SetParent(val9.transform, false); VerticalLayoutGroup obj14 = val11.AddComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)obj14).spacing = 5f; ((LayoutGroup)obj14).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj14).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)obj14).childForceExpandHeight = false; Text obj15 = CreateText("OnlineLabel", val11.transform, 20, Color32.op_Implicit(new Color32((byte)139, (byte)145, (byte)155, byte.MaxValue))); obj15.text = "Online Balance"; obj15.alignment = (TextAnchor)4; OnlineBalanceText = CreateText("OnlineBalanceText", val11.transform, 20, Color32.op_Implicit(ColorPalette.ONLINEBAL)); OnlineBalanceText.text = "$0.00"; OnlineBalanceText.alignment = (TextAnchor)4; OnlineBalanceText.fontStyle = (FontStyle)1; GameObject val12 = new GameObject("AmountDisplay"); val12.transform.SetParent(val3.transform, false); val12.AddComponent<RectTransform>().sizeDelta = new Vector2(0f, 40f); HorizontalLayoutGroup obj16 = val12.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)obj16).spacing = 10f; ((LayoutGroup)obj16).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj16).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj16).childForceExpandHeight = true; Text obj17 = CreateText("AmountLabel", val12.transform, 14, Color32.op_Implicit(new Color32((byte)209, (byte)213, (byte)219, byte.MaxValue))); obj17.text = "Amount"; obj17.alignment = (TextAnchor)3; obj17.fontStyle = (FontStyle)1; obj17.fontSize = 18; SelectedAmountText = CreateText("AmountText", val12.transform, 18, Color.white); SelectedAmountText.text = "$0.00"; SelectedAmountText.alignment = (TextAnchor)5; SelectedAmountText.fontStyle = (FontStyle)1; GameObject val13 = new GameObject("Tabs"); val13.transform.SetParent(val2.transform, false); RectTransform obj18 = val13.AddComponent<RectTransform>(); obj18.anchorMin = new Vector2(0.5f, 1f); obj18.anchorMax = new Vector2(0.5f, 1f); obj18.pivot = new Vector2(0.5f, 1f); obj18.sizeDelta = new Vector2(360f, 35f); obj18.anchoredPosition = new Vector2(0f, -165f); HorizontalLayoutGroup obj19 = val13.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)obj19).spacing = 10f; ((LayoutGroup)obj19).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj19).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj19).childForceExpandHeight = true; DepositTab = CreateTabButton(val13, "⇧ Deposit", active: true, _onDepositTab, val); WithdrawTab = CreateTabButton(val13, "⇩ Withdraw", active: false, _onWithdrawTab, val); GameObject val14 = new GameObject("AmountButtons"); val14.transform.SetParent(val2.transform, false); RectTransform obj20 = val14.AddComponent<RectTransform>(); obj20.anchorMin = new Vector2(0.0515f, 1f); obj20.anchorMax = new Vector2(1f, 1f); obj20.offsetMin = Vector2.zero; obj20.offsetMax = Vector2.zero; obj20.anchoredPosition = new Vector2(0f, -210f); GridLayoutGroup obj21 = val14.AddComponent<GridLayoutGroup>(); obj21.cellSize = new Vector2(174.6f, 50f); obj21.spacing = new Vector2(10f, 10f); obj21.constraint = (Constraint)1; obj21.constraintCount = 2; int[] amounts = _amounts; foreach (int amt in amounts) { GameObject val15 = new GameObject($"Amount_{amt}"); val15.transform.SetParent(val14.transform, false); Image val16 = val15.AddComponent<Image>(); val16.sprite = val; val16.type = (Type)1; ((Graphic)val16).color = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_DEFAULT); val16.m_PixelsPerUnitMultiplier = 40f; Button obj22 = val15.AddComponent<Button>(); ((Selectable)obj22).targetGraphic = (Graphic)(object)val16; ColorBlock colors = ((Selectable)obj22).colors; ((ColorBlock)(ref colors)).normalColor = Color.white; ((ColorBlock)(ref colors)).highlightedColor = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_HOVER); ((ColorBlock)(ref colors)).pressedColor = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_CLICKED); ((ColorBlock)(ref colors)).selectedColor = ((Graphic)val16).color; ((Selectable)obj22).colors = colors; Text obj23 = CreateText("Text", val15.transform, 16, Color.white); obj23.text = $"${amt}"; obj23.alignment = (TextAnchor)4; ((UnityEvent)obj22.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { _onAmountSelected(amt); })); } GameObject val17 = new GameObject("ActionButtons"); val17.transform.SetParent(val2.transform, false); RectTransform obj24 = val17.AddComponent<RectTransform>(); obj24.anchorMin = new Vector2(0.5f, 0f); obj24.anchorMax = new Vector2(0.5f, 0f); obj24.pivot = new Vector2(0.5f, 0f); obj24.sizeDelta = new Vector2(360f, 50f); obj24.anchoredPosition = new Vector2(0f, 100f); HorizontalLayoutGroup obj25 = val17.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)obj25).spacing = 10f; ((LayoutGroup)obj25).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)obj25).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj25).childForceExpandHeight = true; GameObject val18 = new GameObject("ClearButton"); val18.transform.SetParent(val17.transform, false); Image val19 = val18.AddComponent<Image>(); val19.sprite = val; val19.type = (Type)1; ((Graphic)val19).color = Color.white; val19.m_PixelsPerUnitMultiplier = 40f; ResetButton = val18.AddComponent<Button>(); ((Selectable)ResetButton).targetGraphic = (Graphic)(object)val19; ColorBlock colors2 = ((Selectable)ResetButton).colors; ((Graphic)val19).color = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_DEFAULT); ((ColorBlock)(ref colors2)).normalColor = Color.white; ((ColorBlock)(ref colors2)).highlightedColor = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_HOVER); ((ColorBlock)(ref colors2)).pressedColor = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_CLICKED); ((Selectable)ResetButton).colors = colors2; Text obj26 = CreateText("Text", val18.transform, 16, Color.white); obj26.text = "✕ Clear"; obj26.alignment = (TextAnchor)4; ((UnityEvent)ResetButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { _onReset(); })); GameObject val20 = new GameObject("MaxButton"); val20.transform.SetParent(val17.transform, false); Image val21 = val20.AddComponent<Image>(); val21.sprite = val; val21.type = (Type)1; ((Graphic)val21).color = Color.white; val21.m_PixelsPerUnitMultiplier = 40f; MaxButton = val20.AddComponent<Button>(); ((Selectable)MaxButton).targetGraphic = (Graphic)(object)val21; ColorBlock colors3 = ((Selectable)MaxButton).colors; ((Graphic)val21).color = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_DEFAULT); ((ColorBlock)(ref colors3)).normalColor = Color.white; ((ColorBlock)(ref colors3)).highlightedColor = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_HOVER); ((ColorBlock)(ref colors3)).pressedColor = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_CLICKED); ((Selectable)MaxButton).colors = colors3; Text obj27 = CreateText("Text", val20.transform, 16, Color.white); obj27.text = "MAX"; obj27.alignment = (TextAnchor)4; ((UnityEvent)MaxButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { _onMax(); })); GameObject val22 = new GameObject("ConfirmButton"); val22.transform.SetParent(val2.transform, false); RectTransform obj28 = val22.AddComponent<RectTransform>(); obj28.anchorMin = new Vector2(0.05f, 0.05f); obj28.anchorMax = new Vector2(0.95f, 0.143f); obj28.offsetMin = new Vector2(0f, 4f); obj28.offsetMax = new Vector2(0f, 4f); Image val23 = val22.AddComponent<Image>(); val23.sprite = val; val23.type = (Type)1; ((Graphic)val23).color = Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_DEFAULT); val23.m_PixelsPerUnitMultiplier = 40f; ConfirmButton = val22.AddComponent<Button>(); ((Selectable)ConfirmButton).targetGraphic = (Graphic)(object)val23; ColorBlock colors4 = ((Selectable)ConfirmButton).colors; ((ColorBlock)(ref colors4)).normalColor = Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_DEFAULT); ((ColorBlock)(ref colors4)).highlightedColor = Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_HOVERED); ((ColorBlock)(ref colors4)).pressedColor = ((ColorBlock)(ref colors4)).pressedColor; ((ColorBlock)(ref colors4)).selectedColor = ((Graphic)val23).color; ((Selectable)ConfirmButton).colors = colors4; Text obj29 = CreateText("Text", val22.transform, 18, Color.white); obj29.text = ""; obj29.alignment = (TextAnchor)4; obj29.fontStyle = (FontStyle)1; ((UnityEvent)ConfirmButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { _onConfirm(); })); MelonLogger.Msg("BankingAppBuilder: UI build complete."); } private GameObject CreateTabButton(GameObject parent, string label, bool active, Action onClick, Sprite buttonSprite) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0106: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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) GameObject val = new GameObject(label + "Tab"); val.transform.SetParent(parent.transform, false); val.AddComponent<RectTransform>().sizeDelta = new Vector2(0f, 40f); Image val2 = val.AddComponent<Image>(); val2.sprite = buttonSprite; val2.type = (Type)1; ((Graphic)val2).color = Color32.op_Implicit(active ? new Color32((byte)8, (byte)145, (byte)178, byte.MaxValue) : new Color32((byte)31, (byte)41, (byte)55, byte.MaxValue)); val2.m_PixelsPerUnitMultiplier = 40f; Button obj = val.AddComponent<Button>(); ((Selectable)obj).targetGraphic = (Graphic)(object)val2; ColorBlock colors = ((Selectable)obj).colors; ((ColorBlock)(ref colors)).normalColor = ((Graphic)val2).color; ((ColorBlock)(ref colors)).highlightedColor = Color32.op_Implicit(active ? new Color32((byte)14, (byte)116, (byte)144, byte.MaxValue) : new Color32((byte)55, (byte)65, (byte)81, byte.MaxValue)); ((ColorBlock)(ref colors)).pressedColor = Color32.op_Implicit(active ? new Color32((byte)7, (byte)89, (byte)110, byte.MaxValue) : new Color32((byte)20, (byte)24, (byte)29, byte.MaxValue)); ((ColorBlock)(ref colors)).selectedColor = ((Graphic)val2).color; ((Selectable)obj).colors = colors; Text obj2 = CreateText(label + "Text", val.transform, 20, Color.white); obj2.text = label; obj2.alignment = (TextAnchor)4; obj2.fontStyle = (FontStyle)1; obj2.fontSize = 20; ((UnityEvent)obj.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { onClick(); })); return val; } private Text CreateText(string name, Transform parent, int size, Color col) { //IL_0001: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = Vector2.zero; obj.anchorMax = Vector2.one; Vector2 offsetMin = (obj.offsetMax = Vector2.zero); obj.offsetMin = offsetMin; Text obj2 = val.AddComponent<Text>(); obj2.font = Resources.GetBuiltinResource<Font>("Arial.ttf"); obj2.fontSize = size; ((Graphic)obj2).color = col; obj2.alignment = (TextAnchor)4; obj2.fontStyle = (FontStyle)1; return obj2; } private Sprite GetGameSprite(string spriteName) { Sprite[] array = Il2CppArrayBase<Sprite>.op_Implicit(Resources.FindObjectsOfTypeAll<Sprite>()); foreach (Sprite val in array) { if (((Object)val).name.Equals(spriteName, StringComparison.OrdinalIgnoreCase)) { return val; } } MelonLogger.Error("Sprite '" + spriteName + "' not found!"); return null; } } }