fix the sutter at the start of the song
This commit is contained in:
parent
b166733830
commit
8d6e9d88fa
@ -1695,65 +1695,9 @@ class PlayState extends MusicBeatState
|
||||
previousFrameTime = FlxG.game.ticks;
|
||||
lastReportedPlayheadPosition = 0;
|
||||
|
||||
if (!paused)
|
||||
{
|
||||
#if sys
|
||||
if (!isStoryMode && isSM)
|
||||
{
|
||||
trace("Loading " + pathToSm + "/" + sm.header.MUSIC);
|
||||
var bytes = File.getBytes(pathToSm + "/" + sm.header.MUSIC);
|
||||
var sound = new Sound();
|
||||
sound.loadCompressedDataFromByteArray(bytes.getData(), bytes.length);
|
||||
FlxG.sound.playMusic(sound);
|
||||
}
|
||||
else
|
||||
FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false);
|
||||
#else
|
||||
FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false);
|
||||
#end
|
||||
}
|
||||
|
||||
FlxG.sound.music.onComplete = endSong;
|
||||
FlxG.sound.music.play();
|
||||
vocals.play();
|
||||
|
||||
// Song duration in a float, useful for the time left feature
|
||||
songLength = FlxG.sound.music.length;
|
||||
|
||||
if (FlxG.save.data.songPosition)
|
||||
{
|
||||
remove(songPosBG);
|
||||
remove(songPosBar);
|
||||
remove(songName);
|
||||
|
||||
songPosBG = new FlxSprite(0, 10).loadGraphic(Paths.image('healthBar'));
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
songPosBG.y = FlxG.height * 0.9 + 45;
|
||||
songPosBG.screenCenter(X);
|
||||
songPosBG.scrollFactor.set();
|
||||
add(songPosBG);
|
||||
|
||||
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, songLength
|
||||
- 1000);
|
||||
songPosBar.numDivisions = 1000;
|
||||
songPosBar.scrollFactor.set();
|
||||
songPosBar.createFilledBar(FlxColor.GRAY, FlxColor.LIME);
|
||||
add(songPosBar);
|
||||
|
||||
var songName = new FlxText(songPosBG.x + (songPosBG.width / 2) - (SONG.song.length * 5), songPosBG.y, 0, SONG.song, 16);
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
songName.y -= 3;
|
||||
songName.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
songName.scrollFactor.set();
|
||||
add(songName);
|
||||
|
||||
songPosBG.cameras = [camHUD];
|
||||
songPosBar.cameras = [camHUD];
|
||||
songName.cameras = [camHUD];
|
||||
}
|
||||
|
||||
// Song check real quick
|
||||
switch (curSong)
|
||||
{
|
||||
@ -1820,6 +1764,66 @@ class PlayState extends MusicBeatState
|
||||
|
||||
FlxG.sound.list.add(vocals);
|
||||
|
||||
if (!paused)
|
||||
{
|
||||
#if sys
|
||||
if (!isStoryMode && isSM)
|
||||
{
|
||||
trace("Loading " + pathToSm + "/" + sm.header.MUSIC);
|
||||
var bytes = File.getBytes(pathToSm + "/" + sm.header.MUSIC);
|
||||
var sound = new Sound();
|
||||
sound.loadCompressedDataFromByteArray(bytes.getData(), bytes.length);
|
||||
FlxG.sound.playMusic(sound);
|
||||
}
|
||||
else
|
||||
FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false);
|
||||
#else
|
||||
FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false);
|
||||
#end
|
||||
}
|
||||
|
||||
FlxG.sound.music.onComplete = endSong;
|
||||
FlxG.sound.music.pause();
|
||||
|
||||
// Song duration in a float, useful for the time left feature
|
||||
songLength = FlxG.sound.music.length;
|
||||
|
||||
if (FlxG.save.data.songPosition)
|
||||
{
|
||||
remove(songPosBG);
|
||||
remove(songPosBar);
|
||||
remove(songName);
|
||||
|
||||
songPosBG = new FlxSprite(0, 10).loadGraphic(Paths.image('healthBar'));
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
songPosBG.y = FlxG.height * 0.9 + 45;
|
||||
songPosBG.screenCenter(X);
|
||||
songPosBG.scrollFactor.set();
|
||||
add(songPosBG);
|
||||
|
||||
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, songLength
|
||||
- 1000);
|
||||
songPosBar.numDivisions = 1000;
|
||||
songPosBar.scrollFactor.set();
|
||||
songPosBar.createFilledBar(FlxColor.GRAY, FlxColor.LIME);
|
||||
add(songPosBar);
|
||||
|
||||
var songName = new FlxText(songPosBG.x + (songPosBG.width / 2) - (SONG.song.length * 5), songPosBG.y, 0, SONG.song, 16);
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
songName.y -= 3;
|
||||
songName.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
songName.scrollFactor.set();
|
||||
add(songName);
|
||||
|
||||
songPosBG.cameras = [camHUD];
|
||||
songPosBar.cameras = [camHUD];
|
||||
songName.cameras = [camHUD];
|
||||
}
|
||||
|
||||
|
||||
notes = new FlxTypedGroup<Note>();
|
||||
add(notes);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user