mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
hopefully final polish?
This commit is contained in:
parent
ff1ab1eb42
commit
ba96b11196
2 changed files with 16 additions and 20 deletions
source/funkin/play
|
@ -61,8 +61,6 @@ class Countdown
|
|||
// @:privateAccess
|
||||
// PlayState.instance.dispatchEvent(new SongTimeScriptEvent(SONG_BEAT_HIT, 0, 0));
|
||||
|
||||
fetchNoteStyle();
|
||||
|
||||
// The timer function gets called based on the beat of the song.
|
||||
countdownTimer = new FlxTimer();
|
||||
|
||||
|
@ -80,10 +78,10 @@ class Countdown
|
|||
// PlayState.instance.dispatchEvent(new SongTimeScriptEvent(SONG_BEAT_HIT, 0, 0));
|
||||
|
||||
// Countdown graphic.
|
||||
showCountdownGraphic(countdownStep, noteStyle);
|
||||
showCountdownGraphic(countdownStep);
|
||||
|
||||
// Countdown sound.
|
||||
playCountdownSound(countdownStep, noteStyle);
|
||||
playCountdownSound(countdownStep);
|
||||
|
||||
// Event handling bullshit.
|
||||
var cancelled:Bool = propagateCountdownEvent(countdownStep);
|
||||
|
@ -212,7 +210,7 @@ class 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;
|
||||
switch (index)
|
||||
|
@ -229,25 +227,24 @@ class Countdown
|
|||
if (indexString == null) return;
|
||||
|
||||
var spritePath:String = null;
|
||||
spritePath = resolveGraphicPath(noteStyle, indexString);
|
||||
spritePath = resolveGraphicPath(indexString);
|
||||
|
||||
if (spritePath == null) return;
|
||||
|
||||
var countdownSprite:FunkinSprite = FunkinSprite.create(spritePath);
|
||||
countdownSprite.scrollFactor.set(0, 0);
|
||||
|
||||
if (isPixel) countdownSprite.setGraphicSize(Std.int(countdownSprite.width * Constants.PIXEL_ART_SCALE * 1.1));
|
||||
else countdownSprite.setGraphicSize(Std.int(countdownSprite.width * 0.8));
|
||||
if (isPixel) countdownSprite.setGraphicSize(Std.int(countdownSprite.width * Constants.PIXEL_ART_SCALE));
|
||||
else countdownSprite.setGraphicSize(Std.int(countdownSprite.width * 0.7));
|
||||
|
||||
countdownSprite.antialiasing = !isPixel;
|
||||
|
||||
countdownSprite.cameras = [PlayState.instance.camHUD];
|
||||
|
||||
countdownSprite.updateHitbox();
|
||||
countdownSprite.screenCenter();
|
||||
|
||||
// Fade sprite in, then out, then destroy it.
|
||||
FlxTween.tween(countdownSprite, {y: countdownSprite.y += 100, alpha: 0}, Conductor.instance.beatLengthMs / 1000,
|
||||
FlxTween.tween(countdownSprite, {alpha: 0}, Conductor.instance.beatLengthMs / 1000,
|
||||
{
|
||||
ease: FlxEase.cubeInOut,
|
||||
onComplete: function(twn:FlxTween) {
|
||||
|
@ -256,9 +253,10 @@ class Countdown
|
|||
});
|
||||
|
||||
PlayState.instance.add(countdownSprite);
|
||||
countdownSprite.screenCenter();
|
||||
}
|
||||
|
||||
static function resolveGraphicPath(noteStyle:NoteStyle, index:String):Null<String>
|
||||
static function resolveGraphicPath(index:String):Null<String>
|
||||
{
|
||||
fetchNoteStyle();
|
||||
var basePath:String = 'ui/countdown/';
|
||||
|
@ -285,12 +283,12 @@ class 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;
|
||||
fetchNoteStyle();
|
||||
|
|
|
@ -29,8 +29,6 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
|
|||
override public function new()
|
||||
{
|
||||
super();
|
||||
|
||||
fetchNoteStyle();
|
||||
}
|
||||
|
||||
static function fetchNoteStyle():Void
|
||||
|
@ -42,7 +40,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
|
|||
isPixel = false;
|
||||
}
|
||||
|
||||
static function resolveGraphicPath(noteStyle:NoteStyle, index:String):Null<String>
|
||||
static function resolveGraphicPath(index:String):Null<String>
|
||||
{
|
||||
fetchNoteStyle();
|
||||
var basePath:String = 'ui/popup/';
|
||||
|
@ -72,7 +70,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
|
|||
|
||||
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";
|
||||
|
||||
|
@ -122,7 +120,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
|
|||
|
||||
if (combo == null) combo = 0;
|
||||
|
||||
var comboPath:String = resolveGraphicPath(noteStyle, 'combo');
|
||||
var comboPath:String = resolveGraphicPath('combo');
|
||||
var comboSpr:FunkinSprite = FunkinSprite.create(comboPath);
|
||||
comboSpr.y = (FlxG.camera.height * 0.44) + offsets[1];
|
||||
comboSpr.x = (FlxG.width * 0.507) + offsets[0];
|
||||
|
@ -165,7 +163,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
|
|||
var daLoop:Int = 1;
|
||||
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 (isPixel) numScore.setGraphicSize(Std.int(numScore.width * Constants.PIXEL_ART_SCALE * 0.7));
|
||||
else numScore.setGraphicSize(Std.int(numScore.width * 0.45));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue