Decompiled source of ModMenu v1.0.0

BepInEx\plugins\ScheduleIMenu\ScheduleIMenu.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using ScheduleOne;
using ScheduleOne.Core.Items.Framework;
using ScheduleOne.DevUtilities;
using ScheduleOne.Doors;
using ScheduleOne.Economy;
using ScheduleOne.Growing;
using ScheduleOne.ItemFramework;
using ScheduleOne.Levelling;
using ScheduleOne.Map;
using ScheduleOne.Money;
using ScheduleOne.NPCs.Relation;
using ScheduleOne.ObjectScripts;
using ScheduleOne.PlayerScripts;
using ScheduleOne.Property;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.UI;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ScheduleIMenu")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ScheduleIMenu")]
[assembly: AssemblyTitle("ScheduleIMenu")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 ScheduleIMenu
{
	internal static class CheatState
	{
		public static bool Fly;

		public static float FlySpeed = 12f;

		public static bool SoloAllowed = true;

		public static bool FlyActive
		{
			get
			{
				if (Fly)
				{
					return SoloAllowed;
				}
				return false;
			}
		}

		public static void Reset()
		{
			Fly = false;
		}
	}
	public class MenuBehaviour : MonoBehaviour
	{
		private class TeleportEntry
		{
			public string Name;

			public Vector3 Position;

			public int Category;
		}

		private class Row
		{
			public Image Bg;

			public Text State;

			public Func<bool> IsOn;

			public Action Toggle;
		}

		private const int PanelWidth = 720;

		private const int PanelHeight = 680;

		private const int ItemColumns = 2;

		private const int ItemRows = 4;

		private const int ItemsPerPage = 8;

		private static readonly string[] TabNames = new string[5] { "Geral", "Dinheiro", "Itens", "Fazenda", "Teleportes" };

		private static readonly Color PanelColor = new Color(0.045f, 0.05f, 0.07f, 0.97f);

		private static readonly Color Accent = new Color(0.24f, 0.85f, 0.88f, 1f);

		private static readonly Color TextColor = new Color(0.93f, 0.95f, 0.98f, 1f);

		private static readonly Color DimColor = new Color(0.6f, 0.65f, 0.72f, 1f);

		private static readonly Color Green = new Color(0.38f, 1f, 0.52f, 1f);

		private static readonly Color Red = new Color(1f, 0.38f, 0.38f, 1f);

		private static readonly Color RowOff = new Color(1f, 1f, 1f, 0.04f);

		private static readonly Color RowOn = new Color(0.24f, 0.85f, 0.88f, 0.16f);

		private static readonly Color ButtonColor = new Color(0.14f, 0.17f, 0.22f, 1f);

		private static readonly Color BarColor = new Color(1f, 1f, 1f, 0.025f);

		private static readonly Color TabOffColor = new Color(1f, 1f, 1f, 0.05f);

		private static readonly Color TabOnColor = new Color(0.24f, 0.85f, 0.88f, 0.22f);

		private Canvas _canvas;

		private RectTransform _canvasRect;

		private RectTransform _panel;

		private RectTransform _cursor;

		private static Sprite _whiteSprite;

		private RectTransform _tabRoot;

		private RectTransform[] _tabPanels;

		private Image[] _tabButtonImages;

		private Text _soloBadge;

		private Text _flySpeedText;

		private Text _statusText;

		private readonly List<Row> _rows = new List<Row>();

		private readonly List<ItemDefinition> _items = new List<ItemDefinition>();

		private readonly Text[] _itemLabels = (Text[])(object)new Text[8];

		private readonly GameObject[] _itemButtons = (GameObject[])(object)new GameObject[8];

		private Text _qtyText;

		private Text _pageText;

		private int _page;

		private int _qty = 1;

		private Text _cashText;

		private Text _cardText;

		private bool _autoHarvest;

		private bool _autoPlant;

		private float _nextHarvest;

		private float _nextPlant;

		private readonly List<string> _seedIds = new List<string>();

		private readonly List<string> _seedNames = new List<string>();

		private Text _seedText;

		private int _seedIndex;

		private bool _seedsLoaded;

		private readonly List<TeleportEntry> _teleports = new List<TeleportEntry>();

		private readonly List<TeleportEntry> _tpVisible = new List<TeleportEntry>();

		private readonly Text[] _tpLabels = (Text[])(object)new Text[8];

		private readonly GameObject[] _tpButtons = (GameObject[])(object)new GameObject[8];

		private Image[] _tpSubButtons;

		private Text _tpPageText;

		private Text _tpEmptyText;

		private int _tpPage;

		private int _tpSub;

		private bool _open;

		private bool _built;

		private bool _prevCursorVisible;

		private CursorLockMode _prevCursorLock;

		private bool _prevCursorCaptured;

		private int _tab;

		private float _statusUntil;

		private float _errorCooldown;

		private static Font _font;

		private static MethodInfo _onCustomerUnlocked;

		public static bool IsOpen { get; private set; }

		private int PageCount
		{
			get
			{
				if (_items.Count == 0)
				{
					return 0;
				}
				return (_items.Count + 8 - 1) / 8;
			}
		}

		private int TpPageCount
		{
			get
			{
				if (_tpVisible.Count == 0)
				{
					return 0;
				}
				return (_tpVisible.Count + 8 - 1) / 8;
			}
		}

		private void Start()
		{
			try
			{
				Build();
			}
			catch (Exception e)
			{
				Log("Build", e);
			}
		}

		private void Update()
		{
			try
			{
				Refs.Refresh();
				Keyboard current = Keyboard.current;
				if (current != null && ((ButtonControl)current.gKey).wasPressedThisFrame)
				{
					SetOpen(!_open);
				}
				else if (_open && current != null && ((ButtonControl)current.escapeKey).wasPressedThisFrame)
				{
					SetOpen(open: false);
				}
				if ((Object)(object)_canvas != (Object)null && ((Component)_canvas).gameObject.activeSelf != _open)
				{
					((Component)_canvas).gameObject.SetActive(_open);
				}
				if (_open)
				{
					EnsureCursor();
					EnsureCatalog();
					EnsureTeleports();
					UpdateMoney();
					RefreshRows();
					RefreshItems();
					RefreshTeleports();
					UpdateStatus();
				}
				if (CheatState.FlyActive)
				{
					ApplyFly();
				}
				UpdateFarm();
			}
			catch (Exception e)
			{
				if (Time.unscaledTime > _errorCooldown)
				{
					_errorCooldown = Time.unscaledTime + 5f;
					Log("Update", e);
				}
			}
		}

		private void OnDestroy()
		{
			try
			{
				if (IsOpen)
				{
					IsOpen = false;
					SetGameCursor(menuOpen: false);
				}
			}
			catch
			{
			}
		}

		private void LateUpdate()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			if (_open)
			{
				if ((int)Cursor.lockState != 0)
				{
					Cursor.lockState = (CursorLockMode)0;
				}
				if (Cursor.visible)
				{
					Cursor.visible = false;
				}
				UpdateCursor();
			}
		}

		private void UpdateCursor()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_cursor == (Object)null))
			{
				Mouse current = Mouse.current;
				Vector2 anchoredPosition = default(Vector2);
				if (current != null && RectTransformUtility.ScreenPointToLocalPointInRectangle(_canvasRect, ((InputControl<Vector2>)(object)((Pointer)current).position).ReadValue(), (Camera)null, ref anchoredPosition))
				{
					_cursor.anchoredPosition = anchoredPosition;
				}
			}
		}

		private void SetOpen(bool open)
		{
			//IL_0017: 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)
			if (open && !_open)
			{
				_prevCursorVisible = Cursor.visible;
				_prevCursorLock = Cursor.lockState;
				_prevCursorCaptured = true;
			}
			_open = open;
			IsOpen = open;
			if ((Object)(object)_canvas != (Object)null)
			{
				((Component)_canvas).gameObject.SetActive(open);
			}
			if ((Object)(object)_cursor != (Object)null)
			{
				((Component)_cursor).gameObject.SetActive(open);
			}
			if (open)
			{
				SetGameCursor(menuOpen: true);
				UpdateCursor();
				EnsureCatalog();
				EnsureTeleports();
				RefreshRows();
				RefreshItems();
				RefreshTeleports();
			}
			else
			{
				SetGameCursor(menuOpen: false);
			}
		}

		private void SetGameCursor(bool menuOpen)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				PlayerCamera instance = PlayerSingleton<PlayerCamera>.Instance;
				if ((Object)(object)instance != (Object)null)
				{
					if (menuOpen)
					{
						instance.SetCanLook(false);
						instance.FreeMouse(true);
					}
					else
					{
						instance.SetCanLook(true);
						if (_prevCursorCaptured && (int)_prevCursorLock == 1)
						{
							instance.LockMouse(true);
						}
						else
						{
							instance.FreeMouse(false);
						}
					}
				}
			}
			catch
			{
			}
			if (menuOpen)
			{
				Cursor.visible = false;
				Cursor.lockState = (CursorLockMode)0;
			}
			else if (_prevCursorCaptured)
			{
				Cursor.visible = _prevCursorVisible;
				Cursor.lockState = _prevCursorLock;
				_prevCursorCaptured = false;
			}
			else
			{
				Cursor.visible = false;
				Cursor.lockState = (CursorLockMode)1;
			}
		}

		private void EnsureCursor()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			if ((int)Cursor.lockState != 0)
			{
				Cursor.lockState = (CursorLockMode)0;
			}
			if (Cursor.visible)
			{
				Cursor.visible = false;
			}
		}

		private void ApplyFly()
		{
			//IL_004e: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: 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_00d2: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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)
			try
			{
				PlayerMovement movement = Refs.Movement;
				if ((Object)(object)movement == (Object)null)
				{
					return;
				}
				CharacterController controller = movement.Controller;
				if ((Object)(object)controller == (Object)null || !((Collider)controller).enabled)
				{
					return;
				}
				Camera main = Camera.main;
				Keyboard current = Keyboard.current;
				if (!((Object)(object)main == (Object)null) && current != null)
				{
					Vector3 val = Vector3.zero;
					if (((ButtonControl)current.wKey).isPressed)
					{
						val += ((Component)main).transform.forward;
					}
					if (((ButtonControl)current.sKey).isPressed)
					{
						val -= ((Component)main).transform.forward;
					}
					if (((ButtonControl)current.dKey).isPressed)
					{
						val += ((Component)main).transform.right;
					}
					if (((ButtonControl)current.aKey).isPressed)
					{
						val -= ((Component)main).transform.right;
					}
					if (((ButtonControl)current.spaceKey).isPressed)
					{
						val += Vector3.up;
					}
					if (((ButtonControl)current.leftCtrlKey).isPressed)
					{
						val -= Vector3.up;
					}
					if (!(((Vector3)(ref val)).sqrMagnitude < 0.0001f))
					{
						controller.Move(((Vector3)(ref val)).normalized * CheatState.FlySpeed * Time.deltaTime);
					}
				}
			}
			catch
			{
			}
		}

		private void ApplyMaxLevel()
		{
			try
			{
				LevelManager levels = Refs.Levels;
				if ((Object)(object)levels == (Object)null)
				{
					Status("Entre em um save primeiro");
					return;
				}
				levels.Rank = (ERank)10;
				levels.Tier = LevelManager.TIERS_PER_RANK;
				levels.XP = 0;
				levels.TotalXP = 1000000;
				Status("Nivel maximo aplicado");
			}
			catch (Exception e)
			{
				Log("MaxLevel", e);
				Status("Falha ao aplicar nivel");
			}
		}

		private void AddCash(float amount)
		{
			try
			{
				MoneyManager instance = NetworkSingleton<MoneyManager>.Instance;
				if ((Object)(object)instance == (Object)null)
				{
					Status("Entre em um save primeiro");
					return;
				}
				instance.ChangeCashBalance(amount, true, true);
				Status("Dindin +$" + amount.ToString("N0"));
			}
			catch (Exception e)
			{
				Log("AddCash", e);
				Status("Falha ao adicionar dinheiro");
			}
		}

		private void UnlockAllCustomers()
		{
			int num = 0;
			try
			{
				List<Customer> lockedCustomers = Customer.LockedCustomers;
				if (lockedCustomers == null)
				{
					Status("Nenhum customer encontrado");
					return;
				}
				for (int i = 0; i < lockedCustomers.Count; i++)
				{
					Customer val = lockedCustomers[i];
					if ((Object)(object)val == (Object)null)
					{
						continue;
					}
					try
					{
						val.SetHasBeenRecommended();
						if (_onCustomerUnlocked == null)
						{
							_onCustomerUnlocked = AccessTools.Method(typeof(Customer), "OnCustomerUnlocked", (Type[])null, (Type[])null);
						}
						if (_onCustomerUnlocked != null)
						{
							_onCustomerUnlocked.Invoke(val, new object[2]
							{
								(object)(EUnlockType)0,
								true
							});
						}
						num++;
					}
					catch
					{
					}
				}
				Status("Customers desbloqueados: " + num);
			}
			catch (Exception e)
			{
				Log("UnlockCustomers", e);
				Status("Falha ao desbloquear customers");
			}
		}

		private void UnlockAllDealers()
		{
			int num = 0;
			try
			{
				Il2CppReferenceArray<Object> val = Object.FindObjectsOfType(Il2CppType.Of<Dealer>(), true);
				if (val == null)
				{
					Status("Nenhum dealer encontrado");
					return;
				}
				for (int i = 0; i < ((Il2CppArrayBase<Object>)(object)val).Length; i++)
				{
					Dealer val2 = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[i]).TryCast<Dealer>();
					if (!((Object)(object)val2 == (Object)null))
					{
						try
						{
							val2.MarkAsRecommended();
							val2.InitialRecruitment();
							num++;
						}
						catch
						{
						}
					}
				}
				Status("Dealers desbloqueados: " + num);
			}
			catch (Exception e)
			{
				Log("UnlockDealers", e);
				Status("Falha ao desbloquear dealers");
			}
		}

		private void AddCard(float amount)
		{
			try
			{
				MoneyManager instance = NetworkSingleton<MoneyManager>.Instance;
				if ((Object)(object)instance == (Object)null)
				{
					Status("Entre em um save primeiro");
					return;
				}
				instance.CreateOnlineTransaction("Menu", amount, 1f, "menu");
				Status("Cartao +$" + amount.ToString("N0"));
			}
			catch (Exception)
			{
				try
				{
					MoneyManager instance2 = NetworkSingleton<MoneyManager>.Instance;
					if ((Object)(object)instance2 != (Object)null)
					{
						instance2.onlineBalance += amount;
					}
					Status("Cartao +$" + amount.ToString("N0"));
				}
				catch (Exception e)
				{
					Log("AddCard", e);
					Status("Falha ao adicionar no cartao");
				}
			}
		}

		private void EnsureCatalog()
		{
			if (_items.Count > 0)
			{
				return;
			}
			try
			{
				Registry items = Refs.Items;
				if ((Object)(object)items == (Object)null)
				{
					return;
				}
				List<ItemDefinition> allItems = items.GetAllItems();
				if (allItems == null)
				{
					return;
				}
				HashSet<string> hashSet = new HashSet<string>();
				for (int i = 0; i < allItems.Count; i++)
				{
					ItemDefinition val = null;
					string text = null;
					string text2 = null;
					try
					{
						val = allItems[i];
						if ((Object)(object)val == (Object)null)
						{
							continue;
						}
						text = ((BaseItemDefinition)val).ID;
						text2 = ((BaseItemDefinition)val).Name;
						goto IL_0072;
					}
					catch
					{
					}
					continue;
					IL_0072:
					if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2) && hashSet.Add(text))
					{
						_items.Add(val);
					}
				}
				_items.Sort((ItemDefinition a, ItemDefinition b) => string.Compare(((BaseItemDefinition)a).Name, ((BaseItemDefinition)b).Name, StringComparison.OrdinalIgnoreCase));
				if (_items.Count > 0)
				{
					Plugin.Logger.LogInfo((object)("[ScheduleI] item catalog: " + _items.Count + " items"));
				}
				RefreshItems();
			}
			catch (Exception e)
			{
				if (Time.unscaledTime > _errorCooldown)
				{
					_errorCooldown = Time.unscaledTime + 10f;
					Log("Catalog", e);
				}
			}
		}

		private void SpawnItem(int slot)
		{
			EnsureCatalog();
			int num = _page * 8 + slot;
			if (num < 0 || num >= _items.Count)
			{
				return;
			}
			ItemDefinition val = _items[num];
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			PlayerInventory inventory = Refs.Inventory;
			if ((Object)(object)inventory == (Object)null)
			{
				Status("Entre em um save primeiro");
				return;
			}
			try
			{
				ItemInstance defaultInstance = val.GetDefaultInstance(_qty);
				if (defaultInstance == null)
				{
					Status("Nao foi possivel criar o item");
					return;
				}
				inventory.AddItemToInventory(defaultInstance);
				Status("Spawnado: " + ((BaseItemDefinition)val).Name + " x" + _qty);
			}
			catch (Exception e)
			{
				Log("SpawnItem", e);
				Status("Falha ao spawnar item");
			}
		}

		private void LoadSeeds()
		{
			if (_seedsLoaded)
			{
				return;
			}
			_seedsLoaded = true;
			try
			{
				Registry items = Refs.Items;
				if ((Object)(object)items == (Object)null)
				{
					return;
				}
				List<ItemDefinition> allItems = items.GetAllItems();
				if (allItems == null)
				{
					return;
				}
				HashSet<string> hashSet = new HashSet<string>();
				for (int i = 0; i < allItems.Count; i++)
				{
					ItemDefinition val = allItems[i];
					if ((Object)(object)val == (Object)null)
					{
						continue;
					}
					SeedDefinition val2 = ((Il2CppObjectBase)val).TryCast<SeedDefinition>();
					if (!((Object)(object)val2 == (Object)null))
					{
						string text = null;
						string text2 = null;
						try
						{
							text = ((BaseItemDefinition)val2).ID;
							text2 = ((BaseItemDefinition)val2).Name;
						}
						catch
						{
							continue;
						}
						if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2) && hashSet.Add(text))
						{
							_seedIds.Add(text);
							_seedNames.Add(text2);
						}
					}
				}
				if (_seedIds.Count > 0)
				{
					_seedIndex = 0;
					Plugin.Logger.LogInfo((object)("[ScheduleI] seeds: " + string.Join(", ", _seedIds.ToArray())));
				}
				RefreshSeedText();
			}
			catch (Exception e)
			{
				Log("LoadSeeds", e);
			}
		}

		private void RefreshSeedText()
		{
			if (!((Object)(object)_seedText == (Object)null))
			{
				if (_seedIds.Count == 0)
				{
					_seedText.text = "Seed: nenhuma";
				}
				else
				{
					_seedText.text = "Seed: " + _seedNames[_seedIndex];
				}
			}
		}

		private void CycleSeed()
		{
			LoadSeeds();
			if (_seedIds.Count != 0)
			{
				_seedIndex = (_seedIndex + 1) % _seedIds.Count;
				RefreshSeedText();
			}
		}

		private void HarvestAll()
		{
			int num = 0;
			try
			{
				Il2CppReferenceArray<Object> val = Object.FindObjectsOfType(Il2CppType.Of<Pot>());
				if (val != null)
				{
					string text = default(string);
					for (int i = 0; i < ((Il2CppArrayBase<Object>)(object)val).Length; i++)
					{
						Pot val2 = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[i]).TryCast<Pot>();
						if ((Object)(object)val2 == (Object)null || !((GrowContainer)val2).ContainsGrowable() || !val2.IsReadyForHarvest(ref text))
						{
							continue;
						}
						Plant plant = val2.Plant;
						if ((Object)(object)plant == (Object)null)
						{
							continue;
						}
						Il2CppReferenceArray<Component> componentsInChildren = ((Component)plant).GetComponentsInChildren(Il2CppType.Of<PlantHarvestable>(), true);
						if (componentsInChildren == null)
						{
							continue;
						}
						for (int j = 0; j < ((Il2CppArrayBase<Component>)(object)componentsInChildren).Length; j++)
						{
							PlantHarvestable val3 = ((Il2CppObjectBase)((Il2CppArrayBase<Component>)(object)componentsInChildren)[j]).TryCast<PlantHarvestable>();
							if (!((Object)(object)val3 == (Object)null) && ((Component)val3).gameObject.activeInHierarchy)
							{
								try
								{
									val3.Harvest(true);
									num++;
								}
								catch
								{
								}
							}
						}
					}
				}
			}
			catch (Exception e)
			{
				Log("HarvestPots", e);
			}
			try
			{
				Il2CppReferenceArray<Object> val4 = Object.FindObjectsOfType(Il2CppType.Of<GrowingMushroom>());
				if (val4 != null)
				{
					for (int k = 0; k < ((Il2CppArrayBase<Object>)(object)val4).Length; k++)
					{
						GrowingMushroom val5 = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val4)[k]).TryCast<GrowingMushroom>();
						if (!((Object)(object)val5 == (Object)null) && ((Component)val5).gameObject.activeInHierarchy)
						{
							try
							{
								val5.Harvest();
								num++;
							}
							catch
							{
							}
						}
					}
				}
			}
			catch (Exception e2)
			{
				Log("HarvestMushrooms", e2);
			}
			if (num > 0)
			{
				Status("Colhido: " + num + " plantas");
			}
		}

		private void PlantAll()
		{
			LoadSeeds();
			if (_seedIds.Count == 0)
			{
				Status("Nenhuma seed encontrada");
				return;
			}
			string text = _seedIds[_seedIndex];
			int num = 0;
			try
			{
				Il2CppReferenceArray<Object> val = Object.FindObjectsOfType(Il2CppType.Of<Pot>());
				if (val == null)
				{
					return;
				}
				string text2 = default(string);
				for (int i = 0; i < ((Il2CppArrayBase<Object>)(object)val).Length; i++)
				{
					Pot val2 = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[i]).TryCast<Pot>();
					if (!((Object)(object)val2 == (Object)null) && !((GrowContainer)val2).ContainsGrowable() && val2.CanAcceptSeed(ref text2))
					{
						try
						{
							val2.PlantSeed_Server(text, 0f);
							num++;
						}
						catch
						{
						}
					}
				}
			}
			catch (Exception e)
			{
				Log("PlantAll", e);
			}
			if (num > 0)
			{
				Status("Plantado: " + num + " potes");
			}
		}

		private void GrowAll()
		{
			int num = 0;
			try
			{
				Il2CppReferenceArray<Object> val = Object.FindObjectsOfType(Il2CppType.Of<Pot>());
				if (val == null)
				{
					return;
				}
				for (int i = 0; i < ((Il2CppArrayBase<Object>)(object)val).Length; i++)
				{
					Pot val2 = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[i]).TryCast<Pot>();
					if (!((Object)(object)val2 == (Object)null) && ((GrowContainer)val2).ContainsGrowable())
					{
						try
						{
							val2.SetGrowthProgress_Server(1f);
							num++;
						}
						catch
						{
						}
					}
				}
			}
			catch (Exception e)
			{
				Log("GrowAll", e);
			}
			if (num > 0)
			{
				Status("Crescido: " + num + " plantas");
			}
		}

		private void UpdateFarm()
		{
			if (CheatState.SoloAllowed)
			{
				if (_autoHarvest && Time.unscaledTime >= _nextHarvest)
				{
					_nextHarvest = Time.unscaledTime + 4f;
					HarvestAll();
				}
				if (_autoPlant && Time.unscaledTime >= _nextPlant)
				{
					_nextPlant = Time.unscaledTime + 3f;
					PlantAll();
				}
			}
		}

		private void EnsureTeleports()
		{
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			if (_teleports.Count > 0 || (Object)(object)Refs.Local == (Object)null)
			{
				return;
			}
			try
			{
				List<TeleportEntry> list = new List<TeleportEntry>();
				HashSet<string> hashSet = new HashSet<string>();
				List<Business> businesses = Business.Businesses;
				if (businesses != null)
				{
					for (int i = 0; i < businesses.Count; i++)
					{
						AddTeleport(list, hashSet, (Property)(object)businesses[i], 1);
					}
				}
				List<Property> properties = Property.Properties;
				if (properties != null)
				{
					for (int j = 0; j < properties.Count; j++)
					{
						AddTeleport(list, hashSet, properties[j], 1);
					}
				}
				try
				{
					Il2CppReferenceArray<Object> val = Object.FindObjectsOfType(Il2CppType.Of<NPCEnterableBuilding>(), true);
					if (val != null)
					{
						for (int k = 0; k < ((Il2CppArrayBase<Object>)(object)val).Length; k++)
						{
							NPCEnterableBuilding val2 = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val)[k]).TryCast<NPCEnterableBuilding>();
							if ((Object)(object)val2 == (Object)null)
							{
								continue;
							}
							string text = null;
							try
							{
								text = val2.BuildingName;
							}
							catch
							{
								continue;
							}
							if (string.IsNullOrEmpty(text))
							{
								continue;
							}
							text = text.Replace("\r", " ").Replace("\n", " ").Trim();
							while (text.Contains("  "))
							{
								text = text.Replace("  ", " ");
							}
							if (text.Length == 0 || !hashSet.Add(text))
							{
								continue;
							}
							Vector3 position = ((Component)val2).transform.position;
							try
							{
								Vector3 val3 = (((Object)(object)Refs.Local != (Object)null) ? ((Component)Refs.Local).transform.position : ((Component)val2).transform.position);
								StaticDoor closestDoor = val2.GetClosestDoor(val3, true);
								if ((Object)(object)closestDoor != (Object)null && (Object)(object)((Component)closestDoor).transform != (Object)null)
								{
									position = ((Component)closestDoor).transform.position;
								}
							}
							catch
							{
							}
							list.Add(new TeleportEntry
							{
								Name = text,
								Position = position + Vector3.up * 0.25f,
								Category = 0
							});
						}
					}
				}
				catch (Exception e)
				{
					Log("Building teleports", e);
				}
				try
				{
					Il2CppReferenceArray<Object> val4 = Object.FindObjectsOfType(Il2CppType.Of<POI>(), true);
					if (val4 != null)
					{
						for (int l = 0; l < ((Il2CppArrayBase<Object>)(object)val4).Length; l++)
						{
							POI val5 = ((Il2CppObjectBase)((Il2CppArrayBase<Object>)(object)val4)[l]).TryCast<POI>();
							if ((Object)(object)val5 == (Object)null)
							{
								continue;
							}
							string text2 = null;
							try
							{
								text2 = val5.MainText;
								if (string.IsNullOrEmpty(text2))
								{
									text2 = val5.DefaultMainText;
								}
							}
							catch
							{
								continue;
							}
							if (!string.IsNullOrEmpty(text2))
							{
								text2 = text2.Replace("\r", " ").Replace("\n", " ").Trim();
								while (text2.Contains("  "))
								{
									text2 = text2.Replace("  ", " ");
								}
								if (text2.Length != 0 && text2.IndexOf("Dead Drop", StringComparison.OrdinalIgnoreCase) >= 0 && hashSet.Add(text2))
								{
									list.Add(new TeleportEntry
									{
										Name = text2,
										Position = ((Component)val5).transform.position + Vector3.up * 0.25f,
										Category = 2
									});
								}
							}
						}
					}
				}
				catch (Exception e2)
				{
					Log("DeadDrop teleports", e2);
				}
				list.Sort((TeleportEntry a, TeleportEntry b) => string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase));
				_teleports.AddRange(list);
				if (_teleports.Count > 0)
				{
					Plugin.Logger.LogInfo((object)("[ScheduleI] teleports: " + string.Join(", ", _teleports.ConvertAll((TeleportEntry t) => t.Name).ToArray())));
				}
				RefreshTeleports();
			}
			catch (Exception e3)
			{
				if (Time.unscaledTime > _errorCooldown)
				{
					_errorCooldown = Time.unscaledTime + 10f;
					Log("Teleports", e3);
				}
			}
		}

		private void AddTeleport(List<TeleportEntry> list, HashSet<string> names, Property property, int category)
		{
			//IL_007b: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)property == (Object)null)
			{
				return;
			}
			string text = null;
			try
			{
				text = property.PropertyName;
			}
			catch
			{
			}
			if (string.IsNullOrEmpty(text) || !names.Add(text))
			{
				return;
			}
			Transform val = null;
			try
			{
				val = property.InteriorSpawnPoint;
			}
			catch
			{
			}
			if ((Object)(object)val == (Object)null)
			{
				try
				{
					val = property.SpawnPoint;
				}
				catch
				{
				}
			}
			if ((Object)(object)val == (Object)null)
			{
				try
				{
					val = ((Component)property).transform;
				}
				catch
				{
				}
			}
			if (!((Object)(object)val == (Object)null))
			{
				list.Add(new TeleportEntry
				{
					Name = text,
					Position = val.position + Vector3.up * 0.25f,
					Category = category
				});
			}
		}

		private static bool IsShopName(string name)
		{
			return false;
		}

		private void TeleportTo(int slot)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			int num = _tpPage * 8 + slot;
			if (num < 0 || num >= _tpVisible.Count)
			{
				return;
			}
			TeleportEntry teleportEntry = _tpVisible[num];
			if (teleportEntry == null)
			{
				return;
			}
			try
			{
				PlayerMovement movement = Refs.Movement;
				if ((Object)(object)movement == (Object)null)
				{
					Status("Entre em um save primeiro");
					return;
				}
				movement.Teleport(teleportEntry.Position, true);
				Status("Teleportado: " + teleportEntry.Name);
				SetOpen(open: false);
			}
			catch (Exception e)
			{
				Log("Teleport", e);
				Status("Falha ao teleportar");
			}
		}

		private void Build()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: 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)
			//IL_0193: 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_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: 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_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Unknown result type (might be due to invalid IL or missing references)
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: 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_0478: Unknown result type (might be due to invalid IL or missing references)
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e6: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			if (!_built)
			{
				_built = true;
				GameObject val = new GameObject("ScheduleI_Canvas");
				val.transform.SetParent(((Component)this).transform, false);
				_canvas = val.AddComponent<Canvas>();
				_canvas.renderMode = (RenderMode)0;
				_canvas.sortingOrder = 30000;
				CanvasScaler obj = val.AddComponent<CanvasScaler>();
				obj.uiScaleMode = (ScaleMode)1;
				obj.referenceResolution = new Vector2(1600f, 900f);
				obj.screenMatchMode = (ScreenMatchMode)0;
				obj.matchWidthOrHeight = 0.5f;
				val.AddComponent<GraphicRaycaster>();
				_canvasRect = val.GetComponent<RectTransform>();
				if ((Object)(object)EventSystem.current == (Object)null)
				{
					GameObject val2 = new GameObject("ScheduleI_EventSystem");
					val2.transform.SetParent(((Component)this).transform, false);
					val2.AddComponent<EventSystem>();
					val2.AddComponent<InputSystemUIInputModule>();
				}
				_panel = NewRect("Panel", (Transform)(object)_canvasRect);
				RectTransform panel = _panel;
				RectTransform panel2 = _panel;
				Vector2 val3 = default(Vector2);
				((Vector2)(ref val3))..ctor(0.5f, 0.5f);
				panel2.anchorMax = val3;
				panel.anchorMin = val3;
				_panel.pivot = new Vector2(0.5f, 0.5f);
				_panel.sizeDelta = new Vector2(720f, 680f);
				_panel.anchoredPosition = Vector2.zero;
				((Graphic)((Component)_panel).gameObject.AddComponent<Image>()).color = PanelColor;
				Outline obj2 = ((Component)_panel).gameObject.AddComponent<Outline>();
				((Shadow)obj2).effectColor = new Color(0.24f, 0.85f, 0.88f, 0.65f);
				((Shadow)obj2).effectDistance = new Vector2(1.5f, 1.5f);
				RectTransform obj3 = NewRect("AccentBar", (Transform)(object)_panel);
				obj3.anchorMin = new Vector2(0f, 1f);
				obj3.anchorMax = new Vector2(1f, 1f);
				obj3.pivot = new Vector2(0.5f, 1f);
				obj3.sizeDelta = new Vector2(0f, 3f);
				obj3.anchoredPosition = Vector2.zero;
				((Graphic)((Component)obj3).gameObject.AddComponent<Image>()).color = Accent;
				RectTransform rectTransform = ((Graphic)NewText((Transform)(object)_panel, "MODMENU", 27, (TextAnchor)0, Accent, (FontStyle)1)).rectTransform;
				rectTransform.anchorMin = new Vector2(0f, 1f);
				rectTransform.anchorMax = new Vector2(1f, 1f);
				rectTransform.pivot = new Vector2(0f, 1f);
				rectTransform.sizeDelta = new Vector2(-320f, 36f);
				rectTransform.anchoredPosition = new Vector2(22f, -18f);
				RectTransform rectTransform2 = ((Graphic)NewText((Transform)(object)_panel, "G abre / fecha  •  cheats so em single-player", 13, (TextAnchor)0, DimColor, (FontStyle)0)).rectTransform;
				rectTransform2.anchorMin = new Vector2(0f, 1f);
				rectTransform2.anchorMax = new Vector2(1f, 1f);
				rectTransform2.pivot = new Vector2(0f, 1f);
				rectTransform2.sizeDelta = new Vector2(-280f, 22f);
				rectTransform2.anchoredPosition = new Vector2(23f, -52f);
				_soloBadge = NewText((Transform)(object)_panel, "SOLO", 14, (TextAnchor)2, Green, (FontStyle)1);
				RectTransform rectTransform3 = ((Graphic)_soloBadge).rectTransform;
				rectTransform3.anchorMin = new Vector2(1f, 1f);
				rectTransform3.anchorMax = new Vector2(1f, 1f);
				rectTransform3.pivot = new Vector2(1f, 1f);
				rectTransform3.sizeDelta = new Vector2(280f, 24f);
				rectTransform3.anchoredPosition = new Vector2(-22f, -24f);
				BuildTabs();
				_statusText = NewText((Transform)(object)_panel, "", 13, (TextAnchor)4, Green, (FontStyle)0);
				RectTransform rectTransform4 = ((Graphic)_statusText).rectTransform;
				rectTransform4.anchorMin = new Vector2(0f, 0f);
				rectTransform4.anchorMax = new Vector2(1f, 0f);
				rectTransform4.pivot = new Vector2(0.5f, 0f);
				rectTransform4.sizeDelta = new Vector2(-40f, 22f);
				rectTransform4.anchoredPosition = new Vector2(0f, 54f);
				RectTransform rectTransform5 = ((Graphic)NewText((Transform)(object)_panel, "WASD + Espaco/Ctrl para voar   •   G fecha", 13, (TextAnchor)4, DimColor, (FontStyle)0)).rectTransform;
				rectTransform5.anchorMin = new Vector2(0f, 0f);
				rectTransform5.anchorMax = new Vector2(1f, 0f);
				rectTransform5.pivot = new Vector2(0.5f, 0f);
				rectTransform5.sizeDelta = new Vector2(-40f, 26f);
				rectTransform5.anchoredPosition = new Vector2(0f, 16f);
				BuildCursor();
				((Component)_canvas).gameObject.SetActive(false);
			}
		}

		private void BuildCursor()
		{
			//IL_0024: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_00a4: 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_00d2: 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_00ec: 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_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = NewRect("Cursor", (Transform)(object)_canvasRect);
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0.5f, 0.5f);
			val.anchorMax = val2;
			val.anchorMin = val2;
			val.pivot = new Vector2(0.5f, 0.5f);
			val.sizeDelta = new Vector2(24f, 24f);
			val.anchoredPosition = Vector2.zero;
			((Transform)val).SetAsLastSibling();
			AddCursorBar(val, new Vector2(20f, 4f), new Color(0f, 0f, 0f, 0.9f));
			AddCursorBar(val, new Vector2(4f, 20f), new Color(0f, 0f, 0f, 0.9f));
			AddCursorBar(val, new Vector2(16f, 2f), Accent);
			AddCursorBar(val, new Vector2(2f, 16f), Accent);
			AddCursorBar(val, new Vector2(4f, 4f), Color.white);
			_cursor = val;
			((Component)_cursor).gameObject.SetActive(false);
		}

		private static void AddCursorBar(RectTransform parent, Vector2 size, Color color)
		{
			//IL_001e: 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_0035: 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_0047: 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)
			RectTransform obj = NewRect("Bar", (Transform)(object)parent);
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(0.5f, 0.5f);
			obj.anchorMax = val;
			obj.anchorMin = val;
			obj.pivot = new Vector2(0.5f, 0.5f);
			obj.sizeDelta = size;
			obj.anchoredPosition = Vector2.zero;
			Image obj2 = ((Component)obj).gameObject.AddComponent<Image>();
			obj2.sprite = GetWhiteSprite();
			((Graphic)obj2).color = color;
			((Graphic)obj2).raycastTarget = false;
		}

		private static Sprite GetWhiteSprite()
		{
			//IL_0017: 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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			if ((Object)(object)_whiteSprite != (Object)null)
			{
				return _whiteSprite;
			}
			Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false);
			val.SetPixel(0, 0, Color.white);
			val.Apply();
			_whiteSprite = Sprite.Create(val, new Rect(0f, 0f, 1f, 1f), new Vector2(0.5f, 0.5f), 100f);
			return _whiteSprite;
		}

		private void BuildTabs()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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)
			//IL_0060: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: 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_00da: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: 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_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			_tabRoot = NewRect("Tabs", (Transform)(object)_panel);
			_tabRoot.anchorMin = Vector2.zero;
			_tabRoot.anchorMax = Vector2.one;
			_tabRoot.offsetMin = new Vector2(0f, 86f);
			_tabRoot.offsetMax = new Vector2(0f, -124f);
			RectTransform val = NewRect("TabBar", (Transform)(object)_panel);
			val.anchorMin = new Vector2(0f, 1f);
			val.anchorMax = new Vector2(1f, 1f);
			val.pivot = new Vector2(0.5f, 1f);
			val.sizeDelta = new Vector2(-40f, 36f);
			val.anchoredPosition = new Vector2(0f, -78f);
			_tabPanels = (RectTransform[])(object)new RectTransform[TabNames.Length];
			_tabButtonImages = (Image[])(object)new Image[TabNames.Length];
			for (int i = 0; i < TabNames.Length; i++)
			{
				int index = i;
				RectTransform obj = NewRect("Tab_" + TabNames[i], (Transform)(object)val);
				obj.anchorMin = new Vector2(0f, 0f);
				obj.anchorMax = new Vector2(0f, 1f);
				obj.pivot = new Vector2(0f, 0.5f);
				obj.sizeDelta = new Vector2(128f, 0f);
				obj.anchoredPosition = new Vector2((float)i * 136f, 0f);
				Image val2 = ((Component)obj).gameObject.AddComponent<Image>();
				((Graphic)val2).color = TabOffColor;
				_tabButtonImages[i] = val2;
				Button obj2 = ((Component)obj).gameObject.AddComponent<Button>();
				((Selectable)obj2).targetGraphic = (Graphic)(object)val2;
				((Selectable)obj2).transition = (Transition)0;
				((UnityEvent)obj2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					SelectTab(index);
				}));
				Stretch(((Graphic)NewText((Transform)(object)obj, TabNames[i], 15, (TextAnchor)4, TextColor, (FontStyle)1)).rectTransform);
				RectTransform val3 = NewRect("Panel_" + TabNames[i], (Transform)(object)_tabRoot);
				val3.anchorMin = Vector2.zero;
				val3.anchorMax = Vector2.one;
				val3.offsetMin = Vector2.zero;
				val3.offsetMax = Vector2.zero;
				_tabPanels[i] = val3;
			}
			BuildGeral(_tabPanels[0]);
			BuildMoney(_tabPanels[1]);
			BuildItems(_tabPanels[2]);
			BuildFarm(_tabPanels[3]);
			BuildTeleports(_tabPanels[4]);
			SelectTab(0);
		}

		private void SelectTab(int index)
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			_tab = Mathf.Clamp(index, 0, TabNames.Length - 1);
			for (int i = 0; i < _tabPanels.Length; i++)
			{
				if ((Object)(object)_tabPanels[i] != (Object)null)
				{
					((Component)_tabPanels[i]).gameObject.SetActive(i == _tab);
				}
				if ((Object)(object)_tabButtonImages[i] != (Object)null)
				{
					((Graphic)_tabButtonImages[i]).color = ((i == _tab) ? TabOnColor : TabOffColor);
				}
			}
		}

		private void BuildGeral(RectTransform parent)
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			float y = -4f;
			AddRow(parent, "Voar (Fly)", () => CheatState.Fly, ToggleFly, ref y);
			AddFlySpeedRow(parent, -60f);
			AddLevelRow(parent, -114f);
			AddActionButton(parent, "Unlock All Customers", 20f, -176f, 320f, UnlockAllCustomers);
			AddActionButton(parent, "Unlock All Dealers", 360f, -176f, 320f, UnlockAllDealers);
			RectTransform rectTransform = ((Graphic)NewText((Transform)(object)parent, "Fly usa WASD + Espaco/Ctrl. Ajuste a velocidade no - / +.", 13, (TextAnchor)3, DimColor, (FontStyle)0)).rectTransform;
			rectTransform.anchorMin = new Vector2(0f, 1f);
			rectTransform.anchorMax = new Vector2(1f, 1f);
			rectTransform.pivot = new Vector2(0f, 1f);
			rectTransform.sizeDelta = new Vector2(-40f, 24f);
			rectTransform.anchoredPosition = new Vector2(20f, -232f);
		}

		private void BuildMoney(RectTransform parent)
		{
			//IL_0009: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: 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_02c3: Unknown result type (might be due to invalid IL or missing references)
			RectTransform rectTransform = ((Graphic)NewText((Transform)(object)parent, "DINDIN (CASH)", 16, (TextAnchor)3, Accent, (FontStyle)1)).rectTransform;
			rectTransform.anchorMin = new Vector2(0f, 1f);
			rectTransform.anchorMax = new Vector2(0f, 1f);
			rectTransform.pivot = new Vector2(0f, 1f);
			rectTransform.sizeDelta = new Vector2(300f, 24f);
			rectTransform.anchoredPosition = new Vector2(20f, -4f);
			_cashText = NewText((Transform)(object)parent, "", 14, (TextAnchor)5, Green, (FontStyle)1);
			RectTransform rectTransform2 = ((Graphic)_cashText).rectTransform;
			rectTransform2.anchorMin = new Vector2(1f, 1f);
			rectTransform2.anchorMax = new Vector2(1f, 1f);
			rectTransform2.pivot = new Vector2(1f, 1f);
			rectTransform2.sizeDelta = new Vector2(300f, 24f);
			rectTransform2.anchoredPosition = new Vector2(-20f, -4f);
			AddMoneyButtons(parent, -36f, AddCash);
			RectTransform rectTransform3 = ((Graphic)NewText((Transform)(object)parent, "CARTAO (ONLINE)", 16, (TextAnchor)3, Accent, (FontStyle)1)).rectTransform;
			rectTransform3.anchorMin = new Vector2(0f, 1f);
			rectTransform3.anchorMax = new Vector2(0f, 1f);
			rectTransform3.pivot = new Vector2(0f, 1f);
			rectTransform3.sizeDelta = new Vector2(300f, 24f);
			rectTransform3.anchoredPosition = new Vector2(20f, -106f);
			_cardText = NewText((Transform)(object)parent, "", 14, (TextAnchor)5, Green, (FontStyle)1);
			RectTransform rectTransform4 = ((Graphic)_cardText).rectTransform;
			rectTransform4.anchorMin = new Vector2(1f, 1f);
			rectTransform4.anchorMax = new Vector2(1f, 1f);
			rectTransform4.pivot = new Vector2(1f, 1f);
			rectTransform4.sizeDelta = new Vector2(300f, 24f);
			rectTransform4.anchoredPosition = new Vector2(-20f, -106f);
			AddMoneyButtons(parent, -138f, AddCard);
			RectTransform rectTransform5 = ((Graphic)NewText((Transform)(object)parent, "Dindin e cartao sao independentes. Use os botoes de cada secao.", 13, (TextAnchor)3, DimColor, (FontStyle)0)).rectTransform;
			rectTransform5.anchorMin = new Vector2(0f, 1f);
			rectTransform5.anchorMax = new Vector2(1f, 1f);
			rectTransform5.pivot = new Vector2(0f, 1f);
			rectTransform5.sizeDelta = new Vector2(-40f, 24f);
			rectTransform5.anchoredPosition = new Vector2(20f, -206f);
		}

		private void AddMoneyButtons(RectTransform parent, float y, Action<float> action)
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			float[] array = new float[4] { 1000f, 10000f, 100000f, 1000000f };
			string[] array2 = new string[4] { "+$1K", "+$10K", "+$100K", "+$1M" };
			for (int i = 0; i < array.Length; i++)
			{
				float amount = array[i];
				RectTransform obj = NewRect("Money_" + i, (Transform)(object)parent);
				obj.anchorMin = new Vector2(0f, 1f);
				obj.anchorMax = new Vector2(0f, 1f);
				obj.pivot = new Vector2(0f, 1f);
				obj.sizeDelta = new Vector2(158f, 44f);
				obj.anchoredPosition = new Vector2(20f + (float)i * 168f, y);
				Image val = ((Component)obj).gameObject.AddComponent<Image>();
				((Graphic)val).color = ButtonColor;
				Button obj2 = ((Component)obj).gameObject.AddComponent<Button>();
				((Selectable)obj2).targetGraphic = (Graphic)(object)val;
				((Selectable)obj2).transition = (Transition)0;
				((UnityEvent)obj2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					action(amount);
				}));
				Stretch(((Graphic)NewText((Transform)(object)obj, array2[i], 16, (TextAnchor)4, Accent, (FontStyle)1)).rectTransform);
			}
		}

		private void BuildItems(RectTransform parent)
		{
			//IL_0009: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0098: 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_00c2: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: 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_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			RectTransform rectTransform = ((Graphic)NewText((Transform)(object)parent, "Spawnar item", 18, (TextAnchor)3, Accent, (FontStyle)1)).rectTransform;
			rectTransform.anchorMin = new Vector2(0f, 1f);
			rectTransform.anchorMax = new Vector2(0f, 1f);
			rectTransform.pivot = new Vector2(0f, 1f);
			rectTransform.sizeDelta = new Vector2(300f, 30f);
			rectTransform.anchoredPosition = new Vector2(20f, -4f);
			RectTransform val = NewRect("QtyButton", (Transform)(object)parent);
			val.anchorMin = new Vector2(1f, 1f);
			val.anchorMax = new Vector2(1f, 1f);
			val.pivot = new Vector2(1f, 1f);
			val.sizeDelta = new Vector2(120f, 30f);
			val.anchoredPosition = new Vector2(-20f, -4f);
			Image val2 = ((Component)val).gameObject.AddComponent<Image>();
			((Graphic)val2).color = ButtonColor;
			Button obj = ((Component)val).gameObject.AddComponent<Button>();
			((Selectable)obj).targetGraphic = (Graphic)(object)val2;
			((Selectable)obj).transition = (Transition)0;
			((UnityEvent)obj.onClick).AddListener(UnityAction.op_Implicit((Action)CycleQty));
			_qtyText = NewText((Transform)(object)val, "Qtd x1", 15, (TextAnchor)4, Accent, (FontStyle)1);
			Stretch(((Graphic)_qtyText).rectTransform);
			for (int i = 0; i < 8; i++)
			{
				int slot = i;
				int num = i % 2;
				int num2 = i / 2;
				RectTransform val3 = NewRect("Item_" + i, (Transform)(object)parent);
				val3.anchorMin = new Vector2(0f, 1f);
				val3.anchorMax = new Vector2(0f, 1f);
				val3.pivot = new Vector2(0f, 1f);
				val3.sizeDelta = new Vector2(320f, 44f);
				val3.anchoredPosition = new Vector2(20f + (float)num * 340f, -44f - (float)num2 * 52f);
				Image val4 = ((Component)val3).gameObject.AddComponent<Image>();
				((Graphic)val4).color = ButtonColor;
				Button obj2 = ((Component)val3).gameObject.AddComponent<Button>();
				((Selectable)obj2).targetGraphic = (Graphic)(object)val4;
				((Selectable)obj2).transition = (Transition)0;
				((UnityEvent)obj2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					SpawnItem(slot);
				}));
				Text val5 = NewText((Transform)(object)val3, "...", 15, (TextAnchor)3, TextColor, (FontStyle)0);
				RectTransform rectTransform2 = ((Graphic)val5).rectTransform;
				rectTransform2.anchorMin = Vector2.zero;
				rectTransform2.anchorMax = Vector2.one;
				rectTransform2.offsetMin = new Vector2(12f, 0f);
				rectTransform2.offsetMax = new Vector2(-10f, 0f);
				_itemButtons[i] = ((Component)val3).gameObject;
				_itemLabels[i] = val5;
			}
			AddPageRow(parent, -260f, delegate
			{
				ChangePage(-1);
			}, delegate
			{
				ChangePage(1);
			}, out _pageText);
		}

		private void BuildFarm(RectTransform parent)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_00a8: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: 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_0308: Unknown result type (might be due to invalid IL or missing references)
			float y = -4f;
			AddRow(parent, "Auto Harvest (colher)", () => _autoHarvest, delegate
			{
				_autoHarvest = !_autoHarvest;
			}, ref y);
			AddRow(parent, "Auto Plant (plantar)", () => _autoPlant, delegate
			{
				_autoPlant = !_autoPlant;
			}, ref y);
			RectTransform val = NewRect("SeedRow", (Transform)(object)parent);
			val.anchorMin = new Vector2(0f, 1f);
			val.anchorMax = new Vector2(1f, 1f);
			val.pivot = new Vector2(0.5f, 1f);
			val.sizeDelta = new Vector2(-40f, 46f);
			val.anchoredPosition = new Vector2(0f, -124f);
			((Graphic)((Component)val).gameObject.AddComponent<Image>()).color = BarColor;
			_seedText = NewText((Transform)(object)val, "Seed: carregando...", 16, (TextAnchor)3, TextColor, (FontStyle)0);
			RectTransform rectTransform = ((Graphic)_seedText).rectTransform;
			rectTransform.anchorMin = Vector2.zero;
			rectTransform.anchorMax = Vector2.one;
			rectTransform.offsetMin = new Vector2(16f, 0f);
			rectTransform.offsetMax = new Vector2(-140f, 0f);
			RectTransform obj = NewRect("SeedButton", (Transform)(object)val);
			obj.anchorMin = new Vector2(1f, 0.5f);
			obj.anchorMax = new Vector2(1f, 0.5f);
			obj.pivot = new Vector2(1f, 0.5f);
			obj.sizeDelta = new Vector2(120f, 34f);
			obj.anchoredPosition = new Vector2(-12f, 0f);
			Image val2 = ((Component)obj).gameObject.AddComponent<Image>();
			((Graphic)val2).color = ButtonColor;
			Button obj2 = ((Component)obj).gameObject.AddComponent<Button>();
			((Selectable)obj2).targetGraphic = (Graphic)(object)val2;
			((Selectable)obj2).transition = (Transition)0;
			((UnityEvent)obj2.onClick).AddListener(UnityAction.op_Implicit((Action)CycleSeed));
			Stretch(((Graphic)NewText((Transform)(object)obj, "Trocar", 14, (TextAnchor)4, Accent, (FontStyle)1)).rectTransform);
			AddActionButton(parent, "Coletar agora", 20f, -184f, 200f, delegate
			{
				HarvestAll();
			});
			AddActionButton(parent, "Plantar agora", 232f, -184f, 200f, delegate
			{
				PlantAll();
			});
			AddActionButton(parent, "Crescer tudo", 444f, -184f, 200f, delegate
			{
				GrowAll();
			});
			RectTransform rectTransform2 = ((Graphic)NewText((Transform)(object)parent, "Auto Harvest a cada 4s e Auto Plant a cada 3s (usa a seed selecionada).", 13, (TextAnchor)3, DimColor, (FontStyle)0)).rectTransform;
			rectTransform2.anchorMin = new Vector2(0f, 1f);
			rectTransform2.anchorMax = new Vector2(1f, 1f);
			rectTransform2.pivot = new Vector2(0f, 1f);
			rectTransform2.sizeDelta = new Vector2(-40f, 24f);
			rectTransform2.anchoredPosition = new Vector2(20f, -236f);
		}

		private void BuildTeleports(RectTransform parent)
		{
			//IL_0009: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_00e7: 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_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: 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_01fa: 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_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			RectTransform rectTransform = ((Graphic)NewText((Transform)(object)parent, "Teleportes", 18, (TextAnchor)3, Accent, (FontStyle)1)).rectTransform;
			rectTransform.anchorMin = new Vector2(0f, 1f);
			rectTransform.anchorMax = new Vector2(1f, 1f);
			rectTransform.pivot = new Vector2(0f, 1f);
			rectTransform.sizeDelta = new Vector2(-40f, 30f);
			rectTransform.anchoredPosition = new Vector2(20f, -4f);
			string[] array = new string[3] { "Lojas", "Propriedades", "Dead Drops" };
			_tpSubButtons = (Image[])(object)new Image[array.Length];
			for (int i = 0; i < array.Length; i++)
			{
				int index = i;
				RectTransform obj = NewRect("TpSub_" + array[i], (Transform)(object)parent);
				obj.anchorMin = new Vector2(0f, 1f);
				obj.anchorMax = new Vector2(0f, 1f);
				obj.pivot = new Vector2(0f, 1f);
				obj.sizeDelta = new Vector2(220f, 28f);
				obj.anchoredPosition = new Vector2(20f + (float)i * 233f, -40f);
				Image val = ((Component)obj).gameObject.AddComponent<Image>();
				((Graphic)val).color = TabOffColor;
				_tpSubButtons[i] = val;
				Button obj2 = ((Component)obj).gameObject.AddComponent<Button>();
				((Selectable)obj2).targetGraphic = (Graphic)(object)val;
				((Selectable)obj2).transition = (Transition)0;
				((UnityEvent)obj2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					SelectTpSub(index);
				}));
				Stretch(((Graphic)NewText((Transform)(object)obj, array[i], 15, (TextAnchor)4, TextColor, (FontStyle)1)).rectTransform);
			}
			_tpEmptyText = NewText((Transform)(object)parent, "Carregue um save para listar os locais.", 15, (TextAnchor)4, DimColor, (FontStyle)0);
			RectTransform rectTransform2 = ((Graphic)_tpEmptyText).rectTransform;
			rectTransform2.anchorMin = new Vector2(0f, 1f);
			rectTransform2.anchorMax = new Vector2(1f, 1f);
			rectTransform2.pivot = new Vector2(0.5f, 1f);
			rectTransform2.sizeDelta = new Vector2(-40f, 30f);
			rectTransform2.anchoredPosition = new Vector2(0f, -100f);
			for (int num = 0; num < 8; num++)
			{
				int slot = num;
				int num2 = num % 2;
				int num3 = num / 2;
				RectTransform val2 = NewRect("Tp_" + num, (Transform)(object)parent);
				val2.anchorMin = new Vector2(0f, 1f);
				val2.anchorMax = new Vector2(0f, 1f);
				val2.pivot = new Vector2(0f, 1f);
				val2.sizeDelta = new Vector2(320f, 44f);
				val2.anchoredPosition = new Vector2(20f + (float)num2 * 340f, -86f - (float)num3 * 52f);
				Image val3 = ((Component)val2).gameObject.AddComponent<Image>();
				((Graphic)val3).color = ButtonColor;
				Button obj3 = ((Component)val2).gameObject.AddComponent<Button>();
				((Selectable)obj3).targetGraphic = (Graphic)(object)val3;
				((Selectable)obj3).transition = (Transition)0;
				((UnityEvent)obj3.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					TeleportTo(slot);
				}));
				Text val4 = NewText((Transform)(object)val2, "...", 15, (TextAnchor)3, TextColor, (FontStyle)0);
				RectTransform rectTransform3 = ((Graphic)val4).rectTransform;
				rectTransform3.anchorMin = Vector2.zero;
				rectTransform3.anchorMax = Vector2.one;
				rectTransform3.offsetMin = new Vector2(12f, 0f);
				rectTransform3.offsetMax = new Vector2(-10f, 0f);
				_tpButtons[num] = ((Component)val2).gameObject;
				_tpLabels[num] = val4;
			}
			AddPageRow(parent, -316f, delegate
			{
				ChangeTpPage(-1);
			}, delegate
			{
				ChangeTpPage(1);
			}, out _tpPageText);
			SelectTpSub(0);
		}

		private void SelectTpSub(int index)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			_tpSub = Mathf.Clamp(index, 0, 2);
			if (_tpSubButtons != null)
			{
				for (int i = 0; i < _tpSubButtons.Length; i++)
				{
					if ((Object)(object)_tpSubButtons[i] != (Object)null)
					{
						((Graphic)_tpSubButtons[i]).color = ((i == _tpSub) ? TabOnColor : TabOffColor);
					}
				}
			}
			_tpPage = 0;
			RefreshTeleports();
		}

		private void AddPageRow(RectTransform parent, float y, Action prev, Action next, out Text pageText)
		{
			//IL_002b: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0092: 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_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: 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_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: 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_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = NewRect("PrevPage", (Transform)(object)parent);
			obj.anchorMin = new Vector2(0f, 1f);
			obj.anchorMax = new Vector2(0f, 1f);
			obj.pivot = new Vector2(0f, 1f);
			obj.sizeDelta = new Vector2(44f, 32f);
			obj.anchoredPosition = new Vector2(20f, y);
			Image val = ((Component)obj).gameObject.AddComponent<Image>();
			((Graphic)val).color = ButtonColor;
			Button obj2 = ((Component)obj).gameObject.AddComponent<Button>();
			((Selectable)obj2).targetGraphic = (Graphic)(object)val;
			((Selectable)obj2).transition = (Transition)0;
			((UnityEvent)obj2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				prev();
			}));
			Stretch(((Graphic)NewText((Transform)(object)obj, "<", 18, (TextAnchor)4, Accent, (FontStyle)1)).rectTransform);
			RectTransform obj3 = NewRect("NextPage", (Transform)(object)parent);
			obj3.anchorMin = new Vector2(1f, 1f);
			obj3.anchorMax = new Vector2(1f, 1f);
			obj3.pivot = new Vector2(1f, 1f);
			obj3.sizeDelta = new Vector2(44f, 32f);
			obj3.anchoredPosition = new Vector2(-20f, y);
			Image val2 = ((Component)obj3).gameObject.AddComponent<Image>();
			((Graphic)val2).color = ButtonColor;
			Button obj4 = ((Component)obj3).gameObject.AddComponent<Button>();
			((Selectable)obj4).targetGraphic = (Graphic)(object)val2;
			((Selectable)obj4).transition = (Transition)0;
			((UnityEvent)obj4.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				next();
			}));
			Stretch(((Graphic)NewText((Transform)(object)obj3, ">", 18, (TextAnchor)4, Accent, (FontStyle)1)).rectTransform);
			pageText = NewText((Transform)(object)parent, "0/0", 14, (TextAnchor)4, DimColor, (FontStyle)0);
			RectTransform rectTransform = ((Graphic)pageText).rectTransform;
			rectTransform.anchorMin = new Vector2(0f, 1f);
			rectTransform.anchorMax = new Vector2(1f, 1f);
			rectTransform.pivot = new Vector2(0.5f, 1f);
			rectTransform.sizeDelta = new Vector2(-200f, 32f);
			rectTransform.anchoredPosition = new Vector2(0f, y);
		}

		private void AddActionButton(RectTransform parent, string label, float x, float y, float width, Action onClick)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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_008b: 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)
			RectTransform obj = NewRect("Action_" + label, (Transform)(object)parent);
			obj.anchorMin = new Vector2(0f, 1f);
			obj.anchorMax = new Vector2(0f, 1f);
			obj.pivot = new Vector2(0f, 1f);
			obj.sizeDelta = new Vector2(width, 44f);
			obj.anchoredPosition = new Vector2(x, y);
			Image val = ((Component)obj).gameObject.AddComponent<Image>();
			((Graphic)val).color = ButtonColor;
			Button obj2 = ((Component)obj).gameObject.AddComponent<Button>();
			((Selectable)obj2).targetGraphic = (Graphic)(object)val;
			((Selectable)obj2).transition = (Transition)0;
			((UnityEvent)obj2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				try
				{
					onClick();
				}
				catch (Exception e)
				{
					Log("Action", e);
				}
			}));
			Stretch(((Graphic)NewText((Transform)(object)obj, label, 15, (TextAnchor)4, TextColor, (FontStyle)1)).rectTransform);
		}

		private void AddRow(RectTransform parent, string label, Func<bool> isOn, Action toggle, ref float y)
		{
			//IL_0029: 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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: 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_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = NewRect("Row_" + label, (Transform)(object)parent);
			obj.anchorMin = new Vector2(0f, 1f);
			obj.anchorMax = new Vector2(1f, 1f);
			obj.pivot = new Vector2(0.5f, 1f);
			obj.sizeDelta = new Vector2(-40f, 50f);
			obj.anchoredPosition = new Vector2(0f, y);
			Image val = ((Component)obj).gameObject.AddComponent<Image>();
			((Graphic)val).color = RowOff;
			Button val2 = ((Component)obj).gameObject.AddComponent<Button>();
			((Selectable)val2).targetGraphic = (Graphic)(object)val;
			((Selectable)val2).transition = (Transition)0;
			RectTransform rectTransform = ((Graphic)NewText((Transform)(object)obj, label, 17, (TextAnchor)3, TextColor, (FontStyle)0)).rectTransform;
			rectTransform.anchorMin = Vector2.zero;
			rectTransform.anchorMax = Vector2.one;
			rectTransform.offsetMin = new Vector2(16f, 0f);
			rectTransform.offsetMax = new Vector2(-110f, 0f);
			Text val3 = NewText((Transform)(object)obj, "OFF", 14, (TextAnchor)5, DimColor, (FontStyle)1);
			RectTransform rectTransform2 = ((Graphic)val3).rectTransform;
			rectTransform2.anchorMin = new Vector2(1f, 0f);
			rectTransform2.anchorMax = new Vector2(1f, 1f);
			rectTransform2.pivot = new Vector2(1f, 0.5f);
			rectTransform2.sizeDelta = new Vector2(90f, 0f);
			rectTransform2.anchoredPosition = new Vector2(-16f, 0f);
			Row row = new Row
			{
				Bg = val,
				State = val3,
				IsOn = isOn,
				Toggle = toggle
			};
			((UnityEvent)val2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				try
				{
					row.Toggle();
					RefreshRows();
				}
				catch (Exception e)
				{
					Log("RowClick", e);
				}
			}));
			_rows.Add(row);
			y -= 56f;
		}

		private void AddFlySpeedRow(RectTransform parent, float y)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0056: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = NewRect("FlySpeedRow", (Transform)(object)parent);
			val.anchorMin = new Vector2(0f, 1f);
			val.anchorMax = new Vector2(1f, 1f);
			val.pivot = new Vector2(0.5f, 1f);
			val.sizeDelta = new Vector2(-40f, 44f);
			val.anchoredPosition = new Vector2(0f, y);
			((Graphic)((Component)val).gameObject.AddComponent<Image>()).color = BarColor;
			RectTransform rectTransform = ((Graphic)NewText((Transform)(object)val, "Velocidade do voo", 16, (TextAnchor)3, TextColor, (FontStyle)0)).rectTransform;
			rectTransform.anchorMin = Vector2.zero;
			rectTransform.anchorMax = Vector2.one;
			rectTransform.offsetMin = new Vector2(16f, 0f);
			rectTransform.offsetMax = new Vector2(-190f, 0f);
			_flySpeedText = NewText((Transform)(object)val, "12", 17, (TextAnchor)5, Accent, (FontStyle)1);
			RectTransform rectTransform2 = ((Graphic)_flySpeedText).rectTransform;
			rectTransform2.anchorMin = new Vector2(1f, 0f);
			rectTransform2.anchorMax = new Vector2(1f, 1f);
			rectTransform2.pivot = new Vector2(1f, 0.5f);
			rectTransform2.sizeDelta = new Vector2(56f, 0f);
			rectTransform2.anchoredPosition = new Vector2(-58f, 0f);
			SmallButton(val, "-", -114f, delegate
			{
				CheatState.FlySpeed = Mathf.Max(2f, CheatState.FlySpeed - 2f);
				RefreshRows();
			});
			SmallButton(val, "+", -20f, delegate
			{
				CheatState.FlySpeed = Mathf.Min(60f, CheatState.FlySpeed + 2f);
				RefreshRows();
			});
		}

		private void AddLevelRow(RectTransform parent, float y)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = NewRect("LevelRow", (Transform)(object)parent);
			obj.anchorMin = new Vector2(0f, 1f);
			obj.anchorMax = new Vector2(1f, 1f);
			obj.pivot = new Vector2(0.5f, 1f);
			obj.sizeDelta = new Vector2(-40f, 50f);
			obj.anchoredPosition = new Vector2(0f, y);
			Image val = ((Component)obj).gameObject.AddComponent<Image>();
			((Graphic)val).color = RowOff;
			Button obj2 = ((Component)obj).gameObject.AddComponent<Button>();
			((Selectable)obj2).targetGraphic = (Graphic)(object)val;
			((Selectable)obj2).transition = (Transition)0;
			((UnityEvent)obj2.onClick).AddListener(UnityAction.op_Implicit((Action)ApplyMaxLevel));
			RectTransform rectTransform = ((Graphic)NewText((Transform)(object)obj, "Nivel maximo (Kingpin)", 17, (TextAnchor)3, TextColor, (FontStyle)0)).rectTransform;
			rectTransform.anchorMin = Vector2.zero;
			rectTransform.anchorMax = Vector2.one;
			rectTransform.offsetMin = new Vector2(16f, 0f);
			rectTransform.offsetMax = new Vector2(-110f, 0f);
			RectTransform rectTransform2 = ((Graphic)NewText((Transform)(object)obj, "APLICAR", 14, (TextAnchor)5, Accent, (FontStyle)1)).rectTransform;
			rectTransform2.anchorMin = new Vector2(1f, 0f);
			rectTransform2.anchorMax = new Vector2(1f, 1f);
			rectTransform2.pivot = new Vector2(1f, 0.5f);
			rectTransform2.sizeDelta = new Vector2(100f, 0f);
			rectTransform2.anchoredPosition = new Vector2(-16f, 0f);
		}

		private void ChangePage(int delta)
		{
			int pageCount = PageCount;
			if (pageCount > 1)
			{
				_page = (_page + delta + pageCount) % pageCount;
				RefreshItems();
			}
		}

		private void ChangeTpPage(int delta)
		{
			int tpPageCount = TpPageCount;
			if (tpPageCount > 1)
			{
				_tpPage = (_tpPage + delta + tpPageCount) % tpPageCount;
				RefreshTeleports();
			}
		}

		private void CycleQty()
		{
			if (_qty == 1)
			{
				_qty = 5;
			}
			else if (_qty == 5)
			{
				_qty = 10;
			}
			else if (_qty == 10)
			{
				_qty = 25;
			}
			else if (_qty == 25)
			{
				_qty = 50;
			}
			else
			{
				_qty = 1;
			}
			if ((Object)(object)_qtyText != (Object)null)
			{
				_qtyText.text = "Qtd x" + _qty;
			}
		}

		private void RefreshItems()
		{
			int pageCount = PageCount;
			if (pageCount > 0 && _page >= pageCount)
			{
				_page = pageCount - 1;
			}
			if (_page < 0)
			{
				_page = 0;
			}
			for (int i = 0; i < 8; i++)
			{
				bool flag = _page * 8 + i < _items.Count;
				if ((Object)(object)_itemButtons[i] != (Object)null)
				{
					_itemButtons[i].SetActive(flag);
				}
				if (flag && (Object)(object)_itemLabels[i] != (Object)null)
				{
					string text = ((BaseItemDefinition)_items[_page * 8 + i]).Name ?? "?";
					if (text.Length > 28)
					{
						text = text.Substring(0, 27) + "...";
					}
					_itemLabels[i].text = text;
				}
			}
			if ((Object)(object)_pageText != (Object)null)
			{
				_pageText.text = ((pageCount == 0) ? "0/0" : (_page + 1 + "/" + pageCount));
			}
			if ((Object)(object)_qtyText != (Object)null)
			{
				_qtyText.text = "Qtd x" + _qty;
			}
		}

		private void RefreshTeleports()
		{
			_tpVisible.Clear();
			for (int i = 0; i < _teleports.Count; i++)
			{
				if (_teleports[i] != null && _teleports[i].Category == _tpSub)
				{
					_tpVisible.Add(_teleports[i]);
				}
			}
			int tpPageCount = TpPageCount;
			if (tpPageCount > 0 && _tpPage >= tpPageCount)
			{
				_tpPage = tpPageCount - 1;
			}
			if (_tpPage < 0)
			{
				_tpPage = 0;
			}
			for (int j = 0; j < 8; j++)
			{
				bool flag = _tpPage * 8 + j < _tpVisible.Count;
				if ((Object)(object)_tpButtons[j] != (Object)null)
				{
					_tpButtons[j].SetActive(flag);
				}
				if (flag && (Object)(object)_tpLabels[j] != (Object)null)
				{
					string text = _tpVisible[_tpPage * 8 + j].Name ?? "?";
					if (text.Length > 28)
					{
						text = text.Substring(0, 27) + "...";
					}
					_tpLabels[j].text = text;
				}
			}
			if ((Object)(object)_tpPageText != (Object)null)
			{
				_tpPageText.text = ((tpPageCount == 0) ? "0/0" : (_tpPage + 1 + "/" + tpPageCount));
			}
			if ((Object)(object)_tpEmptyText != (Object)null)
			{
				((Component)_tpEmptyText).gameObject.SetActive(_tpVisible.Count == 0);
			}
		}

		private void UpdateMoney()
		{
			if ((Object)(object)_cashText == (Object)null || (Object)(object)_cardText == (Object)null)
			{
				return;
			}
			try
			{
				MoneyManager instance = NetworkSingleton<MoneyManager>.Instance;
				if ((Object)(object)instance == (Object)null)
				{
					_cashText.text = "Cash: -";
					_cardText.text = "Cartao: -";
				}
				else
				{
					_cashText.text = "Cash: $" + instance.cashBalance.ToString("N0");
					_cardText.text = "Cartao: $" + instance.onlineBalance.ToString("N0");
				}
			}
			catch
			{
			}
		}

		private void RefreshRows()
		{
			//IL_0034: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < _rows.Count; i++)
			{
				Row row = _rows[i];
				bool flag = false;
				try
				{
					flag = row.IsOn();
				}
				catch
				{
				}
				((Graphic)row.Bg).color = (flag ? RowOn : RowOff);
				row.State.text = (flag ? "ON" : "OFF");
				((Graphic)row.State).color = (flag ? Green : DimColor);
			}
			if ((Object)(object)_flySpeedText != (Object)null)
			{
				_flySpeedText.text = CheatState.FlySpeed.ToString("0");
			}
			if ((Object)(object)_soloBadge != (Object)null)
			{
				_soloBadge.text = (CheatState.SoloAllowed ? "SOLO" : "CO-OP: CHEATS OFF");
				((Graphic)_soloBadge).color = (CheatState.SoloAllowed ? Green : Red);
			}
		}

		private void Status(string message)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_statusText == (Object)null))
			{
				_statusText.text = message;
				((Graphic)_statusText).color = Green;
				_statusUntil = Time.unscaledTime + 3.5f;
			}
		}

		private void UpdateStatus()
		{
			if (!((Object)(object)_statusText == (Object)null) && _statusText.text.Length > 0 && Time.unscaledTime > _statusUntil)
			{
				_statusText.text = "";
			}
		}

		private void ToggleFly()
		{
			CheatState.Fly = !CheatState.Fly;
		}

		private static void Stretch(RectTransform rt)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			rt.anchorMin = Vector2.zero;
			rt.anchorMax = Vector2.one;
			rt.offsetMin = Vector2.zero;
			rt.offsetMax = Vector2.zero;
		}

		private void SmallButton(RectTransform parent, string label, float rightOffset, Action onClick)
		{
			//IL_0024: 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_004e: 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)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = NewRect("Button", (Transform)(object)parent);
			obj.anchorMin = new Vector2(1f, 0.5f);
			obj.anchorMax = new Vector2(1f, 0.5f);
			obj.pivot = new Vector2(1f, 0.5f);
			obj.sizeDelta = new Vector2(38f, 32f);
			obj.anchoredPosition = new Vector2(rightOffset, 0f);
			Image val = ((Component)obj).gameObject.AddComponent<Image>();
			((Graphic)val).color = ButtonColor;
			Button val2 = ((Component)obj).gameObject.AddComponent<Button>();
			((Selectable)val2).targetGraphic = (Graphic)(object)val;
			((Selectable)val2).transition = (Transition)0;
			Stretch(((Graphic)NewText((Transform)(object)obj, label, 20, (TextAnchor)4, Accent, (FontStyle)1)).rectTransform);
			((UnityEvent)val2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				try
				{
					onClick();
				}
				catch (Exception e)
				{
					Log("SmallButton", e);
				}
			}));
		}

		private static RectTransform NewRect(string name, Transform parent)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			RectTransform obj = new GameObject(name).AddComponent<RectTransform>();
			((Transform)obj).SetParent(parent, false);
			return obj;
		}

		private static Text NewText(Transform parent, string text, int size, TextAnchor anchor, Color color, FontStyle style = (FontStyle)0)
		{
			//IL_002f: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			Text obj = ((Component)NewRect("Text", parent)).gameObject.AddComponent<Text>();
			obj.text = text;
			obj.font = GetFont();
			obj.fontSize = size;
			obj.fontStyle = style;
			((Graphic)obj).color = color;
			obj.alignment = anchor;
			((Graphic)obj).raycastTarget = false;
			obj.horizontalOverflow = (HorizontalWrapMode)1;
			obj.verticalOverflow = (VerticalWrapMode)1;
			return obj;
		}

		private static Font GetFont()
		{
			if ((Object)(object)_font != (Object)null)
			{
				return _font;
			}
			try
			{
				_font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
			}
			catch
			{
			}
			if ((Object)(object)_font == (Object)null)
			{
				try
				{
					_font = Resources.GetBuiltinResource<Font>("Arial.ttf");
				}
				catch
				{
				}
			}
			if ((Object)(object)_font == (Object)null)
			{
				try
				{
					_font = Font.CreateDynamicFontFromOSFont("Segoe UI", 16);
				}
				catch
				{
				}
			}
			return _font;
		}

		private static void Log(string where, Exception e)
		{
			try
			{
				Plugin.Logger.LogError((object)("[ScheduleI] " + where + ": " + e));
			}
			catch
			{
			}
		}
	}
	internal static class Patches
	{
		private static Harmony _harmony;

		internal static void Install()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			_harmony = new Harmony("com.digrididis.scheduleimenu");
			try
			{
				MethodInfo methodInfo = AccessTools.Method(typeof(PlayerMovement), "Move", (Type[])null, (Type[])null);
				if (methodInfo == null)
				{
					Plugin.Logger.LogWarning((object)"[ScheduleI] PlayerMovement.Move not found; fly will fight the game movement.");
					return;
				}
				HarmonyMethod val = new HarmonyMethod(typeof(Patches).GetMethod("PrefixMove", BindingFlags.Static | BindingFlags.NonPublic));
				_harmony.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				Plugin.Logger.LogInfo((object)"[ScheduleI] patched PlayerMovement.Move");
				MethodInfo methodInfo2 = AccessTools.Method(typeof(PlayerCamera), "LockMouse", (Type[])null, (Type[])null);
				if (methodInfo2 != null)
				{
					HarmonyMethod val2 = new HarmonyMethod(typeof(Patches).GetMethod("PrefixLockMouse", BindingFlags.Static | BindingFlags.NonPublic));
					_harmony.Patch((MethodBase)methodInfo2, val2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
					Plugin.Logger.LogInfo((object)"[ScheduleI] patched PlayerCamera.LockMouse");
				}
				else
				{
					Plugin.Logger.LogWarning((object)"[ScheduleI] PlayerCamera.LockMouse not found.");
				}
			}
			catch (Exception ex)
			{
				Plugin.Logger.LogError((object)("[ScheduleI] patch failed: " + ex));
			}
		}

		private static bool PrefixMove()
		{
			return !CheatState.FlyActive;
		}

		private static bool PrefixLockMouse()
		{
			return !MenuBehaviour.IsOpen;
		}
	}
	[BepInPlugin("com.digrididis.scheduleimenu", "ModMenu", "1.0.0")]
	public class Plugin : BasePlugin
	{
		public const string Guid = "com.digrididis.scheduleimenu";

		internal static ManualLogSource Logger;

		public override void Load()
		{
			//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_0020: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			Logger = ((BasePlugin)this).Log;
			try
			{
				ClassInjector.RegisterTypeInIl2Cpp<MenuBehaviour>();
				GameObject val = new GameObject("ScheduleI_Menu");
				Object.DontDestroyOnLoad((Object)val);
				((Object)val).hideFlags = (HideFlags)61;
				val.AddComponent<MenuBehaviour>();
				Logger.LogInfo((object)"Schedule I Menu loaded - press G in game.");
			}
			catch (Exception ex)
			{
				Logger.LogError((object)("Could not create menu object: " + ex));
			}
			Patches.Install();
		}
	}
	internal static class Refs
	{
		private static float _next;

		public static Player Local
		{
			get
			{
				try
				{
					return Player.Local;
				}
				catch
				{
					return null;
				}
			}
		}

		public static PlayerMovement Movement
		{
			get
			{
				try
				{
					return PlayerSingleton<PlayerMovement>.Instance;
				}
				catch
				{
					return null;
				}
			}
		}

		public static PlayerInventory Inventory
		{
			get
			{
				try
				{
					return PlayerSingleton<PlayerInventory>.Instance;
				}
				catch
				{
					return null;
				}
			}
		}

		public static LevelManager Levels
		{
			get
			{
				try
				{