mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 06:49:22 +00:00
move bunch of things to depricated folder
This commit is contained in:
parent
86828a94e2
commit
21f8893095
156 changed files with 193 additions and 93 deletions
63
.DepricatedMods/DesktopVRSwitch/Integrations/BTKUIAddon.cs
Normal file
63
.DepricatedMods/DesktopVRSwitch/Integrations/BTKUIAddon.cs
Normal file
|
@ -0,0 +1,63 @@
|
|||
using BTKUILib;
|
||||
using BTKUILib.UIObjects;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.Integrations;
|
||||
|
||||
public static class BTKUIAddon
|
||||
{
|
||||
#region Initialization
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static void Initialize()
|
||||
{
|
||||
// Add mod to the Misc Menu
|
||||
Page miscPage = QuickMenuAPI.MiscTabPage;
|
||||
Category vrSwitchMiscCategory = miscPage.AddCategory(ModSettings.SettingsCategory);
|
||||
|
||||
vrSwitchMiscCategory.AddButton("Switch VR Mode", "", "Switch to Desktop/VR.").OnPress +=
|
||||
() =>
|
||||
{
|
||||
QuickMenuAPI.ShowConfirm(
|
||||
title: "Switch VR Mode",
|
||||
content: "Are you sure you want to switch to Desktop/VR?",
|
||||
onYes: () => VRModeSwitchManager.Instance.AttemptSwitch()
|
||||
);
|
||||
};
|
||||
|
||||
SetupSwitchConfigurationPage(ref vrSwitchMiscCategory);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pages Setup
|
||||
|
||||
private static void SetupSwitchConfigurationPage(ref Category parentCategory)
|
||||
{
|
||||
Page vrSwitchPage = parentCategory.AddPage("DesktopVRSwitch Settings", "", "Configure the settings for DesktopVRSwitch.", ModSettings.SettingsCategory);
|
||||
vrSwitchPage.MenuTitle = "DesktopVRSwitch Settings";
|
||||
Category vrSwitchCategory = vrSwitchPage.AddCategory(vrSwitchPage.MenuTitle);
|
||||
|
||||
AddMelonToggle(ref vrSwitchCategory, ModSettings.EntryEnterCalibrationOnSwitch);
|
||||
|
||||
AddMelonToggle(ref vrSwitchCategory, ModSettings.EntryUseTransitionOnSwitch);
|
||||
|
||||
AddMelonToggle(ref vrSwitchCategory, ModSettings.EntrySwitchToDesktopOnExit);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Melon Pref Helpers
|
||||
|
||||
private static void AddMelonToggle(ref Category category, MelonLoader.MelonPreferences_Entry<bool> entry)
|
||||
{
|
||||
category.AddToggle(entry.DisplayName, entry.Description, entry.Value).OnValueUpdated += b => entry.Value = b;
|
||||
}
|
||||
|
||||
// private static void AddMelonSlider(ref Page page, MelonLoader.MelonPreferences_Entry<float> entry, float min, float max, int decimalPlaces = 2)
|
||||
// {
|
||||
// page.AddSlider(entry.DisplayName, entry.Description, entry.Value, min, max, decimalPlaces).OnValueUpdated += f => entry.Value = f;
|
||||
// }
|
||||
|
||||
#endregion
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue