Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Add category pages and WingMenu toggles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiokuu committed Jan 4, 2022
1 parent d440c10 commit 51f072b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
22 changes: 19 additions & 3 deletions ReModCE/Components/FlyComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
using System.Linq;
using ReMod.Core;
using ReMod.Core.Managers;
using ReMod.Core.UI;
using ReMod.Core.UI.QuickMenu;
using ReMod.Core.UI.Wings;
using ReMod.Core.VRChat;
using ReModCE.Core;
using ReModCE.Managers;
using UnhollowerRuntimeLib;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.XR;
using VRC.Animation;
using VRC.SDK3.Components;
using VRC.UI.Elements;
using VRCSDK2;
using VRC_AvatarPedestal = VRC.SDKBase.VRC_AvatarPedestal;
using VRC_Pickup = VRC.SDKBase.VRC_Pickup;
Expand All @@ -35,6 +33,7 @@ internal class FlyComponent : ModComponent
private ReMenuButton _flySpeedButton;

private ReMenuToggle _flyToggle;
private ReMirroredWingToggle _noclipWingToggle;
private ReMenuToggle _noclipToggle;
private ReMenuToggle _hotkeyToggle;

Expand All @@ -56,6 +55,11 @@ public FlyComponent()
_noclipToggle.Interactable = allowed;
}

if (_noclipWingToggle != null)
{
_noclipWingToggle.Interactable = allowed;
}

if (!allowed)
{
ToggleNoclip(false);
Expand All @@ -70,6 +74,18 @@ public override void OnUiManagerInit(UiManager uiManager)

_flyToggle = movementMenu.AddToggle("Fly", "Enable/Disable Fly", ToggleFly, _flyEnabled);
_noclipToggle = movementMenu.AddToggle("Noclip", "Enable/Disable Noclip", ToggleNoclip, _noclipEnabled);
_noclipWingToggle = ReModCE.WingMenu.AddToggle("Noclip", "Enable/Disable Noclip", b =>
{
if (b)
{
ToggleNoclip(true);
}
else
{
ToggleFly(false);
}
}, _noclipEnabled);

_hotkeyToggle = hotkeyMenu.AddToggle("Fly Hotkey", "Enable/Disable fly hotkey",
EnableFlyHotkey.SetValue, EnableFlyHotkey);

Expand Down
13 changes: 11 additions & 2 deletions ReModCE/Components/HighlightsComponent.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using ReMod.Core;
using ReMod.Core.Managers;
using ReMod.Core.UI.QuickMenu;
using ReMod.Core.UI.Wings;
using ReMod.Core.Unity;
using ReMod.Core.VRChat;
using ReModCE.Core;
using ReModCE.Managers;
using UnityEngine;
using UnityEngine.UI;
Expand All @@ -20,6 +20,8 @@ internal class HighlightsComponent : ModComponent
private ConfigValue<Color> FriendsColor;
private ConfigValue<Color> OthersColor;
private ConfigValue<bool> ESPEnabled;

private ReMirroredWingToggle _espMirroredToggle;
private ReMenuToggle _espToggle;
private ReMenuButton _friendsColorButton;
private ReMenuButton _othersColorButton;
Expand All @@ -38,6 +40,11 @@ public HighlightsComponent()
{
_espToggle.Interactable = allowed;
}
if(_espMirroredToggle != null)
{
_espMirroredToggle.Interactable = allowed;
}

if (!allowed)
ESPEnabled.SetValue(false);
};
Expand All @@ -57,13 +64,15 @@ public override void OnUiManagerInit(UiManager uiManager)
{
base.OnUiManagerInit(uiManager);

var menu = uiManager.MainMenu.GetMenuPage("Visuals");
var menu = uiManager.MainMenu.GetCategoryPage("Visuals").GetCategory("ESP/Highlights");
_espToggle = menu.AddToggle("ESP/Highlights", "Enable ESP (Highlight players through walls)", b =>
{
ESPEnabled.SetValue(b);
ToggleESP(b);
}, ESPEnabled);

_espMirroredToggle = ReModCE.WingMenu.AddToggle("ESP", "Enable/Disable ESP", ESPEnabled.SetValue, ESPEnabled);

_friendsColorButton = menu.AddButton($"<color=#{FriendsColor.Value.ToHex()}>Friends</color> Color",
$"Set your <color=#{FriendsColor.Value.ToHex()}>friends</color> highlight color",
() =>
Expand Down
4 changes: 1 addition & 3 deletions ReModCE/Components/WireframeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
using MelonLoader;
using ReMod.Core;
using ReMod.Core.Managers;
using ReMod.Core.UI;
using ReMod.Core.UI.QuickMenu;
using ReMod.Core.VRChat;
using ReModCE.Core;
using ReModCE.Managers;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
Expand Down Expand Up @@ -124,7 +122,7 @@ public override void OnUiManagerInitEarly()

public override void OnUiManagerInit(UiManager uiManager)
{
var menu = uiManager.MainMenu.GetMenuPage("Visuals").AddMenuPage("Wireframe", "Access wireframe settings", ResourceManager.GetSprite("remodce.wireframe"));
var menu = uiManager.MainMenu.GetCategoryPage("Visuals").GetCategory("Wireframe").AddMenuPage("Wireframe", "Access wireframe settings", ResourceManager.GetSprite("remodce.wireframe"));
_wireframeToggle = menu.AddToggle("Enable", "Highlight objects using wireframe.", ToggleWireframe, _wireframeEnabled);

_rangeButton = menu.AddButton($"Range: {WireframeRange}",
Expand Down
10 changes: 6 additions & 4 deletions ReModCE/ReMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
using ReMod.Core.UI.Wings;
using ReMod.Core.Unity;
using ReModCE.Components;
using ReModCE.Core;
using ReModCE.Loader;
using ReModCE.Managers;
using UnhollowerRuntimeLib;
using UnhollowerRuntimeLib.XrefScans;
using VRC;
using VRC.Core;
using VRC.DataModel;
using VRC.UI.Elements.Menus;
using ConfigManager = ReMod.Core.Managers.ConfigManager;

namespace ReModCE
{
Expand Down Expand Up @@ -132,11 +131,14 @@ public static void OnUiManagerInit()
ReLogger.Msg("Initializing UI...");

_uiManager = new UiManager("ReMod <color=#00ff00>CE</color>", ResourceManager.GetSprite("remodce.remod"));

WingMenu = ReMirroredWingMenu.Create("ReModCE", "Open the RemodCE menu", ResourceManager.GetSprite("remodce.remod"));

_uiManager.MainMenu.AddMenuPage("Movement", "Access movement related settings", ResourceManager.GetSprite("remodce.running"));
_uiManager.MainMenu.AddMenuPage("Visuals", "Access anything that will affect your game visually", ResourceManager.GetSprite("remodce.eye"));

var visualPage = _uiManager.MainMenu.AddCategoryPage("Visuals", "Access anything that will affect your game visually", ResourceManager.GetSprite("remodce.eye"));
visualPage.AddCategory("ESP/Highlights");
visualPage.AddCategory("Wireframe");

_uiManager.MainMenu.AddMenuPage("Dynamic Bones", "Access your global dynamic bone settings", ResourceManager.GetSprite("remodce.bone"));
_uiManager.MainMenu.AddMenuPage("Avatars", "Access avatar related settings", ResourceManager.GetSprite("remodce.hanger"));

Expand Down

0 comments on commit 51f072b

Please sign in to comment.