lil HTML5 multivoice fixins

This commit is contained in:
Cameron Taylor 2021-09-22 21:09:28 -04:00
parent 43f43f6f6f
commit dc74a434c0
3 changed files with 18 additions and 3 deletions

View file

@ -99,6 +99,7 @@ class FreeplayState extends MusicBeatState
addWeek(['Ugh', 'Guns', 'Stress'], 7, ['tankman']);
addWeek(["Darnell", "lit-up", "2hot"], 8, ['darnell']);
addWeek(["bro"], 1, ['gf']);
// LOAD MUSIC

View file

@ -57,7 +57,18 @@ class LoadingState extends MusicBeatState
var introComplete = callbacks.add("introComplete");
checkLoadSong(getSongPath());
if (PlayState.SONG.needsVoices)
checkLoadSong(getVocalPath());
{
var files = PlayState.SONG.voiceList;
if (files == null)
files = [""]; // loads with no file name assumption, to load "Voices.ogg" or whatev normally
for (sndFile in files)
{
checkLoadSong(getVocalPath(sndFile));
}
}
checkLibrary("shared");
if (PlayState.storyWeek > 0)
checkLibrary("week" + PlayState.storyWeek);
@ -164,9 +175,9 @@ class LoadingState extends MusicBeatState
return Paths.inst(PlayState.SONG.song);
}
static function getVocalPath()
static function getVocalPath(?suffix:String)
{
return Paths.voices(PlayState.SONG.song);
return Paths.voices(PlayState.SONG.song, suffix);
}
inline static public function loadAndSwitchState(target:FlxState, stopMusic = false)

View file

@ -1829,6 +1829,9 @@ class PlayState extends MusicBeatState
}
else
{
if (Paths.SOUND_EXT == 'mp3')
Conductor.offset = -13; // DO NOT FORGET TO REMOVE THE HARDCODE! WHEN I MAKE BETTER OFFSET SYSTEM!
Conductor.songPosition = FlxG.sound.music.time + Conductor.offset; // 20 is THE MILLISECONDS??
// Conductor.songPosition += FlxG.elapsed * 1000;