ActionMenu API - Simple, flexible menus for various formats

Discussion in 'Resources' started by dumptruckman, Aug 5, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    dumptruckman

    ActionMenu is an API to easily create menus. So far I have 3 implementations with a 4th to come. The 3 existing are DefaultActionMenu, SignActionMenu, MapActionMenu. The default one is really ugly as it shows the menu through sendMessage() and thus will be incredibly spammy.

    Luckily it's really easy to create your own ActionMenu implementation. All you do is extend ActionMenu and implement a showMenu() method. This tells the menu how to be displayed.

    Adding menu items is also pretty simple. They need some kind of text or visual information and for you to implement the run() method. This means menu items can do whatever you want them to do.

    Currently, I'm still fleshing out the MapActionMenu but here is an example using SpaceManiac's Map API:

    And here is the very short source code to make that happen: http://pastebin.com/zn3YGA6d
    (Obviously you probably shouldn't design a plugin like I did there but hopefully it conveys the simplicity of the menus.)

    I'd love some feedback so I'll let you download it and play with it now!
    ActionMenu API v.8.4-dev

    You'll have to get documentation from the source. As of now, the MapActionMenu stuff has not been documented and is still subject to great change, as is a lot of the rest of the API.
     
  2. Offline

    wwsean08

    that's pretty awesome, i'll have to keep that in mind in case i ever need a menu
     
  3. Offline

    undeadmach1ne

    wow that looks super handy :eek:

    must learn faster and be able to make use of this...
     
  4. Offline

    Keyle

  5. Offline

    RazorFlint

    @dumptruckman Wow very nice, mind if i use your source for other tests?
     
  6. Offline

    dumptruckman

    Please refer to the license.
     
  7. Offline

    ZephyrSigmar

    Hello!
    First of all i just want to say,its amazing!
    The best thing i seen so far :)
    I started to use it in my servers own rpg plugin but this
    Code:
    menu=new MapActionMenu(this);
    line causes me this error:
    Code:
    2011-08-15 19:08:12 [SEVERE] Error occurred while enabling RPG v0.1 (Is it up to date?): org/bukkit/map/MapFont
    java.lang.NoClassDefFoundError: org/bukkit/map/MapFont
        at me.zephyr.rpg.RPG.onEnable(RPG.java:44)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:878)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:272)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:162)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:146)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ClassNotFoundException: org.bukkit.map.MapFont
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 11 more
    Any ideas? :)
     
  8. Offline

    ZephyrSigmar

  9. Offline

    tha d0ctor

    this definitely deserves a bump
     
  10. Offline

    dumptruckman

    Ack, sorry, forgot about this post... checked it when I couldn't reply.
    So, are you using the latest CB that has maps included? I have not tested it on that since it was built against the map API before it was pulled into the main project. I'll double check the package names and stuff to see if they changed when they were pulled in.

    Edit: I built it on the lastest bukkit so it should work if you update CB.
     
  11. Offline

    Daniel Heppner

    Is this still updated?
     
Thread Status:
Not open for further replies.

Share This Page