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.3
BankApp.dll
Decompiled 3 months 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.Networking; 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), "BankApp", "2.0.3", "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("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+2d9e69f5af8abbcaefa3a5459e64ebbb6a225183")] [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 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_01a9: 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_01cf: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Expected O, but got Unknown //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Expected O, but got Unknown //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Expected O, but got Unknown //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Expected O, but got Unknown //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Expected O, but got Unknown //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Expected O, but got Unknown //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Expected O, but got Unknown //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Expected O, but got Unknown //IL_077d: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_086d: Expected O, but got Unknown //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_08c4: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08f2: Unknown result type (might be due to invalid IL or missing references) //IL_096b: Unknown result type (might be due to invalid IL or missing references) //IL_0972: Expected O, but got Unknown //IL_099b: Unknown result type (might be due to invalid IL or missing references) //IL_09b2: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09cc: Unknown result type (might be due to invalid IL or missing references) //IL_09e3: Unknown result type (might be due to invalid IL or missing references) //IL_0a03: Unknown result type (might be due to invalid IL or missing references) //IL_0a1a: Unknown result type (might be due to invalid IL or missing references) //IL_0a90: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Expected O, but got Unknown //IL_0ac9: Unknown result type (might be due to invalid IL or missing references) //IL_0ace: Unknown result type (might be due to invalid IL or missing references) //IL_0afb: Unknown result type (might be due to invalid IL or missing references) //IL_0b00: Unknown result type (might be due to invalid IL or missing references) //IL_0b04: Unknown result type (might be due to invalid IL or missing references) //IL_0b11: Unknown result type (might be due to invalid IL or missing references) //IL_0b16: Unknown result type (might be due to invalid IL or missing references) //IL_0b23: Unknown result type (might be due to invalid IL or missing references) //IL_0b28: Unknown result type (might be due to invalid IL or missing references) //IL_0b37: Unknown result type (might be due to invalid IL or missing references) //IL_0b44: Unknown result type (might be due to invalid IL or missing references) //IL_0b5b: Unknown result type (might be due to invalid IL or missing references) //IL_0bda: Unknown result type (might be due to invalid IL or missing references) //IL_0be1: Expected O, but got Unknown //IL_0c0a: Unknown result type (might be due to invalid IL or missing references) //IL_0c21: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c4f: Unknown result type (might be due to invalid IL or missing references) //IL_0c66: Unknown result type (might be due to invalid IL or missing references) //IL_0ca7: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Expected O, but got Unknown //IL_0ce0: Unknown result type (might be due to invalid IL or missing references) //IL_0d1a: Unknown result type (might be due to invalid IL or missing references) //IL_0d1f: Unknown result type (might be due to invalid IL or missing references) //IL_0d23: Unknown result type (might be due to invalid IL or missing references) //IL_0d28: Unknown result type (might be due to invalid IL or missing references) //IL_0d35: Unknown result type (might be due to invalid IL or missing references) //IL_0d42: Unknown result type (might be due to invalid IL or missing references) //IL_0d47: Unknown result type (might be due to invalid IL or missing references) //IL_0d54: Unknown result type (might be due to invalid IL or missing references) //IL_0d59: Unknown result type (might be due to invalid IL or missing references) //IL_0d6a: Unknown result type (might be due to invalid IL or missing references) //IL_0d81: Unknown result type (might be due to invalid IL or missing references) //IL_0dca: Unknown result type (might be due to invalid IL or missing references) //IL_0dd1: Expected O, but got Unknown //IL_0e03: Unknown result type (might be due to invalid IL or missing references) //IL_0e3d: Unknown result type (might be due to invalid IL or missing references) //IL_0e42: Unknown result type (might be due to invalid IL or missing references) //IL_0e46: Unknown result type (might be due to invalid IL or missing references) //IL_0e4b: Unknown result type (might be due to invalid IL or missing references) //IL_0e58: Unknown result type (might be due to invalid IL or missing references) //IL_0e65: Unknown result type (might be due to invalid IL or missing references) //IL_0e6a: Unknown result type (might be due to invalid IL or missing references) //IL_0e77: Unknown result type (might be due to invalid IL or missing references) //IL_0e7c: Unknown result type (might be due to invalid IL or missing references) //IL_0e8d: Unknown result type (might be due to invalid IL or missing references) //IL_0ea4: Unknown result type (might be due to invalid IL or missing references) //IL_0eed: Unknown result type (might be due to invalid IL or missing references) //IL_0ef4: Expected O, but got Unknown //IL_0f1d: Unknown result type (might be due to invalid IL or missing references) //IL_0f34: Unknown result type (might be due to invalid IL or missing references) //IL_0f4b: Unknown result type (might be due to invalid IL or missing references) //IL_0f62: Unknown result type (might be due to invalid IL or missing references) //IL_0f8a: Unknown result type (might be due to invalid IL or missing references) //IL_0f8f: Unknown result type (might be due to invalid IL or missing references) //IL_0fc9: Unknown result type (might be due to invalid IL or missing references) //IL_0fce: Unknown result type (might be due to invalid IL or missing references) //IL_0fd2: Unknown result type (might be due to invalid IL or missing references) //IL_0fd7: Unknown result type (might be due to invalid IL or missing references) //IL_0fe4: Unknown result type (might be due to invalid IL or missing references) //IL_0fe9: Unknown result type (might be due to invalid IL or missing references) //IL_0ff8: Unknown result type (might be due to invalid IL or missing references) //IL_1007: Unknown result type (might be due to invalid IL or missing references) //IL_1018: Unknown result type (might be due to invalid IL or missing references) //IL_102f: 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; Sprite val2 = val; GameObject val3 = new GameObject("Card"); val3.transform.SetParent(_container.transform, false); RectTransform val4 = val3.AddComponent<RectTransform>(); val4.anchorMin = new Vector2(0.5f, 0.5f); val4.anchorMax = new Vector2(0.5f, 0.5f); val4.sizeDelta = new Vector2(400f, 600f); val4.pivot = new Vector2(0.5f, 0.5f); val4.anchoredPosition = Vector2.zero; ((Transform)val4).localScale = new Vector3(1.6145f, 2.0618f, 1f); Image val5 = val3.AddComponent<Image>(); ((Graphic)val5).color = Color32.op_Implicit(new Color32((byte)18, (byte)18, (byte)18, byte.MaxValue)); ((Graphic)val5).raycastTarget = true; val5.m_PixelsPerUnitMultiplier = 40f; GameObject val6 = new GameObject("Header"); val6.transform.SetParent(val3.transform, false); RectTransform val7 = val6.AddComponent<RectTransform>(); val7.anchorMin = new Vector2(0f, 0.7f); val7.anchorMax = new Vector2(1f, 1f); Vector2 offsetMin = (val7.offsetMax = Vector2.zero); val7.offsetMin = offsetMin; val7.pivot = new Vector2(0.5f, 1f); VerticalLayoutGroup val8 = val6.AddComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)val8).spacing = 10f; ((LayoutGroup)val8).padding = new RectOffset(20, 20, 20, 20); ((LayoutGroup)val8).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)val8).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val8).childForceExpandHeight = false; GameObject val9 = new GameObject("Progress"); val9.transform.SetParent(val6.transform, false); HorizontalLayoutGroup val10 = val9.AddComponent<HorizontalLayoutGroup>(); ((LayoutGroup)val10).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)val10).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val10).childForceExpandHeight = false; Text val11 = CreateText("ProgressText", val9.transform, 16, Color32.op_Implicit(new Color32((byte)209, (byte)213, (byte)219, byte.MaxValue))); val11.text = "Weekly Progress"; val11.alignment = (TextAnchor)3; Text val12 = CreateText("ProgressAmount", val9.transform, 16, Color32.op_Implicit(new Color32((byte)209, (byte)213, (byte)219, byte.MaxValue))); val12.text = $"${ATM.WeeklyDepositSum} / ${ATM.WEEKLY_DEPOSIT_LIMIT}"; val12.alignment = (TextAnchor)5; WeeklyAmountText = val12; GameObject val13 = new GameObject("ProgressBar"); val13.transform.SetParent(val6.transform, false); LayoutElement val14 = val13.AddComponent<LayoutElement>(); val14.minHeight = 8f; val14.preferredHeight = 8f; Image val15 = val13.AddComponent<Image>(); val15.sprite = builtinResource; val15.type = (Type)1; ((Graphic)val15).color = Color32.op_Implicit(ColorPalette.PROGRESSBAR_BG); val15.m_PixelsPerUnitMultiplier = 40f; GameObject val16 = new GameObject("ProgressFill"); val16.transform.SetParent(val13.transform, false); RectTransform val17 = val16.AddComponent<RectTransform>(); val17.anchorMin = Vector2.zero; float num2 = Mathf.Clamp01(ATM.WeeklyDepositSum / ATM.WEEKLY_DEPOSIT_LIMIT); val17.anchorMax = new Vector2(num2, 1f); offsetMin = (val17.offsetMax = Vector2.zero); val17.offsetMin = offsetMin; WeeklyProgressFill = val17; Image val18 = val16.AddComponent<Image>(); val18.sprite = builtinResource; val18.type = (Type)0; ((Graphic)val18).color = Color32.op_Implicit(ColorPalette.PROGRESSBAR_FILL); val18.m_PixelsPerUnitMultiplier = 1f; GameObject val19 = new GameObject("Balance"); val19.transform.SetParent(val6.transform, false); RectTransform val20 = val19.AddComponent<RectTransform>(); val20.sizeDelta = new Vector2(0f, 60f); Canvas.ForceUpdateCanvases(); val20.anchorMin = new Vector2(0.5f, 0.5f); val20.anchorMax = new Vector2(0.5f, 0.5f); val20.pivot = new Vector2(0.5f, 0.5f); val20.anchoredPosition = new Vector2(0f, 40f); HorizontalLayoutGroup val21 = val19.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)val21).spacing = 20f; ((LayoutGroup)val21).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)val21).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val21).childForceExpandHeight = true; GameObject val22 = new GameObject("CashBalance"); val22.transform.SetParent(val19.transform, false); VerticalLayoutGroup val23 = val22.AddComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)val23).spacing = 5f; ((LayoutGroup)val23).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)val23).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)val23).childForceExpandHeight = false; Text val24 = CreateText("CashLabel", val22.transform, 20, Color32.op_Implicit(new Color32((byte)139, (byte)145, (byte)155, byte.MaxValue))); val24.text = "Cash Balance"; val24.alignment = (TextAnchor)4; CashBalanceText = CreateText("CashBalanceText", val22.transform, 20, Color32.op_Implicit(ColorPalette.CASHBAL)); CashBalanceText.text = "$0.00"; CashBalanceText.alignment = (TextAnchor)4; CashBalanceText.fontStyle = (FontStyle)1; GameObject val25 = new GameObject("OnlineBalance"); val25.transform.SetParent(val19.transform, false); VerticalLayoutGroup val26 = val25.AddComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)val26).spacing = 5f; ((LayoutGroup)val26).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)val26).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)val26).childForceExpandHeight = false; Text val27 = CreateText("OnlineLabel", val25.transform, 20, Color32.op_Implicit(new Color32((byte)139, (byte)145, (byte)155, byte.MaxValue))); val27.text = "Online Balance"; val27.alignment = (TextAnchor)4; OnlineBalanceText = CreateText("OnlineBalanceText", val25.transform, 20, Color32.op_Implicit(ColorPalette.ONLINEBAL)); OnlineBalanceText.text = "$0.00"; OnlineBalanceText.alignment = (TextAnchor)4; OnlineBalanceText.fontStyle = (FontStyle)1; GameObject val28 = new GameObject("AmountDisplay"); val28.transform.SetParent(val6.transform, false); RectTransform val29 = val28.AddComponent<RectTransform>(); val29.sizeDelta = new Vector2(0f, 40f); HorizontalLayoutGroup val30 = val28.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)val30).spacing = 10f; ((LayoutGroup)val30).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)val30).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val30).childForceExpandHeight = true; Text val31 = CreateText("AmountLabel", val28.transform, 14, Color32.op_Implicit(new Color32((byte)209, (byte)213, (byte)219, byte.MaxValue))); val31.text = "Amount"; val31.alignment = (TextAnchor)3; val31.fontStyle = (FontStyle)1; val31.fontSize = 18; SelectedAmountText = CreateText("AmountText", val28.transform, 18, Color.white); SelectedAmountText.text = "$0.00"; SelectedAmountText.alignment = (TextAnchor)5; SelectedAmountText.fontStyle = (FontStyle)1; GameObject val32 = new GameObject("Tabs"); val32.transform.SetParent(val3.transform, false); RectTransform val33 = val32.AddComponent<RectTransform>(); val33.anchorMin = new Vector2(0.5f, 1f); val33.anchorMax = new Vector2(0.5f, 1f); val33.pivot = new Vector2(0.5f, 1f); val33.sizeDelta = new Vector2(360f, 35f); val33.anchoredPosition = new Vector2(0f, -165f); HorizontalLayoutGroup val34 = val32.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)val34).spacing = 10f; ((LayoutGroup)val34).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)val34).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val34).childForceExpandHeight = true; DepositTab = CreateTabButton(val32, "⇧ Deposit", active: true, _onDepositTab, val2); WithdrawTab = CreateTabButton(val32, "⇩ Withdraw", active: false, _onWithdrawTab, val2); GameObject val35 = new GameObject("AmountButtons"); val35.transform.SetParent(val3.transform, false); RectTransform val36 = val35.AddComponent<RectTransform>(); val36.anchorMin = new Vector2(0.0515f, 1f); val36.anchorMax = new Vector2(1f, 1f); val36.offsetMin = Vector2.zero; val36.offsetMax = Vector2.zero; val36.anchoredPosition = new Vector2(0f, -210f); GridLayoutGroup val37 = val35.AddComponent<GridLayoutGroup>(); val37.cellSize = new Vector2(174.6f, 50f); val37.spacing = new Vector2(10f, 10f); val37.constraint = (Constraint)1; val37.constraintCount = 2; int[] amounts = _amounts; foreach (int amt in amounts) { GameObject val38 = new GameObject($"Amount_{amt}"); val38.transform.SetParent(val35.transform, false); Image val39 = val38.AddComponent<Image>(); val39.sprite = val2; val39.type = (Type)1; ((Graphic)val39).color = Color32.op_Implicit(ColorPalette.AMOUNTBUTTONS_DEFAULT); val39.m_PixelsPerUnitMultiplier = 40f; Button val40 = val38.AddComponent<Button>(); ((Selectable)val40).targetGraphic = (Graphic)(object)val39; ColorBlock colors = ((Selectable)val40).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)val39).color; ((Selectable)val40).colors = colors; Text val41 = CreateText("Text", val38.transform, 16, Color.white); val41.text = $"${amt}"; val41.alignment = (TextAnchor)4; ((UnityEvent)val40.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { _onAmountSelected(amt); })); } GameObject val42 = new GameObject("ActionButtons"); val42.transform.SetParent(val3.transform, false); RectTransform val43 = val42.AddComponent<RectTransform>(); val43.anchorMin = new Vector2(0.5f, 0f); val43.anchorMax = new Vector2(0.5f, 0f); val43.pivot = new Vector2(0.5f, 0f); val43.sizeDelta = new Vector2(360f, 50f); val43.anchoredPosition = new Vector2(0f, 100f); HorizontalLayoutGroup val44 = val42.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)val44).spacing = 10f; ((LayoutGroup)val44).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)val44).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val44).childForceExpandHeight = true; GameObject val45 = new GameObject("ClearButton"); val45.transform.SetParent(val42.transform, false); Image val46 = val45.AddComponent<Image>(); val46.sprite = val2; val46.type = (Type)1; ((Graphic)val46).color = Color.white; val46.m_PixelsPerUnitMultiplier = 40f; ResetButton = val45.AddComponent<Button>(); ((Selectable)ResetButton).targetGraphic = (Graphic)(object)val46; ColorBlock colors2 = ((Selectable)ResetButton).colors; ((Graphic)val46).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 val47 = CreateText("Text", val45.transform, 16, Color.white); val47.text = "✕ Clear"; val47.alignment = (TextAnchor)4; ((UnityEvent)ResetButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { _onReset(); })); GameObject val48 = new GameObject("MaxButton"); val48.transform.SetParent(val42.transform, false); Image val49 = val48.AddComponent<Image>(); val49.sprite = val2; val49.type = (Type)1; ((Graphic)val49).color = Color.white; val49.m_PixelsPerUnitMultiplier = 40f; MaxButton = val48.AddComponent<Button>(); ((Selectable)MaxButton).targetGraphic = (Graphic)(object)val49; ColorBlock colors3 = ((Selectable)MaxButton).colors; ((Graphic)val49).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 val50 = CreateText("Text", val48.transform, 16, Color.white); val50.text = "MAX"; val50.alignment = (TextAnchor)4; ((UnityEvent)MaxButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { _onMax(); })); GameObject val51 = new GameObject("ConfirmButton"); val51.transform.SetParent(val3.transform, false); RectTransform val52 = val51.AddComponent<RectTransform>(); val52.anchorMin = new Vector2(0.05f, 0.05f); val52.anchorMax = new Vector2(0.95f, 0.143f); val52.offsetMin = new Vector2(0f, 4f); val52.offsetMax = new Vector2(0f, 4f); Image val53 = val51.AddComponent<Image>(); val53.sprite = val2; val53.type = (Type)1; ((Graphic)val53).color = Color32.op_Implicit(ColorPalette.CONFIRMBUTTON_DEFAULT); val53.m_PixelsPerUnitMultiplier = 40f; ConfirmButton = val51.AddComponent<Button>(); ((Selectable)ConfirmButton).targetGraphic = (Graphic)(object)val53; 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)val53).color; ((Selectable)ConfirmButton).colors = colors4; Text val54 = CreateText("Text", val51.transform, 18, Color.white); val54.text = ""; val54.alignment = (TextAnchor)4; val54.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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(label + "Tab"); val.transform.SetParent(parent.transform, false); RectTransform val2 = val.AddComponent<RectTransform>(); val2.sizeDelta = new Vector2(0f, 40f); Image val3 = val.AddComponent<Image>(); val3.sprite = buttonSprite; val3.type = (Type)1; ((Graphic)val3).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)); val3.m_PixelsPerUnitMultiplier = 40f; Button val4 = val.AddComponent<Button>(); ((Selectable)val4).targetGraphic = (Graphic)(object)val3; ColorBlock colors = ((Selectable)val4).colors; ((ColorBlock)(ref colors)).normalColor = ((Graphic)val3).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)val3).color; ((Selectable)val4).colors = colors; Text val5 = CreateText(label + "Text", val.transform, 20, Color.white); val5.text = label; val5.alignment = (TextAnchor)4; val5.fontStyle = (FontStyle)1; val5.fontSize = 20; ((UnityEvent)val4.onClick).AddListener(UnityAction.op_Implicit((Action)delegate { onClick(); })); return val; } private Text CreateText(string name, Transform parent, int size, Color col) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent<RectTransform>(); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; Vector2 offsetMin = (val2.offsetMax = Vector2.zero); val2.offsetMin = offsetMin; Text val3 = val.AddComponent<Text>(); val3.font = Resources.GetBuiltinResource<Font>("Arial.ttf"); val3.fontSize = size; ((Graphic)val3).color = col; val3.alignment = (TextAnchor)4; val3.fontStyle = (FontStyle)1; return val3; } private Sprite GetGameSprite(string spriteName) { Sprite[] array = Il2CppArrayBase<Sprite>.op_Implicit(Resources.FindObjectsOfTypeAll<Sprite>()); Sprite[] array2 = array; foreach (Sprite val in array2) { if (((Object)val).name.Equals(spriteName, StringComparison.OrdinalIgnoreCase)) { return val; } } MelonLogger.Error("Sprite '" + spriteName + "' not found!"); return null; } } 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 from; public float to; public float duration; public Core <>4__this; private float <elapsed>5__1; private float <t>5__2; private float <v>5__3; 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <elapsed>5__1 = 0f; break; case 1: <>1__state = -1; break; } if (<elapsed>5__1 < duration) { <t>5__2 = <elapsed>5__1 / duration; <v>5__3 = Mathf.Lerp(from, to, <t>5__2); <>4__this._weeklyProgressFill.anchorMax = new Vector2(<v>5__3, 1f); <elapsed>5__1 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } <>4__this._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 <EnsureIconFileExists>d__32 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Core <>4__this; private string <filePath>5__1; private UnityWebRequest <uwr>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <EnsureIconFileExists>d__32(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <filePath>5__1 = null; <uwr>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <filePath>5__1 = Path.Combine("UserData/BankApp", <>4__this.iconFileName); if (!File.Exists(<filePath>5__1)) { MelonLogger.Msg("Downloading icon from " + <>4__this.iconUrl); <uwr>5__2 = UnityWebRequest.Get(<>4__this.iconUrl); <>2__current = <uwr>5__2.SendWebRequest(); <>1__state = 1; return true; } MelonLogger.Msg("Icon already present at " + <filePath>5__1); break; case 1: <>1__state = -1; if (<uwr>5__2.isNetworkError || <uwr>5__2.isHttpError) { MelonLogger.Error("Icon download failed: " + <uwr>5__2.error); <uwr>5__2.Dispose(); return false; } File.WriteAllBytes(<filePath>5__1, Il2CppArrayBase<byte>.op_Implicit((Il2CppArrayBase<byte>)(object)<uwr>5__2.downloadHandler.data)); MelonLogger.Msg("Icon saved to " + <filePath>5__1); <uwr>5__2.Dispose(); <uwr>5__2 = null; break; } 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__36 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Image targetImage; public Core <>4__this; private string <filePath>5__1; private byte[] <data>5__2; private Texture2D <tex>5__3; private Sprite <spr>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SetActiveIconSprite>d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <filePath>5__1 = null; <data>5__2 = null; <tex>5__3 = null; <spr>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00c0: 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) if (<>1__state != 0) { return false; } <>1__state = -1; <filePath>5__1 = Path.Combine("UserData/BankApp", <>4__this.iconFileName); if (!File.Exists(<filePath>5__1)) { MelonLogger.Error("Icon file not found at " + <filePath>5__1); return false; } <data>5__2 = File.ReadAllBytes(<filePath>5__1); <tex>5__3 = <>4__this.CreatePersistentTexture(<data>5__2); if ((Object)(object)<tex>5__3 != (Object)null) { <spr>5__4 = Sprite.Create(<tex>5__3, new Rect(0f, 0f, (float)((Texture)<tex>5__3).width, (float)((Texture)<tex>5__3).height), new Vector2(0.5f, 0.5f)); targetImage.sprite = <spr>5__4; targetImage.preserveAspect = true; ((Graphic)targetImage).SetAllDirty(); <spr>5__4 = null; } 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__35 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject iconGO; public Core <>4__this; private Transform <lbl>5__1; private Text <t>5__2; private Transform <mask>5__3; private Image <img>5__4; private int <i>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <UpdateAppIconLabelAndSpriteCoroutine>d__35(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <lbl>5__1 = null; <t>5__2 = null; <mask>5__3 = null; <img>5__4 = null; <>1__state = -2; } private bool MoveNext() { Transform obj; switch (<>1__state) { default: return false; case 0: <>1__state = -1; <lbl>5__1 = null; <i>5__5 = 0; goto IL_0082; case 1: <>1__state = -1; <i>5__5++; goto IL_0082; case 2: { <>1__state = -1; ((Object)iconGO).name = "BankingApp"; <>4__this._iconModified = true; return false; } IL_0082: if (<i>5__5 < 10 && (Object)(object)<lbl>5__1 == (Object)null) { <lbl>5__1 = iconGO.transform.Find("Label"); <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)<lbl>5__1 != (Object)null) { <t>5__2 = ((Component)<lbl>5__1).GetComponent<Text>(); if (<t>5__2 != null) { <t>5__2.text = "Bank"; goto IL_00ec; } } MelonLogger.Error("Icon label text component not found."); goto IL_00ec; IL_00ec: obj = iconGO.transform.Find("Mask"); <mask>5__3 = ((obj != null) ? obj.Find("Image") : null); if (!((Object)(object)<mask>5__3 == (Object)null)) { <img>5__4 = ((Component)<mask>5__3).GetComponent<Image>(); if (<img>5__4 != null) { <>2__current = <>4__this.SetActiveIconSprite(<img>5__4); <>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 readonly string iconFileName = "BankAppIcon.png"; private readonly string iconUrl = "https://i.imgur.com/hsVNqRx.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(); MelonCoroutines.Start(EnsureIconFileExists()); ClassInjector.RegisterTypeInIl2Cpp<BankingAppComponent>(); MelonLogger.Msg("BankingApp: Successfully registered BankingAppComponent type"); } 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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)(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 + "'."); } } [IteratorStateMachine(typeof(<EnsureIconFileExists>d__32))] private IEnumerator EnsureIconFileExists() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <EnsureIconFileExists>d__32(0) { <>4__this = this }; } 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_01c9: 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__35))] private IEnumerator UpdateAppIconLabelAndSpriteCoroutine(GameObject iconGO) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <UpdateAppIconLabelAndSpriteCoroutine>d__35(0) { <>4__this = this, iconGO = iconGO }; } [IteratorStateMachine(typeof(<SetActiveIconSprite>d__36))] private IEnumerator SetActiveIconSprite(Image targetImage) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SetActiveIconSprite>d__36(0) { <>4__this = this, targetImage = targetImage }; } private void EnsureAppPanelIsSetup(GameObject appPanel) { //IL_00c3: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_0096: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0135: 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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0142: 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"); } } }