A module is a scripted class which receives all events without requiring a specific context. You may have the module active at all times, or only when another script enables it.

Constructor

@:value({ priority : 1000 })new(moduleId:String, priority:Int = 1000, ?params:Null<ModuleParams>)

Called when the module is initialized. It may not be safe to reference other modules here since they may not be loaded yet.

NOTE: To make the module start inactive, call this.active = false in the constructor.

Variables

@:value(true)active:Bool = true

Whether the module is currently active.

@:value("UNKNOWN")read onlymoduleId:String = "UNKNOWN"

@:value(1000)priority:Int = 1000

Determines the order in which modules receive events. You can modify this to change the order in which a given module receives events.

Priority 1 is processed before Priority 1000, etc.

@:value(null)state:Null<Class<Dynamic>> = null

The state this module is associated with. If set, this module will only receive events when the game is in this state.

Methods

onBeatHit(event:SongTimeScriptEvent):Void

Called when a beat is hit in the song.

onCapsuleSelected(event:CapsuleScriptEvent):Void

Called when a capsule is selected.

onCharacterConfirm(event:CharacterSelectScriptEvent):Void

Called when a character has been confirmed.

onCharacterDeselect(event:CharacterSelectScriptEvent):Void

Called when the user presses BACK after confirming a character.

onCharacterSelect(event:CharacterSelectScriptEvent):Void

Called when a character is selected.

onCountdownEnd(event:CountdownScriptEvent):Void

Called when the countdown ends, but BEFORE the song starts.

onCountdownStart(event:CountdownScriptEvent):Void

Called when the countdown begins.

onCountdownStep(event:CountdownScriptEvent):Void

Called for every step in the countdown.

onCreate(event:ScriptEvent):Void

Called when the module is first created. This happens before the title screen appears!

onDestroy(event:ScriptEvent):Void

Called when a module is destroyed. This currently only happens when reloading modules with F5.

onDifficultySwitch(event:CapsuleScriptEvent):Void

Called when the current difficulty is changed.

onFocusGained(event:FocusScriptEvent):Void

Called when the game regains focus. This does not get called if "Pause on Unfocus" is disabled.

onFocusLost(event:FocusScriptEvent):Void

Called when the game loses focus. This does not get called if "Pause on Unfocus" is disabled.

onFreeplayClose(event:FreeplayScriptEvent):Void

Called when Freeplay is closed.

onFreeplayIntroDone(event:FreeplayScriptEvent):Void

Called when the intro for Freeplay finishes.

onFreeplayOutro(event:FreeplayScriptEvent):Void

Called when the Freeplay outro begins.

onGameOver(event:ScriptEvent):Void

Called when the player dies.

onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void

Called when the player presses a key without any notes present.

onNoteHit(event:HitNoteScriptEvent):Void

Called when a note has been hit. This gets dispatched for both the player and opponent strumlines.

onNoteIncoming(event:NoteScriptEvent):Void

Called when a note on the strumline has been rendered and is now onscreen. This gets dispatched for both the player and opponent strumlines.

onNoteMiss(event:NoteScriptEvent):Void

Called when a note has been missed. This gets dispatched for both the player and opponent strumlines.

onPause(event:PauseScriptEvent):Void

Called when the game is paused.

onResume(event:ScriptEvent):Void

Called when the game is resumed.

onScriptEvent(event:ScriptEvent):Void

Called when ANY script event is dispatched.

onSongEnd(event:ScriptEvent):Void

Called when the song ends.

onSongEvent(event:SongEventScriptEvent):Void

Called when a song event is triggered.

onSongLoaded(event:SongLoadScriptEvent):Void

Called when the song's chart has been parsed and loaded.

onSongRetry(event:SongRetryEvent):Void

Called when the song has been restarted.

onSongSelected(event:CapsuleScriptEvent):Void

Called when a song is selected.

onSongStart(event:ScriptEvent):Void

Called when the song begins.

onStateChangeBegin(event:StateChangeScriptEvent):Void

Called when the game is about to switch to a new state.

onStateChangeEnd(event:StateChangeScriptEvent):Void

Called after the game has switched to a new state.

onStateCreate(event:ScriptEvent):Void

Called when any state is created.

onStepHit(event:SongTimeScriptEvent):Void

Called when a step is hit in the song.

onSubStateCloseBegin(event:SubStateScriptEvent):Void

Called when the game is about to close a substate.

onSubStateCloseEnd(event:SubStateScriptEvent):Void

Called when a substate has been closed.

onSubStateOpenBegin(event:SubStateScriptEvent):Void

Called when the game is about to open a substate.

onSubStateOpenEnd(event:SubStateScriptEvent):Void

Called when a substate has been opened.

onUpdate(event:UpdateScriptEvent):Void

Called every frame.

toString():String