diff --git a/source/editors/EditorPlayState.hx b/source/editors/EditorPlayState.hx index 89034b3fe32..f4467af5e1c 100644 --- a/source/editors/EditorPlayState.hx +++ b/source/editors/EditorPlayState.hx @@ -47,6 +47,9 @@ class EditorPlayState extends MusicBeatState var startOffset:Float = 0; var startPos:Float = 0; + var pixelShitPart1:String = ""; + var pixelShitPart2:String = ''; + public function new(startPos:Float) { this.startPos = startPos; Conductor.songPosition = startPos - startOffset; @@ -167,6 +170,7 @@ class EditorPlayState extends MusicBeatState Paths.initNote(4, PlayState.SONG.arrowSkin); Paths.initDefaultSkin(PlayState.SONG.arrowSkin); + cachePopUpScore(); #if !android addVirtualPad(NONE, P); @@ -790,6 +794,28 @@ class EditorPlayState extends MusicBeatState return 0.15 * (!sustainNote ? 1 : 2); } + private function cachePopUpScore() + { + if (PlayState.isPixelStage) + { + pixelShitPart1 = 'pixelUI/'; + pixelShitPart2 = '-pixel'; + } + + var normalRating:String = 'ratings/' + ClientPrefs.ratingType.toLowerCase().replace(' ', '-').trim() + '/'; + + pixelShitPart1 += normalRating; + + Paths.image(pixelShitPart1 + "perfect" + pixelShitPart2); + Paths.image(pixelShitPart1 + "sick" + pixelShitPart2); + Paths.image(pixelShitPart1 + "good" + pixelShitPart2); + Paths.image(pixelShitPart1 + "bad" + pixelShitPart2); + Paths.image(pixelShitPart1 + "shit" + pixelShitPart2); + Paths.image(pixelShitPart1 + "miss" + pixelShitPart2); + + for (i in 0...10) Paths.image(pixelShitPart1 + 'num' + i + pixelShitPart2); + } + var COMBO_X:Float = 400; var COMBO_Y:Float = 340; private function popUpScore(note:Note = null):Void @@ -831,15 +857,6 @@ class EditorPlayState extends MusicBeatState spawnNoteSplashOnNote(note); } - var pixelShitPart1:String = ""; - var pixelShitPart2:String = ''; - - if (PlayState.isPixelStage) - { - pixelShitPart1 = 'pixelUI/'; - pixelShitPart2 = '-pixel'; - } - rating.loadGraphic(Paths.image(pixelShitPart1 + daRating + pixelShitPart2)); rating.screenCenter(); rating.x = coolText.x - 40; @@ -851,32 +868,17 @@ class EditorPlayState extends MusicBeatState rating.x += ClientPrefs.comboOffset[0]; rating.y -= ClientPrefs.comboOffset[1]; - var comboSpr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'combo' + pixelShitPart2)); - comboSpr.screenCenter(); - comboSpr.x = coolText.x; - comboSpr.acceleration.y = 600; - comboSpr.velocity.y -= 150; - comboSpr.visible = !ClientPrefs.hideHud; - comboSpr.x += ClientPrefs.comboOffset[0]; - comboSpr.y -= ClientPrefs.comboOffset[1]; - - comboSpr.velocity.x += FlxG.random.int(1, 10); comboGroup.add(rating); if (!PlayState.isPixelStage) { rating.setGraphicSize(Std.int(rating.width * 0.7)); rating.antialiasing = ClientPrefs.globalAntialiasing; - comboSpr.setGraphicSize(Std.int(comboSpr.width * 0.7)); - comboSpr.antialiasing = ClientPrefs.globalAntialiasing; } else { rating.setGraphicSize(Std.int(rating.width * PlayState.daPixelZoom * 0.85)); - comboSpr.setGraphicSize(Std.int(comboSpr.width * PlayState.daPixelZoom * 0.85)); } - - comboSpr.updateHitbox(); rating.updateHitbox(); var seperatedScore:Array = []; @@ -931,15 +933,9 @@ class EditorPlayState extends MusicBeatState coolText.text = Std.string(seperatedScore); FlxTween.tween(rating, {alpha: 0}, 0.2, { - startDelay: Conductor.crochet * 0.001 - }); - - FlxTween.tween(comboSpr, {alpha: 0}, 0.2, { onComplete: function(tween:FlxTween) { coolText.destroy(); - comboSpr.destroy(); - rating.destroy(); }, startDelay: Conductor.crochet * 0.001