add BGM file copy + bat script for auto-extract and convert
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
Message from repo fork:
|
Message from repo fork:
|
||||||
- Please always remember to update datecode before using [WebUI Resource Update](http://localhost:8083/plugin/sdvx@asphyxia/WebUI%20resource%20update) feature (or this plugin in general).
|
- I highly recommend using the stable version of the plugin.
|
||||||
|
- This version is only properly usable in proper arcade data, meaning no mods.
|
||||||
- This is very work-in-progress. Please **BACK UP YOUR DATA** to prevent unwanted data loss (just in case)
|
- This is very work-in-progress. Please **BACK UP YOUR DATA** to prevent unwanted data loss (just in case)
|
||||||
|
- Please always remember to update datecode before using [WebUI Resource Update](/plugin/sdvx@asphyxia/WebUI%20resource%20update) feature (or this plugin in general).
|
||||||
|
- I won't update the text below lol
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
# SOUND VOLTEX
|
# SOUND VOLTEX
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
@echo off
|
||||||
|
for /f %%a in ('dir "webui\asset\audio\*.s3p" /s /b') do (
|
||||||
|
echo "%%~fa"
|
||||||
|
s3p_extract %%~fa
|
||||||
|
ffmpeg -i "%%~fa.out\0.wma" -vn -ar 44100 -ac 2 -b:a 192k "%%~fa.out\..\0.mp3"
|
||||||
|
ffmpeg -i "%%~fa.out\1.wma" -vn -ar 44100 -ac 2 -b:a 192k "%%~fa.out\..\1.mp3"
|
||||||
|
rmdir /s /q "%%~fa.out"
|
||||||
|
del %%~fa
|
||||||
|
)
|
||||||
|
@echo on
|
||||||
+35
-1
@@ -37,6 +37,7 @@ export const copyResourcesFromGame = async (data: {}) => {
|
|||||||
let newNemsysData = []
|
let newNemsysData = []
|
||||||
let newAPCardData = []
|
let newAPCardData = []
|
||||||
let newSubBGData = []
|
let newSubBGData = []
|
||||||
|
let newBGMData = []
|
||||||
|
|
||||||
// Copying new nemsys files from gamedata
|
// Copying new nemsys files from gamedata
|
||||||
console.log("Copying new nemsys files from gamedata")
|
console.log("Copying new nemsys files from gamedata")
|
||||||
@@ -70,6 +71,13 @@ export const copyResourcesFromGame = async (data: {}) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Appeal card data registration to data.json not properly implemented yet, I don't quite understand how their IDs work
|
||||||
|
// newAPCardData.forEach(fileName => {
|
||||||
|
// if(parseInt(fileName.substring(6, 10))) {
|
||||||
|
// resourceJsonData.apCard.push({"value": parseInt(fileName.substring(6, 10)), "name": fileName + " (please rename)"})
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
// Copying new subbg files from gamedata
|
// Copying new subbg files from gamedata
|
||||||
console.log("Copying new subbg files from gamedata")
|
console.log("Copying new subbg files from gamedata")
|
||||||
let subBGFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\submonitor_bg")
|
let subBGFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\submonitor_bg")
|
||||||
@@ -89,11 +97,37 @@ export const copyResourcesFromGame = async (data: {}) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Copying new bgm files from gamedata
|
||||||
|
console.log("Copying new bgm files from gamedata")
|
||||||
|
let bgmFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "\\data\\sound\\custom")
|
||||||
|
for await (const bgm of bgmFiles) {
|
||||||
|
if (bgm.name.substring(bgm.name.length-4, bgm.name.length) == '.s3p') {
|
||||||
|
let folderName = bgm.name.match(/(custom|special)_([0-9]*)/g)[0]
|
||||||
|
if(folderName != '') {
|
||||||
|
let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "\\data\\sound\\custom\\" + bgm.name)
|
||||||
|
if(!IO.Exists('webui\\asset\\audio\\' + folderName)) {
|
||||||
|
IO.WriteFile('webui\\asset\\audio\\' + folderName + '\\' + bgm.name, fileToWrite)
|
||||||
|
newBGMData.push(bgm.name)
|
||||||
|
} else {
|
||||||
|
console.log(bgm.name + " exists")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newBGMData.forEach(fileName => {
|
||||||
|
let bgmId = fileName.match(/(?<=(custom|special)_)([0-9]*)/g)[0]
|
||||||
|
if(parseInt(bgmId)) {
|
||||||
|
resourceJsonData.bgm.push({"value": parseInt(bgmId), "name": fileName + " (please rename)"})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
await IO.WriteFile('webui\\asset\\json\\data.json', JSON.stringify(resourceJsonData))
|
await IO.WriteFile('webui\\asset\\json\\data.json', JSON.stringify(resourceJsonData))
|
||||||
await IO.WriteFile('webui\\asset\\logs\\copyResourcesFromGame.json', JSON.stringify({
|
await IO.WriteFile('webui\\asset\\logs\\copyResourcesFromGame.json', JSON.stringify({
|
||||||
nemsys: newNemsysData,
|
nemsys: newNemsysData,
|
||||||
apCard: newAPCardData,
|
apCard: newAPCardData,
|
||||||
subbg: newSubBGData
|
subbg: newSubBGData,
|
||||||
|
bgm: newBGMData
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,21 +29,37 @@ $(document).ready(async function() {
|
|||||||
await emit("copyResourcesFromGame").then(
|
await emit("copyResourcesFromGame").then(
|
||||||
function(response){
|
function(response){
|
||||||
$.getJSON( "static/asset/logs/copyResourcesFromGame.json", function( data ) {
|
$.getJSON( "static/asset/logs/copyResourcesFromGame.json", function( data ) {
|
||||||
document.getElementById("logtextarea").textContent += 'New nemsys: \n'
|
if(data['nemsys']) {
|
||||||
$.each(data['nemsys'], function(key, val) {
|
document.getElementById("logtextarea").textContent += 'New nemsys: \n'
|
||||||
document.getElementById("logtextarea").textContent += val + '\n'
|
$.each(data['nemsys'], function(key, val) {
|
||||||
})
|
document.getElementById("logtextarea").textContent += "- " + val + '\n'
|
||||||
document.getElementById("logtextarea").textContent += '\n\n'
|
})
|
||||||
document.getElementById("logtextarea").textContent += 'New appeal cards: \n'
|
document.getElementById("logtextarea").textContent += '\n\n'
|
||||||
$.each(data['apCard'], function(key, val) {
|
}
|
||||||
document.getElementById("logtextarea").textContent += val + '\n'
|
|
||||||
})
|
if(data['apCard']) {
|
||||||
document.getElementById("logtextarea").textContent += '\n\n'
|
document.getElementById("logtextarea").textContent += 'New appeal cards: \n'
|
||||||
document.getElementById("logtextarea").textContent += 'New submonitor backgrounds: \n'
|
$.each(data['apCard'], function(key, val) {
|
||||||
$.each(data['subbg'], function(key, val) {
|
document.getElementById("logtextarea").textContent += "- " + val + '\n'
|
||||||
document.getElementById("logtextarea").textContent += val + '\n'
|
})
|
||||||
})
|
document.getElementById("logtextarea").textContent += '\n\n'
|
||||||
document.getElementById("logtextarea").textContent += '\n\n'
|
}
|
||||||
|
|
||||||
|
if(data['subbg']) {
|
||||||
|
document.getElementById("logtextarea").textContent += 'New submonitor backgrounds: \n'
|
||||||
|
$.each(data['subbg'], function(key, val) {
|
||||||
|
document.getElementById("logtextarea").textContent += "- " + val + '\n'
|
||||||
|
})
|
||||||
|
document.getElementById("logtextarea").textContent += '\n\n'
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data['bgm']) {
|
||||||
|
document.getElementById("logtextarea").textContent += 'New bgm: \n'
|
||||||
|
$.each(data['bgm'], function(key, val) {
|
||||||
|
document.getElementById("logtextarea").textContent += "- " + val + '\n'
|
||||||
|
})
|
||||||
|
document.getElementById("logtextarea").textContent += '\n\n'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
function(error){
|
function(error){
|
||||||
|
|||||||
Reference in New Issue
Block a user