[CHAT] Menu v0.3 - Hierarchical menu pages [1597]

Discussion in 'Inactive/Unsupported Plugins' started by cisco211, Jul 22, 2011.

  1. Offline

    cisco211

    Menu - Hierarchical menu pages

    Version: v0.3

    This simple, smart and easy to use plugin allows you to create unlimited submenus which then contains pages. Useful if you have much text which an user could/should read. Each menu is limited to 19 sub-menus/pages and a page is limited to 19 lines, to avoid the effect that you cant read all because the text does not fit in the screen.

    Important

    If you are updating from v0.1 or v0.2, then you have to rename your current config.yaml to menu.yaml!

    Notes
    Features

    • Shows hierarchical menus in chat (there is no limit how much you can interlace)
    • Each menu can contain 19 more menus/pages (more than 19 shows an error message)
    • Each page supports 19 lines of text (more than 19 shows an error message)
    • Color codes supported (for example: $RED$ for red)
    • The plugin is able to reload the config (useful if you edited the config and dont want to reload server or plugins)
    • The menu can be used in console
    • Possibility to enable/disable the colored text and reload feature
    Commands


    Code:
    /menu - shows the main menu
    /menu reload - reloads the configuration (you cant make a "/menu reload" as menu/page)
    /menu [NAME1 [NAME2 [NAME3 ...]]] - shows an menu/page. The last argument ever acts as a page.
    
    config.yml

    You may need to create that file manually in plugins/Menu/config.yml if its not automatically created
    Code:
    # Menu configuration
    # ==================
    # allowColors:
    #   Allow/Deny usage of colors.
    # allowReload:
    #   Allow/Deny reloading of the plugin.
    
    allowColors: true
    allowReload: true
    
    menu.yml

    You may need to create that file manually in plugins/Menu/menu.yml if its not automatically created
    Code:
    Menu:
        chars:
        - Show me a dollar... $$
        - Show me a minus... -
        - Show me a ampersant... &
        - "Show me a colon... :"
        - Text with new lines in config...
            New line...
            Another line...
        colors:
        - Black = $0$0 $0$0 $BLACK$BLACK
        - Dark blue = $1$1 $1$1 $DARK_BLUE$DARK_BLUE
        - Dark green = $2$2 $2$2 $DARK_GREEN$DARK_GREEN
        - Dark aqua = $3$3 $3$3 $DARK_AQUA$DARK_AQUA
        - Dark red = $4$4 $4$4 $DARK_RED$DARK_RED
        - Dark purple = $5$5 $5$5 $DARK_PURPLE$DARK_PURPLE
        - Gold = $6$6 $6$6 $GOLD$GOLD
        - Gray = $7$7 $7$7 $GRAY$GRAY
        - Dark Gray = $8$8 $8$8 $DARK_GRAY$DARK_GRAY
        - Blue = $9$9 $9$9 $BLUE$BLUE
        - Green = $a$a $A$A $GREEN$GREEN
        - Aqua = $b$b $B$B $AQUA$AQUA
        - Red = $c$c $C$C $RED$RED
        - Light purple = $d$d $D$D $LIGHT_PURPLE$LIGHT_PURPLE
        - Yellow = $e$e $E$E $YELLOW$YELLOW
        - White = $f$f $F$F $WHITE$WHITE
        submenu:
            sub1:
               sub2:
                   sub3:
                   - A page in a...
                   - very deep menu...
                   - cool hm?
    
    Colors
    "$$" means a "$"

    [​IMG]

    IMG HTML

    Download

    JAR:
    SRC: Source Code has been included in jar file.


    Screenshots

    All screenshots are based on the menu.yaml i have posted above!

    Screenshot 1: /menu
    [​IMG]

    Screenshot 2: /menu chars
    [​IMG]

    Screenshot 3: /menu colors
    [​IMG]


    Screenshot 4: /menu submenu
    [​IMG]

    Screenshot 5: /menu submenu sub1
    [​IMG]

    Screenshot 6: /menu submenu sub1 sub2
    [​IMG]

    Screenshot 7: /menu submenu sub1 sub2 sub3
    [​IMG]

    Changelog

    Version 0.3 [1597]
    • Added similar colorcodes based on ZeroZX4's post
    • Added ability to enable/disable plugin reload
    • Added ability to enable/disable color support
    • config.yaml has been moved to menu.yaml (config.yaml is now used for plugin configuration)
    • Fixed a bug in "/menu reload" where the changes are appended instead replaced
    • Added the ability to use the menu in console
    Version 0.2 [1597]

    • Some smaller improvements and fixes
    • Changed the deprecated Configuration API to the new Configuration API
    Older versions... (open)


    Version 0.1 [1000]
    • Just created the plugin


    Known Issues

    Unfixable Issues are not listed here.

    Todo

    Ideas are welcome.
    • Screenshots
    • Permission for /menu reload (Not really needed because its not a security problem)
     
  2. Offline

    MuisYa

    Good idea! Nice made, ill test it out soon :D
    Btw check youre config.yml example... (Nothing in there :3)
     
  3. Offline

    cisco211

    Fixed :)
     
  4. Offline

    MuisYa

    Ah oke, :)
    Good luck!
     
  5. Offline

    captainawesome7

    The useless spoilers, they burn [fire]
    Just fix your post, there are a few things wrong with it:
    • useless spoilers
    • Changelog has to show two latest versions without spoiler
    • Spoiler overload looks terrible
     
  6. Offline

    cisco211

    Fixed :)
     
  7. Offline

    DaNksta

    screenshots would be nice.
     
  8. Offline

    Smidds

    @DaNksta
    Yeah I'd like a picture or two just to see how this all comes out :D
     
  9. Offline

    ZeroZX4

    can you add support of
    [​IMG]

    ++++++++++++++
    edit
    ==============
    and if its possible um my english is poor so i say it as simple as i can

    can you add option that its no matter if i type /menu Chars or /menu chars
    so the size of letters no matter ?
     
  10. Hi! Great work I was looking for a plugin like this! There is just one thing.

    I edited the config.yml to only show my custom menu, deleting the chars, colors and deepmenu Menus. Then I reload the plugin using the command /menu reload and even after that it shows the chars, colors and deepmenus.

    Seems at each reload the plugin rewrite those menus in the config. Anyway to avoid that?

    EDIT: Also. Colors are not supported in the menu names. Example I have an update menu. In the config :

    $GREEN$updates

    for it to shows in game i have to type /menu $GREEN$updates, /menu updates does not work
     
  11. Offline

    cisco211

    This has been added to todo list.

    The bug will be fixed in next version.

    Atm its not possible to colorize the menu names because it breaks the logic of the yaml parser (native). I will try to find a solution for this but i cant guarantee that this feature will be included.

    These color codes are not support, because im using the yaml configuration stuff from craftbukkit. I think that was the reason why i implemented new color codes (cant remember).

    Its also not possible to make the menu names case insensitive because java requires exact key identifiers (There is no way to support this and it wasn't my idea to write a very complex plugin to support this). Just use lower case menu names and you will be fine.

    The bug has been fixed in 0.3 (did a big mistake in the new configuration stuff from craftbukkit). How i mentioned earlier, its not possible to colorize the menu names, JAVA and the YAML parser wants the exact name to read the contents from the given menu (key, section, node, call it however you want).

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  12. Offline

    Lextao

    Pictures would come very handy.
     
  13. Offline

    cisco211

    Thats what im doing atm :D

    Edit: DONE!
     
  14. Offline

    wristdirect

    It doesn't seem to like forward slashes in the line. Is there something special to get them to display?
     
  15. Offline

    cisco211

    Thats java specific, try to use the escape char "\", f.e. "\/". You could also try to encapsulate your text with "'", f.e. 'My text with special chars'
     
  16. Offline

    wristdirect

    Ah, actually, I just realized what the real problem was. Can't start a line with " or '

    Thanks for the feedback though! My users love having explanations of how new/old plugins work!
     
  17. Online

    timtower Administrator Administrator Moderator

    how to add text when the same page has an submenu?
     
  18. Offline

    cisco211

    This is technically not possible
     
  19. Offline

    DDMaxx

    Sounds like a good idea, but it doesn't work for me. I'll add the content of my menu.yml to this post. And, yes, I'm german like you (according to your profile), but I write in English for all the other guys here.

    Do you know any reason why the PlugIn always tells me that the menu I'm searching for is invalid or reloads the default menu structure? I even replaced the menu.yml inside the .jar file, but it didn't help. Any Ideas?

    Greetings from Germany!

    Maxx

    Code:
    Menu:
        Start:
        - Willkommen im Menu-Abschnitt.
        - Hier findest du die Richtlinien fuer das
        - Verhalten auf dem Server sowie die wichtigsten
        - Befehle fuer die Plugins WorldEdit und Multiverse.
        - $e$So rufst du sie auf:
        -
        - /menu - verfuegbare Menus auflisten
        - /menu Rules - Allgemeine Regeln
        - /menu EditRules - Regeln fuer WorldEdit
        - /menu MultiRules - Regeln fuer Multiverse-Portals
        - /menu Edit - Anleitung fuer WorldEdit
        - /menu Multiverse - Anleitung fuer Multiverse
        -
        - $4$Mit /menu Start kommst du immer wieder hierher zurueck!
     
        Rules:
        - $e$Allgemeine Regeln:
        - Keine mutwillige Zerstoerung!
        - Baugebiete markieren!
        - Es gilt das Recht der Erstbesetzung.
     
        EditRules:
        - $e$Regeln fuer WorldEdit:
        - Aufgrund der beschraenkten Leistungsfaehigkeit
        - des Servers ist die gleichzeitige Bearbeitung von
        - zu vielen Bloecken (Richtwert 10000) unerwuenscht,
        - um stabile Serverpeformance zu gewaehrleisten.
     
        MultiRules:
        - $e$Regeln fuer Multiverse-Portals:
        - Die Reisezentrale befindet sich im Schloss aus der
        - alten Welt, welche von nun an den Namen "Horizon"
        - traegt. Eine Kopie dieses Schlosses schwebt
        - inzwischen westlich den Haupt-Jungle-Bioms der
        - neuen Welt, genannt "Eden Prime", auf Hoehe ca. 180
        - in der Luft und beherbergt saemtliche Portale, die
        - zu anderen Punkten in beiden Welten fuehren. Alle
        - anderen Protale ausserhalb des Schlosses muessen in
        - die Zentrale fuehren, was durch eine Zielangabe zum
        - Portal "Zentral" angegeben wird.
        -
        - $e$Es gibt einen "Material-Code", der Portale und
        - $e$deren Zielwelt kennzeichnet:
        - Portale haben die Form eines Nethterportals,
        - bestehen aber aus anderen Materialien.
        - Portale, die zu Reisezentrale fuehren, haben aus
        - Glowstone zu bestehen.
        - Portale, die nach Horizon fuehren, bestehen aus
        - Bedrock, mit Glowstone in den oberen Ecken.
        - Portale, die nach Eden Prime fuehren, bestehen aus
        - Enderstein, mit Glowstone in den oberen Ecken.
        -
        - Die Bedrock-Portale befinden sich vom Zentralportal
        - gesehen links, die Enderstein-Portale rechts.
        - Diese Raeume sind mit Schildern ausgewiesen und
        - sind bindend, der Code muss eingehalten werden.
        -
        - Es ist Plicht, Portale mit einem Schild auf dem
        - rechten Pfeiler des Portals auf Augenhoehe des
        - Spielers zu kennzeichnen, auf dessen zweiter
        - Linie der Zielort des Portals vermerkt ist.
        - Davon ausgenommen sind Portale ausserhalb des
        - Schlosse, da diese immer zu Reisezentrale fuehren
        - muessen.
        -
        - Wenn du den Wunsch hast, Portale zu erstellen, die
        - aus irgendwie geartetem Grund nicht mit den Regeln
        - vereinbar sind, sind temporaere Ausnahmen in
        - Ordnung, sollen aber bitte bei mir angemeldet
        - werden.
     
        - $e$Namensgebung:
        - Portale in der Zentale sind bereits mit Schildern
        - nummeriert und sollen diese Nummerncodes als
        - Namen verwenden.
        - Portale im Rest der Welten sollen Namen haben,
        - die den Zielort beschreiben.
     
        Edit:
        - $e$Tutorial und wichtige Commands fuer WorldEdit:
        -
        - $4$Achtung: $f$Commands fuer WorldEdit werden immer mit
        -                    einem DoppelSlash $4$//$f$ begonnen.
        -
        - //wand - fuegt deinem Inventar den Zauberstab
        -                    (Holzaxt) hinzu. Im Creative-Mode vorher
        -                    eine Stelle in der Schnellzugriffsleiste
        -                    freimachen.
        -                    Linksklick setzt Position 1,
        -                    Rechtsklick setzt Position 2.
        - //undo - rueckgaengig
        - //redo - wiederholen ("rueckgaengig" rueckgaengig machen)
        - //pos1 oder //pos2 - setzt Position 1 oder 2 unter
        -                                            deinen Fuessen
        - //expand vert - Auswahlrahmen von Bedrock-Ebene
        -                                bis zur Obergrenze erweitern
        - //shift $1$Betrag$4$ Richtung$f$ - Auswahlrahmen um
        -                                                    den $1$Betrag$f$ in die
        -                                                    angegebene $4$Richtung$f$
        -                                                    verschieben
        - //count $4$Block$f$ - zaehlt die im Auswahlrahmen
        -                                enthaltenen $4$Bloecke$f$. $4$Block$f$
        -                                kann auch weggelassen werden, um
        -                                alle Bloecke zu zaehlen.
        - //set $4$Block$f$ - verwandelt alle Bloecke im
        -                            Einzugsbereich in den eingegebenen
        -                            Block, wobei Name (auf Englisch) oder
        -                            ID-Wert des Blocks verwendet werden
        -                            koennen.
        -                            "0" oder "air" zum Loeschen.
        - //replace $1$alter Block$4$ neuer Block$f$ -
        -    selbsterklaerend. Blockspezifikation wie oben.
        - //walls $4$Block$f$ - Waende im Auswahlrahmen
        -                                erstellen
        - //outline $4$Block$f$ - wie //walls, plus Boden
        -                                    und Decke
        - //stack $1$Betrag$4$ Richtung$f$ - Inhalt des
        -                                                    Auswahlrahmens um den
        -                                                $1$Betrag$f$ in die
        -                                                    angegebene $4$Richtung$f$
        -                                                    stapeln. Ideal fuer Saeulen.
        - //butcher $4$Radius$f$ - toetet alle NPCs (Viecher)
        -                                        im 3-dimensionalen Umkreis um
        -                                        dich herum.
        - //fixwater $4$Radius$f$ oder
        - //fixlava $4$Radius$f$ - wandelt alle
        -                                        Wasser- / Lavabloecke im
        -                                        2-dimensionalen Umkreis in
        -                                        Quellen, wodurch eine geordnete
        -                                        Oberflaeche entsteht. Du musst
        -                                        dich dazu neben oder im
        -                                        Wasser / in der Lava befinden.
        - //smooth $4$Betrag$f$ - laesst Landschaften und
        -                                    Steigungen im 3D-Umkreis
        -                                    natuerlich aussehen.
        -                                $4$Betrag$f$ bestimmt, wie stark die
        -                                    Umgebung veraendert wird.
        - //copy - selbsterklaerend
        - //cut - ebenso selbsterklaerend
        - //paste - Einfuegen. Geschieht in derselben Relation
        -                    zu deiner Position, wie sie beim Kopieren
        -                    gewesen ist.
        - //save $4$Name$f$ - Zwischenablage (Clipboard) als
        -                        $4$Name$f$ speichern
        - //load $4$Name$f$ - gespeichertes Clipboard laden
        - //clearclipboard - Inhalt des Clipboards loeschen
     
        Multiverse:
        - $e$Tutorial und wichtige Commands fuer
        - $e$Multiverse-Portals:
        -
        - Portale koennen zu einer beliebigen $2$Welt$f$,
        - $1$Koordinaten$f$ in einer beliebigen $2$Welt$f$
        - oder einem anderen $6$Portal$f$ fuehren.
        -
        - Ein Portal kann theoretisch beliebig gross sein und
        - jede beliebige Form haben, sollen auf diesem Server
        - aber nach den oben genannten Regeln gestaltet sein.
        - $e$Um ein Portal zu erstellen, zieht man mit dem
        - $e$Zauberstab einen Rahmen um den Durchgang des Portals
        - $e$und benutzt einen der folgenden Befehle:
        -
        - /mvp create $4$Portalname$f$ w:$2$Weltame$f$:se
        - /mvp create $4$Portalname$f$ e:$2$Weltame$f$:$1$X,Y,Z$f$
        - /mvp create $4$Portalname$f$ p:$6$Zielportal$f$
        -
        - $e$Um das Ziel eines Portals nachtraeglich zu aendern,
        - $e$waehlt man es an:
        - /mvp select $4$Portalname$f$
        - $e$Dann aendert man das Ziel mit:
        - /mvp modify dest $5$neues Ziel$f$
        -
        - &b/mvp select$f$ ohne Eingabe eines $4$Portalnamen$f$
        - zeigt dir, welches Portal gerade angewaehlt ist.
        -
        - $e$Um ein Portal zu loeschen, benutzt man:
        - /mvp remove $4$Portalname$f$
        -
        - Portale $4$muessen$f$ geloescht werden, da die
        - Zerstoerung des Rahmens das Portal nicht deaktiviert.
        - $4$Nur eigene Portale loeschen!!!
     
        submenu:
            sub1:
                sub2:
                    sub3:
                    - A page in a...
                    - very deep menu...
                    - cool hm?
    
     
  20. Offline

    md_5

    Long time no see cisco211. You will notice that this thread has now been placed into the Inactive Plugin subforum.
    If you wish to revive this plugin, please ensure that you update and test compatibility with the latest recommended Bukkit build before reporting your original post, asking for it to be moved back to the release forum.

    Thanks for your time.
    md_5
     

Share This Page