diff --git a/source/game/SpraycanAtlasSprite.hx b/source/game/SpraycanAtlasSprite.hx index 20ae545894..81f0c267e5 100644 --- a/source/game/SpraycanAtlasSprite.hx +++ b/source/game/SpraycanAtlasSprite.hx @@ -44,9 +44,9 @@ class SpraycanAtlasSprite extends FlxAtlasSprite { explodeEZ.animation.play("idle"); PlayState.instance.stage.add(explodeEZ); - explodeEZ.animation.finishCallback = (name:String) -> { + explodeEZ.animation.onFinish.add((name:String) -> { explodeEZ.kill(); - }; + }); } public function playCanStart():Void { diff --git a/source/game/SustainSplash.hx b/source/game/SustainSplash.hx deleted file mode 100644 index d071335b1a..0000000000 --- a/source/game/SustainSplash.hx +++ /dev/null @@ -1,103 +0,0 @@ -package game; - -import shaders.NoteColors; -import haxe.Json; -import openfl.utils.Assets; -import flixel.FlxG; -import utilities.NoteVariables; -import states.PlayState; -import game.Note.JsonData; -import shaders.ColorSwap; -import flixel.FlxSprite; - -class SustainSplash extends FlxSprite { - public var colorSwap:ColorSwap; - public var noteColor:Array = [255,0,0]; - - public var affectedbycolor:Bool = false; - public var jsonData:JsonData; - - public var target:FlxSprite; - - public function setup_splash(noteData:Int, target:FlxSprite, ?isPlayer:Bool = false, ?ui_Skin:String) { - this.target = target; - - var localKeyCount = isPlayer ? PlayState.SONG.playerKeyCount : PlayState.SONG.keyCount; - - alpha = 0.8; - - if (frames == null) { - if (Assets.exists(Paths.image('ui skins/' + PlayState.SONG.ui_Skin + "/arrows/Sustain_Splashes"))) - frames = Paths.getSparrowAtlas('ui skins/' + PlayState.SONG.ui_Skin + "/arrows/Sustain_Splashes"); - else - frames = Paths.getSparrowAtlas("ui skins/default/arrows/Sustain_Splashes"); - } - - graphic.destroyOnNoUse = false; - - animation.addByPrefix("start", "sustain cover pre", 24, false, false, false); - animation.addByPrefix("hold", "sustain splash " + NoteVariables.Other_Note_Anim_Stuff[localKeyCount - 1][noteData] + "0", 24, false, false, false); - animation.addByPrefix("end", "sustain splash end " + NoteVariables.Other_Note_Anim_Stuff[localKeyCount - 1][noteData] + "0", 24, false, false, false); - animation.finishCallback = this.onAnimationFinished; - animation.play("start", false); - - - - //setGraphicSize(Std.int(target.width * 2.5)); - - updateHitbox(); - centerOffsets(); - - if (ui_Skin == null) - ui_Skin = PlayState.SONG.ui_Skin; - - if(Assets.exists(Paths.json("ui skins/" + ui_Skin + "/config"))){ - jsonData = Json.parse(Assets.getText(Paths.json("ui skins/" + ui_Skin + "/config"))); - for (value in jsonData.values) { - this.affectedbycolor = value.affectedbycolor; - } - } - - colorSwap = new ColorSwap(); - shader = colorSwap.shader; - - if(affectedbycolor) { - noteColor = NoteColors.getNoteColor(NoteVariables.Other_Note_Anim_Stuff[PlayState.SONG.keyCount - 1][noteData]); - } - else { - noteColor = [255,0,0]; - } - colorSwap.r = noteColor[0]; - colorSwap.g = noteColor[1]; - colorSwap.b = noteColor[2]; - update(0); - } - - public function onAnimationFinished(animationName:String):Void { - if (animationName.startsWith('start')){ - animation.play('hold', true); - } - if (animationName.startsWith('hold')){ - animation.play('end', true); - } - if (animationName.startsWith('end')){ - this.visible = false; - } - } - - override function update(elapsed:Float) { - if (target != null) { - x = target.x - (target.width / 1.5); - y = target.y - (target.height / 1.5); - - color = target.color; - - flipX = target.flipX; - flipY = target.flipY; - - angle = target.angle; - } - - super.update(elapsed); - } -} \ No newline at end of file diff --git a/source/states/PlayState.hx b/source/states/PlayState.hx index b8a91cf735..e9a8583f19 100644 --- a/source/states/PlayState.hx +++ b/source/states/PlayState.hx @@ -2272,7 +2272,7 @@ class PlayState extends MusicBeatState { splash_group.add(splash); } - spr.animation.finishCallback = function(_) spr.playAnim("static"); + spr.animation.onFinish.add((animName:String) -> spr.playAnim("static")); } }); } diff --git a/source/substates/ResultsSubstate.hx b/source/substates/ResultsSubstate.hx index af86b12757..58034895f7 100644 --- a/source/substates/ResultsSubstate.hx +++ b/source/substates/ResultsSubstate.hx @@ -262,11 +262,11 @@ class ResultsSubstate extends MusicBeatSubstate { gfGood.visible = false; // gfGood.zIndex = 500; gfGood.antialiasing = Options.getData("antialiasing"); - gfGood.animation.finishCallback = _ -> { + gfGood.animation.onFinish.add((animName:String) -> { if (gfGood != null) { gfGood.animation.play('clap', true, false, 9); } - }; + }); add(gfGood); bfGood = new FlxSprite(640, -200); @@ -275,11 +275,11 @@ class ResultsSubstate extends MusicBeatSubstate { bfGood.visible = false; // bfGood.zIndex = 501; bfGood.antialiasing = Options.getData("antialiasing"); - bfGood.animation.finishCallback = function(_) { + bfGood.animation.onFinish.add(function(_) { if (bfGood != null) { bfGood.animation.play('fall', true, false, 14); } - }; + }); add(bfGood); case SHIT: @@ -384,7 +384,7 @@ class ResultsSubstate extends MusicBeatSubstate { try { scorePopin.visible = true; scorePopin.animation.play("score"); - scorePopin.animation.finishCallback = anim -> {}; + scorePopin.animation.onFinish.add(anim -> {}); } catch (e) { #if debug trace(e, ERROR); @@ -420,7 +420,7 @@ class ResultsSubstate extends MusicBeatSubstate { try { highscoreNew.visible = true; highscoreNew.animation.play("new"); - highscoreNew.animation.finishCallback = _ -> highscoreNew.animation.play("new", true, false, 16); + highscoreNew.animation.onFinish.add((animName:String) -> highscoreNew.animation.play("new", true, false, 16)); } catch (e) {} } else { highscoreNew.visible = false; @@ -576,7 +576,7 @@ class ResultsSubstate extends MusicBeatSubstate { // ratingsPopin.animation.play("idle"); // ratingsPopin.visible = true; - ratingsPopin.animation.finishCallback = anim -> { + ratingsPopin.animation.onFinish.add((animName:String) -> { // scorePopin.animation.play("score"); // scorePopin.visible = true; @@ -587,7 +587,7 @@ class ResultsSubstate extends MusicBeatSubstate { } else { highscoreNew.visible = false; } - }; + }); } // refresh(); diff --git a/source/toolbox/ChartingState.hx b/source/toolbox/ChartingState.hx index 7891903d93..e75d0a5679 100644 --- a/source/toolbox/ChartingState.hx +++ b/source/toolbox/ChartingState.hx @@ -146,9 +146,9 @@ class ChartingState extends MusicBeatState { lilBf.frames = Paths.getSparrowAtlas("charter/lil_bf", "shared"); lilBf.animation.addByPrefix("idle", "idle", 12, true); lilBf.animation.play("idle", true); - lilBf.animation.finishCallback = function(name:String) { + lilBf.animation.onFinish.add(function(name:String) { lilBf.animation.play(name, true, false, lilBf.animation.getByName(name).numFrames - 2); - } + }); lilBf.scrollFactor.set(); add(lilBf); @@ -156,9 +156,9 @@ class ChartingState extends MusicBeatState { lilOpp.frames = Paths.getSparrowAtlas("charter/lil_opp", "shared"); lilOpp.animation.addByPrefix("idle", "idle", 12, true); lilOpp.animation.play("idle", true); - lilOpp.animation.finishCallback = function(name:String) { + lilOpp.animation.onFinish.add(function(name:String) { lilOpp.animation.play(name, true, false, lilOpp.animation.getByName(name).numFrames - 2); - } + }); lilOpp.scrollFactor.set(); add(lilOpp); diff --git a/source/ui/DialogueBox.hx b/source/ui/DialogueBox.hx index cf3f817f3e..9f5f4db2d5 100644 --- a/source/ui/DialogueBox.hx +++ b/source/ui/DialogueBox.hx @@ -163,10 +163,10 @@ class DialogueBox extends FlxSpriteGroup if(current_Section.box_Anim != null && current_Section.box_Anim != "") box.animation.addByPrefix("loop", current_Section.box_Anim, current_Section.box_FPS, true); - box.animation.finishCallback = function(animName:String) { + box.animation.onFinish.add(function(animName:String) { if(animName == "open") box.animation.play("loop"); - } + }); box.animation.play("loop", true); diff --git a/source/utilities/Controls.hx b/source/utilities/Controls.hx index b8210df7c8..8c173c9cdb 100644 --- a/source/utilities/Controls.hx +++ b/source/utilities/Controls.hx @@ -240,11 +240,6 @@ class Controls extends FlxActionSet { } } - static function init():Void { - var actions = new FlxActionManager(); - FlxG.inputs.add(actions); - } - /** * Calls a function passing each action bound by the specified control * @param control