Decompiled source of MabelTheCat v1.7.0

Mods/MabelTheCat.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Il2CppExitGames.Client.Photon;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppPhoton.Pun;
using Il2CppPhoton.Realtime;
using Il2CppRUMBLE.Interactions.InteractionBase;
using Il2CppSystem;
using MabelTheCat;
using MelonLoader;
using MelonLoader.Preferences;
using MelonLoader.Utils;
using RumbleModdingAPI.RMAPI;
using UIFramework;
using UIFramework.Models;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(main), "MabelTheCat", "1.7.0", "UlvakSkillz", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 6, true)]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1ae819fd-d86a-44b0-bc6b-aee140e7ca82")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("MabelTheCat")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+56671922307043d65af5a4b358926d2874eb4468")]
[assembly: AssemblyProduct("MabelTheCat")]
[assembly: AssemblyTitle("MabelTheCat")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MabelTheCat;

public static class ModBuildInfo
{
	public const string Version = "1.7.0";
}
public class main : MelonMod
{
	private Random random = new Random();

	private GameObject mabel;

	public static GameObject[] spawnedMabels;

	private static List<Transform>[] mabelBones;

	private string currentScene = "Loader";

	private static int sceneCount;

	private bool flatLandFound = false;

	private static bool flatLandPressed;

	private bool inFlatLand = false;

	private bool init = false;

	private int customMapSceneCount = 0;

	private static GameObject mabelParent;

	private Texture2D texturesLocal;

	private static Shader URPUnlit;

	public static event Action mabelPosingReady;

	public override void OnInitializeMelon()
	{
		Preferences.InitPrefs();
		((ModModelBase)UI.RegisterMelon((MelonBase)(object)this, (MelonPreferences_Category[])(object)new MelonPreferences_Category[1] { Preferences.MabelTheCatCategory })).OnModSaved += Save;
	}

	public override void OnLateInitializeMelon()
	{
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		Actions.onMyModsGathered += checkMods;
		URPUnlit = Shader.Find("Universal Render Pipeline/Unlit");
		if (!Directory.Exists(MelonEnvironment.UserDataDirectory + "\\MabelTheCat"))
		{
			Directory.CreateDirectory(MelonEnvironment.UserDataDirectory + "\\MabelTheCat");
		}
		mabel = Object.Instantiate<GameObject>(AssetBundles.LoadAssetFromStream<GameObject>((MelonMod)(object)this, "MabelTheCat.mabel", "cat"));
		mabel.SetActive(false);
		GameObject val = mabel;
		mabel = Object.Instantiate<GameObject>(mabel);
		((Object)mabel).name = "Mabel";
		ChangeShaderLitToUnlit(mabel);
		Object.DontDestroyOnLoad((Object)(object)mabel);
		mabel.transform.localScale = new Vector3(1.25f, 1.25f, 1.25f);
		mabel.SetActive(false);
		Object.Destroy((Object)(object)val);
	}

	private static void ChangeShaderLitToUnlit(GameObject asset)
	{
		Renderer component = asset.GetComponent<Renderer>();
		if ((Object)(object)component != (Object)null)
		{
			for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)component.materials).Length; i++)
			{
				if (((Object)((Il2CppArrayBase<Material>)(object)component.materials)[i].shader).name == "Universal Render Pipeline/Lit")
				{
					((Il2CppArrayBase<Material>)(object)component.materials)[i].shader = URPUnlit;
				}
			}
		}
		foreach (Renderer componentsInChild in asset.GetComponentsInChildren<Renderer>())
		{
			for (int j = 0; j < ((Il2CppArrayBase<Material>)(object)componentsInChild.materials).Length; j++)
			{
				if (((Object)((Il2CppArrayBase<Material>)(object)componentsInChild.materials)[j].shader).name == "Universal Render Pipeline/Lit")
				{
					((Il2CppArrayBase<Material>)(object)componentsInChild.materials)[j].shader = URPUnlit;
				}
			}
		}
	}

	private void ReskinCat(GameObject thisMabel)
	{
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		if (File.Exists(MelonEnvironment.UserDataDirectory + "\\MabelTheCat\\Cat.png"))
		{
			if ((Object)(object)texturesLocal == (Object)null)
			{
				texturesLocal = new Texture2D(2, 2);
				byte[] array = File.ReadAllBytes(MelonEnvironment.UserDataDirectory + "\\MabelTheCat\\Cat.png");
				ImageConversion.LoadImage(texturesLocal, Il2CppStructArray<byte>.op_Implicit(array));
				((Object)texturesLocal).hideFlags = (HideFlags)61;
			}
			Renderer component = ((Component)thisMabel.transform.GetChild(0)).GetComponent<Renderer>();
			MaterialPropertyBlock val = new MaterialPropertyBlock();
			component.GetPropertyBlock(val);
			Il2CppStringArray propertyNames = ((Component)mabel.transform.GetChild(0)).GetComponent<Renderer>().material.GetPropertyNames((MaterialPropertyType)4);
			val.SetTexture("_BaseMap", (Texture)(object)texturesLocal);
			component.SetPropertyBlock(val);
		}
	}

	private void Save()
	{
		if (Preferences.IsPrefChanged((MelonPreferences_Entry)(object)Preferences.showAllCats))
		{
			removeMabels();
			if (inFlatLand)
			{
				createMabels(isFlatLand: true);
			}
			else
			{
				createMabels(isFlatLand: false);
			}
			poseCats();
		}
		Preferences.StoreLastSavedPrefs();
	}

	private void checkMods()
	{
		flatLandFound = Mods.findOwnMod("FlatLand", "1.6.0", false);
	}

	public void OnEvent(EventData eventData)
	{
		if (eventData.Code == 70)
		{
			customMapSceneCount = sceneCount;
			removeMabels();
		}
	}

	private void removeMabels()
	{
		Object.DestroyImmediate((Object)(object)mabelParent);
	}

	private void poseCats()
	{
		//IL_04e0: 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_0534: Unknown result type (might be due to invalid IL or missing references)
		//IL_055a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0588: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0602: Unknown result type (might be due to invalid IL or missing references)
		//IL_0630: Unknown result type (might be due to invalid IL or missing references)
		//IL_0656: Unknown result type (might be due to invalid IL or missing references)
		//IL_0684: Unknown result type (might be due to invalid IL or missing references)
		//IL_06aa: 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_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: 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_0133: 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_0187: 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_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_095e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0984: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a06: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a2c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a5a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a80: Unknown result type (might be due to invalid IL or missing references)
		//IL_0719: Unknown result type (might be due to invalid IL or missing references)
		//IL_073f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0772: Unknown result type (might be due to invalid IL or missing references)
		//IL_0798: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0824: Unknown result type (might be due to invalid IL or missing references)
		//IL_084a: Unknown result type (might be due to invalid IL or missing references)
		//IL_087d: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: 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)
		//IL_02f5: 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_034e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0374: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0400: Unknown result type (might be due to invalid IL or missing references)
		//IL_0426: Unknown result type (might be due to invalid IL or missing references)
		//IL_0456: Unknown result type (might be due to invalid IL or missing references)
		//IL_047c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c7b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ca1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ccf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cf5: 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_0d49: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d77: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d9d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b0e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b41: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b67: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b9a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf0: 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_0e05: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e2b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e5e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e84: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb7: 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_0f0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f33: Unknown result type (might be due to invalid IL or missing references)
		if (currentScene == "Gym")
		{
			if (flatLandFound)
			{
				MelonCoroutines.Start(listenForFlatLandButton());
			}
			if (Preferences.showAllCats.Value)
			{
				PoseLayingDown(0);
				spawnedMabels[0].transform.position = new Vector3(-0.2856f, 1.5673f, -2.7473f);
				spawnedMabels[0].transform.localRotation = Quaternion.Euler(310.0584f, 41.4574f, 0f);
				StartTailWagStanding(1);
				spawnedMabels[1].transform.position = new Vector3(5.0155f, 0.35f, 1.9536f);
				spawnedMabels[1].transform.localRotation = Quaternion.Euler(0f, 206.7709f, 0f);
				PoseSleeping(2);
				spawnedMabels[2].transform.position = new Vector3(4.3618f, 1.62f, 12.5309f);
				spawnedMabels[2].transform.localRotation = Quaternion.Euler(347.7088f, 146.4092f, 95.1773f);
				PoseSleeping(3);
				spawnedMabels[3].transform.position = new Vector3(-4.0618153f, 0.20091006f, -1.5218217f);
				spawnedMabels[3].transform.localRotation = Quaternion.Euler(347.7088f, 146.4092f, 95.17729f);
				PoseSitting(4);
				spawnedMabels[4].transform.position = new Vector3(12.9546f, 7.4725f, 2.6627f);
				spawnedMabels[4].transform.localRotation = Quaternion.Euler(331.7762f, 238.0956f, -0.0001f);
				PoseStanding(5);
				spawnedMabels[5].transform.position = new Vector3(4.0682f, 2.8709f, 13.1809f);
				spawnedMabels[5].transform.localRotation = Quaternion.Euler(-0f, 206.7709f, 0f);
			}
			else
			{
				switch (random.Next(0, 6))
				{
				case 0:
					PoseLayingDown(0);
					spawnedMabels[0].transform.position = new Vector3(-0.2856f, 1.5673f, -2.7473f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(310.0584f, 41.4574f, 0f);
					break;
				case 1:
					StartTailWagStanding(0);
					spawnedMabels[0].transform.position = new Vector3(5.0155f, 0.35f, 1.9536f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(0f, 206.7709f, 0f);
					break;
				case 2:
					PoseSleeping(0);
					spawnedMabels[0].transform.position = new Vector3(4.3618f, 1.62f, 12.5309f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(347.7088f, 146.4092f, 95.1773f);
					break;
				case 3:
					PoseSleeping(0);
					spawnedMabels[0].transform.position = new Vector3(-4.0618153f, 0.20091006f, -1.5218217f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(347.7088f, 146.4092f, 95.17729f);
					break;
				case 4:
					PoseSitting(0);
					spawnedMabels[0].transform.position = new Vector3(12.9546f, 7.4725f, 2.6627f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(331.7762f, 238.0956f, -0.0001f);
					break;
				case 5:
					PoseStanding(0);
					spawnedMabels[0].transform.position = new Vector3(4.0682f, 2.8709f, 13.1809f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(-0f, 206.7709f, 0f);
					break;
				}
			}
		}
		else if (currentScene == "Park")
		{
			if (Preferences.showAllCats.Value)
			{
				StartTailWagStanding(0);
				spawnedMabels[0].transform.position = new Vector3(-18.0775f, -3.3528f, -9.384f);
				spawnedMabels[0].transform.localRotation = Quaternion.Euler(0f, 234.0795f, 0f);
				PoseSitting(1);
				spawnedMabels[1].transform.position = new Vector3(-29.7215f, 1.5771f, -19.8603f);
				spawnedMabels[1].transform.localRotation = Quaternion.Euler(328.6059f, 61.3965f, 0f);
				PoseStanding(2);
				spawnedMabels[2].transform.position = new Vector3(14.1668f, 7.1245f, 4.1731f);
				spawnedMabels[2].transform.localRotation = Quaternion.Euler(0f, 304.9234f, 0f);
				PoseSleeping(3);
				spawnedMabels[3].transform.position = new Vector3(-22.4429f, -5.7905f, 0.6699f);
				spawnedMabels[3].transform.localRotation = Quaternion.Euler(0f, 62.9994f, 92.1347f);
				PoseLayingDown(4);
				spawnedMabels[4].transform.position = new Vector3(5.8098f, -0.1547f, 5.3263f);
				spawnedMabels[4].transform.localRotation = Quaternion.Euler(302.1827f, 232.8239f, 0f);
				PoseSitting(5);
				spawnedMabels[5].transform.position = new Vector3(26.0936f, -13.7054f, -9.2592f);
				spawnedMabels[5].transform.localRotation = Quaternion.Euler(299.6111f, 293.0545f, -0.0001f);
			}
			else
			{
				switch (random.Next(0, 6))
				{
				case 0:
					StartTailWagStanding(0);
					spawnedMabels[0].transform.position = new Vector3(-18.0775f, -3.3528f, -9.384f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(0f, 234.0795f, 0f);
					break;
				case 1:
					PoseSitting(0);
					spawnedMabels[0].transform.position = new Vector3(-29.7215f, 1.5771f, -19.8603f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(328.6059f, 61.3965f, 0f);
					break;
				case 2:
					PoseStanding(0);
					spawnedMabels[0].transform.position = new Vector3(14.1668f, 7.1245f, 4.1731f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(0f, 304.9234f, 0f);
					break;
				case 3:
					PoseSleeping(0);
					spawnedMabels[0].transform.position = new Vector3(-22.4429f, -5.7905f, 0.6699f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(0f, 62.9994f, 92.1347f);
					break;
				case 4:
					PoseLayingDown(0);
					spawnedMabels[0].transform.position = new Vector3(5.8098f, -0.1547f, 5.3263f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(302.1827f, 232.8239f, 0f);
					break;
				case 5:
					PoseSitting(0);
					spawnedMabels[0].transform.position = new Vector3(26.0936f, -13.7054f, -9.2592f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(299.6111f, 293.0545f, -0.0001f);
					break;
				}
			}
		}
		else if (currentScene == "Map0")
		{
			if (Preferences.showAllCats.Value)
			{
				PoseSitting(0);
				spawnedMabels[0].transform.position = new Vector3(-5.8857f, 3.1199f, 18.2317f);
				spawnedMabels[0].transform.localRotation = Quaternion.Euler(304.6019f, 162.5442f, 0f);
				PoseStanding(1);
				spawnedMabels[1].transform.position = new Vector3(3.9132f, 10.0911f, -15.235f);
				spawnedMabels[1].transform.localRotation = Quaternion.Euler(0f, 34.516f, 0f);
				PoseSleeping(2);
				spawnedMabels[2].transform.position = new Vector3(-16.8323f, 0.6127f, -13.5693f);
				spawnedMabels[2].transform.localRotation = Quaternion.Euler(0f, 66.8559f, 101.1102f);
				PoseLayingDown(3);
				spawnedMabels[3].transform.position = new Vector3(20.2522f, 2.6695f, -5.1527f);
				spawnedMabels[3].transform.localRotation = Quaternion.Euler(311.9057f, 284.6211f, 4.051f);
			}
			else
			{
				switch (random.Next(0, 4))
				{
				case 0:
					PoseSitting(0);
					spawnedMabels[0].transform.position = new Vector3(-5.8857f, 3.1199f, 18.2317f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(304.6019f, 162.5442f, 0f);
					break;
				case 1:
					PoseStanding(0);
					spawnedMabels[0].transform.position = new Vector3(3.9132f, 10.0911f, -15.235f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(0f, 34.516f, 0f);
					break;
				case 2:
					PoseSleeping(0);
					spawnedMabels[0].transform.position = new Vector3(-16.8323f, 0.6127f, -13.5693f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(0f, 66.8559f, 101.1102f);
					break;
				case 3:
					PoseLayingDown(0);
					spawnedMabels[0].transform.position = new Vector3(20.2522f, 2.6695f, -5.1527f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(311.9057f, 284.6211f, 4.051f);
					break;
				}
			}
		}
		else if (currentScene == "Map1")
		{
			if (Preferences.showAllCats.Value)
			{
				PoseSitting(0);
				spawnedMabels[0].transform.position = new Vector3(14.9294f, 10.1897f, 2.5732f);
				spawnedMabels[0].transform.localRotation = Quaternion.Euler(323.7954f, 264.307f, 0f);
				PoseStanding(1);
				spawnedMabels[1].transform.position = new Vector3(-5.8972f, 7.3898f, -11.3046f);
				spawnedMabels[1].transform.localRotation = Quaternion.Euler(10.3407f, 80.0742f, 8.0421f);
				PoseSleeping(2);
				spawnedMabels[2].transform.position = new Vector3(-9.5443f, 3.6002f, 7.8089f);
				spawnedMabels[2].transform.localRotation = Quaternion.Euler(343.6888f, 135.2773f, 90f);
				PoseLayingDown(3);
				spawnedMabels[3].transform.position = new Vector3(-16.8247f, 13.9741f, -4.6171f);
				spawnedMabels[3].transform.localRotation = Quaternion.Euler(323.3444f, 51.1345f, 0f);
			}
			else
			{
				switch (random.Next(0, 4))
				{
				case 0:
					PoseSitting(0);
					spawnedMabels[0].transform.position = new Vector3(14.9294f, 10.1897f, 2.5732f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(323.7954f, 264.307f, 0f);
					break;
				case 1:
					PoseStanding(0);
					spawnedMabels[0].transform.position = new Vector3(-5.8972f, 7.3898f, -11.3046f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(10.3407f, 80.0742f, 8.0421f);
					break;
				case 2:
					PoseSleeping(0);
					spawnedMabels[0].transform.position = new Vector3(-9.5443f, 3.6002f, 7.8089f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(343.6888f, 135.2773f, 90f);
					break;
				case 3:
					PoseLayingDown(0);
					spawnedMabels[0].transform.position = new Vector3(-16.8247f, 13.9741f, -4.6171f);
					spawnedMabels[0].transform.localRotation = Quaternion.Euler(323.3444f, 51.1345f, 0f);
					break;
				}
			}
		}
		for (int i = 0; i < spawnedMabels.Length; i++)
		{
			spawnedMabels[i].SetActive(true);
		}
	}

	private void createMabels(bool isFlatLand)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Expected O, but got Unknown
		mabelParent = new GameObject("Mabels");
		if (Preferences.showAllCats.Value)
		{
			if (isFlatLand)
			{
				spawnedMabels = (GameObject[])(object)new GameObject[1];
				mabelBones = new List<Transform>[1];
			}
			else if (currentScene == "Gym" || currentScene == "Park")
			{
				spawnedMabels = (GameObject[])(object)new GameObject[6];
				mabelBones = new List<Transform>[6];
			}
			else if (currentScene == "Map0" || currentScene == "Map1")
			{
				spawnedMabels = (GameObject[])(object)new GameObject[4];
				mabelBones = new List<Transform>[4];
			}
		}
		else
		{
			spawnedMabels = (GameObject[])(object)new GameObject[1];
			mabelBones = new List<Transform>[1];
		}
		for (int i = 0; i < mabelBones.Length; i++)
		{
			mabelBones[i] = new List<Transform>();
		}
		for (int j = 0; j < spawnedMabels.Length; j++)
		{
			spawnedMabels[j] = Object.Instantiate<GameObject>(mabel);
			((Object)spawnedMabels[j]).name = "Mabel";
			((Object)((Component)spawnedMabels[j].transform.GetChild(0)).gameObject).name = "Mesh";
			spawnedMabels[j].transform.parent = mabelParent.transform;
			ReskinCat(spawnedMabels[j]);
			mabelBones[j].Clear();
			GameObject gameObject = ((Component)spawnedMabels[j].transform.GetChild(1).GetChild(0)).gameObject;
			mabelBones[j].Add(gameObject.transform.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(1));
			mabelBones[j].Add(gameObject.transform.GetChild(1).GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(1).GetChild(0).GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(1).GetChild(0).GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(1).GetChild(0).GetChild(0)
				.GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(2));
			mabelBones[j].Add(gameObject.transform.GetChild(2).GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(2).GetChild(0).GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(2).GetChild(0).GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(2).GetChild(0).GetChild(0)
				.GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(1));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(1)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(1)
				.GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(1)
				.GetChild(0)
				.GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(2));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(2)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(2)
				.GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(2)
				.GetChild(0)
				.GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(3));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(3)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(3)
				.GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(3).GetChild(0).GetChild(1)
				.GetChild(3)
				.GetChild(0)
				.GetChild(0)
				.GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(4));
			mabelBones[j].Add(gameObject.transform.GetChild(4).GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(4).GetChild(0).GetChild(0));
			mabelBones[j].Add(gameObject.transform.GetChild(4).GetChild(0).GetChild(0)
				.GetChild(0));
		}
	}

	private IEnumerator listenForFlatLandButton()
	{
		yield return (object)new WaitForSeconds(1f);
		GameObject.Find("FlatLand/FlatLandButton/Button").GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			flatLandPressed = true;
			MelonCoroutines.Start(toFlatLand());
		}));
	}

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		currentScene = sceneName;
		sceneCount++;
		inFlatLand = false;
		if (sceneName == "Loader")
		{
			return;
		}
		if (!init)
		{
			LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient;
			networkingClient.EventReceived += Action<EventData>.op_Implicit((Action<EventData>)OnEvent);
			init = true;
		}
		createMabels(isFlatLand: false);
		poseCats();
		main.mabelPosingReady?.Invoke();
		if (customMapSceneCount != sceneCount)
		{
			for (int i = 0; i < spawnedMabels.Length; i++)
			{
				spawnedMabels[i].SetActive(true);
			}
		}
	}

	private IEnumerator toFlatLand()
	{
		inFlatLand = true;
		yield return (object)new WaitForSeconds(1f);
		flatLandPressed = false;
		removeMabels();
		createMabels(isFlatLand: true);
		StartTailWagStanding(0);
		spawnedMabels[0].transform.position = new Vector3(5.0155f, 0f, 1.6736f);
		spawnedMabels[0].transform.localRotation = Quaternion.Euler(0f, 206.7709f, 0f);
		spawnedMabels[0].SetActive(true);
	}

	public static IEnumerator JointWag(Transform joint, float[] minMax, float speed, int axis, float waitTime)
	{
		int currentSceneCount = sceneCount;
		while ((Object)(object)joint != (Object)null && currentSceneCount == sceneCount && !flatLandPressed && (Object)(object)mabelParent != (Object)null)
		{
			float jointRotation;
			try
			{
				Quaternion localRotation;
				switch (axis)
				{
				case 0:
				{
					localRotation = joint.localRotation;
					float num2 = ((Quaternion)(ref localRotation)).eulerAngles.x + speed;
					localRotation = joint.localRotation;
					float y2 = ((Quaternion)(ref localRotation)).eulerAngles.y;
					localRotation = joint.localRotation;
					joint.localRotation = Quaternion.Euler(num2, y2, ((Quaternion)(ref localRotation)).eulerAngles.z);
					localRotation = joint.localRotation;
					jointRotation = ((Quaternion)(ref localRotation)).eulerAngles.x;
					break;
				}
				case 1:
				{
					localRotation = joint.localRotation;
					float x2 = ((Quaternion)(ref localRotation)).eulerAngles.x;
					localRotation = joint.localRotation;
					float num = ((Quaternion)(ref localRotation)).eulerAngles.y + speed;
					localRotation = joint.localRotation;
					joint.localRotation = Quaternion.Euler(x2, num, ((Quaternion)(ref localRotation)).eulerAngles.z);
					localRotation = joint.localRotation;
					jointRotation = ((Quaternion)(ref localRotation)).eulerAngles.y;
					break;
				}
				case 2:
				{
					localRotation = joint.localRotation;
					float x = ((Quaternion)(ref localRotation)).eulerAngles.x;
					localRotation = joint.localRotation;
					float y = ((Quaternion)(ref localRotation)).eulerAngles.y;
					localRotation = joint.localRotation;
					joint.localRotation = Quaternion.Euler(x, y, ((Quaternion)(ref localRotation)).eulerAngles.z + speed);
					localRotation = joint.localRotation;
					jointRotation = ((Quaternion)(ref localRotation)).eulerAngles.z;
					break;
				}
				default:
					jointRotation = 0f;
					break;
				}
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
				break;
			}
			if (speed < 0f)
			{
				if (minMax[0] < 0f && jointRotation <= minMax[0] + 360f && jointRotation > 300f)
				{
					speed *= -1f;
					if (waitTime > 0f)
					{
						yield return (object)new WaitForSeconds(waitTime);
					}
				}
				else if (minMax[0] > 0f && jointRotation <= minMax[0])
				{
					speed *= -1f;
					if (waitTime > 0f)
					{
						yield return (object)new WaitForSeconds(waitTime);
					}
				}
			}
			else if (jointRotation >= minMax[1] && jointRotation < 300f)
			{
				speed *= -1f;
			}
			yield return (object)new WaitForFixedUpdate();
		}
	}

	private void PoseLayingDown(int mabelToTransform)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: 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_00b9: 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_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: 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_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: 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_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_035d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0385: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: 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_03fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0475: Unknown result type (might be due to invalid IL or missing references)
		//IL_049d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
		mabelBones[mabelToTransform][0].localRotation = Quaternion.Euler(64.954185f, 15.453509f, 26.672903f);
		mabelBones[mabelToTransform][1].localRotation = Quaternion.Euler(3.1209786f, 4.4456854f, 56.365433f);
		mabelBones[mabelToTransform][2].localRotation = Quaternion.Euler(357.38712f, 157.48375f, 54.1958f);
		mabelBones[mabelToTransform][3].localRotation = Quaternion.Euler(323.17166f, 184.83246f, 179.21472f);
		mabelBones[mabelToTransform][4].localRotation = Quaternion.Euler(39.195377f, 233.07953f, 243.2471f);
		mabelBones[mabelToTransform][5].localRotation = Quaternion.Euler(334.6968f, 13.72322f, 9.599679f);
		mabelBones[mabelToTransform][6].localRotation = Quaternion.Euler(3.1209688f, 355.5546f, 303.63458f);
		mabelBones[mabelToTransform][7].localRotation = Quaternion.Euler(359.37982f, 208.90948f, 305.92798f);
		mabelBones[mabelToTransform][8].localRotation = Quaternion.Euler(327.33673f, 185.46567f, 176.45235f);
		mabelBones[mabelToTransform][9].localRotation = Quaternion.Euler(44.73943f, 235.17944f, 213.96765f);
		mabelBones[mabelToTransform][10].localRotation = Quaternion.Euler(337.84064f, 353.22662f, 342.9142f);
		mabelBones[mabelToTransform][11].localRotation = Quaternion.Euler(29.401266f, 356.84106f, 355.70065f);
		mabelBones[mabelToTransform][12].localRotation = Quaternion.Euler(21.440294f, 6.2652574f, 356.9603f);
		mabelBones[mabelToTransform][13].localRotation = Quaternion.Euler(87.97078f, 180.02342f, 180.0234f);
		mabelBones[mabelToTransform][14].localRotation = Quaternion.Euler(315.02142f, -9.655743E-05f, 6.825087E-05f);
		mabelBones[mabelToTransform][15].localRotation = Quaternion.Euler(58.859253f, 179.99841f, 179.99858f);
		mabelBones[mabelToTransform][16].localRotation = Quaternion.Euler(289.66806f, 306.76492f, 201.24818f);
		mabelBones[mabelToTransform][17].localRotation = Quaternion.Euler(52.753235f, 359.4264f, 29.824442f);
		mabelBones[mabelToTransform][18].localRotation = Quaternion.Euler(5.628575f, 22.14081f, 353.35345f);
		mabelBones[mabelToTransform][19].localRotation = Quaternion.Euler(345.66638f, 343.97522f, 359.7445f);
		mabelBones[mabelToTransform][20].localRotation = Quaternion.Euler(289.6681f, 53.235184f, 158.75185f);
		mabelBones[mabelToTransform][21].localRotation = Quaternion.Euler(29.813198f, 337.28467f, 309.2062f);
		mabelBones[mabelToTransform][22].localRotation = Quaternion.Euler(23.293386f, 14.090822f, 358.94537f);
		mabelBones[mabelToTransform][23].localRotation = Quaternion.Euler(323.03394f, 348.47235f, 347.2814f);
		mabelBones[mabelToTransform][24].localRotation = Quaternion.Euler(357.63348f, 4.0957664E-05f, 1.1290936E-06f);
		mabelBones[mabelToTransform][25].localRotation = Quaternion.Euler(8.128601f, -2.7718724E-07f, -3.9022475E-06f);
		mabelBones[mabelToTransform][26].localRotation = Quaternion.Euler(359.11588f, 1.4551167E-05f, 5.4072797E-07f);
		mabelBones[mabelToTransform][27].localRotation = Quaternion.Euler(294.96143f, -1.8863439E-05f, 2.8531915E-05f);
		mabelBones[mabelToTransform][28].localRotation = Quaternion.Euler(270.10086f, 260.37982f, 0f);
		mabelBones[mabelToTransform][29].localRotation = Quaternion.Euler(61.45423f, 62.812504f, 11.801867f);
		mabelBones[mabelToTransform][30].localRotation = Quaternion.Euler(17.759802f, 2.9351134E-15f, -1.2222483E-17f);
		mabelBones[mabelToTransform][31].localRotation = Quaternion.Euler(4.598563f, 2.2471763E-17f, -2.2091666E-18f);
		StartTailWagLaying(mabelToTransform);
	}

	private void PoseSleeping(int mabelToTransform)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: 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_00b9: 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_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: 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_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: 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_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_035d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0385: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: 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_03fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0475: Unknown result type (might be due to invalid IL or missing references)
		//IL_049d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
		mabelBones[mabelToTransform][0].localRotation = Quaternion.Euler(333.25577f, 129.47911f, 11.290493f);
		mabelBones[mabelToTransform][1].localRotation = Quaternion.Euler(3.1209786f, 4.4456854f, 56.365433f);
		mabelBones[mabelToTransform][2].localRotation = Quaternion.Euler(339.37158f, 148.01077f, 50.255894f);
		mabelBones[mabelToTransform][3].localRotation = Quaternion.Euler(325.35873f, 219.4933f, 149.05473f);
		mabelBones[mabelToTransform][4].localRotation = Quaternion.Euler(73.65269f, 255.12549f, 219.2606f);
		mabelBones[mabelToTransform][5].localRotation = Quaternion.Euler(336.0943f, 18.059381f, 15.658356f);
		mabelBones[mabelToTransform][6].localRotation = Quaternion.Euler(3.1209688f, 355.5546f, 303.63458f);
		mabelBones[mabelToTransform][7].localRotation = Quaternion.Euler(336.07742f, 206.04381f, 310.56415f);
		mabelBones[mabelToTransform][8].localRotation = Quaternion.Euler(303.69308f, 203.37262f, 166.95901f);
		mabelBones[mabelToTransform][9].localRotation = Quaternion.Euler(71.686005f, 105.708694f, 95.61362f);
		mabelBones[mabelToTransform][10].localRotation = Quaternion.Euler(340.04678f, 2.958346f, 349.5857f);
		mabelBones[mabelToTransform][11].localRotation = Quaternion.Euler(51.690998f, 3.105255f, 10.32038f);
		mabelBones[mabelToTransform][12].localRotation = Quaternion.Euler(35.464985f, 357.97955f, 356.40466f);
		mabelBones[mabelToTransform][13].localRotation = Quaternion.Euler(87.97078f, 180.02342f, 180.0234f);
		mabelBones[mabelToTransform][14].localRotation = Quaternion.Euler(351.70013f, 4.1896443f, 4.747881f);
		mabelBones[mabelToTransform][15].localRotation = Quaternion.Euler(58.859253f, 179.99841f, 179.99858f);
		mabelBones[mabelToTransform][16].localRotation = Quaternion.Euler(358.4639f, 208.5479f, 325.71515f);
		mabelBones[mabelToTransform][17].localRotation = Quaternion.Euler(318.0152f, 162.2435f, 143.24417f);
		mabelBones[mabelToTransform][18].localRotation = Quaternion.Euler(23.63959f, -4.9624312E-05f, -0.0001852999f);
		mabelBones[mabelToTransform][19].localRotation = Quaternion.Euler(15.683508f, 347.6637f, 353.93878f);
		mabelBones[mabelToTransform][20].localRotation = Quaternion.Euler(332.47003f, 144.3116f, 51.28744f);
		mabelBones[mabelToTransform][21].localRotation = Quaternion.Euler(302.77478f, 155.6745f, 222.43324f);
		mabelBones[mabelToTransform][22].localRotation = Quaternion.Euler(84.393074f, 37.8366f, 26.441755f);
		mabelBones[mabelToTransform][23].localRotation = Quaternion.Euler(320.5011f, 15.11045f, 348.53348f);
		mabelBones[mabelToTransform][24].localRotation = Quaternion.Euler(35.436886f, 10.085943f, 359.66937f);
		mabelBones[mabelToTransform][25].localRotation = Quaternion.Euler(8.128601f, -2.7718724E-07f, -3.9022475E-06f);
		mabelBones[mabelToTransform][26].localRotation = Quaternion.Euler(359.11588f, 1.4551167E-05f, 5.4072797E-07f);
		mabelBones[mabelToTransform][27].localRotation = Quaternion.Euler(343.39624f, 342.43906f, 352.28305f);
		mabelBones[mabelToTransform][28].localRotation = Quaternion.Euler(45.22453f, 180.6039f, 166.03857f);
		mabelBones[mabelToTransform][29].localRotation = Quaternion.Euler(359.1182f, 87.17388f, 317.72626f);
		mabelBones[mabelToTransform][30].localRotation = Quaternion.Euler(0.2796675f, 337.10666f, 306.12775f);
		mabelBones[mabelToTransform][31].localRotation = Quaternion.Euler(330.37283f, 329.04764f, 328.39276f);
	}

	private void PoseSitting(int mabelToTransform)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: 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_00b9: 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_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: 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_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: 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_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_035d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0385: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: 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_03fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0475: Unknown result type (might be due to invalid IL or missing references)
		//IL_049d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
		mabelBones[mabelToTransform][0].localRotation = Quaternion.Euler(60.704338f, 335.02463f, 341.34723f);
		mabelBones[mabelToTransform][1].localRotation = Quaternion.Euler(3.1209786f, 4.4456854f, 56.365433f);
		mabelBones[mabelToTransform][2].localRotation = Quaternion.Euler(7.8021617f, 164.9378f, 44.55482f);
		mabelBones[mabelToTransform][3].localRotation = Quaternion.Euler(315.27023f, 193.11171f, 173.50316f);
		mabelBones[mabelToTransform][4].localRotation = Quaternion.Euler(77.25561f, 323.94925f, 329.14777f);
		mabelBones[mabelToTransform][5].localRotation = Quaternion.Euler(335.40265f, 359.23508f, 6.788837f);
		mabelBones[mabelToTransform][6].localRotation = Quaternion.Euler(3.120968f, 355.5546f, 303.63458f);
		mabelBones[mabelToTransform][7].localRotation = Quaternion.Euler(352.818f, 191.96672f, 317.15573f);
		mabelBones[mabelToTransform][8].localRotation = Quaternion.Euler(314.94208f, 217.37848f, 160.25224f);
		mabelBones[mabelToTransform][9].localRotation = Quaternion.Euler(75.161964f, 121.47308f, 74.16353f);
		mabelBones[mabelToTransform][10].localRotation = Quaternion.Euler(322.0849f, 357.29453f, 342.4746f);
		mabelBones[mabelToTransform][11].localRotation = Quaternion.Euler(18.673882f, 349.94006f, 4.8356986f);
		mabelBones[mabelToTransform][12].localRotation = Quaternion.Euler(7.66934f, 3.4410949f, 356.7834f);
		mabelBones[mabelToTransform][13].localRotation = Quaternion.Euler(87.97059f, 180.02342f, 180.0234f);
		mabelBones[mabelToTransform][14].localRotation = Quaternion.Euler(340.26074f, -9.6557764E-05f, 6.8251065E-05f);
		mabelBones[mabelToTransform][15].localRotation = Quaternion.Euler(58.859257f, 179.99841f, 179.99858f);
		mabelBones[mabelToTransform][16].localRotation = Quaternion.Euler(289.6681f, 306.76492f, 201.24818f);
		mabelBones[mabelToTransform][17].localRotation = Quaternion.Euler(19.499407f, 334.3408f, 26.786076f);
		mabelBones[mabelToTransform][18].localRotation = Quaternion.Euler(23.639585f, -4.9624312E-05f, -0.00018529988f);
		mabelBones[mabelToTransform][19].localRotation = Quaternion.Euler(7.575464f, 13.0273485f, 349.63495f);
		mabelBones[mabelToTransform][20].localRotation = Quaternion.Euler(289.66812f, 53.23518f, 158.75185f);
		mabelBones[mabelToTransform][21].localRotation = Quaternion.Euler(23.990896f, 34.429726f, 333.46115f);
		mabelBones[mabelToTransform][22].localRotation = Quaternion.Euler(23.63958f, 5.61523E-05f, 0.00019950987f);
		mabelBones[mabelToTransform][23].localRotation = Quaternion.Euler(5.360162f, 358.5285f, 3.332931f);
		mabelBones[mabelToTransform][24].localRotation = Quaternion.Euler(357.63348f, 4.0957664E-05f, 1.1290934E-06f);
		mabelBones[mabelToTransform][25].localRotation = Quaternion.Euler(37.79036f, 358.7982f, 12.7111025f);
		mabelBones[mabelToTransform][26].localRotation = Quaternion.Euler(16.774218f, 359.1383f, 354.23416f);
		mabelBones[mabelToTransform][27].localRotation = Quaternion.Euler(294.96143f, -1.886344E-05f, 2.8531918E-05f);
		mabelBones[mabelToTransform][28].localRotation = Quaternion.Euler(304.89563f, 126.84589f, 213.60846f);
		mabelBones[mabelToTransform][29].localRotation = Quaternion.Euler(23.653973f, 1.5278426f, 15.393756f);
		mabelBones[mabelToTransform][30].localRotation = Quaternion.Euler(34.795444f, 332.2278f, 0.42652133f);
		mabelBones[mabelToTransform][31].localRotation = Quaternion.Euler(28.697893f, 346.5803f, 349.73682f);
		StartTailWagSitting(mabelToTransform);
	}

	private void PoseStanding(int mabelToTransform)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: 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_00b9: 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_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: 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_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: 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_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_035d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0385: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: 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_03fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0475: Unknown result type (might be due to invalid IL or missing references)
		//IL_049d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
		mabelBones[mabelToTransform][0].localRotation = Quaternion.Euler(85.23194f, -1.4076705E-05f, -0.00016377385f);
		mabelBones[mabelToTransform][1].localRotation = Quaternion.Euler(3.1209786f, 4.4456854f, 56.365433f);
		mabelBones[mabelToTransform][2].localRotation = Quaternion.Euler(326.57452f, 95.50591f, 82.301f);
		mabelBones[mabelToTransform][3].localRotation = Quaternion.Euler(309.5199f, 359.71915f, 0.3281641f);
		mabelBones[mabelToTransform][4].localRotation = Quaternion.Euler(54.69404f, -0.00030330702f, -0.00058570225f);
		mabelBones[mabelToTransform][5].localRotation = Quaternion.Euler(47.206306f, -0.00019578602f, -0.0004480658f);
		mabelBones[mabelToTransform][6].localRotation = Quaternion.Euler(3.1209688f, 355.5546f, 303.63458f);
		mabelBones[mabelToTransform][7].localRotation = Quaternion.Euler(326.57452f, 264.4941f, 277.69897f);
		mabelBones[mabelToTransform][8].localRotation = Quaternion.Euler(309.5199f, 0.28084344f, 359.6718f);
		mabelBones[mabelToTransform][9].localRotation = Quaternion.Euler(54.694065f, 0.00031329607f, 0.00060501765f);
		mabelBones[mabelToTransform][10].localRotation = Quaternion.Euler(47.206306f, 0.00020223352f, 0.000462821f);
		mabelBones[mabelToTransform][11].localRotation = Quaternion.Euler(6.1483536f, 0.00015026508f, -8.189325E-11f);
		mabelBones[mabelToTransform][12].localRotation = Quaternion.Euler(355.7813f, 7.81769E-10f, -1.6325444E-12f);
		mabelBones[mabelToTransform][13].localRotation = Quaternion.Euler(87.97078f, 180.02342f, 180.0234f);
		mabelBones[mabelToTransform][14].localRotation = Quaternion.Euler(315.02142f, -9.655743E-05f, 6.825087E-05f);
		mabelBones[mabelToTransform][15].localRotation = Quaternion.Euler(84.74238f, -0.00017562282f, 2.4879216E-09f);
		mabelBones[mabelToTransform][16].localRotation = Quaternion.Euler(289.66806f, 306.76492f, 201.24818f);
		mabelBones[mabelToTransform][17].localRotation = Quaternion.Euler(326.8363f, 320.70926f, 35.50474f);
		mabelBones[mabelToTransform][18].localRotation = Quaternion.Euler(23.63959f, -4.9624312E-05f, -0.0001852999f);
		mabelBones[mabelToTransform][19].localRotation = Quaternion.Euler(43.84563f, -0.00016035534f, -0.00039843447f);
		mabelBones[mabelToTransform][20].localRotation = Quaternion.Euler(289.6681f, 53.235184f, 158.75185f);
		mabelBones[mabelToTransform][21].localRotation = Quaternion.Euler(326.8364f, 39.29078f, 324.49524f);
		mabelBones[mabelToTransform][22].localRotation = Quaternion.Euler(23.639582f, 5.61523E-05f, 0.00019950987f);
		mabelBones[mabelToTransform][23].localRotation = Quaternion.Euler(43.84563f, 0.00015725625f, 0.00042467614f);
		mabelBones[mabelToTransform][24].localRotation = Quaternion.Euler(357.63348f, 4.0957664E-05f, 1.1290936E-06f);
		mabelBones[mabelToTransform][25].localRotation = Quaternion.Euler(8.128601f, -2.7718724E-07f, -3.9022475E-06f);
		mabelBones[mabelToTransform][26].localRotation = Quaternion.Euler(37.642838f, 348.62793f, 43.37256f);
		mabelBones[mabelToTransform][27].localRotation = Quaternion.Euler(294.5568f, -1.886352E-05f, 2.8532124E-05f);
		mabelBones[mabelToTransform][28].localRotation = Quaternion.Euler(15.681303f, 180.00014f, 180f);
		mabelBones[mabelToTransform][29].localRotation = Quaternion.Euler(6.44504f, 8.069696E-10f, -6.5554927E-12f);
		mabelBones[mabelToTransform][30].localRotation = Quaternion.Euler(7.599642f, 2.935112E-15f, -1.22223165E-17f);
		mabelBones[mabelToTransform][31].localRotation = Quaternion.Euler(4.598563f, 2.2471763E-17f, -2.2091666E-18f);
		StartTailWagStanding(mabelToTransform);
	}

	public static void StartTailWagLaying(int mabelToTransform)
	{
		float[] minMax = new float[2] { 1f, 30f };
		float speed = 1f;
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][31], minMax, speed, 2, 1f));
	}

	public static void StartTailWagStanding(int mabelToTransform)
	{
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		float[][] array = new float[4][]
		{
			new float[2] { 145f, 215f },
			new float[2] { -35f, 35f },
			new float[2] { -35f, 35f },
			new float[2] { -35f, 35f }
		};
		float[] array2 = new float[4] { 180f, 330f, 350f, 350f };
		float[] array3 = new float[4] { 2f, 2f, -2f, -2f };
		mabelBones[mabelToTransform][28].localRotation = Quaternion.Euler(15.6784f, 180f, array2[0]);
		mabelBones[mabelToTransform][29].localRotation = Quaternion.Euler(6.445f, 0f, array2[1]);
		mabelBones[mabelToTransform][30].localRotation = Quaternion.Euler(7.5996f, 0f, array2[2]);
		mabelBones[mabelToTransform][31].localRotation = Quaternion.Euler(4.5986f, 0f, array2[3]);
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][28], array[0], array3[0], 2, 0f));
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][29], array[1], array3[1], 2, 0f));
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][30], array[2], array3[2], 2, 0f));
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][31], array[3], array3[3], 2, 0f));
	}

	public static void StartTailWagSitting(int mabelToTransform)
	{
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		float[][] array = new float[4][]
		{
			new float[2] { 145f, 215f },
			new float[2] { -35f, 35f },
			new float[2] { -35f, 35f },
			new float[2] { -35f, 35f }
		};
		float[] array2 = new float[4] { 180f, 330f, 350f, 350f };
		float[] array3 = new float[4] { 2f, 2f, -2f, -2f };
		mabelBones[mabelToTransform][28].localRotation = Quaternion.Euler(304.8956f, 167f, array2[0]);
		mabelBones[mabelToTransform][29].localRotation = Quaternion.Euler(6.445f, 0f, array2[1]);
		mabelBones[mabelToTransform][30].localRotation = Quaternion.Euler(7.5996f, 0f, array2[2]);
		mabelBones[mabelToTransform][31].localRotation = Quaternion.Euler(4.5986f, 0f, array2[3]);
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][28], array[0], array3[0], 2, 0f));
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][29], array[1], array3[1], 2, 0f));
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][30], array[2], array3[2], 2, 0f));
		MelonCoroutines.Start(JointWag(mabelBones[mabelToTransform][31], array[3], array3[3], 2, 0f));
	}
}
public class Preferences
{
	private const string CONFIG_FILE = "config.cfg";

