better events and funkinSave categorization
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package funkin.backend.scripting.events.note;
|
||||
|
||||
import funkin.game.StrumLine;
|
||||
|
||||
final class InputSystemEvent extends CancellableEvent {
|
||||
/**
|
||||
* Array containing whenever a specific control is pressed or not.
|
||||
* For example, `pressed[0]` will return whenever the left strum was pressed.
|
||||
*/
|
||||
public var pressed:Array<Bool>;
|
||||
|
||||
/**
|
||||
* Array containing whenever a specific control was pressed (not hold) this frame or not.
|
||||
* For example, `justPressed[0]` will return whenever the left strum was just pressed.
|
||||
*/
|
||||
public var justPressed:Array<Bool>;
|
||||
|
||||
/**
|
||||
* Array containing whenever a specific control was released this frame or not.
|
||||
* For example, `justReleased[0]` will return whenever the left strum was just released.
|
||||
*/
|
||||
public var justReleased:Array<Bool>;
|
||||
|
||||
/**
|
||||
* Strumline which input is being processed.
|
||||
*/
|
||||
public var strumLine:StrumLine;
|
||||
|
||||
/**
|
||||
* ID of the Strumline.
|
||||
*/
|
||||
public var strumLineID:Int;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package funkin.backend.scripting.events.note;
|
||||
|
||||
import funkin.game.Note;
|
||||
|
||||
final class NoteCreationEvent extends CancellableEvent {
|
||||
/**
|
||||
* Note that is being created
|
||||
*/
|
||||
public var note:Note;
|
||||
|
||||
/**
|
||||
* ID of the strum (from 0 to 3)
|
||||
*/
|
||||
public var strumID:Int;
|
||||
|
||||
/**
|
||||
* Note Type (ex: "My Super Cool Note", or "Mine")
|
||||
*/
|
||||
public var noteType:String;
|
||||
|
||||
/**
|
||||
* ID of the note type.
|
||||
*/
|
||||
public var noteTypeID:Int;
|
||||
|
||||
/**
|
||||
* ID of the player.
|
||||
*/
|
||||
public var strumLineID:Int;
|
||||
|
||||
/**
|
||||
* Whenever the note will need to be hit by the player
|
||||
*/
|
||||
public var mustHit:Bool;
|
||||
|
||||
/**
|
||||
* Note sprite, if you only want to replace the sprite.
|
||||
*/
|
||||
public var noteSprite:String;
|
||||
|
||||
/**
|
||||
* Note scale, if you only want to replace the scale.
|
||||
*/
|
||||
public var noteScale:Float;
|
||||
|
||||
/**
|
||||
* Sing animation suffix. "-alt" for alt anim or "" for normal notes.
|
||||
*/
|
||||
public var animSuffix:String;
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
package funkin.backend.scripting.events.note;
|
||||
|
||||
import funkin.game.Character;
|
||||
import funkin.game.Note;
|
||||
|
||||
final class NoteHitEvent extends CancellableEvent {
|
||||
@:dox(hide) public var animCancelled:Bool = false;
|
||||
@:dox(hide) public var strumGlowCancelled:Bool = false;
|
||||
@:dox(hide) public var deleteNote:Bool = true;
|
||||
@:dox(hide) public var unmuteVocals:Bool = true;
|
||||
@:dox(hide) public var enableCamZooming:Bool = true;
|
||||
@:dox(hide) public var autoHitLastSustain:Bool = true;
|
||||
|
||||
/**
|
||||
* Whenever a miss should be added.
|
||||
*/
|
||||
public var misses:Bool = true;
|
||||
/**
|
||||
* Whether this hit increases combo.
|
||||
*/
|
||||
public var countAsCombo:Bool = true;
|
||||
/**
|
||||
* Whether this hit increases the score
|
||||
*/
|
||||
public var countScore:Bool = true;
|
||||
/**
|
||||
* Whenever ratings (Rating sprite, Digits sprites and Combo sprite) should be shown or not.
|
||||
*
|
||||
* NOTE: Whether it's `true` use `displayRating` and `displayCombo` (plus `minDigitDisplay` in the PlayState class) to change what's going to pop up!
|
||||
*/
|
||||
public var showRating:Null<Bool> = null;
|
||||
/**
|
||||
* Whenever the Rating sprites should be shown or not.
|
||||
*/
|
||||
public var displayRating:Bool;
|
||||
/**
|
||||
* Whenever the Combo sprite should be shown or not (like old Week 7 patches).
|
||||
*/
|
||||
public var displayCombo:Bool;
|
||||
/**
|
||||
* Note that has been pressed
|
||||
*/
|
||||
public var note:Note;
|
||||
/**
|
||||
* Character that pressed the note.
|
||||
*/
|
||||
public var character(get, set):Character;
|
||||
/**
|
||||
* Characters that pressed the note.
|
||||
*/
|
||||
public var characters:Array<Character>;
|
||||
/**
|
||||
* Whenever the Character is a player
|
||||
*/
|
||||
public var player:Bool;
|
||||
/**
|
||||
* Note Type name (null if default note)
|
||||
*/
|
||||
public var noteType:String;
|
||||
/**
|
||||
* Suffix of the animation. "-alt" for alt notes, "" for normal ones.
|
||||
*/
|
||||
public var animSuffix:String;
|
||||
/**
|
||||
* Prefix of the rating sprite path. Defaults to "game/score/"
|
||||
*/
|
||||
public var ratingPrefix:String;
|
||||
/**
|
||||
* Suffix of the rating sprite path.
|
||||
*/
|
||||
public var ratingSuffix:String;
|
||||
/**
|
||||
* Direction of the press (0 = Left, 1 = Down, 2 = Up, 3 = Right)
|
||||
*/
|
||||
public var direction:Int;
|
||||
/**
|
||||
* Score gained after note press.
|
||||
*/
|
||||
public var score:Int;
|
||||
/**
|
||||
* Accuracy gained from pressing this note. From 0 to 1. null means no accuracy is gained.
|
||||
*/
|
||||
public var accuracy:Null<Float>;
|
||||
/**
|
||||
* The amount of health that'll be gained from pressing that note. If called from `onPlayerMiss`, the value will be negative.
|
||||
*/
|
||||
public var healthGain:Float;
|
||||
/**
|
||||
* Rating name. Defaults to "sick", "good", "bad" and "shit". Customisable.
|
||||
*/
|
||||
public var rating:String = "sick";
|
||||
/**
|
||||
* Whenever a splash should be shown when the note is hit.
|
||||
*/
|
||||
public var showSplash:Bool = false;
|
||||
/**
|
||||
* Scale of combo numbers.
|
||||
*/
|
||||
public var numScale:Float = 0.5;
|
||||
/**
|
||||
* Whenever antialiasing should be enabled on combo number.
|
||||
*/
|
||||
public var numAntialiasing:Bool = true;
|
||||
/**
|
||||
* Scale of ratings.
|
||||
*/
|
||||
public var ratingScale:Float = 0.7;
|
||||
/**
|
||||
* Whenever antialiasing should be enabled on ratings.
|
||||
*/
|
||||
public var ratingAntialiasing:Bool = true;
|
||||
/**
|
||||
* Whenever the animation should be forced to play (if it's null it will be forced based on the sprite's data xml, if it has one).
|
||||
*/
|
||||
public var forceAnim:Null<Bool> = true;
|
||||
|
||||
/**
|
||||
* Prevents the default sing animation from being played.
|
||||
*/
|
||||
public function preventAnim() {
|
||||
animCancelled = true;
|
||||
}
|
||||
|
||||
@:dox(hide)
|
||||
public function cancelAnim() {preventAnim();}
|
||||
|
||||
/**
|
||||
* Prevents the note from being deleted.
|
||||
*/
|
||||
public function preventDeletion() {
|
||||
deleteNote = false;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelDeletion() {preventDeletion();}
|
||||
|
||||
/**
|
||||
* Forces the note to be deleted.
|
||||
**/
|
||||
public function forceDeletion() {
|
||||
deleteNote = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevents the vocals volume from being set to 1 after pressing the note.
|
||||
*/
|
||||
public function preventVocalsUnmute() {
|
||||
unmuteVocals = false;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelVocalsUnmute() {preventVocalsUnmute();}
|
||||
|
||||
/**
|
||||
* Prevents the vocals volume from being muted in case its a parameter of `onPlayerMiss`
|
||||
*/
|
||||
public function preventVocalsMute() {
|
||||
unmuteVocals = true;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelVocalsMute() {preventVocalsMute();}
|
||||
|
||||
/**
|
||||
* Prevents the camera zoom every 4 beats from enabling.
|
||||
*/
|
||||
public function preventCamZooming() {
|
||||
enableCamZooming = false;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelCamZooming() {preventCamZooming();}
|
||||
|
||||
/**
|
||||
* Prevents the sustain tail (the last one) from being automatically hit when the sustain before it is hit.
|
||||
*/
|
||||
public function preventLastSustainHit() {
|
||||
autoHitLastSustain = false;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelLastSustainHit() {preventLastSustainHit();}
|
||||
|
||||
/**
|
||||
* Prevents the strum from glowing after this note has been pressed.
|
||||
*/
|
||||
public function preventStrumGlow() {
|
||||
strumGlowCancelled = true;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelStrumGlow() {preventStrumGlow();}
|
||||
|
||||
private inline function get_character()
|
||||
return characters[0];
|
||||
private function set_character(char:Character) {
|
||||
characters = [char];
|
||||
return char;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package funkin.backend.scripting.events.note;
|
||||
|
||||
import funkin.game.Character;
|
||||
import funkin.game.Note;
|
||||
|
||||
final class NoteMissEvent extends CancellableEvent {
|
||||
@:dox(hide) public var animCancelled:Bool = false;
|
||||
@:dox(hide) public var deleteNote:Bool = true;
|
||||
@:dox(hide) public var stunned:Bool = true;
|
||||
@:dox(hide) public var resetCombo:Bool = true;
|
||||
@:dox(hide) public var playMissSound:Bool = true;
|
||||
|
||||
/**
|
||||
* Note that has been missed
|
||||
*/
|
||||
public var note:Note;
|
||||
public var score:Int;
|
||||
public var misses:Int;
|
||||
public var muteVocals:Bool;
|
||||
/**
|
||||
* The amount of health that'll be gained from missing that note. If called from `onPlayerMiss`, the value will be negative.
|
||||
*/
|
||||
public var healthGain:Float;
|
||||
public var missSound:String;
|
||||
public var missVolume:Float;
|
||||
|
||||
public var ghostMiss:Bool;
|
||||
public var gfSad:Bool;
|
||||
public var gfSadAnim:String;
|
||||
public var forceGfAnim:Bool;
|
||||
/**
|
||||
* Whenever the animation should be forced to play (if it's null it will be forced based on the sprite's data xml, if it has one).
|
||||
*/
|
||||
public var forceAnim:Null<Bool>;
|
||||
/**
|
||||
* Suffix of the animation. "miss" for miss notes, "-alt" for alt notes, "" for normal ones.
|
||||
*/
|
||||
public var animSuffix:String;
|
||||
|
||||
/**
|
||||
* Character that pressed the note.
|
||||
*/
|
||||
public var character(get, set):Character;
|
||||
/**
|
||||
* Characters that pressed the note.
|
||||
*/
|
||||
public var characters:Array<Character>;
|
||||
/**
|
||||
* Whenever the Character is a player
|
||||
*/
|
||||
public var playerID:Int;
|
||||
/**
|
||||
* Note Type name (null if default note)
|
||||
*/
|
||||
public var noteType:String;
|
||||
/**
|
||||
* Direction of the press (0 = Left, 1 = Down, 2 = Up, 3 = Right)
|
||||
*/
|
||||
public var direction:Int;
|
||||
/**
|
||||
* Accuracy gained from pressing this note. From 0 to 1. null means no accuracy is gained.
|
||||
*/
|
||||
public var accuracy:Null<Float>;
|
||||
|
||||
/**
|
||||
* Prevents the miss sound from played.
|
||||
*/
|
||||
public function preventMissSound() {
|
||||
playMissSound = false;
|
||||
}
|
||||
|
||||
@:dox(hide)
|
||||
public function cancelMissSound() {preventMissSound();}
|
||||
|
||||
/**
|
||||
* Prevents the combo from being reset.
|
||||
*/
|
||||
public function preventResetCombo() {
|
||||
resetCombo = false;
|
||||
}
|
||||
|
||||
@:dox(hide)
|
||||
public function cancelResetCombo() {preventResetCombo();}
|
||||
|
||||
/**
|
||||
* Prevents the default sing animation from being played.
|
||||
*/
|
||||
public function preventStunned() {
|
||||
stunned = false;
|
||||
}
|
||||
|
||||
@:dox(hide)
|
||||
public function cancelStunned() {preventStunned();}
|
||||
|
||||
/**
|
||||
* Prevents the default sing animation from being played.
|
||||
*/
|
||||
public function preventAnim() {
|
||||
animCancelled = true;
|
||||
}
|
||||
|
||||
@:dox(hide)
|
||||
public function cancelAnim() {preventAnim();}
|
||||
|
||||
/**
|
||||
* Prevents the note from being deleted.
|
||||
*/
|
||||
public function preventDeletion() {
|
||||
deleteNote = false;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelDeletion() {preventDeletion();}
|
||||
|
||||
/**
|
||||
* Prevents the vocals volume from being set to 1 after pressing the note.
|
||||
*/
|
||||
public function preventVocalsUnmute() {
|
||||
muteVocals = true;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelVocalsUnmute() {preventVocalsUnmute();}
|
||||
|
||||
/**
|
||||
* Prevents the vocals volume from being muted in case its a parameter of `onPlayerMiss`
|
||||
*/
|
||||
public function preventVocalsMute() {
|
||||
muteVocals = false;
|
||||
}
|
||||
@:dox(hide)
|
||||
public function cancelVocalsMute() {preventVocalsMute();}
|
||||
|
||||
private inline function get_character()
|
||||
return characters[0];
|
||||
private function set_character(char:Character) {
|
||||
characters = [char];
|
||||
return char;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package funkin.backend.scripting.events.note;
|
||||
|
||||
import funkin.game.Note;
|
||||
import funkin.game.Strum;
|
||||
|
||||
final class NoteUpdateEvent extends CancellableEvent {
|
||||
@:dox(hide) public var __updateHitWindow = true;
|
||||
@:dox(hide) public var __autoCPUHit = true;
|
||||
@:dox(hide) public var __reposNote = true;
|
||||
/**
|
||||
* Note that is being updated
|
||||
*/
|
||||
public var note:Note;
|
||||
|
||||
/**
|
||||
* Time elapsed since last frame
|
||||
*/
|
||||
public var elapsed:Null<Float>;
|
||||
|
||||
/**
|
||||
* Note's strum (can be changed)
|
||||
*/
|
||||
public var strum:Strum;
|
||||
|
||||
/**
|
||||
* Cancels the hit window update.
|
||||
*/
|
||||
public function cancelWindowUpdate() {
|
||||
__updateHitWindow = false;
|
||||
}
|
||||
@:dox(hide) public function preventWindowUpdate() { cancelWindowUpdate(); }
|
||||
|
||||
/**
|
||||
* Cancels the automatic CPU hit.
|
||||
*/
|
||||
public function cancelAutoCPUHit() {
|
||||
__autoCPUHit = false;
|
||||
}
|
||||
@:dox(hide) public function preventAutoCPUHit() { cancelAutoCPUHit(); }
|
||||
|
||||
/**
|
||||
* Cancels the note position update (note will freeze).
|
||||
*/
|
||||
public function cancelPositionUpdate() {
|
||||
__reposNote = false;
|
||||
}
|
||||
@:dox(hide) public function preventPositionUpdate() { cancelPositionUpdate(); }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package funkin.backend.scripting.events.note;
|
||||
|
||||
import funkin.game.Note;
|
||||
|
||||
final class SimpleNoteEvent extends CancellableEvent {
|
||||
/**
|
||||
Note that is affected.
|
||||
**/
|
||||
public var note:Note;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package funkin.backend.scripting.events.note;
|
||||
|
||||
import funkin.game.Strum;
|
||||
|
||||
final class StrumCreationEvent extends CancellableEvent {
|
||||
@:dox(hide) public var __doAnimation = true;
|
||||
|
||||
|
||||
/**
|
||||
* The strum that is being created
|
||||
*/
|
||||
public var strum:Strum;
|
||||
|
||||
/**s
|
||||
* Player ID
|
||||
*/
|
||||
public var player:Int;
|
||||
|
||||
/**
|
||||
* Strum ID, for the sprite.
|
||||
*/
|
||||
public var strumID:Int;
|
||||
|
||||
/**
|
||||
* Animation prefix (`left` = `arrowLEFT`, `left press`, `left confirm`).
|
||||
*/
|
||||
public var animPrefix:String;
|
||||
|
||||
/**
|
||||
* Sprite path, in case you only want to change the sprite.
|
||||
*/
|
||||
public var sprite:String = "game/notes/default";
|
||||
|
||||
/**
|
||||
* Cancels the animation that makes the strum "land" in the strumline.
|
||||
*/
|
||||
public function cancelAnimation() {__doAnimation = false;}
|
||||
@:dox(hide) public function preventAnimation() {cancelAnimation();}
|
||||
}
|
||||
Reference in New Issue
Block a user