Decompiled source of MorePalette v1.0.3

MorePalette.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using DM;
using FhpSLib;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MorePalette")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("GeeztJeez")]
[assembly: AssemblyProduct("SFT by FhpSlime")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("MorePalette")]
[assembly: ComVisible(false)]
[assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266a22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace MorePalette;

[BepInPlugin("BepInEx.MorePalette", "MorePalette", "1.0.3")]
internal class Loader : BaseUnityPlugin
{
	private void Awake()
	{
		((MonoBehaviour)this).StartCoroutine("Call");
	}

	private IEnumerator Call()
	{
		yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
		yield return (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
		Debug.Log((object)"Loading MorePalette...");
		new Harmony("MorePalette").PatchAll();
		Init(ContentDatabase.Instance().LandfallContentDatabase);
		Debug.Log((object)"Loaded MorePalette Successfully!");
	}

	public static void Init(LandfallContentDatabase db)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Expected O, but got Unknown
		//IL_0030: 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_0099: Expected O, but got Unknown
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Expected O, but got Unknown
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Expected O, but got Unknown
		//IL_01cb: 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_0235: Expected O, but got Unknown
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_027a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Expected O, but got Unknown
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Expected O, but got Unknown
		//IL_02a8: 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_02f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0300: Expected O, but got Unknown
		//IL_0318: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Unknown result type (might be due to invalid IL or missing references)
		//IL_034f: Expected O, but got Unknown
		//IL_0352: Unknown result type (might be due to invalid IL or missing references)
		//IL_0363: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Unknown result type (might be due to invalid IL or missing references)
		//IL_039d: 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_03a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0415: Unknown result type (might be due to invalid IL or missing references)
		//IL_041a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0427: Unknown result type (might be due to invalid IL or missing references)
		//IL_0429: Unknown result type (might be due to invalid IL or missing references)
		//IL_0432: Unknown result type (might be due to invalid IL or missing references)
		//IL_045a: Unknown result type (might be due to invalid IL or missing references)
		//IL_045f: Unknown result type (might be due to invalid IL or missing references)
		//IL_046c: Unknown result type (might be due to invalid IL or missing references)
		//IL_046e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0477: Unknown result type (might be due to invalid IL or missing references)
		//IL_049a: Unknown result type (might be due to invalid IL or missing references)
		//IL_049f: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_04af: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04db: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Unknown result type (might be due to invalid IL or missing references)
		//IL_0508: Unknown result type (might be due to invalid IL or missing references)
		//IL_050c: Unknown result type (might be due to invalid IL or missing references)
		Material val = new Material(Shader.Find("Standard"));
		((Object)val).name = "MP-Absolute-Transparent";
		val.color = new Color(0f, 0f, 0f, 0f);
		val.SetOverrideTag("RenderType", "Transparent");
		val.SetFloat("_Mode", 3f);
		val.SetInt("_SrcBlend", 5);
		val.SetInt("_DstBlend", 10);
		val.EnableKeyword("_ALPHABLEND_ON");
		val.renderQueue = 3000;
		Material val2 = new Material(Shader.Find("Standard"));
		((Object)val2).name = "MP-Grey-Transparent";
		val2.color = new Color(0.5f, 0.5f, 0.5f, 0.5f);
		val2.SetOverrideTag("RenderType", "Transparent");
		val2.SetFloat("_Mode", 3f);
		val2.SetInt("_SrcBlend", 5);
		val2.SetInt("_DstBlend", 10);
		val2.EnableKeyword("_ALPHABLEND_ON");
		val2.renderQueue = 3000;
		Material val3 = new Material(Shader.Find("Standard"));
		((Object)val3).name = "MP-Black-Transparent";
		val3.color = new Color(0f, 0f, 0f, 0.5f);
		val3.SetOverrideTag("RenderType", "Transparent");
		val3.SetFloat("_Mode", 3f);
		val3.SetInt("_SrcBlend", 5);
		val3.SetInt("_DstBlend", 10);
		val3.EnableKeyword("_ALPHABLEND_ON");
		val3.renderQueue = 3000;
		Material val4 = new Material(Shader.Find("Standard"));
		((Object)val4).name = "MP-White-Transparent";
		val4.color = new Color(1f, 1f, 1f, 0.5f);
		val4.SetOverrideTag("RenderType", "Transparent");
		val4.SetFloat("_Mode", 3f);
		val4.SetInt("_SrcBlend", 5);
		val4.SetInt("_DstBlend", 10);
		val4.EnableKeyword("_ALPHABLEND_ON");
		val4.renderQueue = 3000;
		Material val5 = new Material(Shader.Find("Standard"));
		((Object)val5).name = "MP-Glow-White";
		val5.color = new Color(2f, 2f, 2f, 2f);
		Material val6 = new Material((Material)SLMALoader.SDic["materials"]["CompleteBlack"]);
		((Object)val6).name = "MP-Absolute-Black";
		val6.color = new Color(0f, 0f, 0f, 1f);
		UnitEditorColorPalette val7 = Resources.FindObjectsOfTypeAll<UnitEditorColorPalette>()[0];
		List<ParentCatagories> list = ((ParentCatagories[])OtherLibrary.GetField<UnitEditorColorPalette>(val7, "m_ColorPalleteParentCatagories")).ToList();
		ParentCatagories val8 = default(ParentCatagories);
		val8.colorWheelSprite = (Sprite)SLMALoader.SDic["sprites"]["Icons_128x128_Painter"];
		val8.name = "MorePallete";
		val8.colorPaletteCatagories = (ColorPaletteCatagory[])(object)new ColorPaletteCatagory[1]
		{
			new ColorPaletteCatagory
			{
				name = "BasicPallete",
				shardImage = (Sprite)SLMALoader.SDic["sprites"]["Icons_128x128_Painter"],
				Cataogry = (CatagoryType)0,
				Colors = (ColorPaletteData[])(object)new ColorPaletteData[6]
				{
					new ColorPaletteData
					{
						ColorIndex = 7544323,
						m_color = new Color(0.25f, 0.25f, 0.25f, 0f),
						m_material = val
					},
					new ColorPaletteData
					{
						ColorIndex = 3423223,
						m_color = new Color(0.5f, 0.5f, 0.5f, 0.5f),
						m_material = val2
					},
					new ColorPaletteData
					{
						ColorIndex = 34232112,
						m_color = new Color(0.1f, 0.1f, 0.1f, 0.5f),
						m_material = val3
					},
					new ColorPaletteData
					{
						ColorIndex = 6435322,
						m_color = new Color(0.9f, 0.9f, 0.9f, 0.5f),
						m_material = val4
					},
					new ColorPaletteData
					{
						ColorIndex = 5663424,
						m_color = new Color(2f, 2f, 2f),
						m_material = val5
					},
					new ColorPaletteData
					{
						ColorIndex = 6435211,
						m_color = new Color(0f, 0f, 0f),
						m_material = val6
					}
				}
			}
		};
		ParentCatagories item = val8;
		list.Add(item);
		OtherLibrary.SetField<UnitEditorColorPalette>(val7, "m_ColorPalleteParentCatagories", (object)list.ToArray());
		val7.Initialize();
	}
}