Update for bepinex

This commit is contained in:
Chomp 2022-03-07 17:17:53 +00:00
parent 040ee3f9e2
commit 41cb23d0a0
9 changed files with 21 additions and 10 deletions

View File

@ -1,16 +1,18 @@
using EFT; using BepInEx;
using EFT;
using EFT.UI; using EFT.UI;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using UnityEngine; using UnityEngine;
namespace astealz.BotMonitor namespace astealz.BotMonitor
{ {
class Module [BepInPlugin("astealz.BotMonitor", "astealz.BotMonitor", "1.1.0")]
public class BotMonitorPlugin : BaseUnityPlugin
{ {
internal const string Name = "BotMonitor"; internal const string Name = "BotMonitor";
private static float timer = 0f; private static float timer = 0f;
static void Main() public void Awake()
{ {
StaticManager.Instance.StaticUpdate += Instance_StaticUpdate; StaticManager.Instance.StaticUpdate += Instance_StaticUpdate;
} }
@ -56,7 +58,7 @@ namespace astealz.BotMonitor
return; return;
} }
var botCounter = Extensions.GetOrAddComponent<BotMonitor>(Globals.GameWorldObject); var botCounter = Extensions.GetOrAddComponent<BotMonitor>(Globals.GameWorldObject);
botCounter.SetMode(value); botCounter.SetMode(value);
botCounter.enabled = value != 0; botCounter.enabled = value != 0;
} }

View File

@ -181,6 +181,8 @@ namespace astealz.BotMonitor
return "followerTagilla"; return "followerTagilla";
case WildSpawnType.followerTest: case WildSpawnType.followerTest:
return "followerTest"; return "followerTest";
case WildSpawnType.exUsec:
return "exUsec";
} }
return wildSpawnType.ToString(); return wildSpawnType.ToString();
} }

View File

@ -45,11 +45,11 @@ namespace astealz.BotMonitor
{ {
_console = consoleScreen; _console = consoleScreen;
AddLog($"{Module.Name}: Console initialized", Color.green); AddLog($"{BotMonitorPlugin.Name}: Console initialized", Color.green);
AddCommand($"{Module.Name.ToLower()}-help", ShowHelp); AddCommand($"{BotMonitorPlugin.Name.ToLower()}-help", ShowHelp);
AddLog($"type '{Module.Name.ToLower()}-help' to see available commands", Color.green); AddLog($"type '{BotMonitorPlugin.Name.ToLower()}-help' to see available commands", Color.green);
} }
private static void ShowHelp(Match obj) private static void ShowHelp(Match obj)

View File

@ -6,13 +6,13 @@ namespace astealz.BotMonitor
{ {
public static void Info(string msg) public static void Info(string msg)
{ {
var s = $"{Module.Name}: {msg}"; var s = $"{BotMonitorPlugin.Name}: {msg}";
GameConsole.AddLog(s); GameConsole.AddLog(s);
} }
public static void Error(string msg) public static void Error(string msg)
{ {
var s = $"{Module.Name}: {msg}"; var s = $"{BotMonitorPlugin.Name}: {msg}";
GameConsole.AddLog(s, Color.red); GameConsole.AddLog(s, Color.red);
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -47,6 +47,9 @@
<HintPath>References\Assembly-CSharp.dll</HintPath> <HintPath>References\Assembly-CSharp.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="BepInEx, Version=5.4.17.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\BepInEx.BaseLib.5.4.17\lib\net35\BepInEx.dll</HintPath>
</Reference>
<Reference Include="Comfort"> <Reference Include="Comfort">
<HintPath>References\Comfort.dll</HintPath> <HintPath>References\Comfort.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@ -55,6 +58,9 @@
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="UnityEngine">
<HintPath>References\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>References\UnityEngine.CoreModule.dll</HintPath> <HintPath>References\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@ -75,10 +81,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BotMonitor.cs" /> <Compile Include="BotMonitor.cs" />
<Compile Include="BotMonitorPlugin.cs" />
<Compile Include="Extensions.cs" /> <Compile Include="Extensions.cs" />
<Compile Include="GenericPatch`.cs" /> <Compile Include="GenericPatch`.cs" />
<Compile Include="Logger.cs" /> <Compile Include="Logger.cs" />
<Compile Include="Module.cs" />
<Compile Include="GameConsole.cs" /> <Compile Include="GameConsole.cs" />
<Compile Include="Globals.cs" /> <Compile Include="Globals.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="BepInEx.BaseLib" version="5.4.17" targetFramework="net472" />
<package id="Lib.Harmony" version="2.1.1" targetFramework="net472" /> <package id="Lib.Harmony" version="2.1.1" targetFramework="net472" />
</packages> </packages>