Decompiled source of ExtraCityEdit v0.2.2

CustomStreetEdit.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AssetBundleLoader;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using SOD.Common.BepInEx;
using SOD.Common.BepInEx.Configuration;
using SOD.Common.Extensions;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using UniverseLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("CustomStreetEdit")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CustomStreetEdit")]
[assembly: AssemblyTitle("CustomStreetEdit")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace ExtraCityEdit
{
	public interface Configs
	{
		[Binding(true, "Alleyways Enabled", "alleyways.enabled")]
		bool AlleyWaysEnabledConfig { get; set; }
	}
	[BepInPlugin("truedartt.extracityedit", "ExtraCityEdit", "0.2.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ExtraCityEdit : PluginController<ExtraCityEdit, Configs>
	{
		[HarmonyPatch(typeof(MainMenuController), "Start")]
		public class AlphaCore
		{
			private static ToggleController? _toggleController;

			public static bool enableAlleywayWalls => _toggleController.isOn;

			public static void Postfix()
			{
				GameObject val = GameObject.Find("MenuCanvas");
				if ((Object)(object)val == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"MenuCanvas not found.");
					return;
				}
				Transform val2 = val.transform.Find("MainMenu/GenerateCityPanel/GenerateNewCityComponents");
				if ((Object)(object)val2 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"GenerateNewCityComponents container not found.");
					return;
				}
				Transform obj = val2.Find("CityEditorToggle");
				GameObject val3 = ((obj != null) ? ((Component)obj).gameObject : null);
				if ((Object)(object)val3 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"CityEditorToggle template not found.");
					return;
				}
				GameObject val4 = Object.Instantiate<GameObject>(val3);
				val4.transform.SetParent(val2, false);
				val4.transform.SetSiblingIndex(6);
				val4.SetActive(true);
				Transform val5 = val4.transform.Find("LabelText");
				if ((Object)(object)val5 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"LabelText missing on newToggle.");
					return;
				}
				MenuAutoTextController component = ((Component)val5).GetComponent<MenuAutoTextController>();
				if ((Object)(object)component != (Object)null)
				{
					Object.Destroy((Object)(object)component);
				}
				TMP_Text component2 = ((Component)val5).GetComponent<TMP_Text>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.text = "Alleyway Walls Enabled";
				}
				else
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"textComponent missing on newToggle.");
				}
				_toggleController = val4.GetComponent<ToggleController>();
				if ((Object)(object)_toggleController != (Object)null)
				{
					_toggleController.playerPrefsID = "";
					if (((PluginController<ExtraCityEdit, Configs>)(object)PluginController<ExtraCityEdit, Configs>.Instance).Config.AlleyWaysEnabledConfig)
					{
						_toggleController.SetOn();
					}
					else
					{
						_toggleController.SetOff();
					}
				}
				else
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"ToggleController missing on newToggle.");
				}
			}
		}

		[HarmonyPatch(typeof(NewBuilding), "Setup")]
		public class BetaCore
		{
			public static void Postfix(NewBuilding __instance)
			{
				if (!AlphaCore.enableAlleywayWalls)
				{
					__instance.preset.enableAlleywayWalls = false;
				}
				((PluginController<ExtraCityEdit, Configs>)(object)PluginController<ExtraCityEdit, Configs>.Instance).Config.AlleyWaysEnabledConfig = AlphaCore.enableAlleywayWalls;
			}
		}

		[HarmonyPatch(typeof(PrototypeDebugPanel), "Awake")]
		public class GammaCore
		{
			private static string path = Path.Combine(Paths.PluginPath, "truedartt-ExtraCityEdit/extrastuff");

			private static AssetBundle bundle = BundleLoader.LoadBundle(path, false, false);

			private static Sprite whiteSquare = bundle.LoadAsset<Sprite>("whitesquare");

			private static Sprite newTexture;

			private static Sprite disabledCross;

			private static GameObject newMenu;

			private static GameObject SpriteObject;

			private static Image ColorBG;

			private static Image ColorBG2;

			private static Image ColorBG3;

			private static Image ColorBG4;

			private static int partPicked;

			private static int colorPartPicked;

			private static TMP_Dropdown ResetSelection;

			private static CityEditorBuildingEdit mainController;

			private static MaterialGroupPreset materialPart;

			private static GameObject colorBlending;

			private static List<MaterialGroupPreset> mat = EnumerableExtensions.ToList<MaterialGroupPreset>(Toolbox.Instance.allMaterialGroups);

			private static Transform ColorPicker;

			private static TMP_Dropdown LandValueDropdown;

			private static TMP_Dropdown EchelonFloorDropdown;

			private static TMP_Dropdown DesignDropdown;

			private static TMP_Dropdown GrubinessDropdown;

			private static List<Color> ColorSelection = new List<Color>
			{
				new Color(0f, 0f, 0f, 1f),
				new Color(0.4627f, 0.1804f, 0.1529f, 1f),
				new Color(0.5294f, 0.298f, 0.2824f, 1f),
				new Color(0.302f, 0.2392f, 0.2196f, 1f),
				new Color(0.4392f, 0.2078f, 0.1333f, 1f),
				new Color(0.8431f, 0.6549f, 0.6471f, 1f),
				new Color(0.8784f, 0.349f, 0.349f, 1f),
				new Color(1f, 1f, 1f, 1f),
				new Color(0.6235f, 0.3961f, 0.3412f, 1f),
				new Color(0.949f, 0.6431f, 0.6392f, 1f),
				new Color(0.3725f, 0.2235f, 0.1373f, 1f),
				new Color(0.4392f, 0.3216f, 0.2509f, 1f),
				new Color(0.7725f, 0.4706f, 0.3843f, 1f),
				new Color(0.5176f, 0.3373f, 0.2392f, 1f),
				new Color(0.8863f, 0.2824f, 0.2f, 1f),
				new Color(0.5137f, 0.298f, 0.1843f, 1f),
				new Color(0.7373f, 0.3333f, 0.1961f, 1f),
				new Color(0.5569f, 0.3216f, 0.1843f, 1f),
				new Color(0.4667f, 0.2078f, 0f, 1f),
				new Color(0.4431f, 0.2824f, 0.149f, 1f),
				new Color(0.7451f, 0.4314f, 0.2784f, 1f),
				new Color(0.5686f, 0.4667f, 0.3804f, 1f),
				new Color(0.6549f, 0.349f, 0.1373f, 1f),
				new Color(0.4863f, 0.4196f, 0.3333f, 1f),
				new Color(0.5098f, 0.3216f, 0.1843f, 1f),
				new Color(0.9137f, 0.6353f, 0.5059f, 1f),
				new Color(0.749f, 0.5804f, 0.4471f, 1f),
				new Color(0.7451f, 0.5137f, 0.3333f, 1f),
				new Color(0.4863f, 0.4196f, 0.2863f, 1f),
				new Color(0.8275f, 0.6941f, 0.5725f, 1f),
				new Color(0.1882f, 0.1686f, 0.1059f, 1f),
				new Color(0.5294f, 0.4784f, 0.3608f, 1f),
				new Color(0.9765f, 0.8667f, 0.7804f, 1f),
				new Color(0.8588f, 0.4706f, 0.149f, 1f),
				new Color(0.6706f, 0.3961f, 0f, 1f),
				new Color(0.6196f, 0.5882f, 0.5137f, 1f),
				new Color(0.5961f, 0.5569f, 0.4667f, 1f),
				new Color(0.9412f, 0.8353f, 0.6863f, 1f),
				new Color(0.9059f, 0.7216f, 0.4627f, 1f),
				new Color(0.8627f, 0.6157f, 0.2275f, 1f),
				new Color(0.698f, 0.5412f, 0.1373f, 1f),
				new Color(0.8824f, 0.6627f, 0.2196f, 1f),
				new Color(0.8667f, 0.8157f, 0.6863f, 1f),
				new Color(0.9059f, 0.7333f, 0.3333f, 1f),
				new Color(0.7412f, 0.7294f, 0.6941f, 1f),
				new Color(0.9804f, 0.9333f, 0.7961f, 1f),
				new Color(0.8431f, 0.7725f, 0.1647f, 1f),
				new Color(0.8941f, 0.8627f, 0.4941f, 1f),
				new Color(0.6706f, 0.6667f, 0.6078f, 1f),
				new Color(0.7882f, 0.7882f, 0.2902f, 1f),
				new Color(0.7686f, 0.7686f, 0.2902f, 1f),
				new Color(0.8118f, 0.8118f, 0.6941f, 1f),
				new Color(0.9137f, 0.9098f, 0.7804f, 1f),
				new Color(0.3961f, 0.4431f, 0.2824f, 1f),
				new Color(0.9216f, 0.9373f, 0.7255f, 1f),
				new Color(0.5961f, 0.6706f, 0.4f, 1f),
				new Color(0.8039f, 0.8784f, 0.4745f, 1f),
				new Color(0.3765f, 0.4667f, 0.2745f, 1f),
				new Color(0.7059f, 0.7647f, 0.5569f, 1f),
				new Color(0.8784f, 0.9255f, 0.7255f, 1f),
				new Color(0.9451f, 0.9569f, 0.9216f, 1f),
				new Color(0.4392f, 0.4745f, 0.4235f, 1f),
				new Color(0.5882f, 0.7059f, 0.4941f, 1f),
				new Color(0.8039f, 0.9059f, 0.6902f, 1f),
				new Color(0.7804f, 0.8431f, 0.7216f, 1f),
				new Color(0.3843f, 0.5294f, 0.3569f, 1f),
				new Color(0.1843f, 0.2353f, 0.1961f, 1f),
				new Color(0.2509f, 0.3922f, 0.2824f, 1f),
				new Color(0.6392f, 0.7451f, 0.6627f, 1f),
				new Color(0.4863f, 0.7373f, 0.5373f, 1f),
				new Color(0.298f, 0.4863f, 0.4f, 1f),
				new Color(0.8157f, 0.8588f, 0.8314f, 1f),
				new Color(0.5098f, 0.6863f, 0.6039f, 1f),
				new Color(0.7647f, 0.8784f, 0.8627f, 1f),
				new Color(0.3804f, 0.4863f, 0.5059f, 1f),
				new Color(0.6235f, 0.9059f, 0.8627f, 1f),
				new Color(0.1373f, 0.5176f, 0.5843f, 1f),
				new Color(0.0824f, 0.149f, 0.1961f, 1f),
				new Color(0.5569f, 0.6706f, 0.6941f, 1f),
				new Color(0.3373f, 0.6824f, 0.7373f, 1f),
				new Color(0.1333f, 0.149f, 0.1647f, 1f),
				new Color(0.2039f, 0.2667f, 0.349f, 1f),
				new Color(0.2392f, 0.8157f, 0.9098f, 1f),
				new Color(0.2863f, 0.5373f, 0.6549f, 1f),
				new Color(0.4667f, 0.7216f, 0.8078f, 1f),
				new Color(0.1843f, 0.2549f, 0.3412f, 1f),
				new Color(0.1137f, 0.1686f, 0.251f, 1f),
				new Color(0.4392f, 0.5569f, 0.6392f, 1f),
				new Color(0.7843f, 0.9059f, 0.9451f, 1f),
				new Color(0.5765f, 0.7412f, 0.8196f, 1f),
				new Color(0.1647f, 0.302f, 0.4745f, 1f),
				new Color(0.3059f, 0.4392f, 0.6157f, 1f),
				new Color(0.6039f, 0.7059f, 0.7961f, 1f),
				new Color(0.2078f, 0.2078f, 0.2824f, 1f),
				new Color(0.4078f, 0.3961f, 0.5922f, 1f),
				new Color(0.8039f, 0.7843f, 0.8627f, 1f),
				new Color(0.1804f, 0.1373f, 0.2078f, 1f),
				new Color(0.4902f, 0.349f, 0.6078f, 1f),
				new Color(0.6471f, 0.4863f, 0.702f, 1f),
				new Color(0.4863f, 0.4275f, 0.4549f, 1f),
				new Color(0.502f, 0.2745f, 0.3686f, 1f),
				new Color(0.4863f, 0.3608f, 0.4f, 1f),
				new Color(0.1569f, 0.1176f, 0.1176f, 1f),
				new Color(0.3922f, 0.2078f, 0.2353f, 1f),
				new Color(0.7569f, 0.3804f, 0.4549f, 1f),
				new Color(0.8039f, 0.3569f, 0.4431f, 1f),
				new Color(0.5804f, 0.1137f, 0.1333f, 1f),
				new Color(0.6627f, 0.4863f, 0.4863f, 1f),
				new Color(0.6667f, 0.1686f, 0.2078f, 1f),
				new Color(0.9294f, 0.3529f, 0.4627f, 1f),
				new Color(0.7882f, 0.6784f, 0.6824f, 1f),
				new Color(0.7843f, 0.1529f, 0.1647f, 1f)
			};

			public static dynamic advancedSettings => newMenu;

			public static dynamic core => mainController;

			public static dynamic BGDelegate => ColorBG;

			public static dynamic SpriteDelegate => SpriteObject;

			public static dynamic ResetDelegate => ResetSelection;

			public static dynamic ResetDelegate2 => LandValueDropdown;

			public static dynamic EchelonDelegate => EchelonFloorDropdown;

			public static dynamic ColorPickerDelegate => ColorPicker;

			public static dynamic DesignDelegate => DesignDropdown;

			public static dynamic GrubinessDelegate => GrubinessDropdown;

			public static void Postfix()
			{
				//IL_0294: Unknown result type (might be due to invalid IL or missing references)
				//IL_0989: Unknown result type (might be due to invalid IL or missing references)
				//IL_09ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a79: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ad2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b2b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0bf7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c16: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c70: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c9f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d02: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d23: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e11: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e38: Unknown result type (might be due to invalid IL or missing references)
				//IL_0edd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f03: Unknown result type (might be due to invalid IL or missing references)
				//IL_15e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_1668: Unknown result type (might be due to invalid IL or missing references)
				newTexture = bundle.LoadAsset<Sprite>("newTextureV2");
				disabledCross = bundle.LoadAsset<Sprite>("disabledCross");
				GameObject val = GameObject.Find("PrototypeBuilderCanvas/CityEditorPanel/ButtonComponents");
				if ((Object)(object)val == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"ButtonComponents not found.");
					return;
				}
				Transform val2 = val.transform.Find("Phase");
				GameObject gameObject = ((Component)val2.Find("LoadingProgress")).gameObject;
				gameObject.SetActive(false);
				if ((Object)(object)val2 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"TileEditButtons not found.");
					return;
				}
				Transform obj = val.transform.Find("SubTools/TileEditButtons/SwapButton");
				GameObject val3 = ((obj != null) ? ((Component)obj).gameObject : null);
				if ((Object)(object)val3 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"SwapButton not found.");
					return;
				}
				GameObject val4 = Object.Instantiate<GameObject>(val3);
				val4.transform.SetParent(val2, false);
				val4.transform.SetSiblingIndex(0);
				((Object)val4.transform).name = "OpenButton";
				val4.SetActive(true);
				ButtonController core = ((Component)val4.transform).GetComponent<ButtonController>();
				if ((Object)(object)core == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"ButtonController missing on openButton.");
					return;
				}
				core.useAutomaticText = false;
				core.SetInteractable(val3.GetComponent<ButtonController>().interactable);
				TextMeshProUGUI component = ((Component)val4.transform.Find("Text")).GetComponent<TextMeshProUGUI>();
				if ((Object)(object)component != (Object)null)
				{
					((TMP_Text)component).text = "Advanced Settings";
				}
				else
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"TextMeshProUGUI component missing on openButton.");
				}
				Button component2 = ((Component)val4.transform).GetComponent<Button>();
				if ((Object)(object)component2 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"Button missing on openButton.");
					return;
				}
				GameObject val5 = GameObject.Find("PrototypeBuilderCanvas/CityEditorPanel");
				newMenu = Object.Instantiate<GameObject>(val5);
				((UnityEvent)component2.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					newMenu.SetActive(true);
					core.SetInteractable(false);
				}));
				((Object)newMenu).name = "AdvancedSettings";
				newMenu.SetActive(false);
				newMenu.transform.SetParent(val5.transform.parent, false);
				((Transform)((Component)newMenu.transform).GetComponent<RectTransform>()).position = new Vector3(667f, 1080f, 0f);
				Transform val6 = newMenu.transform.Find("Header/PanelTitle");
				((Behaviour)((Component)val6).GetComponent<MenuAutoTextController>()).enabled = false;
				((TMP_Text)((Component)val6).GetComponent<TextMeshProUGUI>()).text = "Advanced Settings";
				Transform val7 = newMenu.transform.Find("ButtonComponents/SizeDropdown");
				if ((Object)(object)val7 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"SizeDropdown not found.");
					return;
				}
				val7.SetSiblingIndex(0);
				((Component)val7).GetComponent<DropdownController>().playerPrefsID = "";
				((Behaviour)((Component)val7.Find("LabelText")).GetComponent<MenuAutoTextController>()).enabled = false;
				((TMP_Text)((Component)val7.Find("LabelText")).GetComponent<TextMeshProUGUI>()).text = "Building";
				((Component)val7).gameObject.SetActive(true);
				TMP_Dropdown component3 = ((Component)val7.Find("Dropdown")).GetComponent<TMP_Dropdown>();
				if ((Object)(object)component3 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"TMP_Dropdown 1 not found.");
					return;
				}
				component3.ClearOptions();
				component3.AddOptions(EnumerableExtensions.ToListIl2Cpp<string>((IEnumerable<string>)new List<string> { "Select Part", "Walls", "Floors", "Ceilings", "Miscellaneous", "Miscellaneous2" }));
				component3.value = -1;
				ResetSelection = component3;
				Transform val8 = newMenu.transform.Find("ButtonComponents/SizeDropdown");
				if ((Object)(object)val8 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"SizeDropdown not found.");
					return;
				}
				Transform val9 = Object.Instantiate<Transform>(val8, newMenu.transform.Find("ButtonComponents"));
				((Object)val9).name = "MaterialDropdown";
				if ((Object)(object)val9 == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"SizeDropdown not found.");
					return;
				}
				List<string> list = new List<string>
				{
					"LargeDiamondPanelled(W)", "FloorTiles(FC)", "WoodenPanelling(W)", "Brick(WX)", "MarbleFloor(FC)", "CarpetKubrick02(F)", "LargeDiamond(W)", "Rooster(W)", "EchelonMarbleTiled(W)", "WoodenFence(X)",
					"CarpetKubrick01(F)", "WoodenFenceJoin(X)", "SquareTilesHalf(W)", "BigForal(W)", "LinoTilesSmall(F)", "AlleyBlockWall(WX)", "WoodenFloorPainted(FC)", "RusticBrick(W)", "MarbleTiled(W)", "SmallFloral(W)",
					"StripedWallpaper(W)", "DecoCurved(W)", "WhiteExteriorBrick(WX)", "FloorTilesHex(FC)", "PathFloor(FX)", "ConcreteFloor(WFC)", "StripedWallpaperPaneling(W)", "WoodenFloorRough(FC)", "Carpet(FC)", "FloorTilesFloral(FC)",
					"CeilingTiles(C)", "FurDeLis(W)", "DinerExteriorUnlit(X)", "WoodenFenceEntrance(X)", "CarpetTurkish(FC)", "LinoPlain(FC)", "FancyFloorTiles(WFC)", "RetroFlowers(W)", "MetroTiles(FC)", "CarpetOval(FC)",
					"SmallFloralPanelled(W)", "WoodenFloorVarnished(FC)", "BigFloralPanelled(W)", "DecoCurvedPanelled(W)", "LinoTilesCross(FC)", "LightMetal(W)", "TartanWallpaper(W)", "LinoTilesLarge(FC)", "Deco(W)", "LinoTilesTiny(FC)",
					"SpotCarpet(FC)", "OldBrick(W)", "RetroFlowersPanelled(W)", "DecoPanelled(W)", "JazzChaos(WFC)", "Grass(X)", "ConcreteFloorLight(WFC)", "LinoTilesDiamond(FC)", "SquareTiles(W)", "Marble(W)",
					"CoatedConcrete(WFC)", "PlainWall(WFC)", "WoodenFloorParquet(FC)", "PlasterCeiling(C)", "FurDeListPanelled(W)"
				};
				val9.SetSiblingIndex(1);
				((Component)val9).GetComponent<DropdownController>().playerPrefsID = "";
				((Component)val9).gameObject.SetActive(true);
				((Behaviour)((Component)val9.Find("LabelText")).GetComponent<MenuAutoTextController>()).enabled = false;
				((TMP_Text)((Component)val9.Find("LabelText")).GetComponent<TextMeshProUGUI>()).text = "Material";
				TMP_Dropdown matSelectionDropdown = ((Component)val9.Find("Dropdown")).GetComponent<TMP_Dropdown>();
				if ((Object)(object)matSelectionDropdown == (Object)null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"TMP_Dropdown 2 not found.");
					return;
				}
				matSelectionDropdown.ClearOptions();
				matSelectionDropdown.AddOptions(EnumerableExtensions.ToListIl2Cpp<string>((IEnumerable<string>)list));
				mainController = ((Component)HighlanderSingleton<CityEditorController>.Instance).gameObject.GetComponent<CityEditorBuildingEdit>();
				Transform val10 = Object.Instantiate<Transform>(val8, newMenu.transform.Find("ButtonComponents"));
				((Object)val10).name = "ColorSelection";
				val10.SetSiblingIndex(2);
				((Component)val10).GetComponent<DropdownController>().playerPrefsID = "";
				((Component)val10.Find("Dropdown")).gameObject.SetActive(false);
				((Behaviour)((Component)val10.Find("LabelText")).GetComponent<MenuAutoTextController>()).enabled = false;
				((TMP_Text)((Component)val10.Find("LabelText")).GetComponent<TextMeshProUGUI>()).text = "Color";
				Transform val11 = newMenu.transform.Find("ButtonComponents/Phase/OpenButton");
				Transform ColorButton = Object.Instantiate<Transform>(val11, val10);
				((Object)ColorButton).name = "ColorButtonMain";
				((Component)ColorButton.Find("Text")).gameObject.SetActive(false);
				((Component)ColorButton).GetComponent<ButtonController>().glowOnHighlight = false;
				((Component)ColorButton).GetComponent<RectTransform>().sizeDelta = new Vector2(52f, 52f);
				((Transform)((Component)ColorButton).GetComponent<RectTransform>()).position = new Vector3(253f, 824f, 0f);
				((Component)ColorButton.Find("Border")).gameObject.SetActive(false);
				((UnityEventBase)((Component)ColorButton).GetComponent<Button>().onClick).RemoveAllListeners();
				ColorBG = ((Component)ColorButton).GetComponent<Image>();
				ColorBG.sprite = disabledCross;
				ColorBG.overrideSprite = disabledCross;
				ColorBG.pixelsPerUnitMultiplier = 10f;
				Transform ColorButton2 = Object.Instantiate<Transform>(ColorButton, val10);
				((Object)ColorButton2).name = "ColorButton2";
				ColorBG2 = ((Component)ColorButton2).GetComponent<Image>();
				((Transform)((Component)ColorButton2).GetComponent<RectTransform>()).position = new Vector3(368.666f, 824f, 0f);
				Transform ColorButton3 = Object.Instantiate<Transform>(ColorButton, val10);
				((Object)ColorButton3).name = "ColorButton3";
				ColorBG3 = ((Component)ColorButton3).GetComponent<Image>();
				((Transform)((Component)ColorButton3).GetComponent<RectTransform>()).position = new Vector3(484.333f, 824f, 0f);
				Transform ColorButton4 = Object.Instantiate<Transform>(ColorButton, val10);
				((Object)ColorButton4).name = "ColorButton4";
				ColorBG4 = ((Component)ColorButton4).GetComponent<Image>();
				((Transform)((Component)ColorButton4).GetComponent<RectTransform>()).position = new Vector3(600f, 824f, 0f);
				ColorPicker = Object.Instantiate<Transform>(val10, GameObject.Find("PrototypeBuilderCanvas").transform);
				((Object)ColorPicker).name = "ColorPicker";
				((Component)ColorPicker).gameObject.SetActive(false);
				((Component)ColorPicker.Find("ColorButtonMain")).gameObject.SetActive(false);
				((Component)ColorPicker.Find("ColorButton2")).gameObject.SetActive(false);
				((Component)ColorPicker.Find("ColorButton3")).gameObject.SetActive(false);
				((Component)ColorPicker.Find("ColorButton4")).gameObject.SetActive(false);
				((Transform)((Component)ColorPicker).GetComponent<RectTransform>()).position = new Vector3(950f, 920f, 0f);
				((Component)ColorPicker).GetComponent<RectTransform>().sizeDelta = new Vector2(450f, 850f);
				Transform header2 = Object.Instantiate<Transform>(newMenu.transform.Find("Header"), ColorPicker);
				((Object)header2).name = "Header";
				((Transform)((Component)header2).GetComponent<RectTransform>()).position = new Vector3(950f, 920f, 0f);
				((Component)((Component)header2).transform.Find("LineBreak")).GetComponent<RectTransform>().sizeDelta = new Vector2(-20f, 2f);
				Transform val12 = ColorPicker.Find("ColorButtonMain");
				((Component)val12).GetComponent<Image>().sprite = newTexture;
				((Component)val12).GetComponent<Image>().overrideSprite = newTexture;
				((Component)val12).GetComponent<Image>().pixelsPerUnitMultiplier = 11.9f;
				((Component)val12).GetComponent<RectTransform>().sizeDelta = new Vector2(39f, 39f);
				((Transform)((Component)val12).GetComponent<RectTransform>()).position = new Vector3(775f, 835f, 0f);
				Transform ReturnButton = Object.Instantiate<Transform>(val11, newMenu.transform.Find("ButtonComponents/Phase"));
				((Object)ReturnButton).name = "Return";
				((TMP_Text)((Component)ReturnButton.Find("Text")).GetComponent<TextMeshProUGUI>()).text = "Close menu";
				((UnityEventBase)((Component)ReturnButton).GetComponent<Button>().onClick).RemoveAllListeners();
				((UnityEvent)((Component)ReturnButton).GetComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					newMenu.gameObject.SetActive(false);
					core.SetInteractable(true);
				}));
				int num = 8;
				int num2 = 775;
				int num3 = 835;
				int num4 = 50;
				int num5 = 775;
				for (int i = 0; i < ColorSelection.Count; i++)
				{
					Transform val13 = Object.Instantiate<Transform>(val12, ColorPicker);
					((Transform)((Component)val13).GetComponent<RectTransform>()).position = new Vector3((float)num2, (float)num3, 0f);
					Image swatchColor = ((Component)val13).GetComponent<Image>();
					((Graphic)swatchColor).color = ColorSelection[i];
					((Component)val13).gameObject.SetActive(true);
					((UnityEvent)((Component)val13).GetComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
					{
						//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
						//IL_0113: Unknown result type (might be due to invalid IL or missing references)
						//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
						//IL_01db: Unknown result type (might be due to invalid IL or missing references)
						//IL_028d: Unknown result type (might be due to invalid IL or missing references)
						//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
						//IL_035c: Unknown result type (might be due to invalid IL or missing references)
						//IL_0384: Unknown result type (might be due to invalid IL or missing references)
						//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
						//IL_04d7: 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_0145: 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_020d: Unknown result type (might be due to invalid IL or missing references)
						//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
						//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
						//IL_03af: Unknown result type (might be due to invalid IL or missing references)
						//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
						//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
						//IL_050a: 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)
						//IL_0177: Unknown result type (might be due to invalid IL or missing references)
						//IL_0229: Unknown result type (might be due to invalid IL or missing references)
						//IL_023f: Unknown result type (might be due to invalid IL or missing references)
						//IL_02f1: 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_0402: Unknown result type (might be due to invalid IL or missing references)
						//IL_042a: 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_01a9: Unknown result type (might be due to invalid IL or missing references)
						//IL_025b: Unknown result type (might be due to invalid IL or missing references)
						//IL_0271: Unknown result type (might be due to invalid IL or missing references)
						//IL_0323: Unknown result type (might be due to invalid IL or missing references)
						//IL_0339: Unknown result type (might be due to invalid IL or missing references)
						//IL_0457: Unknown result type (might be due to invalid IL or missing references)
						//IL_0480: Unknown result type (might be due to invalid IL or missing references)
						NewBuilding building12 = mainController.currentlySelectedTile.building;
						(int, int) tuple = (colorPartPicked, partPicked);
						(int, int) tuple2 = tuple;
						ColourSchemePreset val20;
						ColourSchemePreset val21;
						ColourSchemePreset val22;
						ColourSchemePreset val23;
						ColourSchemePreset val24;
						switch (tuple2.Item1)
						{
						case 1:
							switch (tuple2.Item2)
							{
							case 1:
								break;
							case 2:
								goto IL_01b9;
							case 3:
								goto IL_0281;
							case 4:
								goto IL_0349;
							case 5:
								goto IL_0499;
							default:
								goto IL_0517;
							}
							building12.defaultWallKey.mainColour = ((Graphic)swatchColor).color;
							((Graphic)ColorBG).color = ((Graphic)swatchColor).color;
							break;
						case 2:
							switch (tuple2.Item2)
							{
							case 1:
								break;
							case 2:
								goto IL_01eb;
							case 3:
								goto IL_02b3;
							case 4:
								goto IL_039c;
							case 5:
								goto IL_04ed;
							default:
								goto IL_0517;
							}
							building12.defaultWallKey.colour1 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG2).color = ((Graphic)swatchColor).color;
							break;
						case 3:
							switch (tuple2.Item2)
							{
							case 1:
								break;
							case 2:
								goto IL_021d;
							case 3:
								goto IL_02e5;
							case 4:
								goto IL_03ef;
							default:
								goto IL_0517;
							}
							building12.defaultWallKey.colour2 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG3).color = ((Graphic)swatchColor).color;
							break;
						case 4:
							switch (tuple2.Item2)
							{
							case 1:
								break;
							case 2:
								goto IL_024f;
							case 3:
								goto IL_0317;
							case 4:
								goto IL_0442;
							default:
								goto IL_0517;
							}
							building12.defaultWallKey.colour3 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG4).color = ((Graphic)swatchColor).color;
							break;
						default:
							goto IL_0517;
							IL_0442:
							val20 = Object.Instantiate<ColourSchemePreset>(building12.colourScheme);
							val20.secondary2 = ((Graphic)swatchColor).color;
							((Object)val20).name = ((Object)building12.colourScheme).name;
							((Graphic)ColorBG4).color = ((Graphic)swatchColor).color;
							building12.colourScheme = val20;
							break;
							IL_0317:
							building12.ceilingMatKey.colour3 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG4).color = ((Graphic)swatchColor).color;
							break;
							IL_024f:
							building12.floorMatKey.colour3 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG4).color = ((Graphic)swatchColor).color;
							break;
							IL_0349:
							val21 = Object.Instantiate<ColourSchemePreset>(building12.colourScheme);
							val21.primary1 = ((Graphic)swatchColor).color;
							((Object)val21).name = ((Object)building12.colourScheme).name;
							((Graphic)ColorBG).color = ((Graphic)swatchColor).color;
							building12.colourScheme = val21;
							break;
							IL_03ef:
							val22 = Object.Instantiate<ColourSchemePreset>(building12.colourScheme);
							val22.secondary1 = ((Graphic)swatchColor).color;
							((Object)val22).name = ((Object)building12.colourScheme).name;
							((Graphic)ColorBG3).color = ((Graphic)swatchColor).color;
							building12.colourScheme = val22;
							break;
							IL_02e5:
							building12.ceilingMatKey.colour2 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG3).color = ((Graphic)swatchColor).color;
							break;
							IL_021d:
							building12.floorMatKey.colour2 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG3).color = ((Graphic)swatchColor).color;
							break;
							IL_0281:
							building12.ceilingMatKey.mainColour = ((Graphic)swatchColor).color;
							((Graphic)ColorBG).color = ((Graphic)swatchColor).color;
							break;
							IL_04ed:
							building12.wood = ((Graphic)swatchColor).color;
							((Graphic)ColorBG2).color = ((Graphic)swatchColor).color;
							break;
							IL_039c:
							val23 = Object.Instantiate<ColourSchemePreset>(building12.colourScheme);
							val23.primary2 = ((Graphic)swatchColor).color;
							((Object)val23).name = ((Object)building12.colourScheme).name;
							((Graphic)ColorBG2).color = ((Graphic)swatchColor).color;
							building12.colourScheme = val23;
							break;
							IL_02b3:
							building12.ceilingMatKey.colour1 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG2).color = ((Graphic)swatchColor).color;
							break;
							IL_01eb:
							building12.floorMatKey.colour1 = ((Graphic)swatchColor).color;
							((Graphic)ColorBG2).color = ((Graphic)swatchColor).color;
							break;
							IL_01b9:
							building12.floorMatKey.mainColour = ((Graphic)swatchColor).color;
							((Graphic)ColorBG).color = ((Graphic)swatchColor).color;
							break;
							IL_0517:
							PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"Something not selected");
							break;
							IL_0499:
							val24 = Object.Instantiate<ColourSchemePreset>(building12.colourScheme);
							val24.neutral = ((Graphic)swatchColor).color;
							((Object)val24).name = ((Object)building12.colourScheme).name;
							((Graphic)ColorBG).color = ((Graphic)swatchColor).color;
							building12.colourScheme = val24;
							break;
						}
						((Component)ColorPicker).gameObject.SetActive(false);
						((Component)ReturnButton).GetComponent<ButtonController>().SetInteractable(true);
					}));
					num2 += num4;
					if (num2 == num5 + num4 * num)
					{
						num2 = num5;
						num3 -= num4;
					}
				}
				Transform val14 = Object.Instantiate<Transform>(val11, ColorPicker);
				((Component)((Component)val14).transform).GetComponent<RectTransform>().sizeDelta = new Vector2(390f, 52f);
				((Transform)((Component)((Component)val14).transform).GetComponent<RectTransform>()).position = new Vector3(950f, 130f, 0f);
				((TMP_Text)((Component)((Component)val14).transform).GetComponentInChildren<TextMeshProUGUI>()).text = "Cancel";
				((UnityEvent)((Component)((Component)val14).transform).GetComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					((Component)ColorPicker).gameObject.SetActive(false);
				}));
				Transform val15 = Object.Instantiate<Transform>(val8, newMenu.transform.Find("ButtonComponents"));
				val15.SetSiblingIndex(3);
				((Object)val15).name = "LandValueDropdown";
				LandValueDropdown = ((Component)val15.Find("Dropdown")).GetComponent<TMP_Dropdown>();
				((TMP_Text)((Component)((Component)val15).transform.Find("LabelText")).GetComponent<TextMeshProUGUI>()).text = "Land Value";
				LandValueDropdown.ClearOptions();
				LandValueDropdown.AddOptions(EnumerableExtensions.ToListIl2Cpp<string>((IEnumerable<string>)new List<string> { "Very Low", "Low", "Medium", "High", "Very High" }));
				((UnityEventBase)LandValueDropdown.onValueChanged).RemoveAllListeners();
				((UnityEvent<int>)(object)LandValueDropdown.onValueChanged).AddListener(UnityAction<int>.op_Implicit((Action<int>)delegate(int value)
				{
					CityTile currentlySelectedTile = mainController.currentlySelectedTile;
					switch (value)
					{
					case 0:
						currentlySelectedTile.landValue = (LandValue)0;
						break;
					case 1:
						currentlySelectedTile.landValue = (LandValue)1;
						break;
					case 2:
						currentlySelectedTile.landValue = (LandValue)2;
						break;
					case 3:
						currentlySelectedTile.landValue = (LandValue)3;
						break;
					case 4:
						currentlySelectedTile.landValue = (LandValue)4;
						break;
					}
				}));
				Transform val16 = Object.Instantiate<Transform>(val8, newMenu.transform.Find("ButtonComponents"));
				val16.SetSiblingIndex(4);
				((Object)val16).name = "EchelonFloorDropdown";
				((TMP_Text)((Component)((Component)val16).transform.Find("LabelText")).GetComponent<TextMeshProUGUI>()).text = "Echelons";
				EchelonFloorDropdown = ((Component)((Component)val16).transform.Find("Dropdown")).GetComponent<TMP_Dropdown>();
				EchelonFloorDropdown.ClearOptions();
				EchelonFloorDropdown.AddOptions(EnumerableExtensions.ToListIl2Cpp<string>((IEnumerable<string>)new List<string>
				{
					"Ground Floor", "1st Floor", "2nd Floor", "3rd Floor", "4th Floor", "5th Floor", "6th Floor", "7th Floor", "8th Floor", "9th Floor",
					"10th Floor", "11th Floor", "12th Floor", "13th Floor", "14th Floor", "15th Floor", "16th Floor", "17th Floor", "18th Floor", "19th Floor",
					"Disable"
				}));
				((UnityEventBase)EchelonFloorDropdown.onValueChanged).RemoveAllListeners();
				((UnityEvent<int>)(object)EchelonFloorDropdown.onValueChanged).AddListener(UnityAction<int>.op_Implicit((Action<int>)delegate(int value)
				{
					NewBuilding building11 = mainController.currentlySelectedTile.building;
					BuildingPreset val19 = Object.Instantiate<BuildingPreset>(building11.preset);
					val19.buildingFeaturesEchelonFloors = true;
					((Object)val19).name = ((Object)building11.preset).name;
					val19.echelonFloorStart = value;
					building11.preset = val19;
				}));
				Transform val17 = Object.Instantiate<Transform>(val8, newMenu.transform.Find("ButtonComponents"));
				val17.SetSiblingIndex(5);
				((Object)val17).name = "DesignDropdown";
				((TMP_Text)((Component)((Component)val17).transform.Find("LabelText")).GetComponent<TextMeshProUGUI>()).text = "Design";
				DesignDropdown = ((Component)val17.Find("Dropdown")).GetComponent<TMP_Dropdown>();
				DesignDropdown.ClearOptions();
				DesignDropdown.AddOptions(EnumerableExtensions.ToListIl2Cpp<string>((IEnumerable<string>)new List<string> { "Industrial", "Street", "Basement", "Early Century", "80s Modern", "60s 70s", "Mid Century" }));
				((UnityEventBase)DesignDropdown.onValueChanged).RemoveAllListeners();
				((UnityEvent<int>)(object)DesignDropdown.onValueChanged).AddListener(UnityAction<int>.op_Implicit((Action<int>)delegate(int value)
				{
					NewBuilding building10 = mainController.currentlySelectedTile.building;
					building10.designStyle = Toolbox.Instance.allDesignStyles[value];
				}));
				Transform val18 = Object.Instantiate<Transform>(val8, newMenu.transform.Find("ButtonComponents"));
				val18.SetSiblingIndex(6);
				((Object)val18).name = "GrubinessDropdown";
				((TMP_Text)((Component)((Component)val18).transform.Find("LabelText")).GetComponent<TextMeshProUGUI>()).text = "Cleanliness";
				GrubinessDropdown = ((Component)val18.Find("Dropdown")).GetComponent<TMP_Dropdown>();
				GrubinessDropdown.ClearOptions();
				GrubinessDropdown.AddOptions(EnumerableExtensions.ToListIl2Cpp<string>((IEnumerable<string>)new List<string> { "Clean", "Mostly Clean", "Dirty", "Very Dirty", "Janitor is on vacation" }));
				((UnityEventBase)GrubinessDropdown.onValueChanged).RemoveAllListeners();
				((UnityEvent<int>)(object)GrubinessDropdown.onValueChanged).AddListener(UnityAction<int>.op_Implicit((Action<int>)delegate(int value)
				{
					NewBuilding building9 = mainController.currentlySelectedTile.building;
					building9.ceilingMatKey.grubiness = (float)value / 4f;
					building9.floorMatKey.grubiness = (float)value / 4f;
					building9.defaultWallKey.grubiness = (float)value / 4f;
				}));
				((UnityEvent<int>)(object)component3.onValueChanged).AddListener(UnityAction<int>.op_Implicit((Action<int>)delegate(int value)
				{
					//IL_0059: 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_00c4: 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_0117: Unknown result type (might be due to invalid IL or missing references)
					//IL_012d: Unknown result type (might be due to invalid IL or missing references)
					//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
					//IL_046d: Unknown result type (might be due to invalid IL or missing references)
					//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
					//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
					//IL_0518: Unknown result type (might be due to invalid IL or missing references)
					//IL_052f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0546: Unknown result type (might be due to invalid IL or missing references)
					//IL_0501: Unknown result type (might be due to invalid IL or missing references)
					//IL_018e: 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_01a2: 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_01b6: Unknown result type (might be due to invalid IL or missing references)
					//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
					//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
					//IL_01c1: Invalid comparison between Unknown and I4
					//IL_0887: Unknown result type (might be due to invalid IL or missing references)
					//IL_08d9: Unknown result type (might be due to invalid IL or missing references)
					//IL_08f2: Unknown result type (might be due to invalid IL or missing references)
					//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
					//IL_0c7e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0ce4: Unknown result type (might be due to invalid IL or missing references)
					//IL_0d4a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0db0: Unknown result type (might be due to invalid IL or missing references)
					//IL_0932: Unknown result type (might be due to invalid IL or missing references)
					//IL_0949: Unknown result type (might be due to invalid IL or missing references)
					//IL_0960: Unknown result type (might be due to invalid IL or missing references)
					//IL_091b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0277: Unknown result type (might be due to invalid IL or missing references)
					//IL_027b: Invalid comparison between Unknown and I4
					//IL_0e71: Unknown result type (might be due to invalid IL or missing references)
					//IL_0eb8: Unknown result type (might be due to invalid IL or missing references)
					//IL_0eff: Unknown result type (might be due to invalid IL or missing references)
					//IL_0f46: Unknown result type (might be due to invalid IL or missing references)
					//IL_05a8: Unknown result type (might be due to invalid IL or missing references)
					//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
					//IL_05bc: Unknown result type (might be due to invalid IL or missing references)
					//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
					//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
					//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
					//IL_05d7: Unknown result type (might be due to invalid IL or missing references)
					//IL_05db: Invalid comparison between Unknown and I4
					//IL_029d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0fea: Unknown result type (might be due to invalid IL or missing references)
					//IL_1050: Unknown result type (might be due to invalid IL or missing references)
					//IL_10d9: Unknown result type (might be due to invalid IL or missing references)
					//IL_112d: Unknown result type (might be due to invalid IL or missing references)
					//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
					//IL_0331: Unknown result type (might be due to invalid IL or missing references)
					//IL_0335: Invalid comparison between Unknown and I4
					//IL_0691: Unknown result type (might be due to invalid IL or missing references)
					//IL_0695: Invalid comparison between Unknown and I4
					//IL_0357: Unknown result type (might be due to invalid IL or missing references)
					//IL_09c2: Unknown result type (might be due to invalid IL or missing references)
					//IL_09c7: Unknown result type (might be due to invalid IL or missing references)
					//IL_09d6: Unknown result type (might be due to invalid IL or missing references)
					//IL_09db: Unknown result type (might be due to invalid IL or missing references)
					//IL_09ea: Unknown result type (might be due to invalid IL or missing references)
					//IL_09ef: Unknown result type (might be due to invalid IL or missing references)
					//IL_09f1: Unknown result type (might be due to invalid IL or missing references)
					//IL_09f5: Invalid comparison between Unknown and I4
					//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
					//IL_0a17: Unknown result type (might be due to invalid IL or missing references)
					//IL_074b: Unknown result type (might be due to invalid IL or missing references)
					//IL_074f: Invalid comparison between Unknown and I4
					//IL_0aab: Unknown result type (might be due to invalid IL or missing references)
					//IL_0aaf: Invalid comparison between Unknown and I4
					//IL_0771: Unknown result type (might be due to invalid IL or missing references)
					//IL_0ad1: Unknown result type (might be due to invalid IL or missing references)
					//IL_0b65: Unknown result type (might be due to invalid IL or missing references)
					//IL_0b69: Invalid comparison between Unknown and I4
					//IL_0b8b: Unknown result type (might be due to invalid IL or missing references)
					if (value == 1 && (Object)(object)mainController.currentlySelectedTile != (Object)null)
					{
						NewBuilding building4 = mainController.currentlySelectedTile.building;
						materialPart = building4.defaultWallMaterial;
						((Selectable)matSelectionDropdown).interactable = true;
						partPicked = 1;
						((Graphic)ColorBG).color = building4.defaultWallKey.mainColour;
						ColorBG.sprite = newTexture;
						ColorBG.overrideSprite = newTexture;
						((Component)ColorButton).GetComponent<ButtonController>().SetInteractable(true);
						ColorBG.pixelsPerUnitMultiplier = 9f;
						if (((Graphic)ColorBG).color == new Color(0f, 0f, 0f, 0f))
						{
							((Graphic)ColorBG).color = new Color(1f, 1f, 1f, 1f);
						}
						((Graphic)ColorBG2).color = building4.defaultWallKey.colour1;
						((Graphic)ColorBG3).color = building4.defaultWallKey.colour2;
						((Graphic)ColorBG4).color = building4.defaultWallKey.colour3;
						{
							foreach (MaterialGroupPreset item in mat)
							{
								if ((SoCustomComparison)(object)item == (SoCustomComparison)(object)materialPart)
								{
									matSelectionDropdown.value = mat.IndexOf(item);
									MaterialColour colour4 = item.variations[0].colour1;
									MaterialColour colour5 = item.variations[0].colour2;
									MaterialColour colour6 = item.variations[0].colour3;
									if ((int)colour4 == 15)
									{
										((Graphic)ColorBG2).color = new Color(1f, 1f, 1f, 1f);
										ColorBG2.sprite = disabledCross;
										ColorBG2.overrideSprite = disabledCross;
										ColorBG2.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG2.sprite = newTexture;
										ColorBG2.overrideSprite = newTexture;
										ColorBG2.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(true);
									}
									if ((int)colour5 == 15)
									{
										((Graphic)ColorBG3).color = new Color(1f, 1f, 1f, 1f);
										ColorBG3.sprite = disabledCross;
										ColorBG3.overrideSprite = disabledCross;
										ColorBG3.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG3.sprite = newTexture;
										ColorBG3.overrideSprite = newTexture;
										ColorBG3.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(true);
									}
									if ((int)colour6 == 15)
									{
										((Graphic)ColorBG4).color = new Color(1f, 1f, 1f, 1f);
										ColorBG4.sprite = disabledCross;
										ColorBG4.overrideSprite = disabledCross;
										ColorBG4.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG4.sprite = newTexture;
										ColorBG4.overrideSprite = newTexture;
										ColorBG4.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(true);
									}
								}
							}
							return;
						}
					}
					if (value == 2 && (Object)(object)mainController.currentlySelectedTile != (Object)null)
					{
						NewBuilding building5 = mainController.currentlySelectedTile.building;
						materialPart = building5.floorMaterial;
						((Selectable)matSelectionDropdown).interactable = true;
						partPicked = 2;
						((Graphic)ColorBG).color = building5.floorMatKey.mainColour;
						ColorBG.sprite = newTexture;
						ColorBG.overrideSprite = newTexture;
						((Component)ColorButton).GetComponent<ButtonController>().SetInteractable(true);
						ColorBG.pixelsPerUnitMultiplier = 9f;
						if (((Graphic)ColorBG).color == new Color(0f, 0f, 0f, 0f))
						{
							((Graphic)ColorBG).color = new Color(1f, 1f, 1f, 1f);
						}
						((Graphic)ColorBG2).color = building5.floorMatKey.colour1;
						((Graphic)ColorBG3).color = building5.floorMatKey.colour2;
						((Graphic)ColorBG4).color = building5.floorMatKey.colour3;
						{
							foreach (MaterialGroupPreset item2 in mat)
							{
								if ((SoCustomComparison)(object)item2 == (SoCustomComparison)(object)materialPart)
								{
									matSelectionDropdown.value = mat.IndexOf(item2);
									MaterialColour colour7 = item2.variations[0].colour1;
									MaterialColour colour8 = item2.variations[0].colour2;
									MaterialColour colour9 = item2.variations[0].colour3;
									if ((int)colour7 == 15)
									{
										((Graphic)ColorBG2).color = new Color(1f, 1f, 1f, 1f);
										ColorBG2.sprite = disabledCross;
										ColorBG2.overrideSprite = disabledCross;
										ColorBG2.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG2.sprite = newTexture;
										ColorBG2.overrideSprite = newTexture;
										ColorBG2.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(true);
									}
									if ((int)colour8 == 15)
									{
										((Graphic)ColorBG3).color = new Color(1f, 1f, 1f, 1f);
										ColorBG3.sprite = disabledCross;
										ColorBG3.overrideSprite = disabledCross;
										ColorBG3.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG3.sprite = newTexture;
										ColorBG3.overrideSprite = newTexture;
										ColorBG3.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(true);
									}
									if ((int)colour9 == 15)
									{
										((Graphic)ColorBG4).color = new Color(1f, 1f, 1f, 1f);
										ColorBG4.sprite = disabledCross;
										ColorBG4.overrideSprite = disabledCross;
										ColorBG4.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG4.sprite = newTexture;
										ColorBG4.overrideSprite = newTexture;
										ColorBG4.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(true);
									}
								}
							}
							return;
						}
					}
					if (value == 3 && (Object)(object)mainController.currentlySelectedTile != (Object)null)
					{
						NewBuilding building6 = mainController.currentlySelectedTile.building;
						materialPart = building6.ceilingMaterial;
						((Selectable)matSelectionDropdown).interactable = true;
						partPicked = 3;
						((Graphic)ColorBG).color = building6.ceilingMatKey.mainColour;
						ColorBG.sprite = newTexture;
						ColorBG.overrideSprite = newTexture;
						ColorBG.pixelsPerUnitMultiplier = 9f;
						((Component)ColorButton).GetComponent<ButtonController>().SetInteractable(true);
						if (((Graphic)ColorBG).color == new Color(0f, 0f, 0f, 0f))
						{
							((Graphic)ColorBG).color = new Color(1f, 1f, 1f, 1f);
						}
						((Graphic)ColorBG2).color = building6.ceilingMatKey.colour1;
						((Graphic)ColorBG3).color = building6.ceilingMatKey.colour2;
						((Graphic)ColorBG4).color = building6.ceilingMatKey.colour3;
						{
							foreach (MaterialGroupPreset item3 in mat)
							{
								if ((SoCustomComparison)(object)item3 == (SoCustomComparison)(object)materialPart)
								{
									matSelectionDropdown.value = mat.IndexOf(item3);
									MaterialColour colour10 = item3.variations[0].colour1;
									MaterialColour colour11 = item3.variations[0].colour2;
									MaterialColour colour12 = item3.variations[0].colour3;
									if ((int)colour10 == 15)
									{
										((Graphic)ColorBG2).color = new Color(1f, 1f, 1f, 1f);
										ColorBG2.sprite = disabledCross;
										ColorBG2.overrideSprite = disabledCross;
										ColorBG2.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG2.sprite = newTexture;
										ColorBG2.overrideSprite = newTexture;
										ColorBG2.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(true);
									}
									if ((int)colour11 == 15)
									{
										((Graphic)ColorBG3).color = new Color(1f, 1f, 1f, 1f);
										ColorBG3.sprite = disabledCross;
										ColorBG3.overrideSprite = disabledCross;
										ColorBG3.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG3.sprite = newTexture;
										ColorBG3.overrideSprite = newTexture;
										ColorBG3.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(true);
									}
									if ((int)colour12 == 15)
									{
										((Graphic)ColorBG4).color = new Color(1f, 1f, 1f, 1f);
										ColorBG4.sprite = disabledCross;
										ColorBG4.overrideSprite = disabledCross;
										ColorBG4.pixelsPerUnitMultiplier = 10f;
										((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(false);
									}
									else
									{
										ColorBG4.sprite = newTexture;
										ColorBG4.overrideSprite = newTexture;
										ColorBG4.pixelsPerUnitMultiplier = 9f;
										((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(true);
									}
								}
							}
							return;
						}
					}
					switch (value)
					{
					case 0:
						((Selectable)matSelectionDropdown).interactable = false;
						partPicked = 0;
						((Graphic)ColorBG).color = new Color(1f, 1f, 1f, 1f);
						ColorBG.sprite = disabledCross;
						ColorBG.overrideSprite = disabledCross;
						ColorBG.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton).GetComponent<ButtonController>().SetInteractable(false);
						((Graphic)ColorBG2).color = new Color(1f, 1f, 1f, 1f);
						ColorBG2.sprite = disabledCross;
						ColorBG2.overrideSprite = disabledCross;
						ColorBG2.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(false);
						((Graphic)ColorBG3).color = new Color(1f, 1f, 1f, 1f);
						ColorBG3.sprite = disabledCross;
						ColorBG3.overrideSprite = disabledCross;
						ColorBG3.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(false);
						((Graphic)ColorBG4).color = new Color(1f, 1f, 1f, 1f);
						ColorBG4.sprite = disabledCross;
						ColorBG4.overrideSprite = disabledCross;
						ColorBG4.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(false);
						break;
					case 4:
					{
						NewBuilding building8 = mainController.currentlySelectedTile.building;
						partPicked = 4;
						((Selectable)matSelectionDropdown).interactable = false;
						ColorBG4.sprite = newTexture;
						ColorBG4.overrideSprite = newTexture;
						ColorBG4.pixelsPerUnitMultiplier = 9f;
						((Graphic)ColorBG4).color = building8.colourScheme.secondary2;
						ColorBG.sprite = newTexture;
						ColorBG.overrideSprite = newTexture;
						ColorBG.pixelsPerUnitMultiplier = 9f;
						((Graphic)ColorBG).color = building8.colourScheme.primary1;
						ColorBG2.sprite = newTexture;
						ColorBG2.overrideSprite = newTexture;
						ColorBG2.pixelsPerUnitMultiplier = 9f;
						((Graphic)ColorBG2).color = building8.colourScheme.primary2;
						ColorBG3.sprite = newTexture;
						ColorBG3.overrideSprite = newTexture;
						ColorBG3.pixelsPerUnitMultiplier = 9f;
						((Graphic)ColorBG3).color = building8.colourScheme.secondary1;
						((Component)ColorButton).GetComponent<ButtonController>().SetInteractable(true);
						((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(true);
						((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(true);
						((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(true);
						break;
					}
					case 5:
					{
						NewBuilding building7 = mainController.currentlySelectedTile.building;
						partPicked = 5;
						((Selectable)matSelectionDropdown).interactable = false;
						((Graphic)ColorBG3).color = new Color(1f, 1f, 1f, 1f);
						ColorBG3.sprite = disabledCross;
						ColorBG3.overrideSprite = disabledCross;
						ColorBG3.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(false);
						((Graphic)ColorBG4).color = new Color(1f, 1f, 1f, 1f);
						ColorBG4.sprite = disabledCross;
						ColorBG4.overrideSprite = disabledCross;
						ColorBG4.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(false);
						ColorBG.sprite = newTexture;
						ColorBG.overrideSprite = newTexture;
						ColorBG.pixelsPerUnitMultiplier = 9f;
						((Graphic)ColorBG).color = building7.colourScheme.neutral;
						((Component)ColorButton).GetComponent<ButtonController>().SetInteractable(true);
						ColorBG2.sprite = newTexture;
						ColorBG2.overrideSprite = newTexture;
						ColorBG2.pixelsPerUnitMultiplier = 9f;
						((Graphic)ColorBG2).color = building7.wood;
						((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(true);
						break;
					}
					}
				}));
				((UnityEvent<int>)(object)matSelectionDropdown.onValueChanged).AddListener(UnityAction<int>.op_Implicit((Action<int>)delegate(int value)
				{
					//IL_0040: 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_010e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0127: Unknown result type (might be due to invalid IL or missing references)
					//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
					//IL_0193: Unknown result type (might be due to invalid IL or missing references)
					//IL_0198: Unknown result type (might be due to invalid IL or missing references)
					//IL_01af: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b4: 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_01d0: Unknown result type (might be due to invalid IL or missing references)
					//IL_01e7: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
					//IL_01f0: Invalid comparison between Unknown and I4
					//IL_0150: Unknown result type (might be due to invalid IL or missing references)
					//IL_0212: Unknown result type (might be due to invalid IL or missing references)
					//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
					//IL_02a9: Invalid comparison between Unknown and I4
					//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
					//IL_035f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0362: Invalid comparison between Unknown and I4
					//IL_0384: Unknown result type (might be due to invalid IL or missing references)
					//IL_0418: Unknown result type (might be due to invalid IL or missing references)
					//IL_041b: Invalid comparison between Unknown and I4
					//IL_043c: Unknown result type (might be due to invalid IL or missing references)
					if (partPicked == 1)
					{
						NewBuilding building = mainController.currentlySelectedTile.building;
						building.defaultWallMaterial = mat[value];
						((Graphic)ColorBG).color = building.defaultWallKey.mainColour;
					}
					else if (partPicked == 2)
					{
						NewBuilding building2 = mainController.currentlySelectedTile.building;
						building2.floorMaterial = mat[value];
						((Graphic)ColorBG).color = building2.floorMatKey.mainColour;
					}
					else if (partPicked == 3)
					{
						NewBuilding building3 = mainController.currentlySelectedTile.building;
						building3.ceilingMaterial = mat[value];
						((Graphic)ColorBG).color = building3.ceilingMatKey.mainColour;
					}
					ColorBG.sprite = newTexture;
					ColorBG.overrideSprite = newTexture;
					if (((Graphic)ColorBG).color == new Color(0f, 0f, 0f, 0f))
					{
						((Graphic)ColorBG).color = new Color(1f, 1f, 1f, 1f);
					}
					((Component)ColorButton).GetComponent<ButtonController>().SetInteractable(true);
					ColorBG.pixelsPerUnitMultiplier = 9f;
					MaterialColour main = mat[value].variations[0].main;
					MaterialColour colour = mat[value].variations[0].colour1;
					MaterialColour colour2 = mat[value].variations[0].colour2;
					MaterialColour colour3 = mat[value].variations[0].colour3;
					if ((int)colour == 15)
					{
						((Graphic)ColorBG2).color = new Color(1f, 1f, 1f, 1f);
						ColorBG2.sprite = disabledCross;
						ColorBG2.overrideSprite = disabledCross;
						ColorBG2.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(false);
					}
					else
					{
						ColorBG2.sprite = newTexture;
						ColorBG2.overrideSprite = newTexture;
						ColorBG2.pixelsPerUnitMultiplier = 9f;
						((Component)ColorButton2).GetComponent<ButtonController>().SetInteractable(true);
					}
					if ((int)colour2 == 15)
					{
						((Graphic)ColorBG3).color = new Color(1f, 1f, 1f, 1f);
						ColorBG3.sprite = disabledCross;
						ColorBG3.overrideSprite = disabledCross;
						ColorBG3.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(false);
					}
					else
					{
						ColorBG3.sprite = newTexture;
						ColorBG3.overrideSprite = newTexture;
						ColorBG3.pixelsPerUnitMultiplier = 9f;
						((Component)ColorButton3).GetComponent<ButtonController>().SetInteractable(true);
					}
					if ((int)colour3 == 15)
					{
						((Graphic)ColorBG4).color = new Color(1f, 1f, 1f, 1f);
						ColorBG4.sprite = disabledCross;
						ColorBG4.overrideSprite = disabledCross;
						ColorBG4.pixelsPerUnitMultiplier = 10f;
						((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(false);
					}
					else
					{
						ColorBG4.sprite = newTexture;
						ColorBG4.overrideSprite = newTexture;
						ColorBG4.pixelsPerUnitMultiplier = 9f;
						((Component)ColorButton4).GetComponent<ButtonController>().SetInteractable(true);
					}
					if ((int)main == 15)
					{
						((Graphic)ColorBG).color = new Color(1f, 1f, 1f, 1f);
					}
				}));
				((UnityEvent)((Component)ColorButton).GetComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					((Component)ColorPicker).gameObject.SetActive(true);
					((Component)ReturnButton).GetComponent<ButtonController>().SetInteractable(false);
					((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Blending";
					colorPartPicked = 1;
					if (partPicked == 4)
					{
						((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Primary One";
					}
					if (partPicked == 5)
					{
						((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Neutral";
					}
				}));
				((UnityEvent)((Component)ColorButton2).GetComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					((Component)ColorPicker).gameObject.SetActive(true);
					((Component)ReturnButton).GetComponent<ButtonController>().SetInteractable(false);
					((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Primary Color";
					colorPartPicked = 2;
					if (partPicked == 4)
					{
						((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Primary Two";
					}
					if (partPicked == 5)
					{
						((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Wood";
					}
				}));
				((UnityEvent)((Component)ColorButton3).GetComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					((Component)ColorPicker).gameObject.SetActive(true);
					((Component)ReturnButton).GetComponent<ButtonController>().SetInteractable(false);
					((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Secondary Color";
					colorPartPicked = 3;
					if (partPicked == 4)
					{
						((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Secondary One";
					}
				}));
				((UnityEvent)((Component)ColorButton4).GetComponent<Button>().onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					((Component)ColorPicker).gameObject.SetActive(true);
					((Component)ReturnButton).GetComponent<ButtonController>().SetInteractable(false);
					((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Tertiary Color";
					colorPartPicked = 4;
					if (partPicked == 4)
					{
						((TMP_Text)((Component)header2.Find("PanelTitle")).GetComponent<TextMeshProUGUI>()).text = "Secondary Two";
					}
				}));
				((Component)newMenu.transform.Find("ButtonComponents/CityNameInput")).gameObject.SetActive(false);
				((Component)newMenu.transform.Find("ButtonComponents/Seed")).gameObject.SetActive(false);
				((Component)newMenu.transform.Find("ButtonComponents/SubTools")).gameObject.SetActive(false);
				((Component)newMenu.transform.Find("ButtonComponents/GenerateMap")).gameObject.SetActive(false);
				((Component)newMenu.transform.Find("ButtonComponents/Phase")).GetComponent<RectTransform>().sizeDelta = new Vector2(596f, 60f);
				((Component)newMenu.transform.Find("ButtonComponents/Phase/OpenButton")).gameObject.SetActive(false);
				((Component)newMenu.transform.Find("ButtonComponents/Phase/Finalize")).gameObject.SetActive(false);
				((Component)newMenu.transform.Find("ButtonComponents/Phase/Back")).gameObject.SetActive(false);
				((Component)newMenu.transform).GetComponent<RectTransform>().sizeDelta = new Vector2(668f, 704f);
			}
		}

		[HarmonyPatch(typeof(CityEditorBuildingEdit), "SelectBuilding")]
		public class DeltaCore
		{
			public static void Postfix()
			{
				//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_04eb: Expected I4, but got Unknown
				dynamic val = GammaCore.core.currentlySelectedTile;
				TMP_Dropdown component = GameObject.Find("PrototypeBuilderCanvas/AdvancedSettings/ButtonComponents/SizeDropdown/Dropdown").GetComponent<TMP_Dropdown>();
				TMP_Dropdown component2 = GameObject.Find("PrototypeBuilderCanvas/AdvancedSettings/ButtonComponents/MaterialDropdown/Dropdown").GetComponent<TMP_Dropdown>();
				TMP_Dropdown component3 = GameObject.Find("PrototypeBuilderCanvas/AdvancedSettings/ButtonComponents/LandValueDropdown/Dropdown/").GetComponent<TMP_Dropdown>();
				TMP_Dropdown component4 = GameObject.Find("PrototypeBuilderCanvas/AdvancedSettings/ButtonComponents/EchelonFloorDropdown/Dropdown/").GetComponent<TMP_Dropdown>();
				TMP_Dropdown component5 = GameObject.Find("PrototypeBuilderCanvas/AdvancedSettings/ButtonComponents/DesignDropdown/Dropdown/").GetComponent<TMP_Dropdown>();
				TMP_Dropdown component6 = GameObject.Find("PrototypeBuilderCanvas/AdvancedSettings/ButtonComponents/GrubinessDropdown/Dropdown/").GetComponent<TMP_Dropdown>();
				GammaCore.ColorPickerDelegate.gameObject.SetActive(false);
				if (GammaCore.advancedSettings == null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"AdvancedSettings not found.");
					return;
				}
				if (GammaCore.core == null)
				{
					PluginController<ExtraCityEdit, Configs>.Log.LogError((object)"CityEditorBuildingEdit not found.");
					return;
				}
				if (GammaCore.core.currentlySelectedTile != null)
				{
					((Selectable)component).interactable = true;
					((Selectable)component2).interactable = true;
					((Selectable)component3).interactable = true;
					((Selectable)component4).interactable = true;
					((Selectable)component5).interactable = true;
					((Selectable)component6).interactable = true;
					GammaCore.ResetDelegate.value = -1;
					if (val.landValue is LandValue val2)
					{
						switch ((int)val2)
						{
						case 0:
							GammaCore.ResetDelegate2.value = 0;
							break;
						case 1:
							GammaCore.ResetDelegate2.value = 1;
							break;
						case 2:
							GammaCore.ResetDelegate2.value = 2;
							break;
						case 3:
							GammaCore.ResetDelegate2.value = 3;
							break;
						case 4:
							GammaCore.ResetDelegate2.value = 4;
							break;
						}
					}
					GammaCore.EchelonDelegate.value = val.building.preset.echelonFloorStart;
					object obj = val.building.designStyle.presetName;
					object obj2 = obj;
					switch (obj2 as string)
					{
					case "Industrial":
						GammaCore.DesignDelegate.value = 0;
						break;
					case "Street":
						GammaCore.DesignDelegate.value = 1;
						break;
					case "Basement":
						GammaCore.DesignDelegate.value = 2;
						break;
					case "EarlyCentury":
						GammaCore.DesignDelegate.value = 3;
						break;
					case "80sModern":
						GammaCore.DesignDelegate.value = 4;
						break;
					case "60s70s":
						GammaCore.DesignDelegate.value = 5;
						break;
					case "MidCentury":
						GammaCore.DesignDelegate.value = 6;
						break;
					}
					if (val.building.floorMatKey.grubiness is float num)
					{
						if (num == 0f)
						{
							GammaCore.GrubinessDelegate.value = 0;
						}
						else if (num == 0.25f)
						{
							GammaCore.GrubinessDelegate.value = 1;
						}
						else if (num == 0.5f)
						{
							GammaCore.GrubinessDelegate.value = 2;
						}
						else if (num == 0.75f)
						{
							GammaCore.GrubinessDelegate.value = 3;
						}
						else if (num == 1f)
						{
							GammaCore.GrubinessDelegate.value = 4;
						}
					}
				}
				if (GammaCore.core.currentlySelectedTile == null)
				{
					((Selectable)component).interactable = false;
					((Selectable)component2).interactable = false;
					((Selectable)component3).interactable = false;
					((Selectable)component4).interactable = false;
					((Selectable)component5).interactable = false;
					((Selectable)component6).interactable = false;
					GammaCore.ResetDelegate.value = -1;
				}
			}
		}

		[HarmonyPatch(typeof(PrototypeDebugPanel), "Update")]
		public class EpsilonCore
		{
			public static void Postfix()
			{
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				GammaCore.ColorPickerDelegate.GetComponent<RectTransform>().position = (dynamic)new Vector3(950f, 920f, 0f);
			}
		}

		public override void Load()
		{
			base.Harmony.PatchAll(Assembly.GetExecutingAssembly());
			PluginController<ExtraCityEdit, Configs>.Log.LogInfo((object)"Plugin is patched.");
		}
	}
}