diff --git a/mod/mallard/files/0/audio/sound/mallard/quack.mp3 b/mod/mallard/files/0/audio/sound/mallard/quack.mp3 index 6984909..9dea628 100644 Binary files a/mod/mallard/files/0/audio/sound/mallard/quack.mp3 and b/mod/mallard/files/0/audio/sound/mallard/quack.mp3 differ diff --git a/mod/mallard/script.js b/mod/mallard/script.js index 2f7d670..fd5e0c8 100644 --- a/mod/mallard/script.js +++ b/mod/mallard/script.js @@ -1,53 +1,60 @@ // 修改千织语音台词 -console.log('已Hack语音') -const funcBackup = cfg.voice.sound.getGroup -cfg.voice.sound.getGroup = function(soundID) { - const soundGroup = funcBackup.call(this, soundID) - if (soundID === 4) { - const changeMap = { - 大厅交互语音1: { - words: '呱!', - path: 'audio/sound/mallard/quack' - }, - 大厅交互语音2: { - words: '呱!', - path: 'audio/sound/mallard/quack' - }, - 大厅交互语音3: { - words: '呱!', - path: 'audio/sound/mallard/quack' - }, - 大厅交互语音4: { - words: '呱!', - path: 'audio/sound/mallard/quack' - }, - 大厅交互语音5: { - words: '呱!', - path: 'audio/sound/mallard/quack' - }, - 大厅交互语音6: { - words: '呱!', - path: 'audio/sound/mallard/quack' - }, - 大厅交互语音7: { - words: '呱!', - path: 'audio/sound/mallard/quack' - }, - 大厅交互语音8: { - words: '呱!', - path: 'audio/sound/mallard/quack' - } +let raf = requestAnimationFrame(function autoRun() { + try { + const arrBackup = cfg.voice.sound.groups_ + if (!arrBackup || arrBackup.length === 0) { + throw new Error() } - const keyArray = Object.keys(changeMap) - Object.entries(soundGroup).forEach(([soundKey, soundObject]) => { - // soundObject.level_limit = 0 - if (keyArray.includes(soundObject.name)) { - soundGroup[soundKey] = { - ...soundObject, - ...changeMap.soundObject.name + console.log('Hacked语音') + Object.entries(cfg.voice.sound.groups_).forEach(([soundID, soundGroup]) => { + if (soundID == 4) { + const changeMap = { + 大厅交互语音1: { + words: '嘎!', + path: 'audio/sound/mallard/quack' + }, + 大厅交互语音2: { + words: '嘎!', + path: 'audio/sound/mallard/quack' + }, + 大厅交互语音3: { + words: '嘎!', + path: 'audio/sound/mallard/quack' + }, + 大厅交互语音4: { + words: '嘎!', + path: 'audio/sound/mallard/quack' + }, + 大厅交互语音5: { + words: '嘎!', + path: 'audio/sound/mallard/quack' + }, + 大厅交互语音6: { + words: '嘎!', + path: 'audio/sound/mallard/quack' + }, + 大厅交互语音7: { + words: '嘎!', + path: 'audio/sound/mallard/quack' + }, + 大厅交互语音8: { + words: '嘎!', + path: 'audio/sound/mallard/quack' + } } + const keyArray = Object.keys(changeMap) + soundGroup.forEach((soundObject, index) => { + // soundObject.level_limit = 0 + if (keyArray.includes(soundObject.name)) { + soundGroup[index] = { + ...soundObject, + ...changeMap[soundObject.name] + } + } + }) } }) + } catch (error) { + raf = requestAnimationFrame(autoRun) } - return soundGroup -} +}) diff --git a/package.json b/package.json index 2cd3925..27a947e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "majsoul-plus-client", - "version": "1.6.2-alpha.3", + "version": "1.6.2-beta.1", "productName": "Majsoul Plus", "author": "MajsoulPlus Team", "description": "Majsoul Plus",