Skip to content

gompocp/ActionMenuApi

Repository files navigation

MIT License


ActionMenuApi


Request Feature

Table of Contents

  1. Info
  2. Getting Started
  3. Usage
  4. License
  5. Acknowledgements

Info

Preview

This mod doesn't do anything on it's own.

It provides an easy way for modders to add integration with the action menu.

It supports the use of the

  • Radial Puppet
  • Four Axis Puppet
  • Button
  • Toggle Button
  • Sub Menus

Additionally allows mods to add their menus to a dedicated section on the action menu to prevent clutter.

Getting Started

To use simply add ActionMenuApi to your mods folder and reference it in your project same way as with UIX

Building

  1. Clone the repo
    git clone https://github.com/gompocp/ActionMenuApi.git
  2. Copy the .dlls from your MelonLoader\Managed folder to the Libs folder
  3. Build Solution

Usage

using ActionMenuApi.Api;
using ActionMenuApi.Pedals;
/*

Code

*/

//Call in OnApplicationStart()
//To add a button to the main page of the action menu
//                          Page to add to          Action for onClick                    Text       Texture     locked     
VRCActionMenuPage.AddButton(ActionMenuPage.Main, () => MelonLogger.Msg("Pressed Button") , "Button", buttonIcon, true);

//To add a toggle to the main page of the action menu
VRCActionMenuPage.AddToggle(ActionMenuPage.Main, testBool, b => testBool = b, "Toggle", toggleIcon);

//To add a radial pedal to the main page of the action menu
VRCActionMenuPage.AddRadialPuppet(ActionMenuPageType.Main, f => testFloatValue = f, "Radial", testFloatValue, radialIcon);

//To add a submenu to the main page of the action menu and add a toggle and button to it
VRCActionMenuPage.AddSubMenu(ActionMenuPageType.Main, 
    delegate {
        MelonLogger.Msg("Sub Menu Opened");
        AMAPI.AddButtonPedalToSubMenu(() => MelonLogger.Msg("Pressed Button In Sub Menu"), "Sub Menu Button", buttonIcon);
        AMAPI.AddTogglePedalToSubMenu(b => testBool2 = b, testBool2, "Sub Menu Toggle", toggleIcon);
    },
    "Sub Menu", 
    subMenuIcon
);

For a mod example check out the test mod here

License

Distributed under the GPL-3.0 License. See LICENSE for more information.

Project Link: https://github.com/gompocp/ActionMenuApi

Acknowledgements