	private const string USER_DATA = "UserData/MabelTheCat/";

	internal static Dictionary<MelonPreferences_Entry, object> LastSavedValues = new Dictionary<MelonPreferences_Entry, object>();

	internal static MelonPreferences_Category MabelTheCatCategory;

	internal static MelonPreferences_Entry<bool> showAllCats;

	internal static void InitPrefs()
	{
		if (!Directory.Exists("UserData/MabelTheCat/"))
		{
			Directory.CreateDirectory("UserData/MabelTheCat/");
		}
		MabelTheCatCategory = MelonPreferences.CreateCategory("MabelTheCat", "Settings");
		MabelTheCatCategory.SetFilePath(Path.Combine("UserData/MabelTheCat/", "config.cfg"));
		showAllCats = MabelTheCatCategory.CreateEntry<bool>("showAllCats", false, "Show all Cats", "Toggling ON will have all the Cats Shown.", false, false, (ValueValidator)null, (string)null);
		StoreLastSavedPrefs();
	}

	internal static void StoreLastSavedPrefs()
	{
		List<MelonPreferences_Entry> list = new List<MelonPreferences_Entry>();
		list.AddRange(MabelTheCatCategory.Entries);
		foreach (MelonPreferences_Entry item in list)
		{
			LastSavedValues[item] = item.BoxedValue;
		}
	}

	public static bool AnyPrefsChanged()
	{
		foreach (KeyValuePair<MelonPreferences_Entry, object> lastSavedValue in LastSavedValues)
		{
			if (!lastSavedValue.Key.BoxedValue.Equals(lastSavedValue.Value))
			{
				return true;
			}
		}
		return false;
	}

	public static bool IsPrefChanged(MelonPreferences_Entry entry)
	{
		if (LastSavedValues.TryGetValue(entry, out var value))
		{
			return !entry.BoxedValue.Equals(value);
		}
		return false;
	}
}