Skip to content
This repository has been archived by the owner on Sep 12, 2020. It is now read-only.
/ VRCMenuUtils Public archive

A mod library that makes integrating into the VRChat menu system easier

License

Notifications You must be signed in to change notification settings

AtiLion/VRCMenuUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VRCMenuUtils

A mod library that makes integrating into the VRChat menu system easier!

How to use

In order to utilize VRCMenuUtils, it must be loaded first. You can wait for it with:

yield return VRCMenuUtilsAPI.WaitForInit();

alternatively you can use the RunBeforeFlowManager function to run a coroutine when the flow manager is disabled. Using this function is good if you wish to check for any updates to your mod and display a message to the user about them. You can use it as follows:

VRCMenuUtilsAPI.RunBeforeFlowManager(updateCheck());

IEnumerator updateCheck() {
	// Your update code
	
	// Display some message to user
}

after which you can take advantage of its functions. To create a new user info button, you need to create a new VRCEUiButton, and assign it your OnClick event. This can be done as follows:

VRCEUiButton newButton = new VRCEUiButton("Example Name", new Vector2(0f, 0f), "Button Text");
newButton.OnClick += () =>
{
  exampleFunction()
};

Afterwards, you can add it to the User Info page like this:

VRCMenuUtilsAPI.AddUserInfoButton(newButton);

For a QuickMenu button, you need to create a new VRCEUiQuickButton:

VRCEUiQuickButton newQMButton = new VRCEUiQuickButton("Example Name", new Vector2(0f, 0f), "Button\nText", "This text will appear in the tooltip of the Quick Menu", null)
newQMButton.OnClick += () =>
{
  exampleFunction()
};

Afterwards, you can add a Quick Menu button as follows:

VRCMenuUtilsAPI.AddQuickMenuButton(newQMButton);