1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-11-26 06:09:02 +00:00

hopefully final polish?

This commit is contained in:
anysad 2024-07-18 17:56:54 +03:00 committed by EliteMasterEric
parent 82a6ca5916
commit d07564cdc2
2 changed files with 15 additions and 24 deletions

View file

@ -71,8 +71,6 @@ class Countdown
// @:privateAccess // @:privateAccess
// PlayState.instance.dispatchEvent(new SongTimeScriptEvent(SONG_BEAT_HIT, 0, 0)); // PlayState.instance.dispatchEvent(new SongTimeScriptEvent(SONG_BEAT_HIT, 0, 0));
fetchNoteStyle();
// The timer function gets called based on the beat of the song. // The timer function gets called based on the beat of the song.
countdownTimer = new FlxTimer(); countdownTimer = new FlxTimer();
@ -90,10 +88,10 @@ class Countdown
// PlayState.instance.dispatchEvent(new SongTimeScriptEvent(SONG_BEAT_HIT, 0, 0)); // PlayState.instance.dispatchEvent(new SongTimeScriptEvent(SONG_BEAT_HIT, 0, 0));
// Countdown graphic. // Countdown graphic.
showCountdownGraphic(countdownStep, noteStyle); showCountdownGraphic(countdownStep);
// Countdown sound. // Countdown sound.
playCountdownSound(countdownStep, noteStyle); playCountdownSound(countdownStep);
// Event handling bullshit. // Event handling bullshit.
var cancelled:Bool = propagateCountdownEvent(countdownStep); var cancelled:Bool = propagateCountdownEvent(countdownStep);
@ -223,7 +221,7 @@ class Countdown
/** /**
* Retrieves the graphic to use for this step of the countdown. * Retrieves the graphic to use for this step of the countdown.
*/ */
public static function showCountdownGraphic(index:CountdownStep, noteStyle:NoteStyle):Void public static function showCountdownGraphic(index:CountdownStep):Void
{ {
var indexString:String = null; var indexString:String = null;
switch (index) switch (index)
@ -240,7 +238,7 @@ class Countdown
if (indexString == null) return; if (indexString == null) return;
var spritePath:String = null; var spritePath:String = null;
spritePath = resolveGraphicPath(noteStyle, indexString); spritePath = resolveGraphicPath(indexString);
if (spritePath == null) return; if (spritePath == null) return;
@ -259,26 +257,21 @@ class Countdown
countdownSprite.cameras = [PlayState.instance.camHUD]; countdownSprite.cameras = [PlayState.instance.camHUD];
countdownSprite.updateHitbox(); countdownSprite.updateHitbox();
countdownSprite.screenCenter();
// Fade sprite in, then out, then destroy it. // Fade sprite in, then out, then destroy it.
FlxTween.tween(countdownSprite, {y: countdownSprite.y += 100}, Conductor.instance.beatLengthMs / 1000, FlxTween.tween(countdownSprite, {alpha: 0}, Conductor.instance.beatLengthMs / 1000,
{ {
ease: FlxEase.cubeInOut, ease: fadeEase,
onComplete: function(twn:FlxTween) { onComplete: function(twn:FlxTween) {
countdownSprite.destroy(); countdownSprite.destroy();
} }
}); });
FlxTween.tween(countdownSprite, {alpha: 0}, Conductor.instance.beatLengthMs / 1000,
{
ease: fadeEase
});
PlayState.instance.add(countdownSprite); PlayState.instance.add(countdownSprite);
countdownSprite.screenCenter();
} }
static function resolveGraphicPath(noteStyle:NoteStyle, index:String):Null<String> static function resolveGraphicPath(index:String):Null<String>
{ {
fetchNoteStyle(); fetchNoteStyle();
var basePath:String = 'ui/countdown/'; var basePath:String = 'ui/countdown/';
@ -307,12 +300,12 @@ class Countdown
/** /**
* Retrieves the sound file to use for this step of the countdown. * Retrieves the sound file to use for this step of the countdown.
*/ */
public static function playCountdownSound(step:CountdownStep, noteStyle:NoteStyle):Void public static function playCountdownSound(step:CountdownStep):Void
{ {
return FunkinSound.playOnce(Paths.sound(resolveSoundPath(noteStyle, step)), Constants.COUNTDOWN_VOLUME); return FunkinSound.playOnce(Paths.sound(resolveSoundPath(step)), Constants.COUNTDOWN_VOLUME);
} }
static function resolveSoundPath(noteStyle:NoteStyle, step:CountdownStep):Null<String> static function resolveSoundPath(step:CountdownStep):Null<String>
{ {
if (step == CountdownStep.BEFORE || step == CountdownStep.AFTER) return null; if (step == CountdownStep.BEFORE || step == CountdownStep.AFTER) return null;
fetchNoteStyle(); fetchNoteStyle();

View file

@ -30,8 +30,6 @@ class PopUpStuff extends FlxTypedGroup<FunkinSprite>
override public function new() override public function new()
{ {
super(); super();
fetchNoteStyle();
} }
static function fetchNoteStyle():Void static function fetchNoteStyle():Void
@ -44,7 +42,7 @@ class PopUpStuff extends FlxTypedGroup<FunkinSprite>
isPixel = false; isPixel = false;
} }
static function resolveGraphicPath(noteStyle:NoteStyle, index:String):Null<String> static function resolveGraphicPath(index:String):Null<String>
{ {
fetchNoteStyle(); fetchNoteStyle();
var basePath:String = 'ui/popup/'; var basePath:String = 'ui/popup/';
@ -75,7 +73,7 @@ class PopUpStuff extends FlxTypedGroup<FunkinSprite>
if (daRating == null) daRating = "good"; if (daRating == null) daRating = "good";
var ratingPath:String = resolveGraphicPath(noteStyle, daRating); var ratingPath:String = resolveGraphicPath(daRating);
// if (PlayState.instance.currentStageId.startsWith('school')) ratingPath = "weeb/pixelUI/" + ratingPath + "-pixel"; // if (PlayState.instance.currentStageId.startsWith('school')) ratingPath = "weeb/pixelUI/" + ratingPath + "-pixel";
@ -131,7 +129,7 @@ class PopUpStuff extends FlxTypedGroup<FunkinSprite>
if (combo == null) combo = 0; if (combo == null) combo = 0;
var comboPath:String = resolveGraphicPath(noteStyle, 'combo'); var comboPath:String = resolveGraphicPath('combo');
var comboSpr:FunkinSprite = FunkinSprite.create(comboPath); var comboSpr:FunkinSprite = FunkinSprite.create(comboPath);
comboSpr.y = (FlxG.camera.height * 0.44) + offsets[1]; comboSpr.y = (FlxG.camera.height * 0.44) + offsets[1];
comboSpr.x = (FlxG.width * 0.507) + offsets[0]; comboSpr.x = (FlxG.width * 0.507) + offsets[0];
@ -186,7 +184,7 @@ class PopUpStuff extends FlxTypedGroup<FunkinSprite>
var daLoop:Int = 1; var daLoop:Int = 1;
for (i in seperatedScore) for (i in seperatedScore)
{ {
var numScore:FunkinSprite = FunkinSprite.create(0, comboSpr.y, resolveGraphicPath(noteStyle, 'num' + Std.int(i))); var numScore:FunkinSprite = FunkinSprite.create(0, comboSpr.y, resolveGraphicPath('num' + Std.int(i)));
if (graphicSuffix.toLowerCase().contains('pixel')) if (graphicSuffix.toLowerCase().contains('pixel'))
{ {