Search in sources :

Example 1 with TextElement

use of me.tom.sparse.spigot.chat.menu.element.TextElement in project VoxelGamesLibv2 by VoxelGamesLib.

the class TestCommands method chatmenu.

@Subcommand("chatmenu")
@CommandPermission("%admin")
public void chatmenu(@Nonnull User user) {
    ChatMenu menu = new ChatMenu().pauseChat(0, 0, ChatColor.RED + "[Close]");
    menu.add(new TextElement("Hello, world2!", 10, 10));
    IncrementalElement incr = new IncrementalElement(5, 5, 10);
    incr.value.setChangeCallback((s) -> System.out.println("IncrementalElement changed! " + s.getPrevious() + " -> " + s.getCurrent()));
    menu.add(incr);
    menu.openFor(user.getPlayer());
}
Also used : ChatMenu(me.tom.sparse.spigot.chat.menu.ChatMenu) TextElement(me.tom.sparse.spigot.chat.menu.element.TextElement) IncrementalElement(me.tom.sparse.spigot.chat.menu.element.IncrementalElement) Subcommand(co.aikar.commands.annotation.Subcommand) CommandPermission(co.aikar.commands.annotation.CommandPermission)

Aggregations

CommandPermission (co.aikar.commands.annotation.CommandPermission)1 Subcommand (co.aikar.commands.annotation.Subcommand)1 ChatMenu (me.tom.sparse.spigot.chat.menu.ChatMenu)1 IncrementalElement (me.tom.sparse.spigot.chat.menu.element.IncrementalElement)1 TextElement (me.tom.sparse.spigot.chat.menu.element.TextElement)1