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

Commit

Permalink
Version 0.2.0
Browse files Browse the repository at this point in the history
- Added quick access properties to UI components
- Renamed a few properties in UI components
- Added ScreenHeader to VRCEUi
- Added VRCEUiPage
- Added ShowUIPage to API
- Added VRCUiManager property to API
- Added VRCUiPopupManager property to API
- Added RunBeforeFlowManager to API
- Fixed update notifier
- Changed API to use quick access properties
- Changed API structure to look cleaner
  • Loading branch information
AtiLion committed Aug 13, 2019
1 parent 0860d4d commit 9a3e58b
Show file tree
Hide file tree
Showing 15 changed files with 500 additions and 185 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,41 @@ 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:
```csharp
yield return VRCMenuUtils.WaitForInit();
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:
```csharp
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:
```csharp
VRCEUiButton newButton = new VRCEUiButton("Example Name", new Vector2(0f, 0f), "Button Text");
newButton.Button.onClick.AddListener(() =>
newButton.OnClick += () =>
{
exampleFunction()
});
};
```
Afterwards, you can add it to the User Info page like this:
```csharp
VRCMenuUtils.AddUserInfoButton(newButton);
VRCMenuUtilsAPI.AddUserInfoButton(newButton);
```
For a QuickMenu button, you need to create a new VRCEUiQuickButton:
```csharp
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.Button.onClick.AddListener(() =>
newQMButton.OnClick += () =>
{
exampleQMFunction();
});
exampleFunction()
};
```
Afterwards, you can add a Quick Menu button as follows:
```csharp
VRCMenuUtils.AddQuickMenuButton(newQMButton);
VRCMenuUtilsAPI.AddQuickMenuButton(newQMButton);
```
4 changes: 2 additions & 2 deletions VRCMenuUtils/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.1.0")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyVersion("0.0.2.0")]
[assembly: AssemblyFileVersion("0.0.2.0")]
4 changes: 4 additions & 0 deletions VRCMenuUtils/VRCMenuUtils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
<Reference Include="UnityEngine">
<HintPath>..\lib\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\lib\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\lib\UnityEngine.CoreModule.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -84,6 +87,7 @@
<Compile Include="VRChat\UI\QuickMenuUI\VRCEUiQuickButton.cs" />
<Compile Include="VRChat\UI\QuickMenuUI\VRCEUiQuickMenu.cs" />
<Compile Include="VRChat\UI\Scrolling\VRCEUiVerticalScrollView.cs" />
<Compile Include="VRChat\UI\VRCEUiPage.cs" />
<Compile Include="VRChat\UI\VRCEUiText.cs" />
<Compile Include="VRChat\UI\VRCEUiVolumeControl.cs" />
<Compile Include="VRCMenuUtilsAPI.cs" />
Expand Down
Loading

0 comments on commit 9a3e58b

Please sign in to comment.