Fix 2nd Patch for CustomSounds

First is broken still
This commit is contained in:
thororen1234 2024-09-10 22:41:59 -04:00
parent 88a31a14b3
commit 21b1ca72d0
4 changed files with 2 additions and 2 deletions

View file

@ -55,7 +55,7 @@ export default definePlugin({
patches: [ patches: [
// sound class // sound class
{ {
find: 'Error("could not play audio")', find: '"_ensureAudioPromise"',
replacement: [ replacement: [
// override URL // override URL
{ {
@ -64,7 +64,7 @@ export default definePlugin({
}, },
// override volume // override volume
{ {
match: /Math.min\(\i\.\i\.getOutputVolume\(\)\/100\*this\._volume/, match: /Math.min\(\i\.\i\.getOutputVolume\(\).{0,20}volume/,
replace: "$& * ($self.findOverride(this.name)?.volume ?? 100) / 100" replace: "$& * ($self.findOverride(this.name)?.volume ?? 100) / 100"
} }
] ]