Decompiled source of lobbysettingsunlocked v1.0.0

lobbysettingsunlocked.dll

Decompiled 7 months ago
using System;
using System.Diagnostics;
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 BepInEx.Logging;
using HarmonyLib;
using LLGUI;
using LLScreen;
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("lobbysettingsunlocked")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("lobbysettingsunlocked")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("664de4af-aa69-4f3a-9e6b-dd07c879adf5")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.0")]
[module: UnverifiableCode]
namespace lobbysettingsunlocked;

[BepInPlugin("us.wallace.plugins.llb.lobbysettingsunlocked", "lobbysettingsunlocked Plug-In", "1.0.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInProcess("LLBlaze.exe")]
public class Plugin : BaseUnityPlugin
{
	public static ManualLogSource Log { get; private set; }

	private void Awake()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		Log = ((BaseUnityPlugin)this).Logger;
		((BaseUnityPlugin)this).Logger.LogDebug((object)"Patching effects settings...");
		Harmony val = new Harmony("us.wallace.plugins.llb.lobbysettingsunlocked");
		val.PatchAll(typeof(ScreenPlayersSettingsOnOpenPatch));
		val.PatchAll(typeof(ScreenPlayersSettingsUpdateBallTypenPatch));
		((BaseUnityPlugin)this).Logger.LogDebug((object)"lobbysettingsunlocked is loaded");
	}

	private void Start()
	{
	}

	private void FixedUpdate()
	{
	}
}
internal class ScreenPlayersSettingsOnOpenPatch
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static ControlDelegate <>9__0_17;

		public static ControlDelegate <>9__0_18;

		internal void <OnOpen_Prefix>b__0_17(int playerNr)
		{
			DNPFJHMAIBP.GKBNNFEAJGO((Msg)59, playerNr, -1);
		}

		internal void <OnOpen_Prefix>b__0_18(int playerNr)
		{
			DNPFJHMAIBP.GKBNNFEAJGO((Msg)2, playerNr, -1);
		}
	}

	[HarmonyPatch(typeof(ScreenPlayersSettings), "OnOpen")]
	[HarmonyPrefix]
	public static bool OnOpen_Prefix(ScreenPlayersSettings __instance)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected I4, but got Unknown
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Invalid comparison between Unknown and I4
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Expected O, but got Unknown
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Expected O, but got Unknown
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Expected O, but got Unknown
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Expected O, but got Unknown
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Expected O, but got Unknown
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Expected O, but got Unknown
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Expected O, but got Unknown
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: Expected O, but got Unknown
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Expected O, but got Unknown
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0225: Expected O, but got Unknown
		//IL_0253: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Expected O, but got Unknown
		//IL_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Expected O, but got Unknown
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Expected O, but got Unknown
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Expected O, but got Unknown
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Expected O, but got Unknown
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Expected O, but got Unknown
		//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: Expected O, but got Unknown
		//IL_0324: Unknown result type (might be due to invalid IL or missing references)
		//IL_0329: Unknown result type (might be due to invalid IL or missing references)
		//IL_032f: Expected O, but got Unknown
		//IL_0383: 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_038a: Unknown result type (might be due to invalid IL or missing references)
		//IL_038c: Unknown result type (might be due to invalid IL or missing references)
		//IL_038d: Unknown result type (might be due to invalid IL or missing references)
		//IL_038f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0394: Unknown result type (might be due to invalid IL or missing references)
		//IL_0396: Unknown result type (might be due to invalid IL or missing references)
		//IL_0353: Unknown result type (might be due to invalid IL or missing references)
		//IL_0358: Unknown result type (might be due to invalid IL or missing references)
		//IL_035e: Expected O, but got Unknown
		bool flag = true;
		bool flag2 = true;
		bool flag3 = true;
		bool flag4 = true;
		GameMode pNJOKAICMNN = ScreenPlayersSettings.curGameSettings.PNJOKAICMNN;
		GameMode val = pNJOKAICMNN;
		GameMode val2 = val;
		switch (val2 - 2)
		{
		case 0:
			flag = true;
			flag2 = true;
			flag3 = true;
			flag4 = true;
			break;
		case 2:
			flag = true;
			flag2 = true;
			flag3 = true;
			flag4 = true;
			break;
		case 3:
			flag = true;
			flag2 = true;
			flag3 = true;
			flag4 = true;
			break;
		default:
			if ((int)pNJOKAICMNN == 100)
			{
				flag = true;
				flag2 = true;
				flag3 = true;
				flag4 = true;
			}
			break;
		}
		__instance.btStocks.SetEnabled(flag);
		__instance.btTime.SetEnabled(flag);
		if (flag)
		{
			((LLClickable)__instance.btStocks).onClick = (ControlDelegate)delegate
			{
				__instance.BtStocksClick();
			};
			__instance.btStocks.onChange = (ControlIntDelegate)delegate(int playerNr, int delta)
			{
				__instance.BtStocksChange(delta);
			};
			((LLClickable)__instance.btTime).onClick = (ControlDelegate)delegate
			{
				__instance.BtTimeClick();
			};
			__instance.btTime.onChange = (ControlIntDelegate)delegate(int playerNr, int delta)
			{
				__instance.BtTimeChange(delta);
			};
		}
		__instance.btHpFactor.SetEnabled(flag2);
		if (flag2)
		{
			((LLClickable)__instance.btHpFactor).onClick = (ControlDelegate)delegate
			{
				__instance.BtHpFactorClick();
			};
			__instance.btHpFactor.onChange = (ControlIntDelegate)delegate(int playerNr, int delta)
			{
				__instance.BtHpFactorChange(delta);
			};
		}
		if (JOMBNFKIHIC.ALEJJFPNIDP)
		{
			flag3 = true;
		}
		__instance.btPowerupSelection.SetEnabled(flag3);
		if (flag3)
		{
			((LLClickable)__instance.btPowerupSelection).onClick = (ControlDelegate)delegate
			{
				__instance.BtPowerupSelectionClick();
			};
			__instance.btPowerupSelection.onChange = (ControlIntDelegate)delegate(int playerNr, int delta)
			{
				__instance.BtPowerupSelectionChange(delta);
			};
		}
		__instance.btBallType.SetEnabled(flag4);
		if (flag4)
		{
			((LLClickable)__instance.btBallType).onClick = (ControlDelegate)delegate
			{
				__instance.BtBallTypeClick(1);
			};
			__instance.btBallType.onChange = (ControlIntDelegate)delegate(int playerNr, int delta)
			{
				__instance.BtBallTypeChange(delta);
			};
		}
		else
		{
			((Component)__instance.btBallType).gameObject.SetActive(false);
		}
		__instance.btSpeed.onChange = (ControlIntDelegate)delegate(int playerNr, int delta)
		{
			__instance.BtSpeedChange(delta);
		};
		((LLClickable)__instance.btSpeed).onClick = (ControlDelegate)delegate
		{
			__instance.BtSpeedClick();
		};
		__instance.btEnergy.onChange = (ControlIntDelegate)delegate(int playerNr, int delta)
		{
			__instance.BtEnergyChange(delta, 1);
		};
		((LLClickable)__instance.btEnergy).onClick = (ControlDelegate)delegate
		{
			__instance.BtEnergyClick();
		};
		((LLClickable)__instance.btTag).onClick = (ControlDelegate)delegate
		{
			__instance.ChangeSetting((GameSetting)7, !ScreenPlayersSettings.curGameSettings.FILHOMMPHJK());
		};
		((LLClickable)__instance.btPowerupSelection).onClick = (ControlDelegate)delegate
		{
			__instance.BtPowerupSelectionClick();
		};
		__instance.btPowerupSelection.onChange = (ControlIntDelegate)delegate(int playerNr, int delta)
		{
			__instance.BtPowerupSelectionChange(delta);
		};
		PlayersSettingsBar btReset = __instance.btReset;
		object obj = <>c.<>9__0_17;
		if (obj == null)
		{
			ControlDelegate val3 = delegate(int playerNr)
			{
				DNPFJHMAIBP.GKBNNFEAJGO((Msg)59, playerNr, -1);
			};
			<>c.<>9__0_17 = val3;
			obj = (object)val3;
		}
		((LLClickable)btReset).onClick = (ControlDelegate)obj;
		PlayersSettingsBar btBack = __instance.btBack;
		object obj2 = <>c.<>9__0_18;
		if (obj2 == null)
		{
			ControlDelegate val4 = delegate(int playerNr)
			{
				DNPFJHMAIBP.GKBNNFEAJGO((Msg)2, playerNr, -1);
			};
			<>c.<>9__0_18 = val4;
			obj2 = (object)val4;
		}
		((LLClickable)btBack).onClick = (ControlDelegate)obj2;
		__instance.UpdateSettingTexts();
		ScreenPlayersSettings obj3 = __instance;
		ScreenPlayersSettings obj4 = __instance;
		ScreenPlayersSettings obj5 = __instance;
		Msg msgMenu = (Msg)2;
		((ScreenBase)obj5).msgCancel = (Msg)2;
		((ScreenBase)obj3).msgEsc = (((ScreenBase)obj4).msgMenu = msgMenu);
		return false;
	}
}
internal class ScreenPlayersSettingsUpdateBallTypenPatch
{
	[HarmonyPatch(typeof(ScreenPlayersSettings), "UpdateBallType")]
	[HarmonyPrefix]
	public static bool UpdateBallType_Prefix(ScreenPlayersSettings __instance, BallType ballType)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Invalid comparison between Unknown and I4
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Invalid comparison between Unknown and I4
		__instance.btSpeed.SetEnabled((int)ballType != 4);
		__instance.btPowerupSelection.SetEnabled((int)ballType != 4);
		return false;
	}
}