mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
Add back CohtmlView disabling.
This commit is contained in:
parent
f6e2c1622a
commit
87bb3fcb89
4 changed files with 81 additions and 4 deletions
|
@ -1,5 +1,8 @@
|
|||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.IO;
|
||||
using cohtml;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.Melons.FuckMetrics
|
||||
{
|
||||
|
@ -30,5 +33,26 @@ namespace NAK.Melons.FuckMetrics
|
|||
SchedulerSystem.RemoveJob(job);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CohtmlAdvanceView(CohtmlView cohtmlView, Traverse menuOpenTraverse)
|
||||
{
|
||||
if (!FuckMetricsMod.EntryDisableCohtmlViewOnIdle.Value) return;
|
||||
|
||||
// Don't execute if menu is open
|
||||
if (cohtmlView == null || menuOpenTraverse.GetValue<bool>()) return;
|
||||
|
||||
// Disable cohtmlView (opening should enable)
|
||||
cohtmlView.enabled = false;
|
||||
|
||||
// Death
|
||||
try
|
||||
{
|
||||
if (cohtmlView.m_UISystem != null) cohtmlView.View.Advance(cohtmlView.m_UISystem.Id, (double)Time.unscaledTime * 1000.0);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FuckMetricsMod.Logger.Error($"An exception was thrown while calling CohtmlView.Advance(). Error message: {e.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue