[ESCBothMenus] Initial release

This commit is contained in:
NotAKid 2026-03-15 19:40:17 -05:00
parent b4b392d20d
commit 798336f409
4 changed files with 109 additions and 0 deletions

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk" />

52
ESCBothMenus/Main.cs Normal file
View file

@ -0,0 +1,52 @@
using System.Reflection;
using ABI_RC.Core.InteractionSystem;
using ABI_RC.Systems.InputManagement;
using ABI_RC.Systems.Movement;
using HarmonyLib;
using MelonLoader;
using UnityEngine;
namespace NAK.ESCBothMenus;
public class ESCBothMenusMod : MelonMod
{
public override void OnInitializeMelon()
{
HarmonyInstance.Patch(
typeof(ViewManager).GetMethod(nameof(ViewManager.Update),
BindingFlags.NonPublic | BindingFlags.Instance),
prefix: new HarmonyMethod(typeof(ESCBothMenusMod).GetMethod(nameof(OnPreViewManagerUpdate),
BindingFlags.NonPublic | BindingFlags.Static))
);
}
private static float _timer = -1f;
private static bool _main;
private static void OnPreViewManagerUpdate()
{
if (CVRInputManager.Instance.mainMenuButton
&& !BetterBetterCharacterController.Instance.IsSittingOnControlSeat())
{
if (_timer < 0f) _timer = 0.2f;
else _main = true;
}
if (_timer >= 0f && (_timer -= Time.deltaTime) <= 0f)
{
var vm = ViewManager.Instance;
var qm = CVR_MenuManager.Instance;
if (vm.IsViewShown) vm.UiStateToggle(false);
else if (qm.IsViewShown) qm.ToggleQuickMenu(false);
else if (_main) vm.UiStateToggle(true);
else qm.ToggleQuickMenu(true);
_timer = -1f;
_main = false;
}
// consume so original logic doesn't fire
CVRInputManager.Instance.mainMenuButton = false;
}
}

View file

@ -0,0 +1,32 @@
using MelonLoader;
using NAK.ESCBothMenus.Properties;
using System.Reflection;
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
[assembly: AssemblyTitle(nameof(NAK.ESCBothMenus))]
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
[assembly: AssemblyProduct(nameof(NAK.ESCBothMenus))]
[assembly: MelonInfo(
typeof(NAK.ESCBothMenus.ESCBothMenusMod),
nameof(NAK.ESCBothMenus),
AssemblyInfoParams.Version,
AssemblyInfoParams.Author,
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ESCBothMenus"
)]
[assembly: MelonGame("ChilloutVR", "ChilloutVR")]
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
[assembly: MelonColor(255, 246, 25, 99)] // red-pink
[assembly: MelonAuthorColor(255, 158, 21, 32)] // red
[assembly: HarmonyDontPatchAll]
namespace NAK.ESCBothMenus.Properties;
internal static class AssemblyInfoParams
{
public const string Version = "1.0.0";
public const string Author = "NotAKidoS";
}

23
ESCBothMenus/format.json Normal file
View file

@ -0,0 +1,23 @@
{
"_id": 219,
"name": "ScrollFlight",
"modversion": "1.0.5",
"gameversion": "2025r181",
"loaderversion": "0.7.2",
"modtype": "Mod",
"author": "NotAKidoS",
"description": "Scroll-wheel to adjust flight speed in Desktop. Stole idea from Luc.",
"searchtags": [
"flight",
"scroll",
"speed",
"modifier"
],
"requirements": [
"None"
],
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r48/ScrollFlight.dll",
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ScrollFlight/",
"changelog": "- Rebuilt for CVR 2025r181",
"embedcolor": "#f61963"
}