Skip to content

Commit

Permalink
Merge branch 'main' into mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanSantiagoYT committed Oct 22, 2024
2 parents 7394aba + 7c6e915 commit 2fd8691
Showing 1 changed file with 26 additions and 30 deletions.
56 changes: 26 additions & 30 deletions source/editors/EditorPlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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<Int> = [];
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2fd8691

Please sign in to comment.