diff --git a/sdvx@asphyxia/README.md b/sdvx@asphyxia/README.md index ec2da3a..b8859c4 100644 --- a/sdvx@asphyxia/README.md +++ b/sdvx@asphyxia/README.md @@ -1,15 +1,13 @@ -Message from repo fork: - -- This plugin update is for annoying people like me who doesn't want to use the unlock all feature lmao -- This fork enables a few of the features that are added in the later updates of Exceed Gear. However, I still highly recommend using the official stable version of the plugin. -- Most importantly, run the [WebUI Resource Update](/plugin/sdvx@asphyxia/WebUI%20resource%20update) for everything to properly work. -- Don't expect stability, there might be some bugs. Please back up your data to prevent unwanted issues (just in case) - ----------------------------- # SOUND VOLTEX Plugin Version: **v6.0.0** +Message from repo fork: + +- This fork enables a few of the features that are added in the later updates of Exceed Gear. However, I still highly recommend using the official stable version of the plugin. +- Most importantly, run the [WebUI Asset Update](/plugin/sdvx@asphyxia/update%20webui%20assets) for everything to properly work. +- Don't expect stability, there might be some bugs. Please back up your data to prevent unwanted issues (just in case) + Supported Versions: - BOOTH @@ -32,7 +30,19 @@ Fork Changelog ### Latest supported game version - 2022122001 -## fork-6.0.0.1 +## fork-6.0.0.2 + +### New: + +1. Enabled stamp events. Check the Stamp Events dropdown at the [Unlocking Events](/plugin/sdvx@asphyxia/unlocking%20events) page to see which stamp events are available to toggle for now. + +### Fixes: + +1. Various event-related fixes + - Re-did the Unlocking Events functionalities (categorized events by type, etc.) + - Rewrote handling of these events in common.ts and profiles.ts + +## fork-6.0.0.1 ### New: @@ -40,8 +50,8 @@ Fork Changelog 2. Arena Station 3. Valkyrie Generator support -- requires Valkyrie mode 4. WebUI features: - - [WebUI asset update](/plugin/sdvx@asphyxia/WebUI%20resource%20update) -- retrieves assets from sdvx data to update various webui assets such as the music db, bgm, submonitor bg, nemsys, crew, etc. Useful for updating webui assets when new game updates happen. - - [Events page (wip)](/plugin/sdvx@asphyxia/events%20and%20presents) -- a page to toggle unlocking of songs and other items unlocked by previous events (in-game or otherwise) + - [WebUI asset update](/plugin/sdvx@asphyxia/update%20webui%20assets) -- retrieves assets from sdvx data to update various webui assets such as the music db, bgm, submonitor bg, nemsys, crew, etc. Necessary to run for this plugin to properly work, and after updating arcade data. + - [Unlocking Events page](/plugin/sdvx@asphyxia/unlocking%20events) -- a page to toggle unlocking of songs and other items unlocked by previous events (stamp events, etc.) - [Profile pages](/plugin/sdvx@asphyxia/profiles): - Valkyrie Generator item list -- displays a profile's valkyrie/premium generator items that they've already unlocked - Gacha feature for Premium Generator @@ -66,4 +76,4 @@ Change Log ## 1.1 -1. Support VIVIDWAVE \ No newline at end of file +1. Support VIVIDWAVE diff --git a/sdvx@asphyxia/data/exg.ts b/sdvx@asphyxia/data/exg.ts index 0283fb9..960dd53 100644 --- a/sdvx@asphyxia/data/exg.ts +++ b/sdvx@asphyxia/data/exg.ts @@ -61,154 +61,274 @@ export const MISSINGSONGS6 = [ '1903', '1904', '1911', '1916', '1917' ] +export const STAMP_EVENTS6 = { + 'sdvx10thstamp': { + 'type': 'select', + 'info': { + 'id': 1, + 'stmpSlHd': '[sz:22][c:FFA6AA]SOUND VOLTEX 10th Anniversary', + 'stmpSlFt': '[sz:23]期間 2022/01/18~2022/03/21', + 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', + 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 1/18~3/21', + 'stmpBg': 'bg_stamp_anniversary_10th', + 'data': [ + { + 'stmpid': 1, + 'bnr': 'sheet_track_1', + 'stps': 5, + 'stprwrd': [ + ['5', 'track', '1838', '23'] + ] + }, + { + 'stmpid': 2, + 'bnr': 'sheet_track_2', + 'stps': 5, + 'stprwrd': [ + ['5', 'track', '1839', '23'] + ] + }, + { + 'stmpid': 3, + 'bnr': 'sheet_track_3', + 'stps': 5, + 'stprwrd': [ + ['5', 'track', '1840', '23'] + ] + }, + { + 'stmpid': 4, + 'bnr': 'sheet_track_4', + 'stps': 5, + 'stprwrd': [ + ['5', 'track', '1841', '23'] + ] + }, + { + 'stmpid': 5, + 'bnr': 'sheet_track_5', + 'stps': 5, + 'stprwrd': [ + ['5', 'track', '1842', '23'] + ] + }, + { + 'stmpid': 6, + 'bnr': 'sheet_track_6', + 'stps': 5, + 'stprwrd': [ + ['5', 'track', '1843', '23'] + ] + }, + { + 'stmpid': 7, + 'bnr': 'sheet_track_7', + 'stps': 5, + 'stprwrd': [ + ['5', 'track', '1844', '23'] + ] + } + ] + } + }, + 'reflecstamp': { + 'type': 'main', + 'info': { + 'id': 0, + 'stmpSlHd': '', + 'stmpSlFt': '', + 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', + 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 3/30 ~ 5/8', + 'stmpBg': '', + 'data': [ + { + 'stmpid': 8, + 'bnr': '', + 'stps': 15, + 'stprwrd': [ + ['1', 'track', '1853', '23'], + ['3', 'track', '1851', '23'], + ['6', 'track', '1852', '23'], + ['10', 'track', '1850', '23'], + ['15', 'track', '1854', '23'], + ] + } + ] + } + }, + 'pcbevent': { + 'type': 'main', + 'info': { + 'id': 0, + 'stmpSlHd': '', + 'stmpSlFt': '', + 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', + 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 12/8 ~ 1/15', + 'stmpBg': '', + 'data': [ + { + 'stmpid': 9, + 'bnr': '', + 'stps': 5, + 'stprwrd': [ + ['1', 'pcb', '500', ''], + ['2', 'pcb', '500', ''], + ['3', 'pcb', '1000', ''], + ['4', 'pcb', '1000', ''], + ['5', 'pcb', '2000', ''], + ] + } + ] + } + }, + '2023stamp': { + 'type': 'main', + 'info': { + 'id': 0, + 'stmpSlHd': '', + 'stmpSlFt': '', + 'stmpHd': '[sz:22]SPECIAL STAMP BONUS', + 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 1/1 ~ 1/9', + 'stmpBg': '', + 'data': [ + { + 'stmpid': 10, + 'bnr': '', + 'stps': 1, + 'stprwrd': [ + ['1', 'appeal', '5522', ''] + ] + } + ] + } + }, + 'himehina': { + 'type': 'select', + 'info': { + 'id': 2, + 'stmpSlHd': '[sz:22][c:FFA6AA]HIMEHINAコラボ開催中!', + 'stmpSlFt': '[sz:23]期間 2022/04/07~2022/05/08', + 'stmpHd': '[sz:22][c:DAC491]SPECIAL STAMP BONUS', + 'stmpFt': '[sz:22]YOU CAN GET A STAMP AND BONUS! :)[br:5]TERM: 4/7 ~ 5/8', + 'stmpBg': 'bg_stamp_himehina', + 'data': [ + { + 'stmpid': 11, + 'bnr': 'sheet_crew_1', + 'stps': 15, + 'stprwrd': [ + ['1', 'pcb', '100', ''], + ['2', 'pcb', '100', ''], + ['3', 'pcb', '100', ''], + ['4', 'pcb', '100', ''], + ['5', 'pcb', '1000', ''], + ['6', 'pcb', '200', ''], + ['7', 'pcb', '200', ''], + ['8', 'pcb', '200', ''], + ['9', 'pcb', '200', ''], + ['10', 'pcb', '2000', ''], + ['11', 'pcb', '500', ''], + ['12', 'pcb', '500', ''], + ['13', 'pcb', '500', ''], + ['14', 'pcb', '500', ''], + ['15', 'crew', '122', 'ネメシスクルー田中ヒメ'] + ] + }, + { + 'stmpid': 12, + 'bnr': 'sheet_crew_2', + 'stps': 15, + 'stprwrd': [ + ['1', 'pcb', '100', ''], + ['2', 'pcb', '100', ''], + ['3', 'pcb', '100', ''], + ['4', 'pcb', '100', ''], + ['5', 'pcb', '1000', ''], + ['6', 'pcb', '200', ''], + ['7', 'pcb', '200', ''], + ['8', 'pcb', '200', ''], + ['9', 'pcb', '200', ''], + ['10', 'pcb', '2000', ''], + ['11', 'pcb', '500', ''], + ['12', 'pcb', '500', ''], + ['13', 'pcb', '500', ''], + ['14', 'pcb', '500', ''], + ['15', 'crew', '123', 'ネメシスクルー鈴木ヒナ'] + ] + } + ] + } + } +} + export const EVENT_SONGS6 = { // X-Record songs - 'xrecord_1': [ - // 1st edition - '1736', // discordia_penorerihumer - '1737', // chewingood_toriena - '1738', // verflucht_tirfing - ], - 'xrecord_2': [ - // 2nd edition - '1848', // fegrix - '1847', // 2 beasts unchained - '1849', // piano kyousoukyoku - ], + 'xrecord_1': ['1736', '1737', '1738'], + 'xrecord_2': ['1848', '1847', '1849'], // Konaste songs - 'konasute_1': [ - '1762' - ], - 'konasute_2': [ - '1763' - ], - 'konasute_3': [ - '1764' - ], - 'konasute_4': [ - '1765' - ], - 'konasute_5': [ - '1811' - ], + 'konasute_1': ['1762'], + 'konasute_2': ['1763'], + 'konasute_3': ['1764'], + 'konasute_4': ['1765'], + 'konasute_5': ['1811'], // BPL2021 songs - 'bpl2021': [ - '1808', '1809' - ], + 'bpl2021': ['1808', '1809'], // BSB2021 songs - 'bsb2021': [ - '1802', '1803', '1804', '1805', '1806', '1807' - ], + 'bsb2021': ['1802', '1803', '1804', '1805', '1806', '1807'], // SDVX 10th anniversary stamp event songs - 'sdvx10thstamp': [ - '1838', '1839', '1840', '1841', '1842', '1843', '1844' - ], + 'sdvx10thstamp': ['1838', '1839', '1840', '1841', '1842', '1843', '1844'], // REFLECT BEAT stamp event songs - 'reflecstamp': [ - '1850', '1851', '1852', '1853', '1854' - ], + 'reflecstamp': ['1850', '1851', '1852', '1853', '1854'], // BEMANI ichika 2022 event songs - 'gmz2022': [ - '1906', '1907', '1908', '1909', '1910' - ], + 'gmz2022': ['1906', '1907', '1908', '1909', '1910'], // BPL2022 songs - "bpl2022_1": [ - '1952', '1943' - ], - "bpl2022_2": [ - '1948', '1951' - ], - "bpl2022_3": [ - '1956', '1949' - ], - "bpl2022_4": [ - '1946', '1958' - ], - "bpl2022_5": [ - '1957', '1955' - ], - "bpl2022_6": [ - '1947', '1953' - ] + "bpl2022_1": ['1952', '1943'], + "bpl2022_2": ['1948', '1951'], + "bpl2022_3": ['1956', '1949'], + "bpl2022_4": ['1946', '1958'], + "bpl2022_5": ['1957', '1955'], + "bpl2022_6": ['1947', '1953'] } export const RESTRICTED_SONGS6 = { // X-Record songs - 'xrecord_1': [ - // 1st edition - '1736', // discordia_penorerihumer - '1737', // chewingood_toriena - '1738', // verflucht_tirfing - ], - 'xrecord_2': [ - // 2nd edition - '1848', // fegrix - '1847', // 2 beasts unchained - '1849', // piano kyousoukyoku - ], + 'xrecord_1': ['1736', '1737', '1738'], + 'xrecord_2': ['1848', '1847', '1849'], + // Konaste songs + 'konasute_1': ['1762'], + 'konasute_2': ['1763'], + 'konasute_3': ['1764'], + 'konasute_4': ['1765'], + 'konasute_5': ['1811'], // BPL2021 songs - // 'bpl2021': [ - // '1808', '1809' - // ], + 'bpl2021': ['1808', '1809'], // BSB2021 songs - 'bsb2021': [ - '1802', '1803', '1804', '1805', '1806', '1807' - ], + 'bsb2021': ['1802', '1803', '1804', '1805', '1806', '1807'], // SDVX 10th anniversary stamp event songs - 'sdvx10thstamp': [ - '1838', '1839', '1840', '1841', '1842', '1843', '1844' - ], + 'sdvx10thstamp': ['1838', '1839', '1840', '1841', '1842', '1843', '1844'], // REFLECT BEAT stamp event songs - 'reflecstamp': [ - '1850', '1851', '1852', '1853', '1854' - ], + 'reflecstamp': ['1850', '1851', '1852', '1853', '1854'], // BEMANI ichika 2022 event songs - 'gmz2022': [ - '1906', '1907', '1908', '1909', '1910' - ], + 'gmz2022': ['1906', '1907', '1908', '1909', '1910'], // BPL2022 songs - "bpl2022_1": [ - '1952', '1943' - ], - "bpl2022_2": [ - '1948', '1951' - ], - "bpl2022_3": [ - '1956', '1949' - ], - "bpl2022_4": [ - '1946', '1958' - ], - "bpl2022_5": [ - '1957', '1955' - ], - "bpl2022_6": [ - '1947', '1953' - ] + "bpl2022_1": ['1952', '1943'], + "bpl2022_2": ['1948', '1951'], + "bpl2022_3": ['1956', '1949'], + "bpl2022_4": ['1946', '1958'], + "bpl2022_5": ['1957', '1955'], + "bpl2022_6": ['1947', '1953'] } export const APRILFOOLSSONGS = [ '840', '1219', '1751' ] -export const VALKYRIEEXCLUSIVESONGS = [ - '1672', '1744', '1855', '1742', '1743', +export const VALKYRIE_SONGS = [ + '1744', '1672', // Valk exclusives + '1855', '1742', '1743', '1745', // Arena station songs '1736', '1737', '1738', '1848', '1847', '1849' // X-record ] -// arena station crew with name cheatsheet -// 29 nearnoah xmas -// 82 kanade halloween -// 95 rasis v -// 101 right v -// 103 nearnoah v -// 104 nana v -// 106 natsuhi -// 107 cocona -// 122 hime? -// 123 hina? - -// ARENA data export const ARENA = { 'Set 1 (04/25/22)': { details: { diff --git a/sdvx@asphyxia/handlers/common.ts b/sdvx@asphyxia/handlers/common.ts index 8083443..ab1b797 100644 --- a/sdvx@asphyxia/handlers/common.ts +++ b/sdvx@asphyxia/handlers/common.ts @@ -1,7 +1,8 @@ import { EVENT4, COURSES4, EXTENDS4 } from '../data/hvn'; import { EVENT5, COURSES5, EXTENDS5 } from '../data/vvw'; -import { EVENT6, COURSES6, EXTENDS6, APRILFOOLSSONGS, VALKYRIEEXCLUSIVESONGS, - MISSINGSONGS6, ARENA, VALGENE, INFORMATION6, RESTRICTED_SONGS6, EVENT_SONGS6 +import { EVENT6, COURSES6, EXTENDS6, APRILFOOLSSONGS, VALKYRIE_SONGS, + MISSINGSONGS6, ARENA, VALGENE, INFORMATION6, RESTRICTED_SONGS6, EVENT_SONGS6, + STAMP_EVENTS6 } from '../data/exg'; import { COURSE2 } from '../data/inf'; import {getVersion, getRandomIntInclusive} from '../utils'; @@ -110,7 +111,7 @@ export const common: EPR = async (info, data, send) => { if(MISSINGSONGS6.includes(i.toString())) { limitedNo += 1; } - else if(VALKYRIEEXCLUSIVESONGS.includes(i.toString()) && (!U.GetConfig('enable_valk_songs') && info.model.split(":")[2].match(/^(G|H)$/g) == null)){ + else if(VALKYRIE_SONGS.includes(i.toString()) && (!U.GetConfig('enable_valk_songs') && info.model.split(":")[2].match(/^(G|H)$/g) == null)){ limitedNo -= 1; } for(let j = 0; j < 5; j++) { @@ -120,7 +121,7 @@ export const common: EPR = async (info, data, send) => { limited: K.ITEM('u8', limitedNo), }); } - } else if (songData.info.inf_ver['#text'] === '6') { // if song from previous sdvx iteration but with new XCD track; wouldn't work without updated webui asset + } else if (songData.info.inf_ver['#text'] === '6') { // if song has new XCD track; wouldn't work without updated webui asset songs.push({ music_id: K.ITEM('s32', i), music_type: K.ITEM('u8', 3), @@ -165,7 +166,8 @@ export const common: EPR = async (info, data, send) => { '', ], }); - } else if(INFORMATION6[version.toString()] != undefined) { + } + else if(INFORMATION6[version.toString()] != undefined) { console.log("Sending server information"); let time = new Date(); let tempDate = time.getDate(); @@ -190,6 +192,82 @@ export const common: EPR = async (info, data, send) => { } } + if(IO.Exists('handlers/test.json')) { + let testExtend = JSON.parse(await IO.ReadFile('handlers/test.json')) + if(testExtend.length > 0) { + testExtend.forEach(td => { + console.log("testExtend: " + JSON.stringify(td)) + extend.push({ + id: td['id'], + type: td['type'], + params: td['params'] + }); + }) + } + } + + if(IO.Exists('webui/asset/config/events.json')) { + const itemTypeList = {"track": 'e', "appeal": 'a', "crew": 'c', "pcb": 'b'} + let eventData = JSON.parse(await IO.ReadFile('webui/asset/json/events.json')) + let eventConfig = JSON.parse(await IO.ReadFile('webui/asset/config/events.json')) + for(const eventIter in eventData['events']) { + if(eventData['events'][eventIter]['type'] === 'stamp' && eventConfig[eventData['events'][eventIter]['id']]['toggle']) { + let stmpEvntInfo = STAMP_EVENTS6[eventData['events'][eventIter]['id']] + let prmStr1Sel = '' + + for(const stmpDataIter in stmpEvntInfo['info']['data']) { + let stmpRwrd = stmpEvntInfo['info']['data'][stmpDataIter]['stprwrd'] + let prmStr5 = '' + let sSheetName = (stmpRwrd[stmpRwrd.length - 1][1] === 'crew') ? stmpRwrd[stmpRwrd.length - 1][3] : stmpRwrd[stmpRwrd.length - 1][2] + prmStr1Sel += stmpEvntInfo['info']['data'][stmpDataIter]['stmpid'] + '#' + stmpEvntInfo['info']['data'][stmpDataIter]['bnr'] + '#' + itemTypeList[stmpRwrd[stmpRwrd.length - 1][1]] + '#' + sSheetName + (stmpEvntInfo['info']['data'].length - 1 === parseInt(stmpDataIter) ? '' : ',') + for(const stmpRwrdIter in stmpRwrd) { + let iID = stmpRwrd[stmpRwrdIter][2] + if (stmpRwrd[stmpRwrdIter][1] === 'track') iID += stmpRwrd[stmpRwrdIter][3] + prmStr5 += stmpRwrd[stmpRwrdIter][0] + ':' + itemTypeList[stmpRwrd[stmpRwrdIter][1]] + ':' + iID + (stmpRwrd.length - 1 === parseInt(stmpRwrdIter) ? '' : ' ') + } + let prmStep = [ + 5, + stmpEvntInfo['info']['data'][stmpDataIter]['stps'], + 0, + stmpEvntInfo['info']['data'][stmpDataIter]['stps'], + 0, + '', + stmpEvntInfo['info']['stmpHd'], + '', + stmpEvntInfo['info']['stmpFt'], + prmStr5 + ] + let newSelMainExtend = { + 'type': 3, + 'id': stmpEvntInfo['info']['data'][stmpDataIter]['stmpid'], + 'params': prmStep + } + extend.push(newSelMainExtend) + } + + if(stmpEvntInfo['type'] === 'select') { + let newSelExtend = { + 'type': 3, + 'id': stmpEvntInfo['info']['id'], + 'params': [ + 9, + 0, + 0, + 0, + 0, + prmStr1Sel, + '', + stmpEvntInfo['info']['stmpSlHd'], + stmpEvntInfo['info']['stmpSlFt'], + stmpEvntInfo['info']['stmpBg'] + ] + } + extend.push(newSelExtend) + } + } + } + } + if(U.GetConfig('use_asphyxia_gameover')){ let time = new Date(); let tempDate = time.getDate(); diff --git a/sdvx@asphyxia/handlers/profiles.ts b/sdvx@asphyxia/handlers/profiles.ts index 97d8819..48b42b9 100644 --- a/sdvx@asphyxia/handlers/profiles.ts +++ b/sdvx@asphyxia/handlers/profiles.ts @@ -641,6 +641,59 @@ export const load: EPR = async (info, data, send) => { version, })) || { base: 0, name: 0, level: 0 }; + let presents = [] + if(version === 6) { + if(IO.Exists('webui/asset/config/events.json')) { + let eventData = JSON.parse(await IO.ReadFile('webui/asset/json/events.json')) + let eventConfig = JSON.parse(await IO.ReadFile('webui/asset/config/events.json')) + for(const eventIter in eventData['events']) { + if(eventData['events'][eventIter]['type'] === 'gift') { + if(typeof eventConfig[eventData['events'][eventIter]['id']]['toggle'] === "boolean") { + if(eventConfig[eventData['events'][eventIter]['id']]['toggle']) { + for(const itemIter in EVENT_SONGS6[eventData['events'][eventIter]['id']]) { + let itemId = parseInt(EVENT_SONGS6[eventData['events'][eventIter]['id']][itemIter]) + if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { + await DB.Upsert( + refid, + {collection: 'item', type: 0, id: itemId}, + {$set: { param: 23 }} + ) + + presents.push({ + id: itemId, + type: 0, + param: 23 + }) + } + } + } + } else{ + for(const toggleKeys in Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])) { + if(eventConfig[eventData['events'][eventIter]['id']]['toggle'][Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { + for(const itemIter in EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { + let itemId = parseInt(EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]][itemIter]) + if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { + await DB.Upsert( + refid, + {collection: 'item', type: 0, id: itemId}, + {$set: { param: 23 }} + ) + + presents.push({ + id: itemId, + type: 0, + param: 23 + }) + } + } + } + } + } + } + } + } + } + const items = await DB.Find(refid, { collection: 'item' }); const courses = await DB.Find(refid, { collection: 'course', version }); const params = await DB.Find(refid, { collection: 'param' }); @@ -704,62 +757,6 @@ export const load: EPR = async (info, data, send) => { tempItem = U.GetConfig('unlock_all_appeal_cards') ? unlockAppealCards(items) : items; tempItem = removeStampItems(tempItem) - let presents = [] - if(IO.Exists('webui/asset/config/events.json')) { - let eventData = JSON.parse(await IO.ReadFile('webui/asset/json/events.json')) - let eventConfig = JSON.parse(await IO.ReadFile('webui/asset/config/events.json')) - for(const eventIter in eventData['events']) { - if(!eventData['events'][eventIter]['in_game_event']) { - if(typeof eventConfig[eventData['events'][eventIter]['id']]['toggle'] === "boolean") { - if(eventConfig[eventData['events'][eventIter]['id']]['toggle']) { - for(const itemIter in EVENT_SONGS6[eventData['events'][eventIter]['id']]) { - let itemId = parseInt(EVENT_SONGS6[eventData['events'][eventIter]['id']][itemIter]) - if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { - await DB.Upsert( - refid, - {collection: 'item', type: 0, id: itemId}, - {$set: { param: 23 }} - ) - - presents.push({ - id: itemId, - type: 0, - param: 23 - }) - - tempItem.push({ collection: 'item', type: 0, id: itemId, param: 23 }) - } - } - } - } else{ - // eventConfig[eventData['events'][eventIter]['id']]['toggle'] - for(const toggleKeys in Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])) { - if(eventConfig[eventData['events'][eventIter]['id']]['toggle'][Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { - for(const itemIter in EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { - let itemId = parseInt(EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]][itemIter]) - if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { - await DB.Upsert( - refid, - {collection: 'item', type: 0, id: itemId}, - {$set: { param: 23 }} - ) - - presents.push({ - id: itemId, - type: 0, - param: 23 - }) - - tempItem.push({ collection: 'item', type: 0, id: itemId, param: 23 }) - } - } - } - } - } - } - } - } - // Make generator power always 100%, for (let i = 0; i < 50; i++) { const tempGene: Item = { collection: 'item', type: 7, id: i, param: 10 }; diff --git a/sdvx@asphyxia/webui/asset/js/events.js b/sdvx@asphyxia/webui/asset/js/events.js index 0ba33b7..5cae45b 100644 --- a/sdvx@asphyxia/webui/asset/js/events.js +++ b/sdvx@asphyxia/webui/asset/js/events.js @@ -1,6 +1,6 @@ -function generateEventToggles(eventInfo, eventConfig) { +function generateEventToggles(eventInfo, eventConfig, eventEnabled) { let cardContent = $('
') - if(!['bpl2022', 'konasute', 'xrecord'].includes(eventInfo['id'])) { + if(typeof eventInfo['info'] === 'string') { cardContent.append( $('
').append( $('
') @@ -22,13 +22,34 @@ function generateEventToggles(eventInfo, eventConfig) { return cardContent } -async function readEventsConfigFile() { +async function generateNewEventsConfigFile(eventData) { + let eventConfig = {} + for(const eventIter in eventData['events']) { + eventConfig[eventData['events'][eventIter]['id']] = await insertNewEventConfig(eventData, eventIter, eventData['events'][eventIter]['id']) + } + return eventConfig +} + +async function insertNewEventConfig(eventData, eventIter, eventID) { + let toggle = false + if(typeof eventData['events'][eventIter]['info'] !== 'string') { + toggle = {} + for(const toggleIter in eventData['events'][eventIter]['info']) { + toggle[eventData['events'][eventIter]['id'] + '_' + (parseInt(toggleIter) + 1)] = false + } + } + return { + 'toggle': toggle + } +} + +async function readEventsConfigFile(eventData) { try { return await $.getJSON("static/asset/config/events.json", function(data) { return data }) } catch { - return await generateNewEventsConfigFile() + return await generateNewEventsConfigFile(eventData) } } @@ -38,47 +59,30 @@ async function readEventsJsonFile() { }) } -async function generateNewEventsConfigFile() { - let hiddenEvents = ['bpl2021', 'bsb2021', 'gmz2022', 'pcbevent'] - let eventConfig = {} - let eventData = await readEventsJsonFile() - for(const eventIter in eventData['events']) { - let hidden = false - let toggle = false - if(['bpl2022', 'konasute', 'xrecord'].includes(eventData['events'][eventIter]['id'])) { - toggle = {} - for(const toggleIter in eventData['events'][eventIter]['info']) { - toggle[eventData['events'][eventIter]['id'] + '_' + (parseInt(toggleIter) + 1)] = false - } - } - if(hiddenEvents.includes(eventData['events'][eventIter]['id'])) { - hidden = true - } - eventConfig[eventData['events'][eventIter]['id']] = { - 'hidden': hidden, - 'toggle': toggle - } - } - console.log(eventConfig) - return eventConfig -} - - $(document).ready(async function() { let eventData = await readEventsJsonFile() - let eventConfig = await readEventsConfigFile() + let eventConfig = await readEventsConfigFile(eventData) for(const eventIter in eventData['events']) { - if(!eventConfig[eventData['events'][eventIter]['id']]['hidden']) { - $('div.main').append( - $('

