Simple Menu API for Inventorys, Books and Chat
6

Mega Menus

This menu API focuses on a fluent experience with redrawing inventories that do not reset the cursor on every click. A inventory menu with this API keeps the player inventory unlocked and thus allowes for the inventory menu to accept and output items in a controlled manner.

Command for Server Admins

If a player triggered the anti glitch system you can pardon them with
/megamenus pardon <PLAYER> (permission megamenus.command.pardon)
If you changed bits in the config you can reload it with
/megamenus reload (permission megamenus.command.reload)

If you don’t feel like typing megamenus, /mm is a command alias.

To be notified when players obtain glitched items (accident or not) you can use the permission megamenus.antiglitch.notify.

A quick peek in the config:
You can change the behaviour of the anti-glitch system or turn it off in case it acts up and change the default pagination icons for the menus.

Boring dev stuff

The API itself was influenced by java AWT/Swing but is Builder oriented. Additionally the API will automatically generate pagination for menus with elements put on different pages.

Default menu elements included are:

  • Icon - does nothing, but looks pretty
  • Button - has a click callback
  • Checkbox - can be toggled on and off, has a change callback, code can set tri-state
  • Spinner - add a list of values, has a change callback
  • Slot - can provide or accept single stacks of items (not shift-clickable), has a slot chagne callback

Additionally menus hold state objects for the menu and every player in the menu. These objects do not reset automatically and are persistent until the menu is GCed. Menus can be rendered as shared, potentially allowing multiple player to interact on the same instance, or create a bound instance, that provides a separate instance for all elements so interaction does not clash between viewers.

All Elements on the menu render with Icons, collections of ItemStacks that animates with a given FPS or frametime.

Please keep in mind that the menu has to be completely refreshed (recenter mouse cursor) if the number of rows or the menu title changes throughout your menu structure. This is a game limitation.

My Minesweeper plugin is a pretty good demo plugin to get things started

Depending on this plugin

This plugin is jitpack-compatible, if you’re using gradle just add this:

repositories {
    ...
    maven { url "https://jitpack.io" }
}
dependencies {
    ...
    compile 'com.github.DosMike:MegaMenus:master-SNAPSHOT'
}

You can view the JavaDocs here

External Connections

Version Checker
This plugin uses a version checker to notify you about available updates.
This updater is disabled by default and can be enabled in config/megamenus.conf by setting the value VersionChecker to true.
If enabled it will asynchronously check (once per server start) if the Ore repository has any updates.
This will only print update notes into the server log, no files are being downlaoded!

Other Menu/GUI libraries

You might not like how I do things, and that’s ok. There are other great Menu Libraries on Ore:

Ordered alphabetically by plugin name, not by preference - Forgot a plugin? PM me on Sponge or tell me on my Discord.

Need Help?

Join my Discord

Category: Developer Tools

Published on Mar 2, 2019

views

stars

watchers

total downloads

Promoted Versions

Pages

Members