commit
5a66306760
5 changed files with 39 additions and 10 deletions
|
|
@ -40,8 +40,9 @@ public class Core : BasePlugin
|
||||||
MonoInstance = AddComponent<UnityCoroutineHelper>();
|
MonoInstance = AddComponent<UnityCoroutineHelper>();
|
||||||
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
|
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
|
dtStart = DateTime.Now;
|
||||||
|
|
||||||
FileLoader.LoadLanguage();
|
FileLoader.LoadLanguage();
|
||||||
|
|
||||||
AudioStore.Init();
|
AudioStore.Init();
|
||||||
TextureStore.Init();
|
TextureStore.Init();
|
||||||
|
|
@ -76,34 +77,42 @@ public class Core : BasePlugin
|
||||||
dtStartToast = DateTime.Now;
|
dtStartToast = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update()
|
public void OnUpdate()
|
||||||
{
|
{
|
||||||
#if DEBUG
|
|
||||||
ModFeatures.OnLateUpdate();
|
ModFeatures.OnLateUpdate();
|
||||||
#endif
|
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Insert))
|
if (Input.GetKeyDown(KeyCode.Insert))
|
||||||
{
|
{
|
||||||
|
Log.LogInfo("Insert press");
|
||||||
Utils.OpenSaveDirectory();
|
Utils.OpenSaveDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Delete))
|
if (Input.GetKeyDown(KeyCode.Delete))
|
||||||
{
|
{
|
||||||
|
Log.LogInfo("del del");
|
||||||
Utils.OpenTrello();
|
Utils.OpenTrello();
|
||||||
}
|
}
|
||||||
if (TowerManager.Instance != null)
|
if (TowerManager.Instance != null)
|
||||||
{
|
{
|
||||||
TowerManager_Patch.UpdateText();
|
TowerManager_Patch.UpdateText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnGUI()
|
public void OnGUI()
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (dtStartToast != null)
|
if (dtStartToast != null)
|
||||||
{
|
{
|
||||||
GUI.Button(new Rect(10f, 10f, 200f, 20f), "\n" + toast_txt + "\n");
|
try
|
||||||
TimeSpan? timeSpan = DateTime.Now - dtStartToast;
|
{
|
||||||
|
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);
|
TimeSpan t = new TimeSpan(0, 0, 2);
|
||||||
if (timeSpan > t)
|
if (timeSpan > t)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ namespace PvZ_Fusion_Translator__BepInEx_
|
||||||
{
|
{
|
||||||
if (Input.GetKeyDown(feature.KeyCode))
|
if (Input.GetKeyDown(feature.KeyCode))
|
||||||
{
|
{
|
||||||
|
Log.LogDebug(feature.KeyCode);
|
||||||
feature.ToggleFeature();
|
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
|
https://nuget.samboy.dev/v3/index.json
|
||||||
</RestoreAdditionalProjectSources>
|
</RestoreAdditionalProjectSources>
|
||||||
<RootNamespace>PvZ_Fusion_Translator__BepInEx_</RootNamespace>
|
<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>
|
<Configurations>Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate;DebugMulti</Configurations>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
@ -165,6 +165,7 @@
|
||||||
<Compile Include="Patches\Managers\SaveMenu_Patch.cs" />
|
<Compile Include="Patches\Managers\SaveMenu_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\TravelBuffOptionButton_Patch.cs" />
|
<Compile Include="Patches\GameObjects\TravelBuffOptionButton_Patch.cs" />
|
||||||
<Compile Include="Patches\Managers\TowerManager_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\OtherManagers\AchievementClip_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\ButtonObjects\Advanture_Btn_Patch.cs" />
|
<Compile Include="Patches\GameObjects\ButtonObjects\Advanture_Btn_Patch.cs" />
|
||||||
<Compile Include="Patches\Managers\AlmanacMgrZombie_Patch.cs" />
|
<Compile Include="Patches\Managers\AlmanacMgrZombie_Patch.cs" />
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Configurations>Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate</Configurations>
|
<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>
|
<Platforms>AnyCPU;ARM64;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue