Decompiled source of DSPFreeMechaCustom v0.0.2

DSPFreeMechaCustom.dll

Decompiled 5 months 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 BepInEx.Logging;
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("DspFontPatcher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DspFontPatcher")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("81DF3045-8007-4F6A-AAF6-903139D85B6C")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
namespace DSPFreeMechaCustom;

[BepInPlugin("Appun.DSP.plugin.FreeMechaCustom", "DSPFreeMechaCustom", "0.0.1")]
[BepInProcess("DSPGAME.exe")]
[HarmonyPatch]
public class DSPFreeMechaCustom : BaseUnityPlugin
{
	public void Start()
	{
		LogManager.Logger = ((BaseUnityPlugin)this).Logger;
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(UIMechaMatsGroup), "OnApplyClick")]
	public static bool UIMechaMatsGroup_OnApplyClick_prePatch(UIMechaMatsGroup __instance)
	{
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		((BinaryData)__instance.mechaEditor.mecha.diyAppearance).CopyTo((BinaryData)(object)__instance.mechaEditor.mecha.appearance);
		__instance.mechaEditor.player.mechaArmorModel.RefreshAllPartObjects();
		__instance.mechaEditor.player.mechaArmorModel.RefreshAllBoneObjects();
		__instance.mechaEditor.mecha.appearance.NotifyAllEvents();
		__instance.mechaEditor.CalcMechaProperty();
		VFAudio.Create("ui-click-1", (Transform)null, Vector3.zero, true, 0, -1, -1L);
		UIMessageBox.Show(Localization.Translate("应用机甲窗标题"), Localization.Translate("应用机甲窗文字"), Localization.Translate("确定"), 0);
		return false;
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(UIMechaMatsGroup), "_OnUpdate")]
	public static void UIMechaMatsGroup_OnUpdate_PostPatch(UIMechaMatsGroup __instance)
	{
		__instance.applyButtonText.text = Localization.Translate("Apply Mecha Design for Free");
	}
}
public class LogManager
{
	public static ManualLogSource Logger;
}