-
Notifications
You must be signed in to change notification settings - Fork 3
VRCMenuUtilsAPI
Requires The VRCMenuUtils namespace
Returns true if VRCMenuUtils is initalized.
Returns the version of VRCMenuUtils.
Returns the instance of VRCUiManager.
Returns the instance of VRCUiPopupManager.
Called when a page is shown in the menu.
VRCMenuUtils.OnPageShown += (VRCUiPage page) => {
// code
};
Waits for VRCMenuUtils to initialize.
IEnumerator func() {
yield return VRCMenuUtilsAPI.WaitForInit();
// Code
}
Executes a coroutine after the VRChat flow manager is disabled and before it is enabled again.
Parameters
- func - The coroutine function to execute when the flow manager is disabled.
IEnumerator testFunc() {
yield break;
}
VRCMenuUtilsAPI.RunBeforeFlowManager(testFunc());
Shows a specific VRCUiPage on the menu.
Parameters
- page - The page to show on the menu
- removeHeader (default=true) - Should the header buttons be removed (Worlds, Social, ...)
- setupBody (default=true) - Should it create a new menu instance or just switch the menu
VRCUiPage page = VRCMenuUtilsAPI.GetPage("SocialMenu");
VRCMenuUtilsAPI.ShowUIPage(page, false, false);
Gets the VRCUiPage page of the specified pageId or null if he page is not found.
Parameters
- pageId - The ID of the page you are trying to get the instance of
Returns The VRCUiPage that matches the specified ID
VRCUiPage page = VRCMenuUtilsAPI.GetPage("SocialMenu");
Creates an alert popup in VRChat.
Parameters
- title - The title of the alert box
- body - The body/text of the alert box
- additionalSetup (default=null) - The function to execute before showing the alert box
VRCMenuUtilsAPI.Alert("Test title", "Test body");
void Alert(string title, string body, string middleButtonText, Action middleButtonAction, Action additionalSetup)
Creates an alert popup in VRChat with one button.
Parameters
- title - The title of the alert box
- body - The body/text of the alert box
- middleButtonText - The text inside the middle button of the alert
- middleButtonAction - The function to execute when the middle button is pressed
- additionalSetup (default=null) - The function to execute before showing the alert box
VRCMenuUtilsAPI.Alert("Test title", "Test body", "Button", () => {
// Code
});
void Alert(string title, string body, string leftButtonText, Action leftButtonAction, string rightButtonText, Action rightButtonAction, Action additionalSetup)
Creates an alert popup in VRChat with 2 buttons.
Parameters
- title - The title of the alert box
- body - The body/text of the alert box
- leftButtonText - The text inside of the left button of the alert
- leftButtonAction - The function to execute when the left button is pressed
- rightButtonText - The text inside of the right button of the alert
- rightButtonActionThe text inside of the right button of the alert
- additionalSetup (default=null) - The function to execute before showing the alert box
VRCMenuUtilsAPI.Alert("Test title", "Test body",
"Button 1", () => {
// Code
},
"Button 2", () => {
// Code
});
Hides the current open popup/alert.
VRCMenuUtilsAPI.HideCurrentPopup()
Adds a button to the UserInfo "More Menu".
Parameters
- button - The button to add to the menu
VRCMenuUtilsAPI.AddUserInfoButton(new VRCEUiButton("btnName", new Vector2(0f, 0f), "Test Button"));
Adds a button to the UserInfo "More Menu".
Parameters
- button - The button to add to the menu
VRCMenuUtilsAPI.AddUserInfoButton(btnTransform);
Adds a button to the UserInfo "More Menu".
Parameters
- name - The name of the button gameobject(needs to be unique)
- text - The text inside of the button that the user can see
- clickAction - The function to execute when the button is clicked
VRCMenuUtilsAPI.AddUserInfoButton("testBtn", "Test Button", () => {
// Code
});
Adds a buton the the Quick Menu "More Menu"
Parameters
- button - The button to add to the menu
VRCMenuUtilsAPI.AddQuickMenuButton(new VRCEUiQuickButton("btnText", new Vector2(0f, 0f), "Test Button", "Test tooltip"));
Adds a buton the the Quick Menu "More Menu"
Parameters
- name - The name of the button gameobject(needs to be unique)
- text - The text inside of the button that the user can see
- tooltip - The tooltip description of the button that the user can see when hovering on it
- clickAction - The function to execute when the button is clicked
VRCMenuUtilsAPI.AddQuickMenuButton("btnTest", "Test Button", "Test Tooltip", () => {
// Code
});
Sets the current Quick Menu page to the specified ID.
Parameters
- page - The ID of the page to set the current Quick Menu to
VRCMenuUtilsAPI.ShowQuickMenuPage("UserInteractMenu");
Sets the current Quick Menu page to the specified transform instance.
Parameters
- page - The transform instance to set the current Quick Menu to
VRCMenuUtilsAPI.ShowQuickMenuPage(pageTransform);