diff --git a/sdvx@asphyxia/.gitignore b/sdvx@asphyxia/.gitignore
index 86f704d..0bbfa97 100644
--- a/sdvx@asphyxia/.gitignore
+++ b/sdvx@asphyxia/.gitignore
@@ -1,18 +1,3 @@
-webui/asset/ap_card
-webui/asset/audio
-webui/asset/chat_stamp
-webui/asset/difficulty
-webui/asset/force
-webui/asset/json
-webui/asset/logs
-webui/asset/nemsys
-webui/asset/skill_lv
-webui/asset/skill_num
-webui/asset/submonitor_bg
-webui/asset/mark_1.png
-webui/asset/mark_2.png
-webui/asset/nostamp.png
-webui/asset/skill_tex_percent.png
webui/test_asset
s3p_extract.exe
ffmpeg.exe
\ No newline at end of file
diff --git a/sdvx@asphyxia/README.md b/sdvx@asphyxia/README.md
index 7059761..4648c82 100644
--- a/sdvx@asphyxia/README.md
+++ b/sdvx@asphyxia/README.md
@@ -1,8 +1,6 @@
Message from repo fork:
-- 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)
-- Please always remember to update datecode before using [WebUI Resource Update](/plugin/sdvx@asphyxia/WebUI%20resource%20update) feature (or this plugin in general).
+- I highly recommend using the official stable version of the plugin.
+- This is very work-in-progress, so expect things to break. Please **BACK UP YOUR DATA** to prevent unwanted data loss (just in case)
- I won't update the text below lol
----------------------------
diff --git a/sdvx@asphyxia/index.ts b/sdvx@asphyxia/index.ts
index 2ba892c..c822d4b 100644
--- a/sdvx@asphyxia/index.ts
+++ b/sdvx@asphyxia/index.ts
@@ -18,7 +18,6 @@ import {
saveValgene,
} from './handlers/profiles';
import {
- generateLatestMusicDBFile,
copyResourcesFromGame
} from './utils'
import {
@@ -45,7 +44,6 @@ export function register() {
R.Config('use_information' ,{ type: 'boolean', default: true, name:'Use Information', desc:'Enable the information section after entry.'});
R.Config('use_asphyxia_gameover',{ type: 'boolean', default: true, name:'Use Asphyxia Gameover', desc:'Enable the Asphyxia gameover message after ending the game.'})
- R.WebUIEvent('generateLatestMusicDBFile', generateLatestMusicDBFile);
R.WebUIEvent('copyResourcesFromGame', copyResourcesFromGame);
R.WebUIEvent('updateProfile', updateProfile);
R.WebUIEvent('updateMix', updateMix);
diff --git a/sdvx@asphyxia/utils.ts b/sdvx@asphyxia/utils.ts
index 3c95051..2137f05 100644
--- a/sdvx@asphyxia/utils.ts
+++ b/sdvx@asphyxia/utils.ts
@@ -33,205 +33,260 @@ export function getRandomIntInclusive(min, max) {
}
export const copyResourcesFromGame = async (data: {}) => {
- let resourceJsonData = JSON.parse(U.DecodeString(await IO.ReadFile('webui/asset/json/data.json'), 'utf8'))
+ let mdbJsonFix = [];
+ let mdbJsonFixFinal;
+ let newJsonSongs = [];
+ let newVersionSongs = [];
let newNemsysData = []
let newAPCardData = []
let newSubBGData = []
let newBGMData = []
+ let newChatStampData = []
+ let runErrors = []
+ let resourceJsonData = JSON.parse(U.DecodeString(await IO.ReadFile('webui/asset/json/data.json'), 'utf8'))
+
+ // Get new music data from music_db.xml
+ console.log('Getting new music_db info')
+ if(IO.Exists(U.GetConfig('sdvx_eg_root_dir') + "/data/others/music_db.xml")) {
+ let mdb = U.parseXML(U.DecodeString(await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/others/music_db.xml"), "shift_jis"), false)
+ let ea3Config = U.parseXML(U.DecodeString(await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/prop/ea3-config.xml"), "shift_jis"), false)
+ let version = ea3Config['ea3']['soft']['ext']['@content'];
+ let prevAssetMdb = []
+ if(IO.Exists('webui/asset/json/music_db.json')) {
+ prevAssetMdb = JSON.parse(U.DecodeString(await IO.ReadFile('webui/asset/json/music_db.json'), 'utf8'))
+ }
+
+ mdb.mdb.music.forEach(musicValue => {
+ if(Object.keys(prevAssetMdb).length > 0) {
+ if(prevAssetMdb['mdb']['music'].find(item => parseInt(item['@id']) == parseInt(musicValue.info.label['@content'])) == undefined) {
+ console.log("New song added to json: " + musicValue.info.title_name['@content'] + " (" + musicValue.info.distribution_date['@content'] + ")")
+ newJsonSongs.push('[' + musicValue.info.distribution_date['@content'] + '] ' + musicValue.info.title_name['@content'])
+ }
+ } else {
+ console.log("New song added to json: " + musicValue.info.title_name['@content'] + " (" + musicValue.info.distribution_date['@content'] + ")")
+ newJsonSongs.push('[' + musicValue.info.distribution_date['@content'] + '] ' + musicValue.info.title_name['@content'])
+ }
+
+ if(parseInt(musicValue.info.distribution_date['@content'][0]) >= parseInt(version.substring(0,8))) {
+ console.log("Found new song for version " + version + ": " + musicValue.info.title_name['@content'] + " (" + musicValue.info.distribution_date['@content'] + ")");
+ newVersionSongs.push('[' + musicValue.info.distribution_date['@content'] + '] ' + musicValue.info.title_name['@content'])
+ }
+ mdbJsonFix.push({
+ '@id': musicValue['@attr'].id,
+ 'info': {
+ 'title_name': musicValue.info.title_name['@content'],
+ 'version': {
+ '@__type': 'u8',
+ '#text': musicValue.info.version['@content'][0].toString()
+ },
+ 'inf_ver': {
+ '@__type': 'u8',
+ '#text': musicValue.info.inf_ver['@content'][0].toString()
+ },
+ 'distribution_date' : {
+ '#text': musicValue.info.distribution_date['@content'][0]
+ }
+ },
+ 'difficulty': {
+ 'novice': {
+ 'difnum': {
+ '@__type': 'u8',
+ '#text': musicValue.difficulty.novice.difnum['@content'][0].toString()
+ }
+ },
+ 'advanced': {
+ 'difnum': {
+ '@__type': 'u8',
+ '#text': musicValue.difficulty.advanced.difnum['@content'][0].toString()
+ }
+ },
+ 'exhaust': {
+ 'difnum': {
+ '@__type': 'u8',
+ '#text': musicValue.difficulty.exhaust.difnum['@content'][0].toString()
+ }
+ },
+ 'maximum': {
+ 'difnum': {
+ '@__type': 'u8',
+ '#text': musicValue.difficulty.maximum != undefined ? musicValue.difficulty.maximum.difnum['@content'][0].toString() : '0'
+ }
+ },
+ 'infinite': {
+ 'difnum': {
+ '@__type': 'u8',
+ '#text': musicValue.difficulty.infinite != undefined ? musicValue.difficulty.infinite.difnum['@content'][0].toString() : '0'
+ }
+ }
+ }
+ });
+ })
+
+ mdbJsonFixFinal = {
+ 'mdb': {
+ 'version': version,
+ 'music': mdbJsonFix
+ }
+ };
+ IO.WriteFile('webui/asset/json/music_db.json', JSON.stringify(mdbJsonFixFinal));
+ if(!IO.Exists('webui/asset/json/music_db_' + version + '.json')){
+ IO.WriteFile('webui/asset/json/music_db_' + version + '.json', JSON.stringify(mdbJsonFixFinal));
+ }
+
+ } else {
+ console.log('Error reading music_db.xml. Check your "Exceed Gear Data Directory" config.')
+ runErrors.push('[music_db] Error reading music_db.xml. Check your "Exceed Gear Data Directory" config.')
+ }
// Copying new nemsys files from gamedata
console.log("Copying new nemsys files from gamedata")
- let nemsysFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/game_nemsys")
- for await (const nemsys of nemsysFiles) {
- let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/game_nemsys/" + nemsys.name)
- if(!IO.Exists('webui/asset/nemsys/' + nemsys.name.substring(0, (nemsys.name.length - 4)) + ".png") && !IO.Exists('webui/asset/nemsys/' + nemsys.name.substring(0, (nemsys.name.length - 4)) + ".jpg")) {
- IO.WriteFile('webui/asset/nemsys/' + nemsys.name, fileToWrite)
- newNemsysData.push(nemsys.name)
- } else {
- console.log(nemsys.name + " exists")
+ if(IO.Exists(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/game_nemsys")) {
+ let nemsysFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/game_nemsys")
+ for await (const nemsys of nemsysFiles) {
+ let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/game_nemsys/" + nemsys.name)
+ if(!IO.Exists('webui/asset/nemsys/' + nemsys.name.substring(0, (nemsys.name.length - 4)) + ".png") && !IO.Exists('webui/asset/nemsys/' + nemsys.name.substring(0, (nemsys.name.length - 4)) + ".jpg")) {
+ IO.WriteFile('webui/asset/nemsys/' + nemsys.name, fileToWrite)
+ newNemsysData.push(nemsys.name)
+ } else {
+ console.log(nemsys.name + " exists")
+ }
}
+
+ newNemsysData.forEach(fileName => {
+ if(parseInt(fileName.substring(7, 11))) {
+ resourceJsonData.nemsys.push({"value": parseInt(fileName.substring(7, 11)), "name": fileName + " (please rename)"})
+ }
+ })
+ } else {
+ console.log('Error reading nemsys directory. Check your "Exceed Gear Data Directory" config.')
+ runErrors.push('[nemsys] Error reading nemsys directory. Check your "Exceed Gear Data Directory" config.')
}
- newNemsysData.forEach(fileName => {
- if(parseInt(fileName.substring(7, 11))) {
- resourceJsonData.nemsys.push({"value": parseInt(fileName.substring(7, 11)), "name": fileName + " (please rename)"})
- }
- })
-
- // Copying new appeal card files from gamedata
- console.log("Copying new appeal card files from gamedata")
- let apCardFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/ap_card")
- for await (const apCard of apCardFiles) {
- let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/ap_card/" + apCard.name)
- if(!IO.Exists('webui/asset/ap_card/' + apCard.name.substring(0, (apCard.name.length - 4)) + ".png") && !IO.Exists('webui/asset/ap_card/' + apCard.name.substring(0, (apCard.name.length - 4)) + ".jpg")) {
- IO.WriteFile('webui/asset/ap_card/' + apCard.name, fileToWrite)
- newAPCardData.push(apCard.name)
- } else {
- console.log(apCard.name + " exists")
- }
- }
-
- // 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 appeal card files from gamedata (disabled for now)
+ // console.log("Copying new appeal card files from gamedata")
+ // if(IO.Exists(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/game_nemsys")) {
+ // let apCardFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/ap_card")
+ // for await (const apCard of apCardFiles) {
+ // let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/ap_card/" + apCard.name)
+ // if(!IO.Exists('webui/asset/ap_card/' + apCard.name.substring(0, (apCard.name.length - 4)) + ".png") && !IO.Exists('webui/asset/ap_card/' + apCard.name.substring(0, (apCard.name.length - 4)) + ".jpg")) {
+ // IO.WriteFile('webui/asset/ap_card/' + apCard.name, fileToWrite)
+ // newAPCardData.push(apCard.name)
+ // } else {
+ // console.log(apCard.name + " exists")
+ // }
// }
- // })
+
+ // // Appeal card data registration to data.json not properly implemented yet, I don't quite understand how their IDs work yet
+ // newAPCardData.forEach(fileName => {
+ // if(parseInt(fileName.substring(6, 10))) {
+ // resourceJsonData.apCard.push({"value": parseInt(fileName.substring(6, 10)), "name": fileName + " (please rename)"})
+ // }
+ // })
+ // } else {
+ // console.log('Error reading appeal card directory. Check your "Exceed Gear Data Directory" config.')
+ // runErrors.push('[appeal_card] Error reading appeal card directory. Check your "Exceed Gear Data Directory" config.')
+ // }
// 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")
- for await (const subbg of subBGFiles) {
- if (subbg.name.substring(subbg.name.length-4, subbg.name.length).match(/(\.png|\.jpg)/g)) {
- let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/submonitor_bg/" + subbg.name)
- if(!IO.Exists('webui/asset/submonitor_bg/' + subbg.name.substring(0, (subbg.name.length - 4)) + ".png") && !IO.Exists('webui/asset/submonitor_bg/' + subbg.name.substring(0, (subbg.name.length - 4)) + ".jpg")) {
- IO.WriteFile('webui/asset/submonitor_bg/' + subbg.name, fileToWrite)
- newSubBGData.push(subbg.name)
- } else {
- console.log(subbg.name + " exists")
- }
- }
- }
-
- newSubBGData.forEach(fileName => {
- if(parseInt(fileName.substring(6, 10))) {
- resourceJsonData.subbg.push({"value": parseInt(fileName.substring(6, 10)), "name": fileName + " (please rename)"})
- }
- })
-
- // 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)
+ if(IO.Exists(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")
+ for await (const subbg of subBGFiles) {
+ if (subbg.name.substring(subbg.name.length-4, subbg.name.length).match(/(\.png|\.jpg)/g)) {
+ let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/submonitor_bg/" + subbg.name)
+ if(!IO.Exists('webui/asset/submonitor_bg/' + subbg.name.substring(0, (subbg.name.length - 4)) + ".png") && !IO.Exists('webui/asset/submonitor_bg/' + subbg.name.substring(0, (subbg.name.length - 4)) + ".jpg")) {
+ IO.WriteFile('webui/asset/submonitor_bg/' + subbg.name, fileToWrite)
+ newSubBGData.push(subbg.name)
} else {
- console.log(bgm.name + " exists")
+ console.log(subbg.name + " exists")
}
}
}
+
+ newSubBGData.forEach(fileName => {
+ if(parseInt(fileName.substring(6, 10))) {
+ resourceJsonData.subbg.push({"value": parseInt(fileName.substring(6, 10)), "name": fileName + " (please rename)"})
+ }
+ })
+ } else {
+ console.log('Error reading submonitor_bg directory. Check your "Exceed Gear Data Directory" config.')
+ runErrors.push('[submonitor_bg] Error reading submonitor_bg directory. Check your "Exceed Gear Data Directory" config.')
}
- 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)"})
+ // Copying new bgm files from gamedata
+ console.log("Copying new bgm files from gamedata")
+ if(IO.Exists(U.GetConfig('sdvx_eg_root_dir') + "/data/sound/custom")) {
+ 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)"})
+ }
+ })
+ } else {
+ console.log('Error reading BGM directory. Check your "Exceed Gear Data Directory" config.')
+ runErrors.push('[BGM] Error reading BGM directory. Check your "Exceed Gear Data Directory" config.')
+ }
+
+ // Copying new chat_stamp files from gamedata
+ console.log("Copying new chat stamp files from gamedata")
+ if(IO.Exists(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/chat_stamp")) {
+ let chat_stamps_folders = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/chat_stamp")
+ for(const chat_stamp_folder of chat_stamps_folders) {
+ let folderName = chat_stamp_folder.name.match(/stamp_([0-9]*)/g)[0]
+ if(folderName != '') {
+ if(!IO.Exists('webui/asset/chat_stamp/' + folderName)) {
+ let chat_stamps = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/chat_stamp/" + folderName)
+ for(const chat_stamp_ind in chat_stamps) {
+ let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/graphics/chat_stamp/" + folderName + '/' + chat_stamps[chat_stamp_ind].name)
+ IO.WriteFile('webui/asset/chat_stamp/' + folderName + '/' + chat_stamps[chat_stamp_ind].name, fileToWrite)
+ newChatStampData.push(chat_stamps[chat_stamp_ind].name)
+ }
+ } else {
+ console.log(folderName + " exists")
+ }
+ }
+ }
+
+ let stampIDCtr = 3;
+ newChatStampData.forEach(fileName => {
+ let stampId = fileName.match(/(?<=(stamp)_)([0-9]*)/g)[0]
+ if(parseInt(stampId)) {
+ let realStampID = (parseInt(stampId) * 4) - stampIDCtr;
+ resourceJsonData.stamp.push({"value": realStampID, "name": fileName + " (please rename)"})
+ }
+ if(stampIDCtr == 0) stampIDCtr = 3;
+ else stampIDCtr--;
+ })
+ } else {
+ console.log('Error reading chat stamp directory. Check your "Exceed Gear Data Directory" config.')
+ runErrors.push('[chat_stamp] Error reading chat stamp directory. Check your "Exceed Gear Data Directory" config.')
+ }
await IO.WriteFile('webui/asset/json/data.json', JSON.stringify(resourceJsonData))
await IO.WriteFile('webui/asset/logs/copyResourcesFromGame.json', JSON.stringify({
nemsys: newNemsysData,
apCard: newAPCardData,
subbg: newSubBGData,
- bgm: newBGMData
+ bgm: newBGMData,
+ chatStamp: newChatStampData,
+ versionSongs: newVersionSongs,
+ jsonSongs: newJsonSongs,
+ errors: runErrors
}))
}
-
-export const generateLatestMusicDBFile = async (data: {}) => {
- var version = '';
- IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/prop/ea3-config.xml").then(
- function(value){
- let configJson = U.parseXML(U.DecodeString(value, "shift_jis"), false)
- version = configJson['ea3']['soft']['ext']['@content'];
- },
- function(error){
- console.log(error)
- return null;
- }
- );
- var mdbJson;
- var mdbJsonFix = [];
- var mdbJsonFixFinal;
- var mdb = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/others/music_db.xml").then(
- function(value){
- mdbJson = U.parseXML(U.DecodeString(value, "shift_jis"), false)
- try {
- mdbJson.mdb.music.forEach(musicValue => {
- if(parseInt(musicValue.info.distribution_date['@content'][0]) >= parseInt(version.substring(0,8))) {
- console.log("Found new song for version " + version + ": " + musicValue.info.title_name['@content'] + " (" + musicValue.info.distribution_date['@content'] + ")");
- }
- mdbJsonFix.push({
- '@id': musicValue['@attr'].id,
- 'info': {
- 'title_name': musicValue.info.title_name['@content'],
- 'version': {
- '@__type': 'u8',
- '#text': musicValue.info.version['@content'][0].toString()
- },
- 'inf_ver': {
- '@__type': 'u8',
- '#text': musicValue.info.inf_ver['@content'][0].toString()
- },
- 'distribution_date' : {
- '#text': musicValue.info.distribution_date['@content'][0]
- }
- },
- 'difficulty': {
- 'novice': {
- 'difnum': {
- '@__type': 'u8',
- '#text': musicValue.difficulty.novice.difnum['@content'][0].toString()
- }
- },
- 'advanced': {
- 'difnum': {
- '@__type': 'u8',
- '#text': musicValue.difficulty.advanced.difnum['@content'][0].toString()
- }
- },
- 'exhaust': {
- 'difnum': {
- '@__type': 'u8',
- '#text': musicValue.difficulty.exhaust.difnum['@content'][0].toString()
- }
- },
- 'maximum': {
- 'difnum': {
- '@__type': 'u8',
- '#text': musicValue.difficulty.maximum != undefined ? musicValue.difficulty.maximum.difnum['@content'][0].toString() : '0'
- }
- },
- 'infinite': {
- 'difnum': {
- '@__type': 'u8',
- '#text': musicValue.difficulty.infinite != undefined ? musicValue.difficulty.infinite.difnum['@content'][0].toString() : '0'
- }
- }
- }
- });
- })
- } catch (err) {
- console.log(err)
- }
-
- try{
- mdbJsonFixFinal = {
- 'mdb': {
- 'version': version,
- 'music': mdbJsonFix
- }
- };
- IO.WriteFile('webui/asset/json/music_db.json', JSON.stringify(mdbJsonFixFinal));
- if(!IO.Exists('webui/asset/json/music_db_' + version + '.json')){
- IO.WriteFile('webui/asset/json/music_db_' + version + '.json', JSON.stringify(mdbJsonFixFinal));
- }
- } catch(err) {
- console.log(err)
- }
-
- return mdbJsonFixFinal;
- },
- function(error){
- console.log(error);
- return null;
- }
- );
- console.log(mdb.mdb.version)
- return mdb;
-}
\ No newline at end of file
diff --git a/sdvx@asphyxia/webui/WebUI resource update.pug b/sdvx@asphyxia/webui/WebUI resource update.pug
index e4b5497..3b87a7b 100644
--- a/sdvx@asphyxia/webui/WebUI resource update.pug
+++ b/sdvx@asphyxia/webui/WebUI resource update.pug
@@ -1,7 +1,22 @@
-//DATA//
- sdvx_dir: U.GetConfig('sdvx_eg_root_dir')
--
div
+ .card
+ button.collapse() Notes
+ .card-info.collapsible-card
+ p.card-header-info
+ h5() Notes:
+ ul
+ li() For use with Exceed Gear arcade data.
+ li() Use this if you have arcade data that can be used. It wouldn't work otherwise.
+ li() Make sure you have your 'Exceed Gear Data Directory' in the plugin settings properly configured.
+ li() Update your datacode in the ea3-config.xml file.
+ br
+ p.card-header-bgm-guide
+ h5() BGM asset guide
+ p() This feature pulls BGM files from the data, however they are in unplayable s3p format. For BGM preview to work, we need to extract the audio files from the s3p, and convert it to mp3.
+ p() For Windows, there is a bgm_convert.bat script in the SDVX plugin root directory but it requires 2 things:
+ ul
+ li() s3p_extract - download the .exe file from the latest release and put in the same directory as the bat script
+ li() ffmpeg - download and extract ffmpeg.exe and put it in the same directory as the bat script (or put ffmpeg.exe in PATH environment variable)
.card
.card-header
p.card-header-title
@@ -15,8 +30,36 @@ div
i.mdi.mdi-check
span Update
.field
- textarea(style="width: 100%; height: 100%; background: #4a4a4a; color: #ffffff; border-radius: 6px; padding: 5px; font-size: 15px" rows="50" id="logtextarea" name="logtextarea")
+ textarea.log-field(rows="50" id="logtextarea" name="logtextarea" disabled)
script(src="https://requirejs.org/docs/release/2.3.5/minified/require.js")
script(type="text/javascript" src="static/asset/js/updateResources.js")
-div(hidden id='sdvx-dir') !{sdvx_dir}
\ No newline at end of file
+style(type='text/css').
+ .collapse {
+ background-color: #4a4a4a;
+ color: white;
+ padding: 18px;
+ width: 100%;
+ border: none;
+ text-align: left;
+ outline: none;
+ font-size: 20px;
+ }
+
+ .collapse:hover {
+ background-color: #777;
+ }
+
+ .collapsible-card {
+ padding:15px;
+ }
+
+ .log-field {
+ width: 100%;
+ height: 100%;
+ background: #4a4a4a;
+ color: #ffffff;
+ border-radius: 6px;
+ padding: 5px;
+ font-size: 15px;
+ }
\ No newline at end of file
diff --git a/sdvx@asphyxia/webui/asset/js/updateResources.js b/sdvx@asphyxia/webui/asset/js/updateResources.js
index 68119a5..27a5614 100644
--- a/sdvx@asphyxia/webui/asset/js/updateResources.js
+++ b/sdvx@asphyxia/webui/asset/js/updateResources.js
@@ -2,34 +2,30 @@
// data\graphics\ap_card -- appeal card
// data\graphics\submonitor_bg -- subbg
$(document).ready(async function() {
- let sdvxDir = document.getElementById("sdvx-dir").innerText
+ $('.collapse').click(function(){
+ console.log($('.collapsible-card').css('display'))
+ if($('.collapsible-card').css('display') == 'none') {
+ $('.collapsible-card').css('display', 'block')
+ } else $('.collapsible-card').css('display', 'none')
+ })
$( "#updateResources" ).click(async function() {
- answer = confirm("Clicking OK would mean that you have already updated the datecode in your ea3-config.xml file. Would you like to proceed?");
+ answer = confirm("Clicking OK would mean that you have already updated the datacode in your ea3-config.xml file. Would you like to proceed?");
if (answer == true) {
document.getElementById("logtextarea").textContent = ''
- document.getElementById("logtextarea").textContent = 'Updating music_db.json file....\n'
- await emit("generateLatestMusicDBFile").then(
- function(response) {
- $.getJSON( "static/asset/json/music_db.json", function( data ) {
- document.getElementById("logtextarea").textContent += "New songs found in version " + data['mdb']['version'] + ": \n";
- $.each( data['mdb']['music'], function( key, val ) {
- if(parseInt(val.info.distribution_date['#text']) >= parseInt(data['mdb']['version'].substring(0,8))){
- document.getElementById("logtextarea").textContent += val.info.distribution_date['#text'] + " - " + val.info.title_name + "\n";
- }
- });
- document.getElementById("logtextarea").textContent += '\n\n'
- });
- },
- function(error) {
- document.getElementById("logtextarea").textContent += error + "\n";
- document.getElementById("logtextarea").textContent += "Please check if 'Exceed Gear Data Directory' is configured properly." + "\n";
- }
- );
-
+ document.getElementById("logtextarea").textContent = 'Running....\n'
await emit("copyResourcesFromGame").then(
function(response){
+ document.getElementById("logtextarea").textContent += 'Done.\n\n\n'
$.getJSON( "static/asset/logs/copyResourcesFromGame.json", function( data ) {
- if(data['nemsys']) {
+ if(data['errors'].length > 0) {
+ document.getElementById("logtextarea").textContent += 'Errors: \n'
+ $.each(data['errors'], function(key, val) {
+ document.getElementById("logtextarea").textContent += "- " + val + '\n'
+ })
+ document.getElementById("logtextarea").textContent += '\n\n'
+ }
+
+ if(data['nemsys'].length > 0) {
document.getElementById("logtextarea").textContent += 'New nemsys: \n'
$.each(data['nemsys'], function(key, val) {
document.getElementById("logtextarea").textContent += "- " + val + '\n'
@@ -37,7 +33,7 @@ $(document).ready(async function() {
document.getElementById("logtextarea").textContent += '\n\n'
}
- if(data['apCard']) {
+ if(data['apCard'].length > 0) {
document.getElementById("logtextarea").textContent += 'New appeal cards: \n'
$.each(data['apCard'], function(key, val) {
document.getElementById("logtextarea").textContent += "- " + val + '\n'
@@ -45,7 +41,7 @@ $(document).ready(async function() {
document.getElementById("logtextarea").textContent += '\n\n'
}
- if(data['subbg']) {
+ if(data['subbg'].length > 0) {
document.getElementById("logtextarea").textContent += 'New submonitor backgrounds: \n'
$.each(data['subbg'], function(key, val) {
document.getElementById("logtextarea").textContent += "- " + val + '\n'
@@ -53,13 +49,37 @@ $(document).ready(async function() {
document.getElementById("logtextarea").textContent += '\n\n'
}
- if(data['bgm']) {
+ if(data['bgm'].length > 0) {
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'
}
+
+ if(data['chatStamp'].length > 0) {
+ document.getElementById("logtextarea").textContent += 'New chat stamps: \n'
+ $.each(data['chatStamp'], function(key, val) {
+ document.getElementById("logtextarea").textContent += "- " + val + '\n'
+ })
+ document.getElementById("logtextarea").textContent += '\n\n'
+ }
+
+ if(data['versionSongs'].length > 0) {
+ document.getElementById("logtextarea").textContent += 'New songs in latest data: \n'
+ $.each(data['versionSongs'], function(key, val) {
+ document.getElementById("logtextarea").textContent += "- " + val + '\n'
+ })
+ document.getElementById("logtextarea").textContent += '\n\n'
+ }
+
+ if(data['jsonSongs'].length > 0) {
+ document.getElementById("logtextarea").textContent += 'New songs added to mdb asset: \n'
+ $.each(data['jsonSongs'], function(key, val) {
+ document.getElementById("logtextarea").textContent += "- " + val + '\n'
+ })
+ document.getElementById("logtextarea").textContent += '\n\n'
+ }
})
},
function(error){