Module

The module object

Creating a new Module

Creating a module can be done by using breeze.registerModule(String name, String description, Object obj): Module

breeze.register("ModuleName", "Module description", {
    'enable': function() {
        //code goes here
    },
    'disable': function() {
        //code goes here
    },
    'settingChanged' function() {
        //code goes here
    }
});

Module functions

enable

This function gets called whenever the module is enabled.

disable

This function gets called whenever the module is disabled.

settingChanged

This function gets called whenever one of the settings in the module is changed by the user.

Referencing from within the object

Inside of the object you supply when registering the module you can reference the module itself directly via this.module

breeze.register("ModuleName", "Module description", {
    'enable': function() {
        breeze.log(this.module.getName() + "has now been enabled!")
        
        //time to turn it off again
        this.module.disable()
    },
});

Getting a existing Module

To get the object for a existing module in breeze you can use breeze.getModule(String name): Module

getName(): String

Returns the name of the module.

getDescription(): String

Returns the description of the module.

enabled(): boolean

Tells you if the module is enabled or not.

toggle(): void

Will enable the module if its currently disabled, if the module is enabled already it will turn the module off.

enable(): void

Enables the module, if the module is already enabled this won't do anything.

disable(): void

Disables the module, if the module is already disabled this won't do anything

getSetting(String name): Setting

Will get the setting from the module that matches the name given, if the setting can not be found this will return null.

EventsSettings

Last updated