diff --git a/manager/manager.js b/manager/manager.js index bb77d11..3151dda 100644 --- a/manager/manager.js +++ b/manager/manager.js @@ -274,6 +274,12 @@ const saveSettings = () => { modLaunched = modLaunched.filter(element => { return modsWindowList.includes(`${element.name}|${element.author}`) }) + modLaunched.forEach(modInfo=>{ + if(modInfo.execute){ + modInfo.execute.filesDir = modInfo.filesDir + executeLaunched.push(modInfo.execute) + } + }) fs.writeFileSync(executeSettingsFile, JSON.stringify(executeLaunched), { encoding: 'utf-8' diff --git a/mod/active.json b/mod/active.json index a84209f..12ac678 100644 --- a/mod/active.json +++ b/mod/active.json @@ -2,6 +2,11 @@ { "name": "千织普通改绿头鸭", "author": "Handle", - "description": "图片来源pixabay,由Capri23auto上传,CC0协议\n这是一个Mod示范,用途为将普通千织立绘和头像改为绿头鸭。" + "description": "图片来源pixabay,由Capri23auto上传,CC0协议\n这是一个Mod示范,用途为将普通千织立绘和头像改为绿头鸭。", + "replace": [], + "execute": { + "name": "千织普通改绿头鸭台词插件", + "entry": "script.js" + } } ] diff --git a/mod/mallard/files/0/audio/sound/mallard/quack.mp3 b/mod/mallard/files/0/audio/sound/mallard/quack.mp3 new file mode 100644 index 0000000..6984909 Binary files /dev/null and b/mod/mallard/files/0/audio/sound/mallard/quack.mp3 differ diff --git a/mod/mallard/mod.json b/mod/mallard/mod.json index ab7c13d..a3024fa 100644 --- a/mod/mallard/mod.json +++ b/mod/mallard/mod.json @@ -2,5 +2,9 @@ "name": "千织普通改绿头鸭", "author": "Handle", "description": "图片来源pixabay,由Capri23auto上传,CC0协议\n这是一个Mod示范,用途为将普通千织立绘和头像改为绿头鸭。", - "replace": [] + "replace": [], + "execute": { + "name": "千织普通改绿头鸭台词插件", + "entry": "script.js" + } } diff --git a/mod/mallard/script.js b/mod/mallard/script.js new file mode 100644 index 0000000..2f7d670 --- /dev/null +++ b/mod/mallard/script.js @@ -0,0 +1,53 @@ +// 修改千织语音台词 +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' + } + } + 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 + } + } + }) + } + return soundGroup +} diff --git a/package.json b/package.json index 4108870..2cd3925 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "majsoul-plus-client", - "version": "1.6.2-alpha.2", + "version": "1.6.2-alpha.3", "productName": "Majsoul Plus", "author": "MajsoulPlus Team", "description": "Majsoul Plus",