' + eventData['events'][eventIter]['name'] + '

') - ).append( - generateEventToggles(eventData['events'][eventIter], eventConfig[eventData['events'][eventIter]['id']]) - ) + if(eventConfig[eventData['events'][eventIter]['id']] === undefined) { + eventConfig[eventData['events'][eventIter]['id']] = await insertNewEventConfig(eventData, eventIter, eventData['events'][eventIter]['id']) + } + + if(eventData['events'][eventIter]['enabled']) { + if(eventData['events'][eventIter]['type'] === 'stamp') { + $('#stampevent_select').append( + '' + ) + } else if(eventData['events'][eventIter]['type'] === 'gift') { + $('#giftevent_select').append( + '' + ) + } else if(eventData['events'][eventIter]['type'] === 'cross_online') { + $('#crossevent_select').append( + '' + ) + } } } - $('div.main').append( - $('
') - ) $('#event-submit').on('click', async function() { $.each($('span.check'), function(index, value) { @@ -98,11 +102,29 @@ $(document).ready(async function() { await emit("manageEvents", {eventConfig: eventConfig}).then( function(response) { - alert('saved') + alert('Saved.') }, function(error) { console.log(error) } ) }) + + $('select').change(async function(event) { + let selectClass = '#' + $(this).attr('id') + let listClasses = {'#stampevent_select': 'stamp', '#giftevent_select': 'gift', '#crossevent_select': 'cross'} + $('.' + listClasses[selectClass] + '.list').empty() + for(const eventIter in eventData['events']) { + if(eventData['events'][eventIter]['id'] === $(selectClass).val()) { + $('.' + listClasses[selectClass] + '.list').append( + generateEventToggles(eventData['events'][eventIter], eventConfig[eventData['events'][eventIter]['id']], eventData['events'][eventIter]['enabled']) + ) + $('div.main').append( + $('
') + ) + } + } + }) + + }) \ No newline at end of file diff --git a/sdvx@asphyxia/webui/asset/json/events.json b/sdvx@asphyxia/webui/asset/json/events.json index bc425f1..4df47c8 100644 --- a/sdvx@asphyxia/webui/asset/json/events.json +++ b/sdvx@asphyxia/webui/asset/json/events.json @@ -2,7 +2,8 @@ "events": [ { "id": "xrecord", - "in_game_event": false, + "type": "cross_online", + "enabled": false, "name": "X-record", "info": [ "1st set of songs from X-record; originally unlocked by playing either SOUND VOLTEX on the Valkyrie model, or beatmaniaIIDX on the Lightning model.
Enable this option to have them automatically unlocked and saved to your account.", @@ -11,7 +12,8 @@ }, { "id": "konasute", - "in_game_event": false, + "type": "gift", + "enabled": true, "name": "グレイスからの挑戦状!! (GRACE kara no chousenjou!!)", "info": [ "Enables unlock for the song 'ドゥサンコオデッセイ!!' by cosMo@暴走P upon logging in.
This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", @@ -23,52 +25,73 @@ }, { "id": "bpl2021", - "in_game_event": false, + "type": "cross_online", + "enabled": false, "name": "BPL応援 楽曲解禁スタンプラリー (BPL ouen gakkyoku kaikin stamp rally)", "info": "Songs in this event are originally unlocked by accessing the official BEMANI PRO LEAGUE 2021 website and obtaining the stamp by watching VODs of the BPL competition.
Enable this option to have them unlocked and saved to your account." }, { "id": "bsb2021", - "in_game_event": false, + "type": "cross_online", + "enabled": false, "name": "BEMANI 2021真夏の歌合戦5番勝負 (BEMANI 2021 manatsu no utagassen 5 ban shoubu)", "info": "This is a cross-BEMANI event. Songs are originally unlocked by playing participating BEMANI games and earn 'Yell' points.
Enable this option to have the songs unlocked and saved to your account." }, { "id": "sdvx10thstamp", - "in_game_event": true, + "type": "stamp", + "enabled": true, "name": "SOUND VOLTEX 10th Anniversary", - "info": "Stamp event to unlock 7 songs.
Enable this option to enable this stamp event." + "info": "Stamp event to unlock 7 songs.
Toggle this on to enable this stamp event." }, { "id": "reflecstamp", - "in_game_event": true, + "type": "stamp", + "enabled": true, "name": "REFLEC BEAT Song Stamp Event", - "info": "Stamp event to unlock 5 songs originally from the REFLEC BEAT game.
Enable this option to enable this stamp event." + "info": "Stamp event to unlock 5 songs originally from the REFLEC BEAT game series.
Toggle this on to enable this stamp event." }, { "id": "gmz2022", - "in_game_event": false, + "type": "cross_online", + "enabled": false, "name": "いちかのごちゃまぜMix UP! (Ichika no gochamaze Mix UP! )", "info": "This is a cross-BEMANI event. Songs include some that are shared from other BEMANI games and some that are mashup/remixes of the shared songs. These are originally unlocked by playing participating BEMANI games and earning points to fill different gauges.

