Decompiled source of Malkovitch v1.0.0

Malkovitch.dll

Decompiled 10 hours ago
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 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("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = "")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Malkovitch;

[BepInPlugin("Tchernobill.Malkovitch", "Malkovitch", "1.0.0")]
public class MalkovitchPlugin : BaseUnityPlugin
{
	[HarmonyPatch(typeof(DialogueAssetsManager), "GetAssetRequest")]
	public class DialogueAssetsManager_GetAssetRequest
	{
		private unsafe static bool Prefix(ref DialogueAssetsManager __instance, ref bool __result, string _diagDataKey, bool _keyIsTagString, DLCs _dlc, out AssetBundleRequest _assetRequest)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			_assetRequest = null;
			string key = $"{__instance.m_lastLoadedLanguage}{(((int)_dlc == 0) ? string.Empty : ((object)(*(DLCs*)(&_dlc))/*cast due to .constrained prefix*/).ToString())}";
			_diagDataKey = "Yzan_beach_08";
			if (__instance.m_loadedBundleData.TryGetValue(key, out var value) && (Object)(object)value.DiagData != (Object)null && ((DictionaryExt<string, FilenameList>)(object)value.DiagData.DataDict).ContainsKey(_diagDataKey))
			{
				_assetRequest = value.DialogueAssets.LoadAssetAsync<AudioClip>(((DictionaryExt<string, FilenameList>)(object)value.DiagData.DataDict)[_diagDataKey].Filenames[0]);
				__result = true;
				return false;
			}
			__result = false;
			return true;
		}
	}

	public const string Malkovitch = "Yzan_beach_08";

	public const string GUID = "Tchernobill.Malkovitch";

	public const string NAME = "Malkovitch";

	public const string VERSION = "1.0.0";

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("Tchernobill.Malkovitch");
		val.PatchAll();
	}
}