Пример #1
0
 public static void AddFourAxisPedalToMenu(ActionMenuPageType pageType, string text, Action <Vector2> onUpdate,
                                           Texture2D icon         = null, Insertion insertion = Insertion.Post, string topButtonText = "Up",
                                           string rightButtonText = "Right", string downButtonText = "Down", string leftButtonText   = "Left")
 {
     VRCActionMenuPage.AddPedalToList((ActionMenuPage)pageType,
                                      new PedalFourAxis(text, icon, onUpdate, topButtonText, rightButtonText, downButtonText, leftButtonText),
                                      insertion);
 }
Пример #2
0
 public static void AddButtonPedalToMenu(ActionMenuPageType pageType, Action triggerEvent, string text = "Button Text", Texture2D icon = null, Insertion insertion = Insertion.Post)
 {
     AddPedalToList(
         pageType,
         new PedalButton(
             text,
             icon,
             triggerEvent
             ),
         insertion
         );
 }
Пример #3
0
 public static void AddRadialPedalToMenu(ActionMenuPageType pageType, Action <float> onUpdate, string text = "Button Text", float startingValue = 0, Texture2D icon = null, Insertion insertion = Insertion.Post)
 {
     AddPedalToList(
         pageType,
         new PedalRadial(
             text,
             startingValue,
             icon,
             onUpdate
             ),
         insertion
         );
 }
Пример #4
0
 public static void AddTogglePedalToMenu(ActionMenuPageType pageType, bool startingState, System.Action <bool> onToggle, string text, Texture2D icon = null, Insertion insertion = Insertion.Post)
 {
     AddPedalToList(
         pageType,
         new PedalToggle(
             text,
             onToggle,
             startingState,
             icon
             ),
         insertion
         );
 }
Пример #5
0
 public static void AddSubMenuToMenu(ActionMenuPageType pageType, Action openFunc, string text = null,
                                     Texture2D icon = null, Action closeFunc = null, Insertion insertion = Insertion.Post)
 {
     AddPedalToList(
         pageType,
         new PedalSubMenu(
             openFunc,
             text,
             icon,
             closeFunc
             ),
         insertion
         );
 }
Пример #6
0
        private static void AddPedalToList(ActionMenuPageType pageType, PedalStruct customPedal, Insertion insertion)
        {
            switch (pageType)
            {
            case ActionMenuPageType.SDK2Expression:
                if (insertion == Insertion.Pre)
                {
                    Patches.sdk2ExpressionPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.sdk2ExpressionPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Config:
                if (insertion == Insertion.Pre)
                {
                    Patches.configPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.configPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Emojis:
                if (insertion == Insertion.Pre)
                {
                    Patches.emojisPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.emojisPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Expression:
                if (insertion == Insertion.Pre)
                {
                    Patches.expressionPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.expressionPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Main:
                if (insertion == Insertion.Pre)
                {
                    Patches.mainPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.mainPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.MenuOpacity:
                if (insertion == Insertion.Pre)
                {
                    Patches.menuOpacityPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.menuOpacityPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.MenuSize:
                if (insertion == Insertion.Pre)
                {
                    Patches.menuSizePagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.menuSizePagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Nameplates:
                if (insertion == Insertion.Pre)
                {
                    Patches.nameplatesPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.nameplatesPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.NameplatesOpacity:
                if (insertion == Insertion.Pre)
                {
                    Patches.nameplatesOpacityPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.nameplatesOpacityPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.NameplatesSize:
                if (insertion == Insertion.Pre)
                {
                    Patches.nameplatesSizePagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.nameplatesSizePagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.NameplatesVisibilty:
                if (insertion == Insertion.Pre)
                {
                    Patches.nameplatesVisibilityPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.nameplatesVisibilityPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Options:
                if (insertion == Insertion.Pre)
                {
                    Patches.optionsPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    Patches.optionsPagePost.Add(customPedal);
                }
                break;
            }
        }
Пример #7
0
        /// <summary>
        /// Adds a custom Pedal to an already existing menu in vrchat. Options are in enum ActionMenuPageType
        /// </summary>
        /// <param name="pageType">The page type you want to add your pedal to</param>
        /// <param name="triggerEvent">Called on pedal click</param>
        /// <param name="text">Pedal Text</param>
        /// <param name="icon">Pedal Icon</param>
        /// <param name="insertion">Whether to place your pedal before or after vrchat places its own</param>
        public PedalStruct AddPedalToExistingMenu(ActionMenuPageType pageType, System.Action triggerEvent, string text = "Button Text", Texture2D icon = null, Insertion insertion = Insertion.Post)
        {
            PedalStruct customPedal = new PedalStruct(text, icon, triggerEvent);

            switch (pageType)
            {
            case ActionMenuPageType.Config:
                if (insertion == Insertion.Pre)
                {
                    configPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    configPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Emojis:
                if (insertion == Insertion.Pre)
                {
                    emojisPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    emojisPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Expression:
                if (insertion == Insertion.Pre)
                {
                    expressionPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    expressionPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Main:
                if (insertion == Insertion.Pre)
                {
                    mainPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    mainPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.MenuOpacity:
                if (insertion == Insertion.Pre)
                {
                    menuOpacityPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    menuOpacityPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.MenuSize:
                if (insertion == Insertion.Pre)
                {
                    menuSizePagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    menuSizePagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Nameplates:
                if (insertion == Insertion.Pre)
                {
                    nameplatesPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    nameplatesPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.NameplatesOpacity:
                if (insertion == Insertion.Pre)
                {
                    nameplatesOpacityPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    nameplatesOpacityPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.NameplatesSize:
                if (insertion == Insertion.Pre)
                {
                    nameplatesSizePagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    nameplatesSizePagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.NameplatesVisibilty:
                if (insertion == Insertion.Pre)
                {
                    nameplatesVisibilityPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    nameplatesVisibilityPagePost.Add(customPedal);
                }
                break;

            case ActionMenuPageType.Options:
                if (insertion == Insertion.Pre)
                {
                    optionsPagePre.Add(customPedal);
                }
                else if (insertion == Insertion.Post)
                {
                    optionsPagePost.Add(customPedal);
                }
                break;
            }
            return(customPedal);
        }