Enable this option to have the songs unlocked and saved to your account." }, { "id": "bpl2022", - "in_game_event": false, + "type": "gift", + "enabled": true, "name": "BEMANI PRO LEAGUE -SEASON 2-! Original Song", "info": [ - "Enable this option to have songs from the 1st week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", - "Enable this option to have songs from the 2nd week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", - "Enable this option to have songs from the 3rd week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", - "Enable this option to have songs from the 4th week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", - "Enable this option to have songs from the 5th week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", - "Enable this option to have songs from the 6th week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE." + "Toggle to have songs from the 1st week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.
Songs: 'Chat perché' and 'WINNING ROAD'", + "Toggle to have songs from the 2nd week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.
Songs: 'ENDGAME' and 'ИADIR'", + "Toggle to have songs from the 3rd week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.
Songs: 'Ice Fortress' and 'MURASAME'", + "Toggle to have songs from the 4th week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.
Songs: 'Initiating League' and 'Scat Jazz Dance'", + "Toggle to have songs from the 5th week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.
Songs: '最果ての勇者にラブソングを' and '灼ナル刃、破カヰ譜'", + "Toggle to have songs from the 6th week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.
Songs: 'Fl0ating:' and 'Petit espoir'" ] }, { "id": "pcbevent", - "in_game_event": true, - "name": "PCB Stamp Event", - "info": "Stamp event to earn PCB.
Enable this option to enable this stamp event." + "type": "stamp", + "enabled": false, + "name": "PCBおかわりスタンプイベント | PCB Refill Stamp Event", + "info": "Stamp event to earn PCB. Once the stamp goal is complete, it will start over and you can earn more PCB.
Toggle this on to enable this stamp event." + }, + { + "id": "2023stamp", + "type": "stamp", + "enabled": true, + "name": "んだんだぺったん☆二〇二三 | New Year 2023 Stamp Event", + "info": "Stamp event to unlock the んだんだぺったん☆二〇二三 appeal card.
Toggle this on to enable this stamp event." + }, + { + "id": "himehina", + "type": "stamp", + "enabled": true, + "name": "HIMEHINAコラボイベント | HIMEHINA Collab Stamp Event", + "info": "Stamp event to unlock the HIMEHINA crew.
Toggle this on to enable this stamp event." } ] -} \ No newline at end of file +} diff --git a/sdvx@asphyxia/webui/events and presents.pug b/sdvx@asphyxia/webui/events and presents.pug deleted file mode 100644 index d92e2c6..0000000 --- a/sdvx@asphyxia/webui/events and presents.pug +++ /dev/null @@ -1,5 +0,0 @@ -- -link(rel="stylesheet" href="static/asset/css/datatables.css") -div.main - -script(src="static/asset/js/events.js") \ No newline at end of file diff --git a/sdvx@asphyxia/webui/unlocking events.pug b/sdvx@asphyxia/webui/unlocking events.pug new file mode 100644 index 0000000..ecaee87 --- /dev/null +++ b/sdvx@asphyxia/webui/unlocking events.pug @@ -0,0 +1,48 @@ +- +link(rel="stylesheet" href="static/asset/css/datatables.css") +div + .card + .card-header + p.card-header-title + span.icon + i.mdi.mdi-star + | Stamp Events + .card-content + .field + .control + .select + select(name="stampevent_select" id="stampevent_select") + option(name="none" id="none") Select Stamp Event + .stamp.list + .card + .card-header + p.card-header-title + span.icon + i.mdi.mdi-star + | Gift Events + .card-content + .field + .control + .select + select(name="giftevent_select" id="giftevent_select") + option(name="none" id="none") Select Gift Event + .gift.list + .card + .card-header + p.card-header-title + span.icon + i.mdi.mdi-star + | Cross Events + .card-content + .field + .control + .select + select(name="crossevent_select" id="crossevent_select") + option(name="none" id="none") Select Cross Event + .cross.list + div.field.is-grouped + div.control.is-expanded + div.control + button.button.is-link(id="event-submit") Apply + +script(src="static/asset/js/events.js") \ No newline at end of file diff --git a/sdvx@asphyxia/webui/WebUI resource update.pug b/sdvx@asphyxia/webui/update webui assets.pug similarity index 94% rename from sdvx@asphyxia/webui/WebUI resource update.pug rename to sdvx@asphyxia/webui/update webui assets.pug index 3b87a7b..08b3238 100644 --- a/sdvx@asphyxia/webui/WebUI resource update.pug +++ b/sdvx@asphyxia/webui/update webui assets.pug @@ -1,65 +1,65 @@ -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 - span.icon - i.mdi.mdi-account-edit - | Update WebUI Resources (pull from game files) - .card-content - .field - button.button.is-primary(type="update" id="updateResources") - span.icon - i.mdi.mdi-check - span Update - .field - 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") -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; +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 + span.icon + i.mdi.mdi-account-edit + | Update WebUI Assets (pull from game files) + .card-content + .field + button.button.is-primary(type="update" id="updateResources") + span.icon + i.mdi.mdi-check + span Update + .field + 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") +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