From 691279a982c1dfb6b7ffa40c948b9b34490dcdf2 Mon Sep 17 00:00:00 2001 From: CWX Date: Sat, 6 Jul 2024 21:53:10 +0100 Subject: [PATCH] Updated to 3.9.0 and added script for stamina changes (disabled) --- src/CWX-MegaMod/CWX-MegaMod.csproj | 8 +++--- src/CWX-MegaMod/ChadMode/StaminaScript.cs | 26 +++++++++++++++++++ .../InventoryViewer/InventoryViewerPatch.cs | 4 +-- src/CWX-MegaMod/MegaMod.cs | 11 +++++++- src/CWX-MegaMod/MegaModPatch.cs | 2 +- src/CWX-MegaMod/MegaModScript.cs | 5 ++++ .../PainkillerDesat/PainkillerDesatPatch1.cs | 4 +-- .../PainkillerDesat/PainkillerDesatPatch2.cs | 4 +-- .../PainkillerDesat/PainkillerDesatPatch3.cs | 4 +-- .../PainkillerDesat/PainkillerDesatPatch4.cs | 4 +-- .../SpaceUser/SpaceUserFleaPatch.cs | 2 +- .../SpaceUser/SpaceUserSplitPatch.cs | 2 +- .../TradingPlayerItemViewPatch.cs | 2 +- .../WeathePatcher/WeatherPatcherScopePatch.cs | 9 +------ .../WeathePatcher/WeatherPatcherScript.cs | 12 --------- 15 files changed, 60 insertions(+), 39 deletions(-) create mode 100644 src/CWX-MegaMod/ChadMode/StaminaScript.cs diff --git a/src/CWX-MegaMod/CWX-MegaMod.csproj b/src/CWX-MegaMod/CWX-MegaMod.csproj index c9b9688..3b2ed07 100644 --- a/src/CWX-MegaMod/CWX-MegaMod.csproj +++ b/src/CWX-MegaMod/CWX-MegaMod.csproj @@ -9,11 +9,11 @@ ..\..\shared\0Harmony.dll - - ..\..\shared\Aki.Common.dll + + ..\..\shared\spt-Common.dll - - ..\..\shared\Aki.Reflection.dll + + ..\..\shared\spt-Reflection.dll ..\..\shared\Assembly-CSharp.dll diff --git a/src/CWX-MegaMod/ChadMode/StaminaScript.cs b/src/CWX-MegaMod/ChadMode/StaminaScript.cs new file mode 100644 index 0000000..c6df288 --- /dev/null +++ b/src/CWX-MegaMod/ChadMode/StaminaScript.cs @@ -0,0 +1,26 @@ +using Comfort.Common; +using EFT; +using EFT.HealthSystem; +using HarmonyLib; +using UnityEngine; + +namespace CWX_MegaMod.ChadMode +{ + public class StaminaScript : MonoBehaviour + { + private BackendConfigSettingsClass backendConfigSettingsClass; + + private void Awake() + { + backendConfigSettingsClass = Singleton.Instance; + } + + public void StartTask() + { + if (backendConfigSettingsClass != null) + { + // backendConfigSettingsClass.Stamina + } + } + } +} \ No newline at end of file diff --git a/src/CWX-MegaMod/InventoryViewer/InventoryViewerPatch.cs b/src/CWX-MegaMod/InventoryViewer/InventoryViewerPatch.cs index db3cece..d1f6284 100644 --- a/src/CWX-MegaMod/InventoryViewer/InventoryViewerPatch.cs +++ b/src/CWX-MegaMod/InventoryViewer/InventoryViewerPatch.cs @@ -1,7 +1,7 @@ -using Aki.Reflection.Patching; -using EFT.InventoryLogic; +using EFT.InventoryLogic; using HarmonyLib; using System.Reflection; +using SPT.Reflection.Patching; namespace CWX_MegaMod.InventoryViewer { diff --git a/src/CWX-MegaMod/MegaMod.cs b/src/CWX-MegaMod/MegaMod.cs index 1abefa1..f5c9b50 100644 --- a/src/CWX-MegaMod/MegaMod.cs +++ b/src/CWX-MegaMod/MegaMod.cs @@ -11,7 +11,7 @@ namespace CWX_MegaMod { - [BepInPlugin("CWX.MegaMod", "CWX-MegaMod", "1.2.4")] + [BepInPlugin("CWX.MegaMod", "CWX-MegaMod", "1.3.0")] public class MegaMod : BaseUnityPlugin { internal new static ManualLogSource Logger { get; private set; } @@ -27,6 +27,10 @@ public class MegaMod : BaseUnityPlugin internal static ConfigEntry FogRemover { get; private set; } internal static ConfigEntry WeatherDebug { get; private set; } internal static ConfigEntry ReserveAlarmChanger { get; private set; } + // internal static ConfigEntry ChadMode { get; private set; } + // internal static ConfigEntry ChadModeStamJiggle { get; private set; } + // internal static ConfigEntry ChadModeCamRock { get; private set; } + // internal static ConfigEntry ChadModeBreathing { get; private set; } public void Awake() { @@ -48,6 +52,7 @@ public void Awake() private void InitConfig() { // Higher order number comes first + //ChadMode = Config.Bind("All Mods", "ChadMode - On/Off", false, new ConfigDescription("Enable ChadMode - Sets stamina drain to 0", tags: new ConfigurationManagerAttributes() { Order = 12 })); ReserveAlarmChanger = Config.Bind("All Mods", "ReserveAlarmChanger - On/Off", false, new ConfigDescription("Enable Reserve Alarm Changer - changes alarm sound to file on plugin folder (ONLY RUNS ON RAID START)", tags: new ConfigurationManagerAttributes() { Order = 11 })); BushWhacker = Config.Bind("All Mods", "BushWhacker - On/Off", false, new ConfigDescription("Enable BushWhacker - removes slowdown from bushes", tags: new ConfigurationManagerAttributes() { Order = 10 })); GrassCutter = Config.Bind("All Mods", "GrassCutter - On/Off", false, new ConfigDescription("Enable GrassCutter - removes grass", tags: new ConfigurationManagerAttributes() { Order = 9 })); @@ -61,6 +66,10 @@ private void InitConfig() FogRemover = Config.Bind("All Mods", "FogRemover - On/Off", false, new ConfigDescription("Enable FogRemover - Removes fog", tags: new ConfigurationManagerAttributes() { Order = 1 })); MasterKeyToUse = Config.Bind("MasterKey", "MasterKeyToUse", EMasterKeys.Yellow, new ConfigDescription("This will be set to all unlockable doors", tags: new ConfigurationManagerAttributes() { Order = 1 })); + + //ChadModeStamJiggle = Config.Bind("ChadMode", "Disable Exhaustion Jiggle", false, new ConfigDescription("Disable Exhaustion Jiggle", tags: new ConfigurationManagerAttributes() { Order = 3 })); + //ChadModeCamRock = Config.Bind("ChadMode", "Disable Exhaustion CameraRock", false, new ConfigDescription("Disable Exhaustion CameraRock", tags: new ConfigurationManagerAttributes() { Order = 2 })); + //ChadModeBreathing = Config.Bind("ChadMode", "Disable Exhaustion Breathing", false, new ConfigDescription("Disable Exhaustion Breathing", tags: new ConfigurationManagerAttributes() { Order = 1 })); } public static void LogToScreen(string message = "", EMessageType eMessageType = EMessageType.info) diff --git a/src/CWX-MegaMod/MegaModPatch.cs b/src/CWX-MegaMod/MegaModPatch.cs index c5c7e64..d877df7 100644 --- a/src/CWX-MegaMod/MegaModPatch.cs +++ b/src/CWX-MegaMod/MegaModPatch.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using Comfort.Common; using EFT; using HarmonyLib; diff --git a/src/CWX-MegaMod/MegaModScript.cs b/src/CWX-MegaMod/MegaModScript.cs index 36603fd..c00cc97 100644 --- a/src/CWX-MegaMod/MegaModScript.cs +++ b/src/CWX-MegaMod/MegaModScript.cs @@ -1,6 +1,7 @@ using Comfort.Common; using CWX_MegaMod.AlarmChanger; using CWX_MegaMod.BushWhacker; +using CWX_MegaMod.ChadMode; using CWX_MegaMod.EnvironmentEnjoyer; using CWX_MegaMod.GrassCutter; using CWX_MegaMod.MasterKey; @@ -21,6 +22,7 @@ public class MegaModScript : MonoBehaviour public EnvironmentEnjoyerScript _environmentEnjoyerScript; public WeatherPatcherScript _weatherPatcherScript; public AlarmChangerScript _alarmChangerScript; + // public StaminaScript _staminaScript; private void Awake() { @@ -61,6 +63,7 @@ private void SetupMegaModScripts() _environmentEnjoyerScript = _gameWorld.gameObject.AddComponent(); _weatherPatcherScript = _gameWorld.gameObject.AddComponent(); _alarmChangerScript = _gameWorld.gameObject.AddComponent(); + // _staminaScript = _gameWorld.gameObject.AddComponent(); } private void RunFirstTime() @@ -70,6 +73,7 @@ private void RunFirstTime() _masterKeyScript.StartTask(); _environmentEnjoyerScript.StartTask(); _weatherPatcherScript.StartTask(); + // _staminaScript.StartTask(); } private void SetupMegaModEvents() @@ -81,6 +85,7 @@ private void SetupMegaModEvents() MegaMod.EnvironmentEnjoyer.SettingChanged += (a, b) => _environmentEnjoyerScript.StartTask(); MegaMod.FogRemover.SettingChanged += (a, b) => _weatherPatcherScript.StartTask(); MegaMod.WeatherDebug.SettingChanged += (a, b) => _weatherPatcherScript.StartTask(); + // MegaMod.ChadMode.SettingChanged += (a, b) => _staminaScript.StartTask(); } } } \ No newline at end of file diff --git a/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch1.cs b/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch1.cs index 12cd1db..c19cb8f 100644 --- a/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch1.cs +++ b/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch1.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using HarmonyLib; namespace CWX_MegaMod.PainkillerDesat @@ -8,7 +8,7 @@ public class PainkillerDesatScript1 : ModulePatch { protected override MethodBase GetTargetMethod() { - return AccessTools.Method(typeof(EffectsController.Class572), nameof(EffectsController.Class572.method_2)); + return AccessTools.Method(typeof(EffectsController.Class582), nameof(EffectsController.Class582.method_2)); } [PatchPrefix] // removes the sharpen/desat effect from some painkillers diff --git a/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch2.cs b/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch2.cs index 0cf2712..601b9f5 100644 --- a/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch2.cs +++ b/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch2.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using HarmonyLib; namespace CWX_MegaMod.PainkillerDesat @@ -8,7 +8,7 @@ public class PainkillerDesatScript2 : ModulePatch { protected override MethodBase GetTargetMethod() { - return AccessTools.Method(typeof(EffectsController.Class572), nameof(EffectsController.Class572.method_1)); + return AccessTools.Method(typeof(EffectsController.Class582), nameof(EffectsController.Class582.method_1)); } [PatchPrefix] // removes the sharpen/desat effect from some painkillers diff --git a/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch3.cs b/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch3.cs index 2c32aca..01355d6 100644 --- a/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch3.cs +++ b/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch3.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using HarmonyLib; namespace CWX_MegaMod.PainkillerDesat @@ -8,7 +8,7 @@ public class PainkillerDesatScript3 : ModulePatch { protected override MethodBase GetTargetMethod() { - return AccessTools.Method(typeof(EffectsController.Class577), nameof(EffectsController.Class577.Toggle)); + return AccessTools.Method(typeof(EffectsController.Class587), nameof(EffectsController.Class587.Toggle)); } [PatchPrefix] // removes the wiggle effect from some painkillers diff --git a/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch4.cs b/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch4.cs index b15b274..d93af3f 100644 --- a/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch4.cs +++ b/src/CWX-MegaMod/PainkillerDesat/PainkillerDesatPatch4.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using HarmonyLib; namespace CWX_MegaMod.PainkillerDesat @@ -8,7 +8,7 @@ public class PainkillerDesatScript4 : ModulePatch { protected override MethodBase GetTargetMethod() { - return AccessTools.Method(typeof(EffectsController.Class568), nameof(EffectsController.Class568.Toggle)); + return AccessTools.Method(typeof(EffectsController.Class578), nameof(EffectsController.Class578.Toggle)); } [PatchPrefix] // removes the double vision effect from some painkillers diff --git a/src/CWX-MegaMod/SpaceUser/SpaceUserFleaPatch.cs b/src/CWX-MegaMod/SpaceUser/SpaceUserFleaPatch.cs index 7f3d9c2..e00b723 100644 --- a/src/CWX-MegaMod/SpaceUser/SpaceUserFleaPatch.cs +++ b/src/CWX-MegaMod/SpaceUser/SpaceUserFleaPatch.cs @@ -1,6 +1,6 @@ using System.Linq; using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using EFT.UI; using HarmonyLib; using UnityEngine; diff --git a/src/CWX-MegaMod/SpaceUser/SpaceUserSplitPatch.cs b/src/CWX-MegaMod/SpaceUser/SpaceUserSplitPatch.cs index f3ed1af..28e87fc 100644 --- a/src/CWX-MegaMod/SpaceUser/SpaceUserSplitPatch.cs +++ b/src/CWX-MegaMod/SpaceUser/SpaceUserSplitPatch.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using EFT.UI; using HarmonyLib; using UnityEngine; diff --git a/src/CWX-MegaMod/TradingPlayerView/TradingPlayerItemViewPatch.cs b/src/CWX-MegaMod/TradingPlayerView/TradingPlayerItemViewPatch.cs index 26cc1e7..06ca8c3 100644 --- a/src/CWX-MegaMod/TradingPlayerView/TradingPlayerItemViewPatch.cs +++ b/src/CWX-MegaMod/TradingPlayerView/TradingPlayerItemViewPatch.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using Comfort.Common; using EFT.UI; using EFT.UI.DragAndDrop; diff --git a/src/CWX-MegaMod/WeathePatcher/WeatherPatcherScopePatch.cs b/src/CWX-MegaMod/WeathePatcher/WeatherPatcherScopePatch.cs index 223f973..e187131 100644 --- a/src/CWX-MegaMod/WeathePatcher/WeatherPatcherScopePatch.cs +++ b/src/CWX-MegaMod/WeathePatcher/WeatherPatcherScopePatch.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Aki.Reflection.Patching; +using SPT.Reflection.Patching; using EFT.CameraControl; using HarmonyLib; @@ -17,22 +17,15 @@ public static void PatchPostfix(ref OpticComponentUpdater __instance) { if (!WeatherPatcherScript.ScopeRunOnce) { - WeatherPatcherScript.ScopeGlobalFog = __instance.gameObject.GetComponent(); WeatherPatcherScript.ScopeScattering = __instance.gameObject.GetComponent(); WeatherPatcherScript.ScopeMboit = __instance.gameObject.GetComponent(); - MegaMod.LogToScreen($"ScopeGlobalFog was null? {WeatherPatcherScript.ScopeGlobalFog == null}"); MegaMod.LogToScreen($"ScopeScattering was null? {WeatherPatcherScript.ScopeScattering == null}"); MegaMod.LogToScreen($"ScopeMboit was null? {WeatherPatcherScript.ScopeMboit == null}"); WeatherPatcherScript.ScopeRunOnce = true; } - if (WeatherPatcherScript.ScopeGlobalFog != null) - { - WeatherPatcherScript.ScopeGlobalFog.enabled = !MegaMod.FogRemover.Value; - } - if (WeatherPatcherScript.ScopeScattering != null) { WeatherPatcherScript.ScopeScattering.enabled = !MegaMod.FogRemover.Value; diff --git a/src/CWX-MegaMod/WeathePatcher/WeatherPatcherScript.cs b/src/CWX-MegaMod/WeathePatcher/WeatherPatcherScript.cs index c0f9207..506d155 100644 --- a/src/CWX-MegaMod/WeathePatcher/WeatherPatcherScript.cs +++ b/src/CWX-MegaMod/WeathePatcher/WeatherPatcherScript.cs @@ -8,11 +8,9 @@ public class WeatherPatcherScript : MonoBehaviour private CameraClass camera; private WeatherController weatherController; private float debugFogFloat = 0f; - private CustomGlobalFog globalFog = null; private TOD_Scattering scattering = null; private MBOIT_Scattering mboit = null; public static bool ScopeRunOnce = false; - public static CustomGlobalFog ScopeGlobalFog = null; public static TOD_Scattering ScopeScattering = null; public static MBOIT_Scattering ScopeMboit = null; @@ -28,7 +26,6 @@ private void Awake() if (camera.Camera != null) { - globalFog = camera.Camera.gameObject.GetComponentInChildren(); scattering = camera.Camera.gameObject.GetComponentInChildren(); mboit = camera.Camera.gameObject.GetComponentInChildren(); } @@ -36,14 +33,6 @@ private void Awake() public void StartTask() { - // fog related - - - if (globalFog != null) - { - globalFog.enabled = !MegaMod.FogRemover.Value; - } - if (scattering != null) { scattering.enabled = !MegaMod.FogRemover.Value; @@ -80,7 +69,6 @@ public void StartTask() public void OnDestroy() { ScopeRunOnce = false; - ScopeGlobalFog = null; ScopeScattering = null; ScopeMboit = null; }