Skip to content

Commit

Permalink
flxtimer bull
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Aug 26, 2023
1 parent 5476a83 commit dd2b8cf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
16 changes: 10 additions & 6 deletions source/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4756,9 +4756,11 @@ class PlayState extends MusicBeatState
CustomFadeTransition.nextCamera = null;
}

persistentUpdate = true;
openSubState(new ResultsSubState(sicks, goods, bads, shits, Std.int(campaignScore), Std.int(campaignMisses),
Highscore.floorDecimal(ratingPercent * 100, 2), ratingName, ratingFC));
new FlxTimer().start(1, function(tmr:FlxTimer) {
persistentUpdate = true;
openSubState(new ResultsSubState(sicks, goods, bads, shits, Std.int(campaignScore), Std.int(campaignMisses),
Highscore.floorDecimal(ratingPercent * 100, 2), ratingName, ratingFC));
});

if(!ClientPrefs.getGameplaySetting('practice', false) && !ClientPrefs.getGameplaySetting('botplay', false)) {
StoryMenuState.weekCompleted.set(WeekData.weeksList[storyWeek], true);
Expand Down Expand Up @@ -4818,9 +4820,11 @@ class PlayState extends MusicBeatState
CustomFadeTransition.nextCamera = null;
}

persistentUpdate = true;
openSubState(new ResultsSubState(sicks, goods, bads, shits, songScore, songMisses,
Highscore.floorDecimal(ratingPercent * 100, 2), ratingName, ratingFC));
new FlxTimer().start(1, function(tmr:FlxTimer) {
persistentUpdate = true;
openSubState(new ResultsSubState(sicks, goods, bads, shits, songScore, songMisses,
Highscore.floorDecimal(ratingPercent * 100, 2), ratingName, ratingFC));
});

changedDifficulty = false;
}
Expand Down
20 changes: 16 additions & 4 deletions source/meta/substate/ResultsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package meta.substate;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import flixel.tweens.FlxEase;

import flixel.util.FlxColor;
import flixel.util.FlxTimer;

import meta.*;
import meta.state.*;

import meta.state.PlayState;

// ? <-- looks like the glottal stop!!
Expand Down Expand Up @@ -49,12 +52,12 @@ class ResultsSubState extends MusicBeatSubstate

bg = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
bg.scale.set(10, 10);
bg.alpha = 0.5;
bg.alpha = 0;
add(bg);

var versionShit:FlxText = new FlxText(12, FlxG.height - 24, 0, 'Press ACCEPT to continue.', 12);
versionShit.scrollFactor.set();
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
versionShit.setFormat("VCR OSD Mono", 26, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(versionShit);

titleTxt = new FlxText(0, 0, 0, 'RESULTS', 72);
Expand All @@ -80,6 +83,15 @@ class ResultsSubState extends MusicBeatSubstate
resultsTxt.updateHitbox();
add(resultsTxt);

versionShit.alpha = 0;
resultsTxt.alpha = 0;
titleTxt.alpha = 0;

FlxTween.tween(bg, {alpha: 0.5}, 0.75, {ease: FlxEase.quadOut});
FlxTween.tween(titleTxt, {alpha: 1}, 1, {ease: FlxEase.quadOut});
FlxTween.tween(resultsTxt, {alpha: 1}, 2, {ease: FlxEase.quadOut});
FlxTween.tween(versionShit, {alpha: 1}, 3, {ease: FlxEase.quadOut});

super.create();

cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
Expand All @@ -105,4 +117,4 @@ class ResultsSubState extends MusicBeatSubstate
FlxG.sound.playMusic(Paths.music('freakyMenu'));
}
}
}
}

0 comments on commit dd2b8cf

Please sign in to comment.