mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
Job Removal
This commit is contained in:
parent
1ce18e6aa6
commit
a5fa241fb1
8 changed files with 94 additions and 47 deletions
34
FuckCohtml/FuckCohtml.cs
Normal file
34
FuckCohtml/FuckCohtml.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.IO;
|
||||
|
||||
namespace NAK.Melons.FuckCohtml
|
||||
{
|
||||
public static class FuckCohtml
|
||||
{
|
||||
public static void ToggleMetrics(bool disable)
|
||||
{
|
||||
var job = SchedulerSystem.Instance.activeJobs.FirstOrDefault(pair => pair.Job.Method.Name == "UpdateMetrics").Job;
|
||||
if (!disable && job == null)
|
||||
{
|
||||
SchedulerSystem.AddJob(new SchedulerSystem.Job(ViewManager.Instance.UpdateMetrics), 0f, 0.5f, -1);
|
||||
}
|
||||
else if (disable && job != null)
|
||||
{
|
||||
SchedulerSystem.RemoveJob(job);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ToggleCoreUpdates(bool disable)
|
||||
{
|
||||
var job = SchedulerSystem.Instance.activeJobs.FirstOrDefault(pair => pair.Job.Method.Name == "SendCoreUpdate").Job;
|
||||
if (!disable && job == null)
|
||||
{
|
||||
SchedulerSystem.AddJob(new SchedulerSystem.Job(CVR_MenuManager.Instance.SendCoreUpdate), 0f, 0.1f, -1);
|
||||
}
|
||||
else if (disable && job != null)
|
||||
{
|
||||
SchedulerSystem.RemoveJob(job);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue