|
1 | 1 | using System;
|
2 | 2 | using ActionMenuApi.Api;
|
3 |
| -using ActionMenuApi.Managers; |
4 | 3 | using ActionMenuApi.Pedals;
|
5 | 4 | using ActionMenuApi.Types;
|
6 |
| -using MelonLoader; |
7 |
| -using UnhollowerRuntimeLib; |
8 | 5 | using UnityEngine;
|
9 |
| -using UnityEngine.UI; |
10 | 6 | using PedalOptionTriggerEvent = PedalOption.MulticastDelegateNPublicSealedBoUnique; //Will this change?, ¯\_(ツ)_/¯
|
11 | 7 | // ReSharper disable HeuristicUnreachableCode
|
12 | 8 | #pragma warning disable 1591
|
13 | 9 |
|
14 | 10 | namespace ActionMenuApi
|
15 | 11 | {
|
16 |
| - [Obsolete("This class is only here for compatibility reasons! Please use ActionMenuApi.Api.CustomSubMenu/VRCActionMenuPage/AMUtils for new updated methods to integrate with the action menu", false)] |
| 12 | + [Obsolete( |
| 13 | + "This class is only here for compatibility reasons! Please use ActionMenuApi.Api.CustomSubMenu/VRCActionMenuPage/AMUtils for new updated methods to integrate with the action menu", |
| 14 | + false)] |
17 | 15 | public static class AMAPI
|
18 | 16 | {
|
19 |
| - |
20 |
| - [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddButton()", false)] |
21 |
| - public static void AddButtonPedalToMenu(ActionMenuPageType pageType, string text, Action triggerEvent, Texture2D icon = null, Insertion insertion = Insertion.Post) |
| 17 | + [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddButton()", |
| 18 | + false)] |
| 19 | + public static void AddButtonPedalToMenu(ActionMenuPageType pageType, string text, Action triggerEvent, |
| 20 | + Texture2D icon = null, Insertion insertion = Insertion.Post) |
22 | 21 | {
|
23 |
| - VRCActionMenuPage.AddPedalToList((ActionMenuPage)pageType, new PedalButton(text, icon, triggerEvent), insertion); |
| 22 | + VRCActionMenuPage.AddPedalToList((ActionMenuPage) pageType, new PedalButton(text, icon, triggerEvent), |
| 23 | + insertion); |
24 | 24 | }
|
25 |
| - |
| 25 | + |
26 | 26 | [Obsolete("This method is only here for compatibility reasons! Please use CustomSubMenu.AddButton()", false)]
|
27 | 27 | public static PedalOption AddButtonPedalToSubMenu(string text, Action triggerEvent, Texture2D icon = null)
|
28 | 28 | {
|
29 |
| - return CustomSubMenu.AddButton(text, triggerEvent, icon, false); |
| 29 | + return CustomSubMenu.AddButton(text, triggerEvent, icon); |
30 | 30 | }
|
31 |
| - |
32 |
| - [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddRadialPuppet()", false)] |
33 |
| - public static void AddRadialPedalToMenu(ActionMenuPageType pageType, string text, Action<float> onUpdate, float startingValue = 0, Texture2D icon = null, Insertion insertion = Insertion.Post) |
| 31 | + |
| 32 | + [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddRadialPuppet()", |
| 33 | + false)] |
| 34 | + public static void AddRadialPedalToMenu(ActionMenuPageType pageType, string text, Action<float> onUpdate, |
| 35 | + float startingValue = 0, Texture2D icon = null, Insertion insertion = Insertion.Post) |
34 | 36 | {
|
35 |
| - VRCActionMenuPage.AddPedalToList((ActionMenuPage)pageType, new PedalRadial(text, startingValue, icon, onUpdate), insertion); |
| 37 | + VRCActionMenuPage.AddPedalToList((ActionMenuPage) pageType, |
| 38 | + new PedalRadial(text, startingValue, icon, onUpdate), insertion); |
36 | 39 | }
|
37 | 40 |
|
38 |
| - [Obsolete("This method is only here for compatibility reasons! Please use CustomSubMenu.AddRadialPuppet()", false)] |
39 |
| - public static PedalOption AddRadialPedalToSubMenu(string text, Action<float> onUpdate, float startingValue = 0, Texture2D icon = null) |
| 41 | + [Obsolete("This method is only here for compatibility reasons! Please use CustomSubMenu.AddRadialPuppet()", |
| 42 | + false)] |
| 43 | + public static PedalOption AddRadialPedalToSubMenu(string text, Action<float> onUpdate, float startingValue = 0, |
| 44 | + Texture2D icon = null) |
40 | 45 | {
|
41 |
| - return CustomSubMenu.AddRadialPuppet(text, onUpdate, startingValue, icon, false); |
| 46 | + return CustomSubMenu.AddRadialPuppet(text, onUpdate, startingValue, icon); |
42 | 47 | }
|
43 |
| - |
44 |
| - [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddFourAxisPuppet()", false)] |
45 |
| - public static void AddFourAxisPedalToMenu(ActionMenuPageType pageType, string text, Action<Vector2> onUpdate,Texture2D icon = null, Insertion insertion = Insertion.Post, string topButtonText = "Up", |
| 48 | + |
| 49 | + [Obsolete( |
| 50 | + "This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddFourAxisPuppet()", |
| 51 | + false)] |
| 52 | + public static void AddFourAxisPedalToMenu(ActionMenuPageType pageType, string text, Action<Vector2> onUpdate, |
| 53 | + Texture2D icon = null, Insertion insertion = Insertion.Post, string topButtonText = "Up", |
46 | 54 | string rightButtonText = "Right", string downButtonText = "Down", string leftButtonText = "Left")
|
47 | 55 | {
|
48 |
| - VRCActionMenuPage.AddPedalToList((ActionMenuPage)pageType, new PedalFourAxis(text, icon, onUpdate, topButtonText, rightButtonText, downButtonText, leftButtonText), insertion); |
| 56 | + VRCActionMenuPage.AddPedalToList((ActionMenuPage) pageType, |
| 57 | + new PedalFourAxis(text, icon, onUpdate, topButtonText, rightButtonText, downButtonText, leftButtonText), |
| 58 | + insertion); |
49 | 59 | }
|
50 |
| - |
51 |
| - [Obsolete("This method is only here for compatibility reasons! Please use CustomSubMenu.AddFourAxisPuppet()", false)] |
52 |
| - public static PedalOption AddFourAxisPedalToSubMenu(string text, Action<Vector2> onUpdate,Texture2D icon = null, string topButtonText = "Up", |
| 60 | + |
| 61 | + [Obsolete("This method is only here for compatibility reasons! Please use CustomSubMenu.AddFourAxisPuppet()", |
| 62 | + false)] |
| 63 | + public static PedalOption AddFourAxisPedalToSubMenu(string text, Action<Vector2> onUpdate, |
| 64 | + Texture2D icon = null, string topButtonText = "Up", |
53 | 65 | string rightButtonText = "Right", string downButtonText = "Down", string leftButtonText = "Left")
|
54 | 66 | {
|
55 |
| - return CustomSubMenu.AddFourAxisPuppet(text, onUpdate, icon, false, topButtonText, rightButtonText, downButtonText, leftButtonText); |
| 67 | + return CustomSubMenu.AddFourAxisPuppet(text, onUpdate, icon, false, topButtonText, rightButtonText, |
| 68 | + downButtonText, leftButtonText); |
56 | 69 | }
|
57 |
| - |
58 |
| - [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddSubMenu()", false)] |
59 |
| - public static void AddSubMenuToMenu(ActionMenuPageType pageType, string text, Action openFunc, Texture2D icon = null, Action closeFunc = null, Insertion insertion = Insertion.Post) |
| 70 | + |
| 71 | + [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddSubMenu()", |
| 72 | + false)] |
| 73 | + public static void AddSubMenuToMenu(ActionMenuPageType pageType, string text, Action openFunc, |
| 74 | + Texture2D icon = null, Action closeFunc = null, Insertion insertion = Insertion.Post) |
60 | 75 | {
|
61 |
| - VRCActionMenuPage.AddPedalToList((ActionMenuPage)pageType, new PedalSubMenu(openFunc, text, icon, closeFunc), insertion); |
| 76 | + VRCActionMenuPage.AddPedalToList((ActionMenuPage) pageType, |
| 77 | + new PedalSubMenu(openFunc, text, icon, closeFunc), insertion); |
62 | 78 | }
|
63 |
| - |
| 79 | + |
64 | 80 | [Obsolete("This method is only here for compatibility reasons! Please use CustomSubMenu.AddSubMenu()", false)]
|
65 |
| - public static PedalOption AddSubMenuToSubMenu(string text, Action openFunc, Texture2D icon = null, Action closeFunc = null) |
| 81 | + public static PedalOption AddSubMenuToSubMenu(string text, Action openFunc, Texture2D icon = null, |
| 82 | + Action closeFunc = null) |
66 | 83 | {
|
67 |
| - return CustomSubMenu.AddSubMenu(text, openFunc, icon, false, closeFunc); |
| 84 | + return CustomSubMenu.AddSubMenu(text, openFunc, icon, false, closeFunc); |
68 | 85 | }
|
69 |
| - |
70 |
| - [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddToggle()", false)] |
71 |
| - public static void AddTogglePedalToMenu(ActionMenuPageType pageType, string text, bool startingState, Action<bool> onToggle, Texture2D icon = null, Insertion insertion = Insertion.Post) |
| 86 | + |
| 87 | + [Obsolete("This method is only here for compatibility reasons! Please use VRCActionMenuPage.AddToggle()", |
| 88 | + false)] |
| 89 | + public static void AddTogglePedalToMenu(ActionMenuPageType pageType, string text, bool startingState, |
| 90 | + Action<bool> onToggle, Texture2D icon = null, Insertion insertion = Insertion.Post) |
72 | 91 | {
|
73 |
| - VRCActionMenuPage.AddPedalToList((ActionMenuPage)pageType, new PedalToggle(text, onToggle, startingState, icon), insertion); |
| 92 | + VRCActionMenuPage.AddPedalToList((ActionMenuPage) pageType, |
| 93 | + new PedalToggle(text, onToggle, startingState, icon), insertion); |
74 | 94 | }
|
75 |
| - |
| 95 | + |
76 | 96 | [Obsolete("This method is only here for compatibility reasons! Please use CustomSubMenu.AddToggle()", false)]
|
77 |
| - public static PedalOption AddTogglePedalToSubMenu(string text, bool startingState, Action<bool> onToggle, Texture2D icon = null) |
| 97 | + public static PedalOption AddTogglePedalToSubMenu(string text, bool startingState, Action<bool> onToggle, |
| 98 | + Texture2D icon = null) |
78 | 99 | {
|
79 |
| - return CustomSubMenu.AddToggle(text, startingState, onToggle, icon, false); |
| 100 | + return CustomSubMenu.AddToggle(text, startingState, onToggle, icon); |
80 | 101 | }
|
81 |
| - |
| 102 | + |
82 | 103 | [Obsolete("This method is only here for compatibility reasons! Please use AMUtils.AddToModsFolder()", false)]
|
83 | 104 | public static void AddModFolder(string text, Action openFunc, Texture2D icon = null)
|
84 | 105 | {
|
|
0 commit comments