From b4338cc9e1be519771fd9afd0816c31aa204f7c8 Mon Sep 17 00:00:00 2001
From: gompocp <73906388+gompocp@users.noreply.github.com>
Date: Fri, 11 Jun 2021 19:59:51 +0100
Subject: [PATCH] Additional Cleanup
---
ActionMenuApi/Api/VRCActionMenuPage.cs | 17 +++++++++++++++++
ActionMenuApi/Pedals/PedalRadial.cs | 6 ++++--
ActionMenuApi/Stuff/LoaderIntegrityCheck.cs | 2 +-
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/ActionMenuApi/Api/VRCActionMenuPage.cs b/ActionMenuApi/Api/VRCActionMenuPage.cs
index 48f7be6..6ddd5ca 100644
--- a/ActionMenuApi/Api/VRCActionMenuPage.cs
+++ b/ActionMenuApi/Api/VRCActionMenuPage.cs
@@ -40,6 +40,23 @@ public static PedalRadial AddRadialPuppet(ActionMenuPage pageType, string text,
AddPedalToList(pageType, pedal, insertion);
return pedal;
}
+
+ ///
+ /// Add a restricted radial puppet button pedal to a specific ActionMenu page. Restricted meaning that you can't rotate past 100 to get to 0 and vice versa
+ ///
+ /// The page to add the button to
+ /// Button text
+ /// Calls action with a float between 0 - 1 depending on the current value of the radial puppet
+ /// (optional) Starting value for radial puppet 0-1
+ /// (optional) The Button Icon
+ /// (optional)The starting state for the lockable pedal, true = locked, false = unlocked
+ /// (optional) Determines whether or not the button is added before or after VRChat's buttons for the target page
+ public static PedalRadial AddRestrictedRadialPuppet(ActionMenuPage pageType, string text, Action onUpdate, float startingValue = 0, Texture2D icon = null, bool locked = false, Insertion insertion = Insertion.Post)
+ {
+ var pedal = new PedalRadial(text, startingValue, icon, onUpdate, locked, true);
+ AddPedalToList(pageType, pedal, insertion);
+ return pedal;
+ }
///
/// Add a four axis puppet button pedal to a specific ActionMenu page
diff --git a/ActionMenuApi/Pedals/PedalRadial.cs b/ActionMenuApi/Pedals/PedalRadial.cs
index 7290268..2adb049 100644
--- a/ActionMenuApi/Pedals/PedalRadial.cs
+++ b/ActionMenuApi/Pedals/PedalRadial.cs
@@ -10,8 +10,9 @@ public sealed class PedalRadial : PedalStruct
{
public float currentValue;
public PedalOption pedal { get; set; }
+ public bool restricted { get; private set; }
- public PedalRadial(string text, float startingValue, Texture2D icon, Action onUpdate, bool locked = false)
+ public PedalRadial(string text, float startingValue, Texture2D icon, Action onUpdate, bool locked = false, bool restricted = false)
{
this.text = text;
this.currentValue = startingValue;
@@ -22,10 +23,11 @@ public PedalRadial(string text, float startingValue, Texture2D icon, Action