2022-03-11 06:30:01 +00:00
|
|
|
package funkin.modding;
|
|
|
|
|
|
|
|
import funkin.modding.events.ScriptEvent;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines a set of callbacks available to all scripted classes.
|
|
|
|
*
|
|
|
|
* Includes events handling basic life cycle relevant to all scripted classes.
|
|
|
|
*/
|
|
|
|
interface IScriptedClass
|
|
|
|
{
|
|
|
|
public function onScriptEvent(event:ScriptEvent):Void;
|
|
|
|
|
|
|
|
public function onCreate(event:ScriptEvent):Void;
|
|
|
|
public function onDestroy(event:ScriptEvent):Void;
|
|
|
|
public function onUpdate(event:UpdateScriptEvent):Void;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-03-15 00:48:45 +00:00
|
|
|
* Defines a set of callbacks available to scripted classes which can follow the game between states.
|
2022-03-11 06:30:01 +00:00
|
|
|
*/
|
2022-03-15 00:48:45 +00:00
|
|
|
interface IStateChangingScriptedClass extends IScriptedClass
|
2022-03-11 06:30:01 +00:00
|
|
|
{
|
2022-03-15 00:48:45 +00:00
|
|
|
public function onStateChangeBegin(event:StateChangeScriptEvent):Void;
|
|
|
|
public function onStateChangeEnd(event:StateChangeScriptEvent):Void;
|
2022-03-21 04:19:05 +00:00
|
|
|
|
|
|
|
public function onSubstateOpenBegin(event:SubStateScriptEvent):Void;
|
|
|
|
public function onSubstateOpenEnd(event:SubStateScriptEvent):Void;
|
|
|
|
public function onSubstateCloseBegin(event:SubStateScriptEvent):Void;
|
|
|
|
public function onSubstateCloseEnd(event:SubStateScriptEvent):Void;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines a set of callbacks available to scripted classes which represent notes.
|
|
|
|
*/
|
|
|
|
interface INoteScriptedClass extends IScriptedClass
|
|
|
|
{
|
|
|
|
public function onNoteHit(event:NoteScriptEvent):Void;
|
|
|
|
public function onNoteMiss(event:NoteScriptEvent):Void;
|
2022-03-11 06:30:01 +00:00
|
|
|
}
|
|
|
|
|
2022-03-15 00:48:45 +00:00
|
|
|
/**
|
|
|
|
* Developer note:
|
|
|
|
*
|
|
|
|
* I previously considered adding events for onKeyDown, onKeyUp, mouse events, etc.
|
|
|
|
* However, I realized that you can simply call something like the following within a module:
|
|
|
|
* `FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);`
|
|
|
|
* This is more efficient than adding an entire event handler for every key press.
|
|
|
|
*
|
|
|
|
* -Eric
|
|
|
|
*/
|
2022-03-11 06:30:01 +00:00
|
|
|
/**
|
|
|
|
* Defines a set of callbacks available to scripted classes that involve the lifecycle of the Play State.
|
|
|
|
*/
|
|
|
|
interface IPlayStateScriptedClass extends IScriptedClass
|
|
|
|
{
|
2022-03-30 01:56:04 +00:00
|
|
|
public function onPause(event:PauseScriptEvent):Void;
|
2022-03-11 06:30:01 +00:00
|
|
|
public function onResume(event:ScriptEvent):Void;
|
|
|
|
|
2022-03-13 18:36:03 +00:00
|
|
|
public function onSongLoaded(eent:SongLoadScriptEvent):Void;
|
2022-03-11 06:30:01 +00:00
|
|
|
public function onSongStart(event:ScriptEvent):Void;
|
|
|
|
public function onSongEnd(event:ScriptEvent):Void;
|
|
|
|
public function onGameOver(event:ScriptEvent):Void;
|
2022-03-21 04:19:05 +00:00
|
|
|
public function onSongRetry(event:ScriptEvent):Void;
|
2022-03-11 06:30:01 +00:00
|
|
|
|
|
|
|
public function onNoteHit(event:NoteScriptEvent):Void;
|
|
|
|
public function onNoteMiss(event:NoteScriptEvent):Void;
|
2022-03-21 04:19:05 +00:00
|
|
|
public function onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void;
|
2022-03-11 06:30:01 +00:00
|
|
|
|
|
|
|
public function onStepHit(event:SongTimeScriptEvent):Void;
|
|
|
|
public function onBeatHit(event:SongTimeScriptEvent):Void;
|
|
|
|
|
|
|
|
public function onCountdownStart(event:CountdownScriptEvent):Void;
|
|
|
|
public function onCountdownStep(event:CountdownScriptEvent):Void;
|
2022-03-13 18:36:03 +00:00
|
|
|
public function onCountdownEnd(event:CountdownScriptEvent):Void;
|
2022-03-11 06:30:01 +00:00
|
|
|
}
|