mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-12-23 09:46:15 +08:00
only load combo voices as needed
This commit is contained in:
parent
91e5127613
commit
9f7ce52cb4
@ -109,58 +109,6 @@ var assets = {
|
||||
"se_results_countup.wav",
|
||||
"se_results_crown.wav",
|
||||
|
||||
"v_combo_50.wav",
|
||||
"v_combo_100.wav",
|
||||
"v_combo_200.wav",
|
||||
"v_combo_300.wav",
|
||||
"v_combo_400.wav",
|
||||
"v_combo_500.wav",
|
||||
"v_combo_600.wav",
|
||||
"v_combo_700.wav",
|
||||
"v_combo_800.wav",
|
||||
"v_combo_900.wav",
|
||||
"v_combo_1000.wav",
|
||||
"v_combo_1100.wav",
|
||||
"v_combo_1200.wav",
|
||||
"v_combo_1300.wav",
|
||||
"v_combo_1400.wav",
|
||||
"v_combo_1500.wav",
|
||||
"v_combo_1600.wav",
|
||||
"v_combo_1700.wav",
|
||||
"v_combo_1800.wav",
|
||||
"v_combo_1900.wav",
|
||||
"v_combo_2000.wav",
|
||||
"v_combo_2100.wav",
|
||||
"v_combo_2200.wav",
|
||||
"v_combo_2300.wav",
|
||||
"v_combo_2400.wav",
|
||||
"v_combo_2500.wav",
|
||||
"v_combo_2600.wav",
|
||||
"v_combo_2700.wav",
|
||||
"v_combo_2800.wav",
|
||||
"v_combo_2900.wav",
|
||||
"v_combo_3000.wav",
|
||||
"v_combo_3100.wav",
|
||||
"v_combo_3200.wav",
|
||||
"v_combo_3300.wav",
|
||||
"v_combo_3400.wav",
|
||||
"v_combo_3500.wav",
|
||||
"v_combo_3600.wav",
|
||||
"v_combo_3700.wav",
|
||||
"v_combo_3800.wav",
|
||||
"v_combo_3900.wav",
|
||||
"v_combo_4000.wav",
|
||||
"v_combo_4100.wav",
|
||||
"v_combo_4200.wav",
|
||||
"v_combo_4300.wav",
|
||||
"v_combo_4400.wav",
|
||||
"v_combo_4500.wav",
|
||||
"v_combo_4600.wav",
|
||||
"v_combo_4700.wav",
|
||||
"v_combo_4800.wav",
|
||||
"v_combo_4900.wav",
|
||||
"v_combo_5000.wav",
|
||||
|
||||
"v_fullcombo.wav",
|
||||
"v_renda.wav",
|
||||
"v_results_fullcombo.wav",
|
||||
|
@ -27,6 +27,23 @@ class Controller{
|
||||
this.parsedSongData = new ParseOsu(songData, selectedSong.difficulty, selectedSong.stars, selectedSong.offset)
|
||||
}
|
||||
this.offset = this.parsedSongData.soundOffset
|
||||
|
||||
var maxCombo = this.parsedSongData.circles.filter(circle => ["don", "ka", "daiDon", "daiKa"].indexOf(circle.type) > -1 && (!circle.branch || circle.branch.name == "master")).length
|
||||
if (maxCombo >= 50) {
|
||||
var comboVoices = ["v_combo_50"].concat([...Array(Math.floor(maxCombo/100)).keys()].map(i => "v_combo_" + (i + 1)*100))
|
||||
var promises = []
|
||||
|
||||
comboVoices.forEach(name => {
|
||||
if (!assets.sounds[name + "_p1"]) {
|
||||
promises.push(loader.loadSound(name + ".wav", snd.sfxGain).then(sound => {
|
||||
assets.sounds[name + "_p1"] = assets.sounds[name].copy(snd.sfxGainL)
|
||||
assets.sounds[name + "_p2"] = assets.sounds[name].copy(snd.sfxGainR)
|
||||
}))
|
||||
}
|
||||
})
|
||||
|
||||
Promise.all(this.promises)
|
||||
}
|
||||
|
||||
if(this.calibrationMode){
|
||||
this.volume = 1
|
||||
|
Loading…
Reference in New Issue
Block a user