BepInEx Fixes
This commit is contained in:
parent
f1cbb7f43b
commit
f55d5f3e73
6 changed files with 89 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.2</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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||||
README.md = README.md
|
README.md = README.md
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PvZ Fusion Translator [BepInEx]", "BepInEx\PvZ Fusion Translator [BepInEx].csproj", "{395E60A0-A884-61F2-EF18-BC94BB7D9C69}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|
@ -86,6 +88,54 @@ Global
|
||||||
{90AA30F8-EFE7-6E1A-3859-0EE79252222A}.ReleaseOther|ARM64.Build.0 = ReleaseOther|ARM64
|
{90AA30F8-EFE7-6E1A-3859-0EE79252222A}.ReleaseOther|ARM64.Build.0 = ReleaseOther|ARM64
|
||||||
{90AA30F8-EFE7-6E1A-3859-0EE79252222A}.ReleaseOther|x64.ActiveCfg = ReleaseOther|x64
|
{90AA30F8-EFE7-6E1A-3859-0EE79252222A}.ReleaseOther|x64.ActiveCfg = ReleaseOther|x64
|
||||||
{90AA30F8-EFE7-6E1A-3859-0EE79252222A}.ReleaseOther|x64.Build.0 = ReleaseOther|x64
|
{90AA30F8-EFE7-6E1A-3859-0EE79252222A}.ReleaseOther|x64.Build.0 = ReleaseOther|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|ARM64.Build.0 = Debug|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|Any CPU.ActiveCfg = DebugEnglish|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|Any CPU.Build.0 = DebugEnglish|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|ARM64.ActiveCfg = DebugEnglish|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|ARM64.Build.0 = DebugEnglish|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|x64.ActiveCfg = DebugEnglish|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|x64.Build.0 = DebugEnglish|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|Any CPU.ActiveCfg = DebugObfuscate|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|Any CPU.Build.0 = DebugObfuscate|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|ARM64.ActiveCfg = DebugObfuscate|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|ARM64.Build.0 = DebugObfuscate|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|x64.ActiveCfg = DebugObfuscate|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|x64.Build.0 = DebugObfuscate|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|Any CPU.ActiveCfg = DebugTesting|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|Any CPU.Build.0 = DebugTesting|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|ARM64.ActiveCfg = DebugTesting|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|ARM64.Build.0 = DebugTesting|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|x64.ActiveCfg = DebugTesting|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|x64.Build.0 = DebugTesting|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|Any CPU.ActiveCfg = ReleaseEnglish|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|Any CPU.Build.0 = ReleaseEnglish|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|ARM64.ActiveCfg = ReleaseEnglish|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|ARM64.Build.0 = ReleaseEnglish|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|x64.ActiveCfg = ReleaseEnglish|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|x64.Build.0 = ReleaseEnglish|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|Any CPU.ActiveCfg = ReleaseMulti|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|Any CPU.Build.0 = ReleaseMulti|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|ARM64.ActiveCfg = ReleaseMulti|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|ARM64.Build.0 = ReleaseMulti|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|x64.ActiveCfg = ReleaseMulti|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|x64.Build.0 = ReleaseMulti|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|Any CPU.ActiveCfg = ReleaseObfuscate|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|Any CPU.Build.0 = ReleaseObfuscate|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|ARM64.ActiveCfg = ReleaseObfuscate|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|ARM64.Build.0 = ReleaseObfuscate|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|x64.ActiveCfg = ReleaseObfuscate|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|x64.Build.0 = ReleaseObfuscate|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|Any CPU.ActiveCfg = ReleaseOther|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|Any CPU.Build.0 = ReleaseOther|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|ARM64.ActiveCfg = ReleaseOther|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|ARM64.Build.0 = ReleaseOther|Any CPU
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|x64.ActiveCfg = ReleaseOther|x64
|
||||||
|
{395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|x64.Build.0 = ReleaseOther|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue