Minimal presenter code:
function AddonDemo_create(){ var presenter = function(){} presenter.run = function(view, model){ } return presenter; }
Function | Description |
---|---|
run(view, model) |
Initialize the addon when a module is loaded.
|
Function | Description |
---|---|
createPreview(view, model) |
Used by the presentation editor to create preview in the editor's mode.
|
Function | Description |
---|---|
executeCommand(commandName, params) | Execute command with given *name* and *params* |
setShowErrorsMode() | Addon should mark all errors and disable all interaction |
setWorkMode() | Return to normal mode. |
reset() | Return module to initial state |
getErrorCount() | Return current number of errors |
getMaxScore() | Get maximum score for this module |
getScore() | Get current score |
getState() | Return state (as String) which should be preserved while switching between pages. |
setState(state) | Return to previously saved state. |
If you want to access player functions from the addon, you have to implement the following function:
presenter.setPlayerController = function(controller){ }
The object controller is the PlayerServices type.