VeryVeryValet-Val8.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = "")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("VeryVeryValet-Val8")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+89c9a83e1d15e14d0705f7503ef5c32fadf779d1")]
[assembly: AssemblyProduct("VeryVeryValet-Val8")]
[assembly: AssemblyTitle("VeryVeryValet-Val8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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;
		}
	}
}
namespace TemplatePlugin
{
	internal static class TemplatePluginInfo
	{
		public const string PLUGIN_GUID = "very_very_valet_val8";

		public const string PLUGIN_NAME = "Val8";

		public const string GAME_NAME = "Very Very Valet";
	}
}
namespace VeryVeryValet_Val8
{
	[BepInPlugin("very_very_valet_val8", "Val8", "1.0.0")]
	public class PluginMain : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(ScreenUI_Title), "OnPlay")]
		private static class ScreenUI_Title_Patch
		{
			private static void Postfix(DefaultButtonUi button, string name)
			{
				PlayerMgr.ActiveMaxPlayerCount = 8;
			}
		}

		[HarmonyPatch(typeof(ResultsVoteUi), "Init")]
		private static class ResultsVoteUi_Patch
		{
			private static void Prefix(ResultsVoteUi __instance, ref List<int> playerIds)
			{
				if (playerIds.Count > 4)
				{
					playerIds.RemoveRange(4, playerIds.Count - 4);
				}
				__instance._playerFlowCount = Math.Min(playerIds.Count, 4);
			}
		}

		[HarmonyPatch(typeof(ScreenUI_Results), "_setWin")]
		private static class ScreenUI_Results_Patch
		{
			private static void Postfix(ScreenUI_Results __instance, LevelData levelData, int strikeCount, bool isStrikes, string topKey, string bottomKey, Transform[] photoHandles, Dictionary<int, TitleData> playersToTitles, LevelController levelController, PlayerMgr playerMgr, SaveLevelResult saveResult)
			{
				int count = __instance._valetFacesUis.Count;
				if (count > 4)
				{
					for (int i = 4; i < count; i++)
					{
						Object.Destroy((Object)(object)__instance._valetFacesUis[i]);
					}
					__instance._valetFacesUis.RemoveRange(4, count - 4);
				}
			}
		}

		public const string GameName = "Very Very Valet";

		private const string Version = "1.0.0";

		private readonly Harmony _harmony = new Harmony("very_very_valet_val8");

		public static ManualLogSource? logger;

		private void Awake()
		{
			logger = ((BaseUnityPlugin)this).Logger;
			_harmony.PatchAll();
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			SceneManager.sceneLoaded += delegate
			{
			};
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}