Skip to content

Commit b4338cc

Browse files
committed
Additional Cleanup
1 parent 976b205 commit b4338cc

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

ActionMenuApi/Api/VRCActionMenuPage.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,23 @@ public static PedalRadial AddRadialPuppet(ActionMenuPage pageType, string text,
4040
AddPedalToList(pageType, pedal, insertion);
4141
return pedal;
4242
}
43+
44+
/// <summary>
45+
/// 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
46+
/// </summary>
47+
/// <param name="pageType">The page to add the button to</param>
48+
/// <param name="text">Button text</param>
49+
/// <param name="onUpdate">Calls action with a float between 0 - 1 depending on the current value of the radial puppet</param>
50+
/// <param name="startingValue">(optional) Starting value for radial puppet 0-1</param>
51+
/// <param name="icon">(optional) The Button Icon</param>
52+
/// <param name="locked">(optional)The starting state for the lockable pedal, true = locked, false = unlocked</param>
53+
/// <param name="insertion">(optional) Determines whether or not the button is added before or after VRChat's buttons for the target page</param>
54+
public static PedalRadial AddRestrictedRadialPuppet(ActionMenuPage pageType, string text, Action<float> onUpdate, float startingValue = 0, Texture2D icon = null, bool locked = false, Insertion insertion = Insertion.Post)
55+
{
56+
var pedal = new PedalRadial(text, startingValue, icon, onUpdate, locked, true);
57+
AddPedalToList(pageType, pedal, insertion);
58+
return pedal;
59+
}
4360

4461
/// <summary>
4562
/// Add a four axis puppet button pedal to a specific ActionMenu page

ActionMenuApi/Pedals/PedalRadial.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ public sealed class PedalRadial : PedalStruct
1010
{
1111
public float currentValue;
1212
public PedalOption pedal { get; set; }
13+
public bool restricted { get; private set; }
1314

14-
public PedalRadial(string text, float startingValue, Texture2D icon, Action<float> onUpdate, bool locked = false)
15+
public PedalRadial(string text, float startingValue, Texture2D icon, Action<float> onUpdate, bool locked = false, bool restricted = false)
1516
{
1617
this.text = text;
1718
this.currentValue = startingValue;
@@ -22,10 +23,11 @@ public PedalRadial(string text, float startingValue, Texture2D icon, Action<floa
2223
startingValue = f;
2324
pedal.SetButtonPercentText($"{Math.Round(startingValue * 100)}%");
2425
}), onUpdate);
25-
RadialPuppetManager.OpenRadialMenu(startingValue, combinedAction, text, pedal);
26+
RadialPuppetManager.OpenRadialMenu(startingValue, combinedAction, text, pedal, restricted);
2627
};
2728
this.Type = PedalType.RadialPuppet;
2829
this.locked = locked;
30+
this.restricted = restricted;
2931
}
3032
}
3133
}

ActionMenuApi/Stuff/LoaderIntegrityCheck.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace ActionMenuApi
88
{
9-
[HarmonyShield]
9+
[PatchShield]
1010
internal static class LoaderIntegrityCheck
1111
{
1212
//Credit to knah: https://github.com/knah/VRCMods/blob/master/UIExpansionKit/LoaderIntegrityCheck.cs

0 commit comments

Comments
 (0)