OpenROV/openrov-software — pull request #256 by codewithpassion (2014-07-11 00:43:28+00:00)
Title: Feature/249 add heads up menu

# NOTE:
This depends on the pull request #255, issue #253

# NOTE2:
Up to now, most plugins on the client side defined a ''listen'' function and called it themselves.

**Now, cockpit.js is responsible for calling this function.**
first, all plugins are loaded/instantiated and afterwards, the 'listen' function is called on those who expose one.

The registratoin message for the headsUpMenu has to be sent in the listen function. otherwise a menu item might not get displayed.

# Added the heads up menu

## To Register
rov.cockpit.emit('headsUpMenu.register', {
label: "Toggle Lasers",
callback: function () {
rov.cockpit.emit('rovpilot.toggleLasers');
}
});

__The parameter can be an array of parameters__

The Example plugin shows some more elaborate features.

## Usage
Currently, the heads up menu is showed when the START button on the gamepad or the key 'e' is pressed.
While the buton/key is pressed, you can move the selection with DPAD up/down or 'd' and 'c'

The when START/e is released, the current menu item is activated.
To not activate any, move the selection up/down until no item is selected.