Song Position bar & Save cleanup
This commit is contained in:
@ -59,6 +59,9 @@ class PlayState extends MusicBeatState
|
||||
public static var goods:Int = 0;
|
||||
public static var sicks:Int = 0;
|
||||
|
||||
public static var songPosBG:FlxSprite;
|
||||
public static var songPosBar:FlxBar;
|
||||
|
||||
public static var rep:Replay;
|
||||
public static var loadRep:Bool = false;
|
||||
|
||||
@ -107,7 +110,8 @@ class PlayState extends MusicBeatState
|
||||
|
||||
private var healthBarBG:FlxSprite;
|
||||
private var healthBar:FlxBar;
|
||||
|
||||
private var songPositionBar:Float = 0;
|
||||
|
||||
private var generatedMusic:Bool = false;
|
||||
private var startingSong:Bool = false;
|
||||
|
||||
@ -128,7 +132,7 @@ class PlayState extends MusicBeatState
|
||||
var limo:FlxSprite;
|
||||
var grpLimoDancers:FlxTypedGroup<BackgroundDancer>;
|
||||
var fastCar:FlxSprite;
|
||||
|
||||
var songName:FlxText;
|
||||
var upperBoppers:FlxSprite;
|
||||
var bottomBoppers:FlxSprite;
|
||||
var santa:FlxSprite;
|
||||
@ -762,6 +766,33 @@ class PlayState extends MusicBeatState
|
||||
|
||||
FlxG.fixedTimestep = false;
|
||||
|
||||
if (FlxG.save.data.songPosition) // I dont wanna talk about this code :(
|
||||
{
|
||||
songPosBG = new FlxSprite(0, strumLine.y - 15).loadGraphic(Paths.image('healthBar'));
|
||||
if (FlxG.save.data.downscroll)
|
||||
songPosBG.y = FlxG.height * 0.9 + 45;
|
||||
songPosBG.screenCenter(X);
|
||||
songPosBG.scrollFactor.set();
|
||||
add(songPosBG);
|
||||
|
||||
if (curStage.contains("school") && FlxG.save.data.downscroll)
|
||||
songPosBG.y -= 45;
|
||||
|
||||
songPosBar = new FlxBar(songPosBG.x + 4, songPosBG.y + 4, LEFT_TO_RIGHT, Std.int(songPosBG.width - 8), Std.int(songPosBG.height - 8), this,
|
||||
'songPositionBar', 0, 90000);
|
||||
songPosBar.scrollFactor.set();
|
||||
songPosBar.createFilledBar(FlxColor.GRAY, FlxColor.LIME);
|
||||
add(songPosBar);
|
||||
|
||||
var songName = new FlxText(songPosBG.x + (songPosBG.width / 2) - 20,songPosBG.y,0,SONG.song, 16);
|
||||
if (FlxG.save.data.downscroll)
|
||||
songName.y -= 3;
|
||||
if (!curStage.contains("school"))
|
||||
songName.x -= 15;
|
||||
songName.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
songName.scrollFactor.set();
|
||||
add(songName);
|
||||
}
|
||||
|
||||
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(Paths.image('healthBar'));
|
||||
if (FlxG.save.data.downscroll)
|
||||
@ -1095,11 +1126,46 @@ class PlayState extends MusicBeatState
|
||||
FlxG.sound.music.onComplete = endSong;
|
||||
vocals.play();
|
||||
|
||||
if (FlxG.save.data.songPosition)
|
||||
{
|
||||
remove(songPosBG);
|
||||
remove(songPosBar);
|
||||
remove(songName);
|
||||
|
||||
songPosBG = new FlxSprite(0, strumLine.y - 15).loadGraphic(Paths.image('healthBar'));
|
||||
if (FlxG.save.data.downscroll)
|
||||
songPosBG.y = FlxG.height * 0.9 + 45;
|
||||
songPosBG.screenCenter(X);
|
||||
songPosBG.scrollFactor.set();
|
||||
add(songPosBG);
|
||||
|
||||
if (curStage.contains("school") && FlxG.save.data.downscroll)
|
||||
songPosBG.y -= 45;
|
||||
|
||||
songPosBar = new FlxBar(songPosBG.x + 4, songPosBG.y + 4, LEFT_TO_RIGHT, Std.int(songPosBG.width - 8), Std.int(songPosBG.height - 8), this,
|
||||
'songPositionBar', 0, 90000);
|
||||
songPosBar.scrollFactor.set();
|
||||
songPosBar.createFilledBar(FlxColor.GRAY, FlxColor.LIME);
|
||||
add(songPosBar);
|
||||
|
||||
var songName = new FlxText(songPosBG.x + (songPosBG.width / 2) - 20,songPosBG.y,0,SONG.song, 16);
|
||||
if (FlxG.save.data.downscroll)
|
||||
songName.y -= 3;
|
||||
if (!curStage.contains("school"))
|
||||
songName.x -= 15;
|
||||
songName.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
songName.scrollFactor.set();
|
||||
add(songName);
|
||||
}
|
||||
|
||||
#if desktop
|
||||
// Song duration in a float, useful for the time left feature
|
||||
songLength = FlxG.sound.music.length;
|
||||
|
||||
// Updating Discord Rich Presence (with Time Left)
|
||||
|
||||
|
||||
|
||||
DiscordClient.changePresence(detailsText + " " + SONG.song + " (" + storyDifficultyText + ")", "\nAcc: " + truncateFloat(accuracy, 2) + "% | Score: " + songScore + " | Misses: " + misses , iconRPC);
|
||||
#end
|
||||
}
|
||||
@ -1395,6 +1461,8 @@ class PlayState extends MusicBeatState
|
||||
perfectMode = false;
|
||||
#end
|
||||
|
||||
songPositionBar = Conductor.songPosition;
|
||||
|
||||
if (FlxG.keys.justPressed.NINE)
|
||||
{
|
||||
if (iconP1.animation.curAnim.name == 'bf-old')
|
||||
@ -1970,6 +2038,7 @@ class PlayState extends MusicBeatState
|
||||
|
||||
rating.loadGraphic(Paths.image(pixelShitPart1 + daRating + pixelShitPart2));
|
||||
rating.screenCenter();
|
||||
rating.y += 200;
|
||||
rating.x = coolText.x - 40;
|
||||
rating.y -= 60;
|
||||
rating.acceleration.y = 550;
|
||||
@ -1979,6 +2048,7 @@ class PlayState extends MusicBeatState
|
||||
var comboSpr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'combo' + pixelShitPart2));
|
||||
comboSpr.screenCenter();
|
||||
comboSpr.x = coolText.x;
|
||||
comboSpr.y += 200;
|
||||
comboSpr.acceleration.y = 600;
|
||||
comboSpr.velocity.y -= 150;
|
||||
|
||||
@ -2020,7 +2090,7 @@ class PlayState extends MusicBeatState
|
||||
var numScore:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'num' + Std.int(i) + pixelShitPart2));
|
||||
numScore.screenCenter();
|
||||
numScore.x = coolText.x + (43 * daLoop) - 90;
|
||||
numScore.y += 80;
|
||||
numScore.y += 80 + 200;
|
||||
|
||||
if (!curStage.startsWith('school'))
|
||||
{
|
||||
|
Reference in New Issue
Block a user