mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
Move mods to Depricated folder.
This commit is contained in:
parent
e61f119f32
commit
5d1cb2ebec
70 changed files with 44 additions and 119 deletions
64
.DepricatedMods/FuckMetrics/HarmonyPatches.cs
Normal file
64
.DepricatedMods/FuckMetrics/HarmonyPatches.cs
Normal file
|
@ -0,0 +1,64 @@
|
|||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.IO;
|
||||
using cohtml;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace NAK.FuckMetrics.HarmonyPatches;
|
||||
|
||||
public static class CVR_MenuManagerPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CVR_MenuManager), "ToggleQuickMenu", new Type[] { typeof(bool) })]
|
||||
private static void Postfix_CVR_MenuManager_ToggleQuickMenu(bool show)
|
||||
{
|
||||
FuckMetrics.ApplyMetricsSettings(show);
|
||||
FuckMetrics.ApplyCoreUpdatesSettings(show);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ViewManagerPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ViewManager), "UiStateToggle", new Type[] { typeof(bool) })]
|
||||
private static void Postfix_ViewManager_UiStateToggle(bool show)
|
||||
{
|
||||
FuckMetrics.ApplyMetricsSettings(show);
|
||||
FuckMetrics.ApplyCoreUpdatesSettings(show);
|
||||
}
|
||||
}
|
||||
|
||||
public static class CohtmlViewPatches
|
||||
{
|
||||
private static CohtmlView _quickMenuView;
|
||||
private static CohtmlView _gameMenuView;
|
||||
private static Traverse _quickMenuOpenTraverse;
|
||||
private static Traverse _gameMenuOpenTraverse;
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CVR_MenuManager), "Start")]
|
||||
private static void Postfix_CVRMenuManager_Start(ref CVR_MenuManager __instance, ref CohtmlView ___quickMenu)
|
||||
{
|
||||
_quickMenuView = ___quickMenu;
|
||||
_quickMenuOpenTraverse = Traverse.Create(__instance).Field("_quickMenuOpen");
|
||||
SchedulerSystem.AddJob(() => FuckMetrics.CohtmlAdvanceView(_quickMenuView, _quickMenuOpenTraverse), 15f, 6f, -1);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ViewManager), "Start")]
|
||||
private static void Postfix_ViewManager_Start(ref ViewManager __instance, ref CohtmlView ___gameMenuView)
|
||||
{
|
||||
_gameMenuView = ___gameMenuView;
|
||||
_gameMenuOpenTraverse = Traverse.Create(__instance).Field("_gameMenuOpen");
|
||||
SchedulerSystem.AddJob(() => FuckMetrics.CohtmlAdvanceView(_gameMenuView, _gameMenuOpenTraverse), 12f, 6f, -1);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ViewManager), "OnMicrophoneStatusSwitched")]
|
||||
private static void Postfix_ViewManager_OnMicrophoneStatusSwitched()
|
||||
{
|
||||
if (_quickMenuOpenTraverse.GetValue<bool>())
|
||||
{
|
||||
CVR_MenuManager.Instance.SendCoreUpdate();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue