feat: card audio blob support.

This commit is contained in:
Rintim 2024-04-21 21:06:57 +08:00
parent a1d6180e9a
commit 0eec71eb01
No known key found for this signature in database
GPG Key ID: BE9E1EA615BACFCF
1 changed files with 3 additions and 1 deletions

View File

@ -1737,7 +1737,9 @@ export class Game {
const audio = get.dynamicVariable(lib.card[card.name].audio, card, sex);
if (typeof audio == "string") {
const audioInfo = audio.split(":");
if (audio.startsWith("db:"))
if (["blob:", "data:"].some((prefix) => audio.startsWith(prefix))) {
game.playAudio(audio);
} else if (audio.startsWith("db:"))
game.playAudio(
`${audioInfo[0]}:${audioInfo[1]}`,
audioInfo[2],