Packages
 Comm
 DB
 Debug
 Input
 Interface
 Module
 Token
 User

Objects
 bitmapwidget
 databasenode
 dragdata
 textwidget
 tokeninstance
 widget
 widgetcontainer

Elements
 buttoncontrol
 categoryselectioncontrol
 chatentry
 chatwindow
 databasecontrol
 diecontrol
 diefield
 genericcontrol
 imagecontrol
 numbercontrol
 numberfield
 portraitselectioncontrol
 script
 scrollbarcontrol
 scrollercontrol
 stringcontrol
 stringfield
 subwindow
 textbasecontrol
 tokenbag
 tokencontrol
 tokenfield
 windowclass
 windowcontrol
 windowinstance
 windowlist
 windowreferencecontrol
 windowreferencefield

Components
 categoryselectionsettings
 customdie
 desktopframe
 die
 distance
 font
 framedef
 hotkeybar
 icon
 imageupdatefolder
 importinfo
 includefile
 panel
 portraitset
 properties
 replaces
 template
 tokenroot
 tooltip
activate
deactivate
export
getModuleInfo
getModules
onActivationRequested
onModuleAdded
onModuleLoad
onModuleRemoved
onModuleUnload
onModuleUpdated
onUnloadedReference
revert
setModulePermissions



This is a global built in package that provides information about the modules available and functions for their use.

Modules are package files placed locally in 'modules' subdirectory under the program installation folder.



Interface

activate

function activate( name )

Requests the activation of a specified module. For some modules, the process is asynchronous, requiring communication with the host before the activation is completed.

Parameters

name   (string)   
The name of the module being targeted by the operation

deactivate

function deactivate( name )

Requests the deactivation of the given module. Host deactivation will not cause unloading of locally loaded client modules, only shared data. See setModulePermissions for more information.

Parameters

name   (string)   
The name of the module being targeted by the operation

export

function export( name, filename, author, hostnodes, commonnodes, clientnodes, tokens, thumbnail )

Exports a set of database nodes, images and tokens to a Fantasy Grounds compatible data module.

Parameters

name   (string)   
The visible name of the new module.
filename   (string)   
The file name of the new module.
author   (string)   
The author of the new module.
hostnodes   (table)   
A table of string values indicating the database node identifiers for the nodes which should be exported as host module data.
commonnodes   (table)   
A table of string values indicating the database node identifiers for the nodes which should be exported as common module data.
clientnodes   (table)   
A table of string values indicating the database node identifiers for the nodes which should be exported as client module data.
tokens   (table)   
A table of string values indicating the file names for the tokens which should be exported as host module data.
thumbnail   (string)   
The file name of the thumbnail graphic which should be used for the module.

Return values

(boolean)
A value of true will be returned if the export is successful, otherwise a value of false will be returned.

getModuleInfo

function getModuleInfo( name )

This function can be used to retrieve information about a particular module. The returned table contains information in the following fields.

The fields name and author are string values containing the respective information. The installed field will be true if the module is installed on the running computer, or false otherwise. If the module has been activated, the loaded field will be true. The loading field will be true if module data is being transferred from the host to the client for loading. The loadpending field set to true indicates one or more clients have made a request to load the module (and the permission setting to allow or disallow this has not been set) and that these clients are waiting for host permission to complete the loading operation. The permission field indicates the current setting for the module loading permissions, and has the possible values of "none" (value not set), "disallow" (client loading prohibited), "allow" (client loading allowed) or "autoload" (client load allowed and automatically performed). The intact field is a boolean whose value is true if there are no user modifications on the entire module, or false if any node has been modified.

Parameters

name   (string)   
The name of the module being targeted by the operation

Return values

(table)
A table containing information about the module, see above for details

getModules

function getModules( )

This function returns a list of modules available. The list will include locally available modules compatible with the current ruleset, as well as modules requested for use by clients (for the host) or loaded host modules with shared data (for clients).

To get more information on a module, see getModuleInfo.

Return values

(table)
An integer indexed table of string values containing the names of the modules available.

onActivationRequested

handler function onActivationRequested( name )

This event is fired when a client requests loading a module that does not have its permissions set. The request will remain pending (with the module not loaded) on the client until the host acknowledges the request by blocking or allowing the operation.

Parameters

name   (string)   
The name of the module causing the event

onModuleAdded

handler function onModuleAdded( name )

This event is fired when a new module is added to the list of modules. This might occur either due to clients requesting to load a module not installed on the host computer (when running as host) or the host activating modules not found locally on client computers and containing shared data (when running as a client).

Parameters

name   (string)   
The name of the module causing the event

onModuleLoad

handler function onModuleLoad( name )

This event is fired when a module is loaded.

Parameters

name   (string)   
The name of the module causing the event

onModuleRemoved

handler function onModuleRemoved( name )

This event is fired when a module is removed from the list of modules. This will occur on clients when the host unloads modules containing shared data not found as a local installation.

Parameters

name   (string)   
The name of the module causing the event

onModuleUnload

handler function onModuleUnload( name )

This event is fired when a module is unloaded.

Parameters

name   (string)   
The name of the module causing the event

onModuleUpdated

handler function onModuleUpdated( name )

This event is fired when some properties of a module are changed, typically requiring updating of a module listing interface. See the getModuleInfo function for more information on module properties.

Parameters

name   (string)   
The name of the module causing the event

onUnloadedReference

handler function onUnloadedReference( name )

This function is called when an attempt is made to open a new top level window for data contained in an unloaded module. Returning a value other than true will cause the window creation to fail, as will not having the module loaded after this function returns.

Parameters

name   (string)   
The name of the module causing the event

Return values

(boolean)
A value of true will force the engine to retry opening the window with the given module data source. Otherwise, the creation of the requested top level window fails.

revert

function revert( name )

Removes all user modifications to data loaded from the specified module, reverting it back to the original contents.

Parameters

name   (string)   
The name of the module being targeted by the operation

setModulePermissions

function setModulePermissions( name, allow, autoload )

Sets the loading permissions for the given module. This function will fail if called from a client mode script.

Parameters

name   (string)   
The name of the module being targeted by the operation
allow   (boolean)   
A value of true to allow clients to load the module, or false to prohibit loading
autoload   (boolean)   
If true, all clients that can access the module will automatically load it. The second parameter must be true for this parameter to have any effect.


'Fantasy Grounds' is a trademark of SmiteWorks Ltd. All other trademarks are the property of their respective owners.
© 2004-2010 SmiteWorks Ltd. ALL RIGHTS RESERVED.
Privacy policy