VRCMenuUtilsAPI - AtiLion/VRCMenuUtils Wiki

VRCMenuUtilsAPI Docs

Requires The VRCMenuUtils namespace

Table of Contents

Properties

bool IsIntialized

Returns true if VRCMenuUtils is initalized.

string Version

Returns the version of VRCMenuUtils.

VRCUiManager VRCUiManager

Returns the instance of VRCUiManager.

VRCUiPopupManager VRCUiPopupManager

Returns the instance of VRCUiPopupManager.

Events

Action OnPageShown

Called when a page is shown in the menu.

VRCMenuUtils.OnPageShown += (VRCUiPage page) => {
	// code
};

Coroutine Functions

IEnumerator WaitForInit()

Waits for VRCMenuUtils to initialize.

IEnumerator func() {
	yield return VRCMenuUtilsAPI.WaitForInit();

	// Code
}

Functions

void RunBeforeFlowManager(IEnumerator func)

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());

void ShowUIPage(VRCUiPage page, bool removeHeader, bool setupBody)

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);

VRCUiPage GetPage(string pageId)

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");

void Alert(string title, string body, Action additionalSetup)

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
});

void HideCurrentPopup()

Hides the current open popup/alert.

VRCMenuUtilsAPI.HideCurrentPopup()

void AddUserInfoButton(VRCEUiButton button)

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"));

void AddUserInfoButton(Transform button)

Adds a button to the UserInfo "More Menu".

Parameters

  • button - The button to add to the menu
VRCMenuUtilsAPI.AddUserInfoButton(btnTransform);

void AddUserInfoButton(string name, string text, Action clickAction)

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
});

void AddQuickMenuButton(VRCEUiQuickButton button)

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"));

void AddQuickMenuButton(string name, string text, string tooltip, Action clickAction)

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
});

void ShowQuickMenuPage(string page)

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");

void ShowQuickMenuPage(Transform page)

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);