Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of LaundryApp v1.0.6
Mods/LaundryApp.dll
Decompiled 9 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 Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne; using Il2CppScheduleOne.DevUtilities; using Il2CppScheduleOne.Money; using Il2CppScheduleOne.Property; using Il2CppScheduleOne.UI; using Il2CppScheduleOne.UI.Phone; using Il2CppScheduleOne.Variables; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using LaundryApp; using LaundryApp.App; using MelonLoader; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(Core), "Laundry App", "1.0.6", "DazUki", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: AssemblyMetadata("NexusModID", "1455")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("LaundryApp")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.6.0")] [assembly: AssemblyInformationalVersion("1.0.0+9ade4045a20b1257e04be76f23abf56524844c9a")] [assembly: AssemblyProduct("LaundryApp")] [assembly: AssemblyTitle("LaundryApp")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.6.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 LaundryApp { public class Core : MelonMod { [CompilerGenerated] private sealed class <InitializeLaundryApp>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Core <>4__this; private int <maxWaitAttempts>5__2; private int <attempts>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <InitializeLaundryApp>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown int num = <>1__state; Core core = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <maxWaitAttempts>5__2 = 100; <attempts>5__3 = 0; break; case 1: <>1__state = -1; break; } if (<attempts>5__3 < <maxWaitAttempts>5__2) { <attempts>5__3++; if (!PlayerSingleton<HomeScreen>.InstanceExists || !PlayerSingleton<AppsCanvas>.InstanceExists) { ((MelonBase)core).LoggerInstance.Msg($"[Laundry_App] Waiting for Phone UI to be setup... (Attempt {<attempts>5__3})"); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } } if (<attempts>5__3 >= <maxWaitAttempts>5__2) { ((MelonBase)core).LoggerInstance.Error("Phone UI did not initialize in time"); return false; } try { ((MelonBase)core).LoggerInstance.Msg("Phone UI is ready, creating Laundry App..."); core._laundryApp = new LaundryApp(); core._laundryApp.Initialize(); ((MelonBase)core).LoggerInstance.Msg("Laundry App initialized successfully"); } catch (Exception ex) { ((MelonBase)core).LoggerInstance.Error("Failed to initialize laundry app: " + ex.Message); ((MelonBase)core).LoggerInstance.Error("Stack trace: " + ex.StackTrace); } 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 bool _initialized; private LaundryApp _laundryApp; public static Core Instance { get; private set; } public override void OnInitializeMelon() { Instance = this; ((MelonBase)this).LoggerInstance.Msg("Laundry App loaded!"); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { if (sceneName == "Menu") { _initialized = false; _laundryApp?.Cleanup(); _laundryApp = null; } else if (sceneName == "Main" && !_initialized) { _initialized = true; MelonCoroutines.Start(InitializeLaundryApp()); } } [IteratorStateMachine(typeof(<InitializeLaundryApp>d__8))] private IEnumerator InitializeLaundryApp() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <InitializeLaundryApp>d__8(0) { <>4__this = this }; } public override void OnUpdate() { _laundryApp?.Update(); } } public class LaundryApp { private readonly UI _ui; private BusinessView _businessView; private bool _isOpen; private float _lastRefreshTime; private string _lastAmount = "100"; private float _lastAddButtonClickTime = -2f; private readonly List<Business> _ownedBusinesses = new List<Business>(); public LaundryApp() { _ui = new UI(); } public void Initialize() { _ui.Initialize(); if ((Object)(object)_ui.HeaderText == (Object)null || (Object)(object)_ui.BusinessListContainer == (Object)null || (Object)(object)_ui.CircleSprite == (Object)null) { MelonLogger.Error("Failed to initialize - UI components are null"); return; } _businessView = new BusinessView(_ui.HeaderText, _ui.BusinessListContainer, _ui.CircleSprite); RegisterEventHandlers(); MelonLogger.Msg("App initialized"); } private void RegisterEventHandlers() { UI.RegisterIconClickHandler(OnAppIconClicked); OperationsView operationsView = _ui.OperationsView; if (operationsView != null) { Button startOperationButton = operationsView.StartOperationButton; if (startOperationButton != null) { ((UnityEvent)startOperationButton.onClick).AddListener(UnityAction.op_Implicit((Action)OnStartOperationClicked)); } } OperationsView operationsView2 = _ui.OperationsView; if (operationsView2 != null) { InputField amountInput = operationsView2.AmountInput; if (amountInput != null) { ((UnityEvent<string>)(object)amountInput.onValueChanged).AddListener(UnityAction<string>.op_Implicit((Action<string>)OnAmountValueChanged)); } } OperationsView operationsView3 = _ui.OperationsView; if (operationsView3 != null) { Dropdown businessDropdown = operationsView3.BusinessDropdown; if (businessDropdown != null) { ((UnityEvent<int>)(object)businessDropdown.onValueChanged).AddListener(UnityAction<int>.op_Implicit((Action<int>)OnBusinessDropdownChanged)); } } OperationsView operationsView4 = _ui.OperationsView; if (operationsView4 != null) { Button maxButton = operationsView4.MaxButton; if (maxButton != null) { ((UnityEvent)maxButton.onClick).AddListener(UnityAction.op_Implicit((Action)OnMaxButtonClicked)); } } GameInput.RegisterExitListener(ExitDelegate.op_Implicit((Action<ExitAction>)OnExitAction), 1); if (PlayerSingleton<Phone>.InstanceExists) { Phone instance = PlayerSingleton<Phone>.Instance; instance.closeApps += Action.op_Implicit((Action)Close); } } private void OnAmountValueChanged(string val) { //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_ui.OperationsView?.AmountInput == (Object)null || (Object)(object)_ui.OperationsView?.StartOperationButton == (Object)null) { return; } if (string.IsNullOrEmpty(val)) { _ui.OperationsView.AmountInput.text = _lastAmount; return; } Dropdown businessDropdown = _ui.OperationsView.BusinessDropdown; int num = ((businessDropdown != null) ? businessDropdown.value : (-1)); if (int.TryParse(val, out var result) && num >= 0 && num < _ownedBusinesses.Count) { Business val2 = _ownedBusinesses[num]; float num2 = val2.LaunderCapacity - val2.currentLaunderTotal; if ((float)result > num2 && num2 > 0f) { result = (int)num2; _ui.OperationsView.AmountInput.text = result.ToString(); _lastAmount = result.ToString(); return; } } _lastAmount = val; bool flag = true; if (num >= 0 && num < _ownedBusinesses.Count) { Business val3 = _ownedBusinesses[num]; flag = val3.LaunderCapacity - val3.currentLaunderTotal > 0f; } MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; bool flag2 = true; if ((Object)(object)instance != (Object)null && int.TryParse(val, out var result2)) { flag2 = Mathf.FloorToInt(instance.cashBalance) >= result2; } int result3; bool flag3 = int.TryParse(val, out result3) && result3 >= 10 && flag && flag2; ((Selectable)_ui.OperationsView.StartOperationButton).interactable = flag3; Image image = ((Selectable)_ui.OperationsView.StartOperationButton).image; if (image != null) { ((Graphic)image).color = Color32.op_Implicit(flag3 ? Constants.BUTTON_BACKGROUND_COLOR : Constants.BUTTON_DISABLED_COLOR); } } private void OnAppIconClicked() { if (_isOpen) { Close(); } else { Open(); } } private void OnMaxButtonClicked() { if ((Object)(object)_ui?.OperationsView?.BusinessDropdown == (Object)null || (Object)(object)_ui?.OperationsView?.AmountInput == (Object)null) { return; } int value = _ui.OperationsView.BusinessDropdown.value; if (value < 0 || value >= _ownedBusinesses.Count) { return; } Business val = _ownedBusinesses[value]; if ((Object)(object)val == (Object)null) { return; } float num = val.LaunderCapacity - val.currentLaunderTotal; if (!(num <= 0f)) { float num2 = num; MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; if ((Object)(object)instance != (Object)null && instance.cashBalance < num2) { num2 = instance.cashBalance; } _ui.OperationsView.AmountInput.text = Mathf.FloorToInt(num2).ToString(); } } private void PopulateBusinessDropdown() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown if ((Object)(object)_ui.OperationsView?.BusinessDropdown == (Object)null) { return; } _ownedBusinesses.Clear(); List<Business> ownedBusinesses = Business.OwnedBusinesses; List<OptionData> val = new List<OptionData>(); for (int i = 0; i < ownedBusinesses.Count; i++) { Business val2 = ownedBusinesses[i]; if ((Object)(object)val2 != (Object)null) { _ownedBusinesses.Add(val2); OptionData val3 = new OptionData { text = ((Property)val2).PropertyName }; val.Add(val3); } } _ui.OperationsView.BusinessDropdown.ClearOptions(); _ui.OperationsView.BusinessDropdown.AddOptions(val); _ui.OperationsView.BusinessDropdown.value = 0; UpdateCapacityDisplay(0); } private void OnBusinessDropdownChanged(int index) { UpdateCapacityDisplay(index); } private void UpdateCapacityDisplay(int businessIndex) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (businessIndex < 0 || businessIndex >= _ownedBusinesses.Count) { return; } Business val = _ownedBusinesses[businessIndex]; if (val.LaunderCapacity - val.currentLaunderTotal <= 0f) { if (_ui.OperationsView?.StartOperationButton != null) { ((Selectable)_ui.OperationsView.StartOperationButton).interactable = false; Image image = ((Selectable)_ui.OperationsView.StartOperationButton).image; if (image != null) { ((Graphic)image).color = Color32.op_Implicit(Constants.BUTTON_DISABLED_COLOR); } } } else if ((Object)(object)_ui.OperationsView?.AmountInput != (Object)null) { OnAmountValueChanged(_ui.OperationsView.AmountInput.text); } } private void OnStartOperationClicked() { if (Time.time - _lastAddButtonClickTime < 2f) { if ((Object)(object)_ui.OperationsView?.StartOperationButtonText != (Object)null) { _ui.OperationsView.StartOperationButtonText.text = "..."; } return; } if ((Object)(object)_ui.OperationsView?.BusinessDropdown == (Object)null || (Object)(object)_ui.OperationsView?.AmountInput == (Object)null) { MelonLogger.Error("OperationsView components are null"); return; } int value = _ui.OperationsView.BusinessDropdown.value; if (value < 0 || value >= _ownedBusinesses.Count) { MelonLogger.Warning("Invalid business selection"); return; } Business val = _ownedBusinesses[value]; if (!int.TryParse(_ui.OperationsView.AmountInput.text, out var result) || result < 10) { MelonLogger.Warning($"Invalid amount (min ${10})"); return; } MoneyManager instance = NetworkSingleton<MoneyManager>.Instance; if ((Object)(object)instance == (Object)null) { MelonLogger.Error("MoneyManager instance is null"); return; } if (instance.cashBalance < (float)result) { MelonLogger.Warning($"Insufficient cash (${instance.cashBalance:F0})"); return; } if (val.currentLaunderTotal + (float)result > val.LaunderCapacity) { float value2 = val.LaunderCapacity - val.currentLaunderTotal; MelonLogger.Warning($"Exceeds capacity (Max: ${value2:F0})"); return; } try { instance.ChangeCashBalance((float)(-result), true, true); val.StartLaunderingOperation((float)result, 0); _lastAddButtonClickTime = Time.time; if ((Object)(object)_ui.OperationsView?.StartOperationButtonText != (Object)null) { _ui.OperationsView.StartOperationButtonText.text = "..."; } VariableDatabase instance2 = NetworkSingleton<VariableDatabase>.Instance; if ((Object)(object)instance2 != (Object)null) { float value3 = instance2.GetValue<float>("LaunderingOperationsStarted"); instance2.SetVariableValue("LaunderingOperationsStarted", (value3 + 1f).ToString(), true); } _businessView.RefreshBusinessList(); } catch (Exception value4) { MelonLogger.Error($"Start Operation Failed: {value4}"); } } public void Open() { if (!_isOpen && !((Object)(object)Phone.ActiveApp != (Object)null)) { _isOpen = true; _ui.AppContainer.SetActive(true); Phone.ActiveApp = _ui.AppContainer; PlayerSingleton<HomeScreen>.Instance.SetIsOpen(false); PlayerSingleton<AppsCanvas>.Instance.SetIsOpen(true); PlayerSingleton<Phone>.Instance.SetIsHorizontal(false); PlayerSingleton<Phone>.Instance.SetLookOffsetMultiplier(1f); _businessView.RefreshBusinessList(); PopulateBusinessDropdown(); } } public void Close() { if (_isOpen) { _isOpen = false; _ui.AppContainer.SetActive(false); if ((Object)(object)Phone.ActiveApp == (Object)(object)_ui.AppContainer) { Phone.ActiveApp = null; } PlayerSingleton<HomeScreen>.Instance.SetIsOpen(true); PlayerSingleton<Phone>.Instance.SetIsHorizontal(false); PlayerSingleton<Phone>.Instance.SetLookOffsetMultiplier(1f); } } public void Cleanup() { Close(); OperationsView operationsView = _ui.OperationsView; if (operationsView != null) { Button startOperationButton = operationsView.StartOperationButton; if (startOperationButton != null) { ((UnityEventBase)startOperationButton.onClick).RemoveAllListeners(); } } OperationsView operationsView2 = _ui.OperationsView; if (operationsView2 != null) { InputField amountInput = operationsView2.AmountInput; if (amountInput != null) { ((UnityEventBase)amountInput.onValueChanged).RemoveAllListeners(); } } OperationsView operationsView3 = _ui.OperationsView; if (operationsView3 != null) { InputField amountInput2 = operationsView3.AmountInput; if (amountInput2 != null) { ((UnityEventBase)amountInput2.onEndEdit).RemoveAllListeners(); } } OperationsView operationsView4 = _ui.OperationsView; if (operationsView4 != null) { Dropdown businessDropdown = operationsView4.BusinessDropdown; if (businessDropdown != null) { ((UnityEventBase)businessDropdown.onValueChanged).RemoveAllListeners(); } } OperationsView operationsView5 = _ui.OperationsView; if (operationsView5 != null) { Button maxButton = operationsView5.MaxButton; if (maxButton != null) { ((UnityEventBase)maxButton.onClick).RemoveAllListeners(); } } if (PlayerSingleton<Phone>.InstanceExists) { Phone instance = PlayerSingleton<Phone>.Instance; instance.closeApps -= Action.op_Implicit((Action)Close); } _ownedBusinesses.Clear(); } private void OnExitAction(ExitAction exit) { if (exit != null && !exit.Used && _isOpen && PlayerSingleton<Phone>.InstanceExists && PlayerSingleton<Phone>.Instance.IsOpen) { exit.Used = true; Close(); } } public void Update() { if (!_isOpen) { return; } if (PlayerSingleton<Phone>.Instance.IsOpen && IsHoveringHomeButton() && GameInput.GetButtonDown((ButtonCode)0)) { Close(); } if (Time.time - _lastRefreshTime >= 0.1f) { _lastRefreshTime = Time.time; _businessView.RefreshBusinessList(); if ((Object)(object)_ui.OperationsView?.BusinessDropdown != (Object)null) { UpdateCapacityDisplay(_ui.OperationsView.BusinessDropdown.value); } } if ((Object)(object)_ui.OperationsView?.StartOperationButtonText != (Object)null && _ui.OperationsView.StartOperationButtonText.text == "..." && Time.time - _lastAddButtonClickTime >= 2f) { _ui.OperationsView.StartOperationButtonText.text = "Add"; } } private static bool IsHoveringHomeButton() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(Singleton<GameplayMenu>.Instance.OverlayCamera.ScreenPointToRay(Input.mousePosition), ref val, 2f, 1 << LayerMask.NameToLayer("Overlay"))) { return ((Object)((Component)((RaycastHit)(ref val)).collider).gameObject).name == "Button"; } return false; } } } namespace LaundryApp.App { public static class Constants { public const float REFRESH_INTERVAL = 0.1f; public const int HEADER_FONT_SIZE = 48; public const int BUTTON_FONT_SIZE = 34; public const int MAX_BUTTON_FONT_SIZE = 28; public const int BUSINESS_NAME_FONT_SIZE = 44; public const int CAPACITY_FONT_SIZE = 36; public const int OPERATION_FONT_SIZE = 38; public const int MESSAGE_FONT_SIZE = 34; public const int DROPDOWN_FONT_SIZE = 26; public const int CAPTION_FONT_SIZE = 32; public const int INPUT_FONT_SIZE = 28; public const float BUSINESS_NAME_HEIGHT = 50f; public const float CAPACITY_HEIGHT = 40f; public const float OPERATION_HEIGHT = 50f; public const float BUSINESS_SPACING = 20f; public const float OPERATIONS_TOP_SPACING = 10f; public const float BUSINESS_INFO_PADDING = 8f; public const float CIRCLE_SIZE = 40f; public const float CIRCLE_LEFT_OFFSET = 100f; public const int CIRCLE_TEXTURE_SIZE = 64; public const float CIRCLE_TEXTURE_RADIUS = 30f; public static readonly Color32 BACKGROUND_COLOR = new Color32((byte)20, (byte)20, (byte)20, byte.MaxValue); public static readonly Color32 BUSINESS_BACKGROUND_COLOR = new Color32((byte)40, (byte)40, (byte)40, byte.MaxValue); public static readonly Color32 CIRCLE_BACKGROUND_COLOR = new Color32((byte)10, (byte)10, (byte)10, byte.MaxValue); public static readonly Color32 CIRCLE_FILL_COLOR = new Color32(byte.MaxValue, (byte)184, (byte)93, byte.MaxValue); public static readonly Color32 BUTTON_BACKGROUND_COLOR = new Color32(byte.MaxValue, (byte)184, (byte)93, byte.MaxValue); public static readonly Color32 MAX_BUTTON_BACKGROUND_COLOR = new Color32((byte)33, (byte)33, (byte)33, byte.MaxValue); public static readonly Color32 BUTTON_DISABLED_COLOR = new Color32(byte.MaxValue, (byte)103, (byte)93, byte.MaxValue); public static readonly Color32 BUTTON_TEXT_COLOR = new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue); public static readonly Color32 WHITE_TEXT_COLOR = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); public static readonly Color32 PLACEHOLDER_TEXT_COLOR = new Color32((byte)60, (byte)60, (byte)60, byte.MaxValue); public static readonly Color32 INPUT_BACKGROUND_COLOR = new Color32((byte)43, (byte)43, (byte)43, byte.MaxValue); public const string COLOR_LIGHT_GREEN = "#5EFF5E"; public const string COLOR_LIGHT_ORANGE = "#FFB85D"; public const string APP_NAME = "Laundry"; public const string APP_TITLE = "Laundry Operations"; public const string ICON_FILENAME = "LaundryApp_icon.png"; public const string NO_BUSINESSES_MESSAGE = "No businesses available"; public const string NO_OPERATIONS_MESSAGE = "No ongoing operations"; public const int MIN_LAUNDER_AMOUNT = 10; public const string INPUT_PLACEHOLDER_TEXT = "Enter amount..."; public const string ICON_OBJECT_NAME = "LaundryAppIcon"; public const string CONTAINER_OBJECT_NAME = "LaundryApp"; public const string DEALER_APP_NAME = "DealerManagement"; public const string DELIVERY_APP_NAME = "Delivery"; public const string PRODUCT_MANAGER_APP_NAME = "ProductManager"; public const string COUNTEROFFER_APP_NAME = "Counteroffer"; public static Font ArialFont { get; } = Resources.GetBuiltinResource<Font>("Arial.ttf"); } public class UI { private GameObject _operationsFormContainer; public GameObject AppContainer { get; private set; } public Text HeaderText { get; private set; } public GameObject BusinessListContainer { get; private set; } public Sprite CircleSprite { get; private set; } public OperationsView OperationsView { get; private set; } public void Initialize() { CreateCircleSprite(); CreateAppIcon(); CreateAppUI(); } private void CreateCircleSprite() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_00a0: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(64, 64); Color[] array = (Color[])(object)new Color[4096]; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(32f, 32f); for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num = Vector2.Distance(new Vector2((float)j, (float)i), val2); array[i * 64 + j] = ((num <= 30f) ? Color.white : Color.clear); } } val.SetPixels(Il2CppStructArray<Color>.op_Implicit(array)); val.Apply(); CircleSprite = Sprite.Create(val, new Rect(0f, 0f, 64f, 64f), new Vector2(0.5f, 0.5f)); } private static void CreateAppIcon() { //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) HomeScreen instance = PlayerSingleton<HomeScreen>.Instance; if ((Object)(object)instance == (Object)null) { MelonLogger.Error("HomeScreen not found"); return; } RectTransform appIconContainer = instance.appIconContainer; GameObject appIconPrefab = instance.appIconPrefab; if ((Object)(object)appIconContainer == (Object)null || (Object)(object)appIconPrefab == (Object)null) { MelonLogger.Error("Icon container or prefab is null"); return; } GameObject obj = Object.Instantiate<GameObject>(appIconPrefab, ((Component)appIconContainer).transform); ((Object)obj).name = "LaundryAppIcon"; Transform obj2 = obj.transform.Find("Label"); Text val = ((obj2 != null) ? ((Component)obj2).GetComponent<Text>() : null); if (val != null) { val.text = "Laundry"; } Transform obj3 = obj.transform.Find("Mask/Image"); Image val2 = ((obj3 != null) ? ((Component)obj3).GetComponent<Image>() : null); if (val2 != null) { Sprite val3 = LoadIconSprite(); val2.sprite = val3 ?? val2.sprite; if ((Object)(object)val3 == (Object)null) { ((Graphic)val2).color = Color32.op_Implicit(new Color32((byte)45, (byte)45, (byte)45, byte.MaxValue)); } } Transform val4 = obj.transform.Find("Notifications"); if (val4 != null) { ((Component)val4).gameObject.SetActive(false); } MelonLogger.Msg("App icon created"); } public static void RegisterIconClickHandler(Action onClickHandler) { if (onClickHandler == null) { MelonLogger.Error("Icon click handler is null"); return; } HomeScreen instance = PlayerSingleton<HomeScreen>.Instance; if ((Object)(object)instance == (Object)null) { MelonLogger.Error("HomeScreen instance is null"); return; } Transform val = ((Component)instance.appIconContainer).transform.Find("LaundryAppIcon"); if ((Object)(object)val == (Object)null) { MelonLogger.Error("Icon transform not found"); return; } Button component = ((Component)val).GetComponent<Button>(); if ((Object)(object)component != (Object)null) { ((UnityEventBase)component.onClick).RemoveAllListeners(); ((UnityEvent)component.onClick).AddListener(UnityAction.op_Implicit((Action)onClickHandler.Invoke)); } } private void CreateAppUI() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0093: 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_00ab: 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) AppsCanvas instance = PlayerSingleton<AppsCanvas>.Instance; if (!((Object)(object)instance == (Object)null)) { AppContainer = new GameObject("LaundryApp"); AppContainer.transform.SetParent(((Component)instance.canvas).transform, false); Transform val = ((Component)instance.canvas).transform.Find("DealerManagement"); if ((Object)(object)val != (Object)null) { RectTransform component = ((Component)val).GetComponent<RectTransform>(); RectTransform obj = AppContainer.AddComponent<RectTransform>(); obj.anchorMin = component.anchorMin; obj.anchorMax = component.anchorMax; obj.anchoredPosition = component.anchoredPosition; obj.sizeDelta = component.sizeDelta; obj.pivot = component.pivot; ((Transform)obj).localScale = ((Transform)component).localScale; ((Transform)obj).localRotation = ((Transform)component).localRotation; } else { RectTransform obj2 = AppContainer.AddComponent<RectTransform>(); obj2.anchorMin = Vector2.zero; obj2.anchorMax = Vector2.one; obj2.offsetMin = Vector2.zero; obj2.offsetMax = Vector2.zero; MelonLogger.Warning("DealerManagement not found, using fallback RectTransform"); } CreateBackground(); CreateHeader(); CreateOperationsFormContainer(); CreateBusinessListContainer(); AppContainer.SetActive(false); MelonLogger.Msg("App UI created"); } } private void CreateBackground() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Background"); val.transform.SetParent(AppContainer.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = Vector2.zero; obj.anchorMax = Vector2.one; obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; ((Graphic)val.AddComponent<Image>()).color = Color32.op_Implicit(Constants.BACKGROUND_COLOR); } private void CreateHeader() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Header"); val.transform.SetParent(AppContainer.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0.05f, 0.85f); obj.anchorMax = new Vector2(0.95f, 0.95f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; HeaderText = val.AddComponent<Text>(); HeaderText.fontSize = 48; HeaderText.alignment = (TextAnchor)1; ((Graphic)HeaderText).color = Color.white; HeaderText.font = Constants.ArialFont; HeaderText.fontStyle = (FontStyle)1; HeaderText.text = "Laundry Operations"; } private void CreateOperationsFormContainer() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0048: 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) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) _operationsFormContainer = new GameObject("OperationsForm"); _operationsFormContainer.transform.SetParent(AppContainer.transform, false); RectTransform obj = _operationsFormContainer.AddComponent<RectTransform>(); float num = 0.098148145f; obj.anchorMin = new Vector2(0.08f, 0.8185f); obj.anchorMax = new Vector2(0.92f, 0.8185f + num); obj.offsetMin = new Vector2(-11f, 0f); obj.offsetMax = new Vector2(-6f, 0f); OperationsView = new OperationsView(_operationsFormContainer); } private void CreateBusinessListContainer() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BusinessListContainer"); val.transform.SetParent(AppContainer.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0.08f, 0.08f); obj.anchorMax = new Vector2(0.92f, 0.817f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; BusinessListContainer = val; } private static Sprite LoadIconSprite() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0095: 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) try { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string text = "LaundryApp.Assets.LaundryApp_icon.png"; using Stream stream = executingAssembly.GetManifestResourceStream(text); if (stream == null) { MelonLogger.Warning("Embedded icon not found: " + text); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, Il2CppStructArray<byte>.op_Implicit(array)); if (((Texture)val).width == 2 && ((Texture)val).height == 2) { MelonLogger.Error("Failed to load image data into texture"); return null; } Sprite result = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); MelonLogger.Msg("Successfully loaded embedded icon"); return result; } catch (Exception ex) { MelonLogger.Error("Error loading icon: " + ex.Message); return null; } } } public class BusinessView { private readonly Text _headerText = headerText ?? throw new ArgumentNullException("headerText"); private readonly GameObject _businessListContainer = businessListContainer ?? throw new ArgumentNullException("businessListContainer"); private readonly Sprite _circleSprite = circleSprite ?? throw new ArgumentNullException("circleSprite"); public BusinessView(Text headerText, GameObject businessListContainer, Sprite circleSprite) { } public bool RefreshBusinessList() { try { List<Business> ownedBusinesses = Business.OwnedBusinesses; ClearBusinessList(); if (ownedBusinesses == null || ownedBusinesses.Count == 0) { DisplayNoBusinessesMessage(); return false; } _headerText.text = "Laundry Operations"; RenderBusinessList(ownedBusinesses); return true; } catch (Exception ex) { DisplayError(ex.Message); MelonLogger.Error("Error: " + ex.Message); return false; } } private void ClearBusinessList() { for (int num = _businessListContainer.transform.childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)_businessListContainer.transform.GetChild(num)).gameObject); } } private void DisplayNoBusinessesMessage() { //IL_0015: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) //IL_0080: 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) _headerText.text = "Laundry Operations"; GameObject val = new GameObject("NoBusinesses"); val.transform.SetParent(_businessListContainer.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 0.5f); obj.anchorMax = new Vector2(1f, 0.5f); obj.sizeDelta = new Vector2(0f, 50f); obj.anchoredPosition = new Vector2(0f, 20f); Text obj2 = val.AddComponent<Text>(); obj2.text = "No businesses available"; obj2.fontSize = 34; obj2.alignment = (TextAnchor)4; ((Graphic)obj2).color = Color.white; obj2.font = Constants.ArialFont; } private void DisplayError(string errorMessage) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_00b6: Unknown result type (might be due to invalid IL or missing references) _headerText.text = "Laundry Operations"; ClearBusinessList(); GameObject val = new GameObject("Error"); val.transform.SetParent(_businessListContainer.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 0.5f); obj.anchorMax = new Vector2(1f, 0.5f); obj.sizeDelta = new Vector2(0f, 50f); obj.anchoredPosition = new Vector2(0f, 20f); Text obj2 = val.AddComponent<Text>(); obj2.text = "Error: " + errorMessage; obj2.fontSize = 34; obj2.alignment = (TextAnchor)4; ((Graphic)obj2).color = Color.red; obj2.font = Constants.ArialFont; } private void RenderBusinessList(List<Business> ownedBusinesses) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) float yOffset = 20f; for (int i = 0; i < ownedBusinesses.Count; i++) { Business val = ownedBusinesses[i]; if (!((Object)(object)val == (Object)null)) { GameObject val2 = CreateBusinessContainer(i, ref yOffset); float height = 0f; CreateBusinessInfo(val, val2, ref height); height += 10f; List<LaunderingOperation> launderingOperations = val.LaunderingOperations; CreateOperationsList(launderingOperations, val2, ref height); height += 20f; val2.GetComponent<RectTransform>().sizeDelta = new Vector2(0f, height); yOffset -= height; } } } private GameObject CreateBusinessContainer(int index, ref float yOffset) { //IL_0025: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown GameObject val = new GameObject($"Business_{index}"); val.transform.SetParent(_businessListContainer.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0.5f, 1f); obj.anchoredPosition = new Vector2(0f, yOffset); return val; } private void CreateBusinessInfo(Business business, GameObject parent, ref float height) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_007f: 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_0094: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BusinessInfo"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0.5f, 1f); obj.sizeDelta = new Vector2(0f, 106f); obj.anchoredPosition = new Vector2(0f, 0f - height); ((Graphic)val.AddComponent<Image>()).color = Color32.op_Implicit(Constants.BUSINESS_BACKGROUND_COLOR); CreateBusinessName(((Property)business).PropertyName, val); CreateCapacityInfo(business, val); height += 106f; } private static void CreateBusinessName(string propertyName, GameObject parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) //IL_0080: 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) GameObject val = new GameObject("BusinessName"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0.5f, 1f); obj.sizeDelta = new Vector2(0f, 50f); obj.anchoredPosition = new Vector2(0f, -8f); Text obj2 = val.AddComponent<Text>(); obj2.text = propertyName; obj2.fontSize = 44; obj2.fontStyle = (FontStyle)1; obj2.alignment = (TextAnchor)4; ((Graphic)obj2).color = Color.white; obj2.font = Constants.ArialFont; } private static void CreateCapacityInfo(Business business, GameObject parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Capacity"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0.5f, 1f); obj.sizeDelta = new Vector2(0f, 40f); obj.anchoredPosition = new Vector2(0f, -58f); Text obj2 = val.AddComponent<Text>(); obj2.text = FormatCapacityString(business); obj2.fontSize = 36; obj2.alignment = (TextAnchor)4; ((Graphic)obj2).color = Color.white; obj2.font = Constants.ArialFont; obj2.supportRichText = true; } private static string FormatCapacityString(Business business) { if (business.currentLaunderTotal >= business.LaunderCapacity) { string obj = $"<color={"#5EFF5E"}>${business.currentLaunderTotal:F0}</color>"; string text = $"<color={"#5EFF5E"}>${business.LaunderCapacity:F0}</color>"; string text2 = ((business.appliedLaunderLimit > 0f) ? $" (${business.appliedLaunderLimit:F0} left)" : ""); return obj + " / " + text + text2; } if (business.currentLaunderTotal > 0f) { string obj2 = $"<color={"#FFB85D"}>${business.currentLaunderTotal:F0}</color>"; string text3 = $"${business.LaunderCapacity:F0}"; string text4 = ((business.appliedLaunderLimit > 0f) ? $" (<color={"#FFB85D"}>${business.appliedLaunderLimit:F0}</color> left)" : ""); return obj2 + " / " + text3 + text4; } string obj3 = $"${business.currentLaunderTotal:F0}"; string text5 = $"${business.LaunderCapacity:F0}"; string text6 = ((business.appliedLaunderLimit > 0f) ? $" (<color={"#5EFF5E"}>${business.appliedLaunderLimit:F0}</color> left)" : ""); return obj3 + " / " + text5 + text6; } private void CreateOperationsList(List<LaunderingOperation> operations, GameObject parent, ref float height) { bool flag = false; for (int i = 0; i < operations.Count; i++) { LaunderingOperation val = operations[i]; if (val != null) { CreateOperationEntry(val, i, parent, height); height += 50f; flag = true; } } if (!flag) { CreatePlaceholderEntry(parent, height); height += 50f; } } private static void CreatePlaceholderEntry(GameObject parent, float yOffset) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) //IL_007d: 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_00ac: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("PlaceholderOperation"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0.5f, 1f); obj.sizeDelta = new Vector2(0f, 50f); obj.anchoredPosition = new Vector2(0f, 0f - yOffset); Text obj2 = val.AddComponent<Text>(); obj2.text = "No ongoing operations"; obj2.fontSize = 38; obj2.alignment = (TextAnchor)4; ((Graphic)obj2).color = Color32.op_Implicit(Constants.PLACEHOLDER_TEXT_COLOR); obj2.font = Constants.ArialFont; } private void CreateOperationEntry(LaunderingOperation op, int index, GameObject parent, float yOffset) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) int num = op.completionTime_Minutes - op.minutesSinceStarted; int value = num / 60; int value2 = num % 60; GameObject val = new GameObject($"Operation_{index}"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(0.5f, 1f); obj.sizeDelta = new Vector2(0f, 50f); obj.anchoredPosition = new Vector2(0f, 0f - yOffset); CreateProgressCircle(op, val); Text obj2 = val.AddComponent<Text>(); obj2.text = $"${op.amount:F0} - {value}h {value2}m"; obj2.fontSize = 38; obj2.alignment = (TextAnchor)4; ((Graphic)obj2).color = Color.white; obj2.font = Constants.ArialFont; obj2.supportRichText = true; } private void CreateProgressCircle(LaunderingOperation op, GameObject parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0081: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ProgressCircle"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(0f, 0.5f); obj.anchorMax = new Vector2(0f, 0.5f); obj.pivot = new Vector2(0.5f, 0.5f); obj.sizeDelta = new Vector2(40f, 40f); obj.anchoredPosition = new Vector2(100f, 0f); CreateBackgroundCircle(val); CreateForegroundCircle(op, val); } private void CreateBackgroundCircle(GameObject parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BackgroundCircle"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = Vector2.zero; obj.anchorMax = Vector2.one; obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; Image obj2 = val.AddComponent<Image>(); obj2.sprite = _circleSprite; ((Graphic)obj2).color = Color32.op_Implicit(Constants.CIRCLE_BACKGROUND_COLOR); } private void CreateForegroundCircle(LaunderingOperation op, GameObject parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0094: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ForegroundCircle"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent<RectTransform>(); obj.anchorMin = Vector2.zero; obj.anchorMax = Vector2.one; obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; Image obj2 = val.AddComponent<Image>(); obj2.sprite = _circleSprite; obj2.type = (Type)3; obj2.fillMethod = (FillMethod)4; obj2.fillOrigin = 2; obj2.fillClockwise = true; obj2.fillAmount = (float)op.minutesSinceStarted / (float)op.completionTime_Minutes; ((Graphic)obj2).color = Color32.op_Implicit(Constants.CIRCLE_FILL_COLOR); } } public class OperationsView { private readonly GameObject _container; public Dropdown BusinessDropdown { get; private set; } public InputField AmountInput { get; private set; } public Button MaxButton { get; private set; } public Button StartOperationButton { get; private set; } public Text StartOperationButtonText { get; private set; } public OperationsView(GameObject container) { _container = container ?? throw new ArgumentNullException("container"); CreateForm(); } private void CreateForm() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_0145: 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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Expected O, but got Unknown //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Expected O, but got Unknown //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0665: 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_067a: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06c6: Expected O, but got Unknown //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03da: 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_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) Font arialFont = Constants.ArialFont; float num = 0.02f; float num2 = 0.01f; GameObject val = FindAndCloneComponent<Dropdown>("Delivery"); if (val != null) { ((Object)val).name = "BusinessDropdown"; val.transform.SetParent(_container.transform, false); val.transform.localScale = Vector3.one; RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(num, 0.25f); component.anchorMax = new Vector2(num + 0.42f, 0.75f); component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; BusinessDropdown = val.GetComponent<Dropdown>(); BusinessDropdown.ClearOptions(); StripDropdownImages(BusinessDropdown); if ((Object)(object)BusinessDropdown.captionText != (Object)null) { ((Graphic)BusinessDropdown.captionText).color = Color.white; BusinessDropdown.captionText.resizeTextForBestFit = true; BusinessDropdown.captionText.resizeTextMinSize = 18; BusinessDropdown.captionText.resizeTextMaxSize = 30; ExpandTextToFillParent(BusinessDropdown.captionText); } if ((Object)(object)BusinessDropdown.itemText != (Object)null) { ((Graphic)BusinessDropdown.itemText).color = Color.white; BusinessDropdown.itemText.fontSize = 28; ExpandTextToFillParent(BusinessDropdown.itemText); } num += 0.42f + num2; } else { MelonLogger.Warning("Failed to find Dropdown component for cloning"); } GameObject val2 = FindAndCloneComponent<InputField>("ProductManager"); if (val2 == null) { val2 = FindAndCloneComponent<InputField>("Counteroffer"); } if (val2 != null) { ((Object)val2).name = "AmountInput"; val2.transform.SetParent(_container.transform, false); val2.transform.localScale = Vector3.one; RectTransform component2 = val2.GetComponent<RectTransform>(); component2.anchorMin = new Vector2(num, 0.25f); component2.anchorMax = new Vector2(num + 0.28f, 0.75f); component2.offsetMin = Vector2.zero; component2.offsetMax = new Vector2(-2f, 0f); Image component3 = val2.GetComponent<Image>(); if ((Object)(object)component3 != (Object)null) { component3.sprite = null; ((Graphic)component3).color = Color32.op_Implicit(Constants.INPUT_BACKGROUND_COLOR); } AmountInput = val2.GetComponent<InputField>(); ((UnityEventBase)AmountInput.onValueChanged).RemoveAllListeners(); ((UnityEventBase)AmountInput.onEndEdit).RemoveAllListeners(); AmountInput.text = "100"; AmountInput.contentType = (ContentType)2; AmountInput.lineType = (LineType)0; if ((Object)(object)AmountInput.textComponent != (Object)null) { ((Graphic)AmountInput.textComponent).color = Color.white; AmountInput.textComponent.fontSize = 62; AmountInput.textComponent.alignment = (TextAnchor)3; RectTransform component4 = ((Component)AmountInput.textComponent).GetComponent<RectTransform>(); if ((Object)(object)component4 != (Object)null) { component4.anchorMin = Vector2.zero; component4.anchorMax = Vector2.one; component4.offsetMin = new Vector2(-20f, 0f); component4.offsetMax = Vector2.zero; } } Graphic placeholder = AmountInput.placeholder; Text val3 = (Text)(object)((placeholder is Text) ? placeholder : null); if (val3 != null) { ((Graphic)val3).color = new Color(0.6f, 0.6f, 0.6f); val3.fontSize = 62; val3.text = "Enter amount..."; val3.alignment = (TextAnchor)3; RectTransform component5 = ((Component)val3).GetComponent<RectTransform>(); if ((Object)(object)component5 != (Object)null) { component5.anchorMin = Vector2.zero; component5.anchorMax = Vector2.one; component5.offsetMin = new Vector2(-20f, 0f); component5.offsetMax = Vector2.zero; } } Text[] array = Il2CppArrayBase<Text>.op_Implicit(((Component)AmountInput).GetComponentsInChildren<Text>(true)); foreach (Text val4 in array) { if (val4.text.Contains('$')) { val4.text = "$"; ((Graphic)val4).color = Color.white; val4.fontSize = 62; val4.alignment = (TextAnchor)3; RectTransform component6 = ((Component)val4).GetComponent<RectTransform>(); if ((Object)(object)component6 != (Object)null) { component6.anchorMin = Vector2.zero; component6.anchorMax = Vector2.one; component6.offsetMin = new Vector2(-40f, 0f); component6.offsetMax = Vector2.zero; } break; } } num += 0.28f + num2; } else { MelonLogger.Warning("Failed to find InputField component for cloning"); } GameObject val5 = new GameObject("MaxButton"); val5.transform.SetParent(_container.transform, false); val5.transform.localScale = Vector3.one; RectTransform obj = val5.AddComponent<RectTransform>(); obj.anchorMin = new Vector2(num, 0.25f); obj.anchorMax = new Vector2(num + 0.13f, 0.75f); obj.offsetMin = Vector2.zero; obj.offsetMax = Vector2.zero; Image obj2 = val5.AddComponent<Image>(); ((Graphic)obj2).color = Color32.op_Implicit(Constants.MAX_BUTTON_BACKGROUND_COLOR); ((Graphic)obj2).raycastTarget = true; MaxButton = val5.AddComponent<Button>(); ((Selectable)MaxButton).transition = (Transition)0; GameObject val6 = new GameObject("Text"); val6.transform.SetParent(val5.transform, false); RectTransform obj3 = val6.AddComponent<RectTransform>(); obj3.anchorMin = Vector2.zero; obj3.anchorMax = Vector2.one; obj3.offsetMin = Vector2.zero; obj3.offsetMax = Vector2.zero; num += 0.13f + num2; Text obj4 = val6.AddComponent<Text>(); obj4.text = "Max"; obj4.font = arialFont; obj4.fontStyle = (FontStyle)1; obj4.fontSize = 30; obj4.alignment = (TextAnchor)4; ((Graphic)obj4).color = Color32.op_Implicit(Constants.WHITE_TEXT_COLOR); ((Graphic)obj4).raycastTarget = false; GameObject val7 = new GameObject("LaunderButton"); val7.transform.SetParent(_container.transform, false); val7.transform.localScale = Vector3.one; RectTransform obj5 = val7.AddComponent<RectTransform>(); obj5.anchorMin = new Vector2(num, 0.25f); obj5.anchorMax = new Vector2(num + 0.13f, 0.75f); obj5.offsetMin = Vector2.zero; obj5.offsetMax = Vector2.zero; Image obj6 = val7.AddComponent<Image>(); ((Graphic)obj6).color = Color32.op_Implicit(Constants.BUTTON_BACKGROUND_COLOR); ((Graphic)obj6).raycastTarget = true; StartOperationButton = val7.AddComponent<Button>(); ((Selectable)StartOperationButton).transition = (Transition)0; GameObject val8 = new GameObject("Text"); val8.transform.SetParent(val7.transform, false); RectTransform obj7 = val8.AddComponent<RectTransform>(); obj7.anchorMin = Vector2.zero; obj7.anchorMax = Vector2.one; obj7.offsetMin = Vector2.zero; obj7.offsetMax = Vector2.zero; StartOperationButtonText = val8.AddComponent<Text>(); StartOperationButtonText.text = "Add"; StartOperationButtonText.font = arialFont; StartOperationButtonText.fontStyle = (FontStyle)1; StartOperationButtonText.fontSize = 30; StartOperationButtonText.alignment = (TextAnchor)4; ((Graphic)StartOperationButtonText).color = Color32.op_Implicit(Constants.BUTTON_TEXT_COLOR); ((Graphic)StartOperationButtonText).raycastTarget = false; } private static void StripDropdownImages(Dropdown dropdown) { dropdown.captionImage = null; dropdown.itemImage = null; Image component = ((Component)dropdown).GetComponent<Image>(); if ((Object)(object)component != (Object)null) { component.sprite = null; component.type = (Type)0; } RectTransform template = dropdown.template; Image[] array = Il2CppArrayBase<Image>.op_Implicit(((Component)dropdown).GetComponentsInChildren<Image>(true)); foreach (Image val in array) { if (!((Object)(object)((Component)val).gameObject == (Object)(object)((Component)dropdown).gameObject) && (!((Object)(object)template != (Object)null) || !((Component)val).transform.IsChildOf((Transform)(object)template)) && !(((Object)((Component)val).transform).name == "Arrow") && (!((Object)(object)dropdown.captionText != (Object)null) || !((Object)(object)((Component)val).gameObject == (Object)(object)((Component)dropdown.captionText).gameObject))) { Object.Destroy((Object)(object)((Component)val).gameObject); } } if (!((Object)(object)template != (Object)null) || !((Object)(object)dropdown.itemText != (Object)null)) { return; } Transform parent = ((Component)dropdown.itemText).transform.parent; if (!((Object)(object)parent != (Object)null)) { return; } for (int num = parent.childCount - 1; num >= 0; num--) { Transform child = parent.GetChild(num); if (!((Object)(object)((Component)child).GetComponent<Text>() != (Object)null) && (Object)(object)((Component)child).GetComponent<Image>() != (Object)null && child.childCount == 0) { Object.Destroy((Object)(object)((Component)child).gameObject); } } } private static void ExpandTextToFillParent(Text text) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) RectTransform component = ((Component)text).GetComponent<RectTransform>(); if ((Object)(object)component != (Object)null) { component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = new Vector2(10f, 0f); component.offsetMax = new Vector2(-10f, 0f); } } private static GameObject FindAndCloneComponent<T>(string preferredAppName) where T : Component { AppsCanvas instance = PlayerSingleton<AppsCanvas>.Instance; if ((Object)(object)instance == (Object)null) { return null; } Transform val = ((Component)instance.canvas).transform.Find(preferredAppName); if ((Object)(object)val != (Object)null) { T componentInChildren = ((Component)val).GetComponentInChildren<T>(true); if ((Object)(object)componentInChildren != (Object)null) { return Object.Instantiate<GameObject>(((Component)componentInChildren).gameObject); } } int childCount = ((Component)instance.canvas).transform.childCount; for (int i = 0; i < childCount; i++) { T componentInChildren2 = ((Component)((Component)instance.canvas).transform.GetChild(i)).GetComponentInChildren<T>(true); if ((Object)(object)componentInChildren2 != (Object)null) { return Object.Instantiate<GameObject>(((Component)componentInChildren2).gameObject); } } return null; } } }