commit
5a66306760
5 changed files with 39 additions and 10 deletions
|
|
@ -40,6 +40,7 @@ public class Core : BasePlugin
|
|||
MonoInstance = AddComponent<UnityCoroutineHelper>();
|
||||
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
|
||||
LoadConfig();
|
||||
dtStart = DateTime.Now;
|
||||
|
||||
FileLoader.LoadLanguage();
|
||||
|
||||
|
|
@ -76,19 +77,19 @@ public class Core : BasePlugin
|
|||
dtStartToast = DateTime.Now;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
public void OnUpdate()
|
||||
{
|
||||
#if DEBUG
|
||||
ModFeatures.OnLateUpdate();
|
||||
#endif
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Insert))
|
||||
{
|
||||
Log.LogInfo("Insert press");
|
||||
Utils.OpenSaveDirectory();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Delete))
|
||||
{
|
||||
Log.LogInfo("del del");
|
||||
Utils.OpenTrello();
|
||||
}
|
||||
if (TowerManager.Instance != null)
|
||||
|
|
@ -101,8 +102,16 @@ public class Core : BasePlugin
|
|||
{
|
||||
#if DEBUG
|
||||
if (dtStartToast != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
GUI.Button(new Rect(10f, 10f, 200f, 20f), "\n" + toast_txt + "\n");
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.LogError(e);
|
||||
}
|
||||
|
||||
TimeSpan? timeSpan = DateTime.Now - dtStartToast;
|
||||
TimeSpan t = new TimeSpan(0, 0, 2);
|
||||
if (timeSpan > t)
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ namespace PvZ_Fusion_Translator__BepInEx_
|
|||
{
|
||||
if (Input.GetKeyDown(feature.KeyCode))
|
||||
{
|
||||
Log.LogDebug(feature.KeyCode);
|
||||
feature.ToggleFeature();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
18
BepInEx/Patches/Managers/GameAPP_Patch.cs
Normal file
18
BepInEx/Patches/Managers/GameAPP_Patch.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using HarmonyLib;
|
||||
using System;
|
||||
using PvZ_Fusion_Translator__BepInEx_.AssetStore;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers
|
||||
{
|
||||
[HarmonyPatch(typeof(GameAPP))]
|
||||
public class GameAPP_Patch
|
||||
{
|
||||
[HarmonyPatch(nameof(GameAPP.Update))]
|
||||
[HarmonyPostfix]
|
||||
private static void Update(GameAPP __instance)
|
||||
{
|
||||
Core.Instance.OnUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
https://nuget.samboy.dev/v3/index.json
|
||||
</RestoreAdditionalProjectSources>
|
||||
<RootNamespace>PvZ_Fusion_Translator__BepInEx_</RootNamespace>
|
||||
<GamePath>D:\PvZ Fusion\BepInEx Game Files</GamePath>
|
||||
<GamePath>C:\Users\rainb\Desktop\PC_PVZ-Fusion_2.8.2-BepInEx</GamePath>
|
||||
<Configurations>Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate;DebugMulti</Configurations>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
|
@ -165,6 +165,7 @@
|
|||
<Compile Include="Patches\Managers\SaveMenu_Patch.cs" />
|
||||
<Compile Include="Patches\GameObjects\TravelBuffOptionButton_Patch.cs" />
|
||||
<Compile Include="Patches\Managers\TowerManager_Patch.cs" />
|
||||
<Compile Include="Patches\Managers\GameAPP_Patch.cs" />
|
||||
<Compile Include="Patches\OtherManagers\AchievementClip_Patch.cs" />
|
||||
<Compile Include="Patches\GameObjects\ButtonObjects\Advanture_Btn_Patch.cs" />
|
||||
<Compile Include="Patches\Managers\AlmanacMgrZombie_Patch.cs" />
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Configurations>Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate</Configurations>
|
||||
<GamePath>C:\Users\rainb\Desktop\PC_PVZ-Fusion-2.8.1</GamePath>
|
||||
<GamePath>C:\Users\rainb\Desktop\PC_PVZ-Fusion_2.8.2</GamePath>
|
||||
<Platforms>AnyCPU;ARM64;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue