[DEV/GEN] MenuMetaMod v0.8 - Client Menu Framework [1240]

Discussion in 'Inactive/Unsupported Plugins' started by GarethNZ, Mar 19, 2011.

  1. Offline

    GarethNZ

    Moved to http://dev.bukkit.org/server-mods/menumetamod/

    Show Spoiler


    MenuMetaMod - Client Menu Framework:
    Version: v0.8
    This plugin aids client server communication by providing players with numbered menus. It is designed to be used by other plugins, and also supports server-side yml configured menus.

    Features:
    • Send Menu to Client
    • Handle response, i.e. make player execute a command
    • Menu with Value parameter after selection: command is then executed with the parameter as a suffix
    • yml Config file to determine menu contents
    Download: MenuMetaMod.jar
    Requirements: Spout

    Outdated - Sample Plugin (Menu for MyWarp) MyWarpMenu.jar, requires MyWarp
    Source Code

    Changelog:
    Version 0.8
    • Initial version using Spout
    • Misc code tiding
    Version 0.7
    • Allow multiple commands for menu options ';' separated
    • Static 'Cancel' Menu option ('0' on last page)
    Version 0.6
    • Allow any text for valuemenus
    • Removed some test code
    Version 0.5.1
    • Everything inc MCMenu updated to 1.4_01
    • Changed quick menu command to /qm
    Version 0.5

    • Added configurable menus (based on comment from RustyDagger)
    • Bug fixes
    • Updated to CB 612
    Version 0.4

    • Bug fixes (updated bukkit)
    Version 0.3

    • Added Value Menu, for parameterized commands
    • Bug fixes
    Version 0.2

    • Pages managed for > 10 options / commands
    Version 0.1

    • Options are numbered 1-9,0
    Future

    • Multiple .yml files , for easy sharing of /qm 'filename'
    • Remove All the printlns (add 'debug: true' config option)
    • Parametrise config options such as "%p" = Name of the calling player.
    Example usage

    Show Spoiler
    Show Spoiler

    MenuMetaMod.sendMenu(player, new MetaModMenu(title, optionText[], commands[]) );
    // optionText = String[] of Option Titles
    // commands = String[] of Commands to execute on selection

    When the player chooses an option, the plugin makes the player execute the command at the same index in the commands array. (eg. "/warp spawn" is executed)

    For a full implementation See ~line 100 of MyWarpMenu.java, which gets a list of the warps available to the player, creates the arrays, and sends the menu.


    Config file usage
    Show Spoiler
    Show Spoiler

    On first launch, the plugin will create an empty config.yml in the plugins/MenuMetaMod/ dir.
    Fill it up with content, following the syntax of the example file: Sample config.yml

    Menus will be sent to the user following the command:

    Code:
    /qm ('command' in config.yml)
    e.g.
    /qm menu1
    
    the command
    Code:
    /qm
    will send the 1st configured menu



    Screenshots
    With MyWarpMenu
    [​IMG]


    (Obsolete) Client-Side Mod
    Show Spoiler
    Show Spoiler

    The purpose of this was to enable quick Client side responses as well.
    I have also developed a client side mod available at
    ClientSideMod-MCMenu - ModLoader Beta 1.7.3

    Client Side works with Value Menu.


    Client Side tells the server it is installed on join. (buggy at the momment)

    [21/06] Updated for MC 1.7.3
    [21/06] Updated to allow any string as input to ValueMenu
    Show Spoiler

    Configuration stored in
    .minecraft\mods\MCMenu\guiconfig.properties
    See this example file, for the syntax.
    Syntax [Key in Uppercase]=/command
    EG:
    Pushing the 'k' button calls the command "/qm" giving you the first configured menu.

    [25/05] Updated to allow configurable buttons with commands




    ClientSide Video
    Show Spoiler






     
  2. Offline

    riuthamus

    untold possibilities, if you can refine it a bit. API like this would be perfect for a book mod. Or for SERVER RULES. Can i verify something, is the clientside mod required? I assume yes but just wanted to make sure.
     
  3. Offline

    GarethNZ

    Actually no, the client side is optional, but recommended... Updated thread post with Screen-shot without mod..

    I should make a video without the mod... It just becomes a chat session, where the user can see the options in the chatlog, and replies by 'saying' the option number.

    Cheers for the interest :)
     
  4. Offline

    Don Redhorse

    really nice... like how a lot of stuff is being done by developers FOR developers... like your plugin or tkelly's help... and ofcourse the permissions plugins...

    on the other side it makes updating harder and harder as you have a lot of dependencies.. sigh.. so many options..
     
  5. Offline

    GarethNZ

    Version 0.2: Updated so the framework will handle pages if you give it > 10 options
     
  6. Offline

    diegokilla

    this looks great! cant wait to see some of the applications :D
     
  7. Offline

    GarethNZ

    Version 0.3: Added "ValueMenu" which will also ask the player for a suffix for the command selected in the menu

    Also bug fixes
     
  8. Offline

    WolwX

    That's look like really interesting but can you give us a sample menu source code ?
     
  9. Offline

    GarethNZ

    I updated the thread post with a bit more detail under 'Example usage'.

    It is just one function call though... So it is quite short :p
     
  10. Offline

    WolwX

    That's cool :D

    But I'm sorry I'm a noob at creating plugin, and when I try to use your MyWarpMenu exemple jar that's doesn't work ... :(

    Here it's the console log error :

    Code:
    13:56:24 [SEVERE] me/taylorkelly/mywarp/WarpList loading MyWarpMenu v0.1 (Is it up to date?)
    java.lang.NoClassDefFoundError: me/taylorkelly/mywarp/WarpList
    at com.shawlyne.mc.MyWarpMenu.MyWarpMenu.setMyWarp(MyWarpMenu.java:123)
    at com.shawlyne.mc.MyWarpMenu.MyWarpMenu.onEnable(MyWarpMenu.java:44)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: me.taylorkelly.mywarp.WarpList
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 12 more

    And here the error in eclipse in the MyWarpMenuListener.java line 26:

    Code:
    The method onPluginEnabled(PluginEvent) of type MyWarpMenuPluginListener must override or implement a
     supertype method
    Can you help to fix that please ?
     
  11. Offline

    GarethNZ

    Do you have the MyWarp plugin installed (mentioned in OP)

    Fixed now... Bukkit was updated. MyWarpMenu Source + Jar updated
     
  12. Offline

    Tasqa

    Awesome!!! Cant wait for this. I'll keep a close eye on this one!
     
  13. Offline

    GarethNZ

    Version 0.3.and a bit

    Client mod works nicely with Value menus & Fixed a big important bug (I don't want to talk about it)

    New videos today / tomorrow to show with / without ClientSideMod and Value menus
     
  14. Offline

    RustyDagger

    Hmm nice the client side mod just makes it into a multi choice i see How dose 1 set up the options on each page handled by plugin devs i assume Would be nice if you could add some kind of file where server owners could configure a page or 10 and options for it and the command it would run removing the need for plugins to support it and Then it could be used with like every plugin
     
  15. Offline

    GarethNZ

    Yeah the plugin needs to set up arrays of commands with some text for the option label, then make an API call... (Pages are handled automagically if there are > 10 options)

    Server side configuration is a very good idea... I'll look into it when I have some time :)
     
  16. Offline

    SubNoize

    this is amazing.. it needs to be part of bukkit
     
  17. Offline

    GarethNZ

    Version 0.5 released

    expected to be buggy at the moment, fixes as I find them

    I added config.yml to configure menus. Feel free to beg test for me :)


    Bug that I have noticed when using the ClientSide mod: configured menus that send a menu.... break the client :(
     
  18. Offline

    RustyDagger

    O nice I may try and make a bit of a system for world edit Could you add a way to bring up a facts page?

    You nearly need to set it up like a tree In the config file Not sure how you would go about it. Ill have a bit more of a think about it.
     
  19. Offline

    GarethNZ

    The best I can think of at the moment is a "menu" showing "options", but all the commands are blank..
    Which reminds me I should check to make sure the command isn't blank before calling player.performCommand(), though hopefully bukkit does that part too..

    The config file is a tree... or what did you mean?
     
  20. Offline

    ChrisX930

    Very nice Plugin :D
    I've edited my config.yml a little bit, then I'll get this Error:

    This is my config.yml (not finished yet)(german)
    http://kh-fortress.de/config.yml
     
  21. Offline

    RustyDagger

    HELPING OTHERS​

    @ChrisX930 You are missing the Configured Menu: line Im not sure where it needs to go but im sure it has to be some where Mines like at the top under menus: and indented in 4 spaces from the side. Im assuming it what sets the type of menu between a value and a preset menu.

    IDEA !!!!​
    Another idea is for Color codes in the config file that would be real handy also spaces in command names fail :( i wanted to set it up like /m name1 /m name2

    COMMENTS​
    I can not get my command name to work at all. on build 621 I had /quick work once but that is no longer working any ideas?​
     
  22. Offline

    ChrisX930

    GREAT!
    I love it <3
    Look this! http://kh-fortress.de/config.yml (not finished now)


    Question:
    Is it possible to create a second config.yml for Users?
    The first one is for Admins.
    A Menu for Admins and a Menu for users, that's what I want :)
     
  23. Offline

    RustyDagger

    Hmm here is my config its just a start for some testing but uh Command will not work.

    Code:
    toughblocks: null
    
    menus:
    
        Configured Menu:
            type: Menu
            command: mhelp
            options:
                 --------Menu List-------- : /
                /mhelp (this menu) : /
                /General ( General commands ) : /
                Turn on God : /god
                Turn off God : /ungod
    
     
  24. Offline

    ChrisX930


    This is my config.yml and it works Great.
    Try this:

    Code:
    menus:
        --------Menu List--------:
            type: Menu
            command: mhelp
            options:
                (this menu) : /mhelp
                ( General commands ) : /General
                Turn on God : /god
                Turn off God : /ungod
    
     
    GarethNZ likes this.
  25. Offline

    GarethNZ

    Oh thanks to both of you :)

    Yeah that "Configured Menu" is just the title...


    I've updated the sample config.yml to show the structure properly.. should make it less confusing for other people

    Note that the "command:" option does not add /command... I haven't worked out how to add them.
    Bukkit only allows me to specifiy the commands in a .yml in the .jar file for loading on init.
    So for now, the command is just "/quick command"



    Glad it's working :)
     
  26. Offline

    ChrisX930

    Hi GarethNZ,
    I've edited the Sourcecode a little bit, but I don't know how to compile it.
    If I need something other + your Sourcecode to compile this?
     
  27. Offline

    GarethNZ

    You need the Bukkit.jar to compile it. Then just export the Jar into the plugins folder.

    What did you change, and are you using git? Did you want to push the changes to me?
     
  28. Offline

    TheAdmiral

    Love it! Very cool!

    Yeah, I'd definitely love to have this fleshed out just a touch more. My miners hate command line stuff, so this should help immensely. Any plans on making a graphical version of the menu in the client-side mod?

    Suggestion

    Not sure how possible this is, but I'd love to have a simple way of adding a 'who' question when working server-side. So for example:

    Where do you want to go?:
    Home : /mw home
    To Player : /tp %player

    And then when they select the option of Player, it'd give a list of the players on the server:

    1. AdmiralRob
    2. Sweets
    3. Biggie
    4. Eclipse

    and so on. When they choose that of course, it'd put the player name of their choice into the %player spot of the command.

    Suggestion 2

    Also, i just noticed that the number pad doesn't work with the menu system. It'd be great if it did!
     
  29. Offline

    ChrisX930

    I've only edited the commands from /quick to /qm and translated it for my german OP's :)

    hmmm... I don't know how to use git :/
    I'm a beginner, but I want to compile it for my OPs :/

    For programming I use always "NETBEANS" (windows version)
     
  30. Offline

    GarethNZ

    What did you mean about a graphical version of the menu in the client-side mod?

    For dynamic menus, you need to make a plugin (they are very easy to write), and call sendMenu(Player, themenu)

    So you could add a plug-in to respond to /tpto, which sends a menu, and the player picks a person to tp to. (Option[] would just be an array of the playernames, and the commands[] "/tp <PlayerName>").

    Oh I'm surprised about the number pad... I'll add it in the next day or so.
     

Share This Page