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
disableThis function gets called whenever the module is disabled.
settingChanged
settingChangedThis function gets called whenever one of the settings in the module is changed by the user.
Referencing from within the object
objectInside 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
getName(): StringReturns the name of the module.
getDescription(): String
getDescription(): StringReturns the description of the module.
enabled(): boolean
enabled(): booleanTells you if the module is enabled or not.
toggle(): void
toggle(): voidWill enable the module if its currently disabled, if the module is enabled already it will turn the module off.
enable(): void
enable(): voidEnables the module, if the module is already enabled this won't do anything.
disable(): void
disable(): voidDisables the module, if the module is already disabled this won't do anything
getSetting(String name): Setting
getSetting(String name): SettingWill get the setting from the module that matches the name given, if the setting can not be found this will return null.
EventsSettingsLast updated