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

ScrollingMenuSign v0.3

ScrollingMenuSign is a Bukkit plugin that allows you to attach a scrolling command menu to any sign on your CraftBukkit Minecraft server. A command menu consists of a title and zero or more entries: a label, a command to execute, and an optional feedback message to send to the player. By default, players can scroll through the menu entries on a sign by right-clicking it, and execute the currently-selected entry by left-clicking it, but this is fully configurable.

Installation

Very simple: copy ScrollingMenuSign.jar into your plugins/ folder. Restart/reload your server. Done.

Sections

Config File

ScrollingMenuSign uses a config file in the plugin data directory: plugins/ScrollingMenuSign/config.yml. This is a YAML file and can be edited directly if you want. If you do edit it while the server is running, it's strongly recommended to reload your changes immediately with "/sms reload" - any server reload/restart or "/sms setcfg" command will cause unreloaded changes to be overwritten.

If config.yml doesn't exist when the plugin starts up, a default one will be written (see below for list of defaults).

To view or change configuration settings from within Minecraft, you can use "/sms getcfg" and "/sms setcfg".

Example:

/sms getcfg
9 lines (page 1/1)
-----------------
sms.actions.leftclick.normal = execute
sms.actions.leftclick.sneak = none
....
-----------------

To update a setting, use "/sms setcfg ". Example:

/sms setcfg actions.leftclick.sneak execute

Known configuration keys

  • actions.leftclick.normal - action to take if a sign is left-clicked while not sneaking - default "execute"
  • actions.leftclick.sneak - action to take if a sign is left-clicked while sneaking - default "none"
  • actions.rightclick.normal - action to take if a sign is right-clicked while not sneaking - default "scrolldown"
  • actions.rightclick.sneak - action to take if a sign is right-clicked while sneaking - default "scrollup"
  • actions.wheeldown.normal - action to take if mouse wheel is rotated down while targetting a sign and not sneaking - default "none"
  • actions.wheeldown.sneak - action to take if mouse wheel is rotated down while targetting a sign and sneaking - default "scrolldown"
  • actions.wheelup.normal - action to take if mouse wheel is rotated up while targetting a sign and not sneaking - default "none"
  • actions.wheelup.sneak - action to take if mouse wheel is rotated up while targetting a sign and sneaking - default "scrollup"
  • menuitem_separator - the field separator string used in "/sms add" - default "|"

(To sneak, hold down Shift)

Valid actions for configuration keys under "actions.*" are:

  • none - as name suggests, do nothing
  • execute - execute the currently selected menu item
  • scrollup - scroll the menu up
  • scrolldown - scroll the menu down

Permissions support

ScrollingMenuSign supports the Permissions plugin, but if Permissions is not present, only server ops are allowed to manipulate menus. Non-ops are, however, allowed to scroll and execute menus.

If Permissions is present, the following command nodes are understood, each of which correspond directly to /sms command:

  • scrollingmenusign.commands.create
  • scrollingmenusign.commands.break
  • scrollingmenusign.commands.title
  • scrollingmenusign.commands.add
  • scrollingmenusign.commands.remove
  • scrollingmenusign.commands.list
  • scrollingmenusign.commands.show
  • scrollingmenusign.commands.save
  • scrollingmenusign.commands.reload
  • scrollingmenusign.commands.getcfg
  • scrollingmenusign.commands.setcfg

In addition, the following nodes are understood:

  • scrollingmenusign.scroll: allow signs to be scrolled by right-clicking
  • scrollingmenusign.execute: allow sign commands to be executed by left-clicking
  • scrollingmenusign.destroy: allow destruction of signs with a menu that is owned by another player
  • scrollingmenusign.coloursigns: allow usage of colour codes in titles and entry labels
  • scrollingmenusign.colorsigns: synonym for scrollingmenusign.coloursigns

Known bugs/limitations

  • Indirectly breaking (e.g breaking the block it's attached to) a sign with a menu won't give the player any feedback that the menu is destroyed, but the menu will be deleted.
  • Sometimes signs get destroyed and the menu object isn't deleted - creeper/TNT explosions are a common cause. If you put the sign back where it used to be and scroll it (right-click by default), the sign text will re-appear.

TODO/planned features

  • Allow commands to be executed with elevated permissions. Permissions v3 may be the answer here...
  • Allow menu entries to be deleted by label in addition to numeric index.
  • Fully synchronised menus (update menu A, changes also appear on menu B)
  • Some kind of order/sorting control on menu items.
  • Commands which take arguments? Can prompt via the chat window...
  • iConomy support?

Changelog

ScrollingMenuSign v0.2.1 (27/5/2011)

  • Fixed bug in /sms title where only the first word of a multi-word title was used
  • Most commands can now be used on the console (/sms create cannot be, and /sms show & /sms break can only be used if a menu name is passed)

ScrollingMenuSign v0.2 (26/5/2011)

  • Added colour support for menu titles & labels.
  • Titles are no longer blue by default - colour support means you can choose their colour yourself. However, any previously saved menus will have lost their colour after upgrading - sorry! You can re-colour them with the new "/sms title" command.
  • Added config file (config.yml) and "/sms getcfg" / "/sms setcfg" commands
  • Added "/sms title" command to change an existing menu's title
  • Menu item field separator for "/sms add" can now be set in configuration
  • Menu actions (left-click, right-click, mouse wheel) are now configurable.

ScrollingMenuSign v0.1.1 (25/5/2011)

  • Fixed NPE on sign creation in some circumstances
  • Fixed problem where menus were destroyed if any block was placed/removed beside a sign (bad processing of block physics event)

ScrollingMenuSign 0.1 (23/5/2011)

  • Initial release
Clone this wiki locally