diff --git a/Live/CWX_DebuggingTool/.gitattributes b/Live/CWX_DebuggingTool/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/Live/CWX_DebuggingTool/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/Live/CWX_DebuggingTool/.gitignore b/Live/CWX_DebuggingTool/.gitignore new file mode 100644 index 0000000..c0f0c51 --- /dev/null +++ b/Live/CWX_DebuggingTool/.gitignore @@ -0,0 +1,364 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ +[Pp]ackage/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/Live/CWX_DebuggingTool/BotmonClass.cs b/Live/CWX_DebuggingTool/BotmonClass.cs index 09eb257..6e07386 100644 --- a/Live/CWX_DebuggingTool/BotmonClass.cs +++ b/Live/CWX_DebuggingTool/BotmonClass.cs @@ -10,10 +10,8 @@ using CWX_DebuggingTool.Models; namespace CWX_DebuggingTool { - public sealed class BotmonClass : MonoBehaviour, IDisposable + public sealed class BotmonClass : MonoBehaviour { - private static BotmonClass _instance; - private GUIContent _guiContent; private GUIStyle _textStyle; private Player _player; @@ -29,35 +27,14 @@ namespace CWX_DebuggingTool private BotmonClass() { + } - public int Mode { get; set; } - - public static BotmonClass Instance - { - get - { - if (_instance == null) - { - _instance = new BotmonClass(); - } - - return _instance; - } - } - - public void Dispose() - { - var gameWorld = Singleton.Instance; - - var gameobj = gameWorld.GetComponent(); - Destroy(gameobj); - _instance = null; - GC.SuppressFinalize(this); - } + public BotMonitorMode Mode { get; set; } ~BotmonClass() { + ConsoleScreen.Log("BotMonitor Disabled on game end"); } public void Awake() @@ -84,7 +61,7 @@ namespace CWX_DebuggingTool } // Add existing Bots to list - if (_gameWorld.RegisteredPlayers.Count > 1) + if (_gameWorld.AllAlivePlayersList.Count > 1) { foreach (var player in _gameWorld.AllAlivePlayersList) { @@ -102,17 +79,25 @@ namespace CWX_DebuggingTool _botGame.BotsController.BotSpawner.OnBotCreated += owner => { var player = owner.GetPlayer; - _zoneAndPlayers[player.AIData.BotOwner.BotsGroup.BotZone.NameZone].Add(player); + _zoneAndPlayers[owner.BotsGroup.BotZone.NameZone].Add(player); _playerRoleAndDiff.Add(player.ProfileId, GetBotRoleAndDiffClass(player.Profile.Info)); }; + + // Sub to event to gget and remove Bot when they despawn + _botGame.BotsController.BotSpawner.OnBotRemoved += owner => + { + var player = owner.GetPlayer; + _zoneAndPlayers[owner.BotsGroup.BotZone.NameZone].Remove(player); + _playerRoleAndDiff.Remove(player.ProfileId); + }; } public BotRoleAndDiffClass GetBotRoleAndDiffClass(InfoClass info) { - var settings = info.GetType().GetField("Settings", BindingFlags.Public | BindingFlags.Instance)?.GetValue(info); + var settings = info.GetType().GetField("Settings", BindingFlags.Public | BindingFlags.Instance).GetValue(info); - var role = settings.GetType().GetField("Role", BindingFlags.Instance | BindingFlags.Public)?.GetValue(settings).ToString(); - var diff = settings.GetType().GetField("BotDifficulty", BindingFlags.Instance | BindingFlags.Public)?.GetValue(settings).ToString(); + var role = settings.GetType().GetField("Role", BindingFlags.Instance | BindingFlags.Public).GetValue(settings).ToString(); + var diff = settings.GetType().GetField("BotDifficulty", BindingFlags.Instance | BindingFlags.Public).GetValue(settings).ToString(); return new BotRoleAndDiffClass(string.IsNullOrEmpty(role) ? "" : role, string.IsNullOrEmpty(diff) ? "" : diff); } @@ -134,26 +119,26 @@ namespace CWX_DebuggingTool _guiContent = new GUIContent(); } - // If Mode Greater than or equal to 1 show total - if (Mode >= 1) + // If Mode Greater than or equal to Total show total + if (Mode >= BotMonitorMode.Total) { _content = string.Empty; _content += $"Total = {_gameWorld.AllAlivePlayersList.Count - 1}\n"; } - // If Mode Greater than or equal to 2 show total for each zone - if (Mode >= 2 && _zoneAndPlayers != null) + // If Mode Greater than or equal to PerZoneTotal show total for each zone + if (Mode >= BotMonitorMode.PerZoneTotal && _zoneAndPlayers != null) { foreach (var zone in _zoneAndPlayers) { - if (_zoneAndPlayers[zone.Key].FindAll(x => x != null && x.HealthController != null && x.HealthController.IsAlive).Count <= 0) continue; + if (_zoneAndPlayers[zone.Key].FindAll(x => x.HealthController.IsAlive).Count <= 0) continue; - _content += $"{zone.Key} = {_zoneAndPlayers[zone.Key].FindAll(x => x != null && x.HealthController != null && x.HealthController.IsAlive).Count}\n"; + _content += $"{zone.Key} = {_zoneAndPlayers[zone.Key].FindAll(x => x.HealthController.IsAlive).Count}\n"; - // If Mode Greater than or equal to 3 show Bots individually also - if (Mode < 3) continue; + // If Mode Greater than or equal to FullList show Bots individually also + if (Mode < BotMonitorMode.FullList) continue; - foreach (var player in _zoneAndPlayers[zone.Key].Where(player => player != null && player.HealthController != null && player.HealthController.IsAlive)) + foreach (var player in _zoneAndPlayers[zone.Key].Where(player => player.HealthController.IsAlive)) { _distance = Vector3.Distance(player.Position, _player.Position); _content += $"> [{_distance:n2}m] [{_playerRoleAndDiff.First(x => x.Key == player.ProfileId).Value.Role}] " + @@ -161,7 +146,7 @@ namespace CWX_DebuggingTool } } } - + _guiContent.text = _content; _guiSize = _textStyle.CalcSize(_guiContent); diff --git a/Live/CWX_DebuggingTool/CWX_DebuggingTool 1.1.0/BepInEx/plugins/CWX_DebuggingTool.dll b/Live/CWX_DebuggingTool/CWX_DebuggingTool 1.1.0/BepInEx/plugins/CWX_DebuggingTool.dll deleted file mode 100644 index 5f1755d..0000000 Binary files a/Live/CWX_DebuggingTool/CWX_DebuggingTool 1.1.0/BepInEx/plugins/CWX_DebuggingTool.dll and /dev/null differ diff --git a/Live/CWX_DebuggingTool/CWX_DebuggingTool.csproj b/Live/CWX_DebuggingTool/CWX_DebuggingTool.csproj index df75912..013ec13 100644 --- a/Live/CWX_DebuggingTool/CWX_DebuggingTool.csproj +++ b/Live/CWX_DebuggingTool/CWX_DebuggingTool.csproj @@ -2,39 +2,45 @@ net472 + + 2.2.0.0 - ..\..\..\Shared\Aki.Common.dll + ..\..\EscapeFromTarkov_Data\Managed\Aki.Common.dll - ..\..\..\Shared\Aki.Reflection.dll + ..\..\EscapeFromTarkov_Data\Managed\Aki.Reflection.dll - ..\..\..\Shared\Assembly-CSharp.dll + ..\..\EscapeFromTarkov_Data\Managed\Assembly-CSharp.dll - ..\..\..\Shared\BepInEx.dll + ..\..\BepInEx\Core\BepInEx.dll - ..\..\..\Shared\bsg.console.core.dll + ..\..\EscapeFromTarkov_Data\Managed\bsg.console.core.dll - ..\..\..\Shared\Comfort.dll + ..\..\EscapeFromTarkov_Data\Managed\Comfort.dll - ..\..\..\Shared\UnityEngine.dll + ..\..\EscapeFromTarkov_Data\Managed\UnityEngine.dll - ..\..\..\Shared\UnityEngine.CoreModule.dll + ..\..\EscapeFromTarkov_Data\Managed\UnityEngine.CoreModule.dll - ..\..\..\Shared\UnityEngine.IMGUIModule.dll + ..\..\EscapeFromTarkov_Data\Managed\UnityEngine.IMGUIModule.dll - ..\..\..\Shared\UnityEngine.TextRenderingModule.dll + ..\..\EscapeFromTarkov_Data\Managed\UnityEngine.TextRenderingModule.dll + + + + diff --git a/Live/CWX_DebuggingTool/CWX_DebuggingTool.sln b/Live/CWX_DebuggingTool/CWX_DebuggingTool.sln new file mode 100644 index 0000000..8ae8a31 --- /dev/null +++ b/Live/CWX_DebuggingTool/CWX_DebuggingTool.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33801.468 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CWX_DebuggingTool", "CWX_DebuggingTool.csproj", "{FC152A95-1628-4DE9-A92E-38B368C188D0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FC152A95-1628-4DE9-A92E-38B368C188D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC152A95-1628-4DE9-A92E-38B368C188D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC152A95-1628-4DE9-A92E-38B368C188D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC152A95-1628-4DE9-A92E-38B368C188D0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {37A296E5-8559-4E04-8B2B-02B32F793C6E} + EndGlobalSection +EndGlobal diff --git a/Live/CWX_DebuggingTool/DebuggingTool.cs b/Live/CWX_DebuggingTool/DebuggingTool.cs index eeb3094..4de6d42 100644 --- a/Live/CWX_DebuggingTool/DebuggingTool.cs +++ b/Live/CWX_DebuggingTool/DebuggingTool.cs @@ -1,64 +1,82 @@ -using BepInEx; +using Aki.Reflection.Patching; +using BepInEx; +using BepInEx.Configuration; using Comfort.Common; +using CWX_DebuggingTool.Helpers; +using CWX_DebuggingTool.Models; using EFT; using EFT.Console.Core; using EFT.UI; +using System.Reflection; namespace CWX_DebuggingTool { - [BepInPlugin("com.cwx.debuggingtool", "cwx-debuggingtool", "1.1.0")] + [BepInPlugin("com.cwx.debuggingtool-dxyz", "cwx-debuggingtool-dxyz", "2.2.1")] public class DebuggingTool : BaseUnityPlugin { + public static ConfigEntry DefaultMode; + private void Awake() { + DefaultMode = Config.Bind( + "Main Settings", + "DefaultMode", + BotMonitorMode.None, + "Default Mode on Startup"); + ConsoleScreen.Processor.RegisterCommandGroup(); + new MatchStartPatch().Enable(); } [ConsoleCommand("BotMonitor")] - public static void BotMonitorConsoleCommand([ConsoleArgument("", "Options: 0 = off, 1 = Total bots, 2 = 1+Total bots per Zone, 3 = 2+Each bot")] int value ) + public static void BotMonitorConsoleCommand([ConsoleArgument("", "Options: 0 = off, 1 = Total bots, 2 = 1+Total bots per Zone, 3 = 2+Each bot")] BotMonitorMode mode ) { - switch (value) + if (mode == BotMonitorMode.None) { - case 0: - DisableBotMonitor(); - ConsoleScreen.Log("BotMonitor disabled"); - break; - case 1: - EnableBotMonitor(1); - ConsoleScreen.Log("BotMonitor enabled with only Total"); - break; - case 2: - EnableBotMonitor(2); - ConsoleScreen.Log("BotMonitor enabled with Total and per zone Total"); - break; - case 3: - EnableBotMonitor(3); - ConsoleScreen.Log("BotMonitor enabled with Total, per zone Total and each bot"); - break; - default: - // fail to load, or wrong option used - ConsoleScreen.LogError("Wrong Option used, please use 0, 1, 2 or 3"); - break; + DisableBotMonitor(); + ConsoleScreen.Log("BotMonitor disabled"); + } + else if (!mode.IsValid()) + { + ConsoleScreen.LogError("Wrong Option used, please use 0, 1, 2 or 3"); + } + else + { + ConsoleScreen.Log($"BotMonitor enabled with {mode.Description()}"); + EnableBotMonitor(mode); } } - private static void DisableBotMonitor() - { - BotmonClass.Instance.Dispose(); - } - - private static void EnableBotMonitor(int option) + public static void DisableBotMonitor() { var gameWorld = Singleton.Instance; + var btmInstance = gameWorld.GetComponent(); + if (btmInstance != null) + { + Destroy(btmInstance); + } + } - var checkExists = gameWorld.gameObject.GetComponentInChildren(); - - if (checkExists != null) - Destroy(checkExists); - - var btmInstance = gameWorld.gameObject.AddComponent(); + public static void EnableBotMonitor(BotMonitorMode mode) + { + var gameWorld = Singleton.Instance; + var btmInstance = gameWorld.GetOrAddComponent(); + btmInstance.Mode = mode; + } - btmInstance.Mode = option; + // Add the component every time a match starts if enabled + internal class MatchStartPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() => typeof(GameWorld).GetMethod(nameof(GameWorld.OnGameStarted)); + + [PatchPrefix] + public static void PatchPrefix() + { + if (DefaultMode.Value != BotMonitorMode.None) + { + EnableBotMonitor(DefaultMode.Value); + } + } } } } \ No newline at end of file diff --git a/Live/CWX_DebuggingTool/Helpers/EnumExtension.cs b/Live/CWX_DebuggingTool/Helpers/EnumExtension.cs new file mode 100644 index 0000000..bd388b7 --- /dev/null +++ b/Live/CWX_DebuggingTool/Helpers/EnumExtension.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace CWX_DebuggingTool.Helpers +{ + internal static class EnumExtension + { + public static string Description(this T src) where T : Enum + { + FieldInfo fi = src.GetType().GetField(src.ToString()); + DescriptionAttribute[] attributes = fi.GetCustomAttributes(false) as DescriptionAttribute[]; + if (attributes != null && attributes.Length > 0) + { + return attributes[0].Description; + } + + return ""; + } + + public static bool IsValid(this T src) where T : Enum + { + return Enum.GetValues(typeof(T)).Cast().Contains(src); + } + } +} diff --git a/Live/CWX_DebuggingTool/Models/BotMonitorMode.cs b/Live/CWX_DebuggingTool/Models/BotMonitorMode.cs new file mode 100644 index 0000000..24dc33a --- /dev/null +++ b/Live/CWX_DebuggingTool/Models/BotMonitorMode.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CWX_DebuggingTool.Models +{ + public enum BotMonitorMode + { + [Description("Disabled")] + None = 0, + [Description("Only Total")] + Total = 1, + [Description("Total and Per Zone Total")] + PerZoneTotal = 2, + [Description("Total, Per Zone Total, and Bot List")] + FullList = 3 + } +} diff --git a/Live/CWX_DebuggingTool/README.md b/Live/CWX_DebuggingTool/README.md index ca1f2dd..9c98cbe 100644 --- a/Live/CWX_DebuggingTool/README.md +++ b/Live/CWX_DebuggingTool/README.md @@ -1,5 +1,5 @@ # DebuggingTool ## CWX-DEBUGGINGTOOL for EFT - SPT-AKI -### CURRENT AKI VERSION: 3.5.1 -### GAMEVERSION: 22032 +### CURRENT AKI VERSION: 3.5.7 +### GAMEVERSION: 23399 ### USING BEPINEX