Mod(name, isDependency)

new Mod(name, isDependency)

a class that represents a mod internally once it has been parsed and loaded

Parameters:
Name Type Default Description
name String

the unique name of this mod

isDependency boolean false

is this mod a dependency of another mod

Members

assets :Array.<Asset>

any script dependencies this mod has in the form of paths to the dependency

Default Value:
  • {};
Current Value:

dependencies :Array.<string>

any script dependencies this mod has in the form of paths to the dependency

Default Value:
  • {};
Current Value:

displayName :string

the name of this mod that should be displayed to the user

Default Value:
  • this.name
Current Value:

isDependency :boolean

if this mod is a dependency of another mod or not

Default Value:
  • false
Current Value:

lastStatus :boolean

the last status of this mod

Default Value:
  • false
Current Value:

name :string

the name of this mod MUST BE UNQUIET

offloadScript :function|null

the function to call when this mod is offloaded

Default Value:
  • null
Current Value:

onloadScript :function|null

the function to call when this mod loads

Default Value:
  • null
Current Value:

params :Object

any user configurable parameters this mod has

Default Value:
  • {};
Current Value:

status :boolean

the default status of this mod, should it be automatically enabled or not

Default Value:
  • false
Current Value:

Methods

addAsset(asset)

add an asset to the assets arr. this function handles setting up onload and offload scripts for assets

Parameters:
Name Type Description
asset Object

;

addToOffLoad(cb)

add a callback to call when this mod is unloaded/disabled

Parameters:
Name Type Description
cb function

the call back to be called

addToOnLoad(cb)

add a callback to call when this mod is loaded

Parameters:
Name Type Description
cb function

the call back to be called

getStatus()

check if this mod is enabled or not

loadFromObj(obj;)

add all members of an object to this mod

Parameters:
Name Type Description
obj; Object

setStatus(bool)

change the status of this mod

Parameters:
Name Type Description
bool bool

whether the mod is enabled or not

statusHasChanged() → {bool}

check if current status and last status are different

Returns:
bool -

whether the status has changed