Skip to content
desht edited this page Jun 1, 2011 · 20 revisions

Usage

Creating a menu

Method 1

To create a new scrolling menu, place a sign (contents don't matter, it can be blank), look at it, then type: /sms create <title>

name is a unique name to identify the menu. title is the menu title, and is always shown as the top line of the scrolling menu sign.

When you do this, the menu becomes associated with the sign. The sign's appearance will change; the title will be shown as "Title" centred on the first line, and the third line will look like ">" (this is the currently selected menu item - it's blank because the menu has no entries yet).

Example:

/sms create mymenu Time of Day

Menu titles can be coloured - use the '&X' notation to specify a colour. Example:

/sms create mymenu &4Time of Day

gives the sign a red title. See http://www.minecraftwiki.net/wiki/Classic_server_protocol#Color_Codes for a list of the numeric (hex) codes (yes, that page is from Classic, but the codes are still valid). Be aware that colour codes use up characters from the sign's 15 characters-per-line limit.

Method 2

Alternatively, you can place a sign with the following text:

LINE 1: [sms]
LINE 2: <name>
LINE 3: <title>
LINE 4: (BLANK)

When you punch (i.e. left-click with no held item) such a sign, a menu will be created and associated with the sign, if possible.

Method 3

You can add a new sign to an existing menu too. In this case, the sign is automatically synchronised with all other signs belonging to that menu - only the scrolling position is maintained independently. To do this, look at a sign (which doesn't belong to any menu) and type:

/sms sync <existing-name>

Or you can create a sign with the following text:

LINE 1: [sms]
LINE 2: <existing-name>
LINE 3: (BLANK)
LINE 4: (BLANK)

and punch it, as in Method 2.

Method 4

Finally, you can create a new menu as a copy of an existing menu. Look at a sign and type:

/sms create <name> from <other-name>

where other-name is the unique identifier of a menu that already exists.

Example:

/sms create mymenu2 from mymenu

mymenu2 will be an exact copy of mymenu, including the title. However, after it's created, the two menus will be independent of each other; any items added to one menu will not appear in the other. If you want that, see Method 3.

Destroying a menu

To destroy a menu, there are two options:

  • Look at a menu sign, and type "/sms delete"
  • Type "/sms delete name" where name is a unique menu name

When you do this, all signs that were associated with the menu will go blank.

Removing a sign from a menu

If you want to remove a sign from a menu, there are a few options:

  • Look at a sign, and type "/sms break".
  • Take an axe to the sign!
  • Break the block to which the sign is attached.

Destroying a sign which has a menu created by another player is only allowed with the appropriate permission (see Permissions Support below).

Note that taking an axe to the sign will trigger the sign's currently selected menu item if left-click is configured to execute items (which is the default). So using "/sms break" is the preferred option.

Example:

/sms break

Changing a menu's title

To change a menu's title, type "/sms title name new title"

Example:

/sms title mymenu &2Time of Day

Colour codes are accepted, as in "/sms create".

Adding menu entries

To add a menu item to an existing menu, type "/sms add name item-specifier"

The syntax of item-specifier is "label|command[|message]". This is most easily explained by example:

/sms add mymenu Day|/time day|It's daytime!
/sms add mymenu Night|/time night|It's night time!

adds a menu entry to the menu called mymenu with a label of "Day", and one with a label of "Night". If "Day" is executed (left-clicked), it will issue "/time day" as a command, and send a message to the player of "It's daytime!". Similarly for "Night".

If you don't like the default field separator (|), you can change it to any other string - example:

/sms setcfg menuitem_separator ::

Then you can do:

/sms add mymenu Day::/time day::It's daytime!

You can also leave out the message if you want, e.g.:

/sms add mymenu Compass|/compass

If the command doesn't start with a slash (/), then the player will speak the command string instead, e.g.:

/sms add mymenu Say hello|Hello everyone!

Menu labels can be coloured, just like sign titles. The same syntax applies. Example:

/sms add mymenu &1Compass|/compass

gives this entry a blue label.

Removing menu entries

To remove a menu item from an existing menu, type "/sms remove name index". Example:

/sms remove mymenu 1

removes the first item in the menu. To find which index corresponds to which item, you can use "/sms show", see below. Removing items by label is on the TODO list.

Interacting with a menu

These are the default bindings to interact with a menu (but they are fully configurable - see section Config File below):

  • Left-click on a menu executes the currently-selected item
  • Right-click on a menu scrolls the menu downwards
  • Shift (sneak) + right-click on a menu scrolls the menu upwards
  • Shift + mouse wheel up or down while looking at a menu scrolls it in the corresponding direction

Listing all menus

To show all menus that have been defined, use "/sms list". Example:

/sms list
1 line (page 1/1)
-------------------------
mymenu @ -100,65,50 world "Time of Day" [3]
-------------------------

That's the menu named "mymenu" at location (-100,65,50) on world "world" with title "Time Control", and has 3 entries.

Show menu detail

To show information for a menu including all entries, use "/sms show name". Example:

/sms show mymenu
4 lines (page 1/1)
-------------------------
Menu 'mymenu': title 'Time of Day'
 1) Day [/time day] "It's daytime!"
 2) Night [/time night] "It's night time!"
 3) Compass [/compass] ""
-------------------------

Output paging

The output of "/sms list" and "/sms show" could be too large to fit on screen. In this case, further pages of output from the last list or show command can be shown with "/sms page page-num". Example:

/sms page 2

Forcing menu data & configuration to be saved

To force menu and configuration data to be written to disk immediately:

/sms save

You will not normally need to do this, since it's automatically done if the server is stopped or if the plugin is reloaded. Additionally, configuration data is saved whenever a change is made via "/sms setcfg".

The following data files (in plugins/ScrollingMenuSign) are used:

  • config.yml - stores plugin configuration items
  • scrollingmenus.yml - menu persistence data

Forcing menu data & configuration to be reloaded

To force menu and configuration data to be reloaded:

/sms reload

This may be useful if you choose to edit the config.yml or scrollingmenus.yml data files directly.

Clone this wiki locally