diff --git a/aklive2d.js b/aklive2d.js index 3cf3118..bcaf099 100644 --- a/aklive2d.js +++ b/aklive2d.js @@ -14,12 +14,12 @@ import directory from './libs/directory.js' import Background from './libs/background.js' import CharwordTable from './libs/charword_table.js'; import Music from './libs/music.js'; -import officalUpdate from './libs/offical_update.js'; -import LogoInfo from './libs/logo_info.js'; +import OfficalInfo from './libs/offical_info.js'; async function main() { global.__projectRoot = path.dirname(fileURLToPath(import.meta.url)) - global.__config = getConfig() + const officalInfo = new OfficalInfo() + global.__config = getConfig(officalInfo) global.__error = [] @@ -28,7 +28,6 @@ async function main() { const charwordTable = new CharwordTable() const musicTable = new Music() - const logoTable = new LogoInfo() /** * Skip all, no need for OPERATOR_NAME @@ -56,11 +55,8 @@ async function main() { case 'music': await musicTable.process() process.exit(0) - case 'logo': - await logoTable.process() - process.exit(0) case 'offical_update': - await officalUpdate() + await officalInfo.update() process.exit(0) default: break @@ -101,7 +97,7 @@ async function main() { */ switch (op) { case 'init': - init(OPERATOR_NAME, [EXTRACTED_FOLDER, ...VOICE_FOLDERS]) + init(OPERATOR_NAME, [EXTRACTED_FOLDER, ...VOICE_FOLDERS], officalInfo) process.exit(0) default: break diff --git a/config/_template.yaml b/config/_template.yaml index bf145b7..afdb568 100644 --- a/config/_template.yaml +++ b/config/_template.yaml @@ -1,13 +1,11 @@ -date: 2021/08 filename: dyn_illust_char_1013_chen2 logo: logo_rhodes_override fallback_name: char_1013_chen2_2 viewport_left: 0 viewport_right: 0 -viewport_top: 1 -viewport_bottom: 1 +viewport_top: 0 +viewport_bottom: 0 invert_filter: false -color: rgba(14, 126, 239, 0.85) codename: zh-CN: 假日威龙陈 en-US: Ch'en/Chen the Holungday \ No newline at end of file diff --git a/config/chen.yaml b/config/chen.yaml index bf145b7..e700a96 100644 --- a/config/chen.yaml +++ b/config/chen.yaml @@ -1,4 +1,3 @@ -date: 2021/08 filename: dyn_illust_char_1013_chen2 logo: logo_rhodes_override fallback_name: char_1013_chen2_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 1 viewport_bottom: 1 invert_filter: false -color: rgba(14, 126, 239, 0.85) codename: zh-CN: 假日威龙陈 - en-US: Ch'en/Chen the Holungday \ No newline at end of file + en-US: Ch'en/Chen the Holungday +offical_id: "20220345" \ No newline at end of file diff --git a/config/chen_ten_thousand_mountains.yaml b/config/chen_ten_thousand_mountains.yaml index 95013de..2535d45 100644 --- a/config/chen_ten_thousand_mountains.yaml +++ b/config/chen_ten_thousand_mountains.yaml @@ -1,4 +1,3 @@ -date: 2023/04 filename: dyn_illust_char_1013_chen2_boc#6 logo: logo_rhodes_override fallback_name: char_1013_chen2_boc#6 @@ -7,7 +6,7 @@ viewport_right: 1 viewport_top: 2 viewport_bottom: -1 invert_filter: false -color: rgb(6, 34, 129) codename: zh-CN: 万重山 · 假日威龙陈 - en-US: Ten Thousand Mountains / Ch'en/Chen the Holungday \ No newline at end of file + en-US: Ten Thousand Mountains / Ch'en/Chen the Holungday +offical_id: "202304659" \ No newline at end of file diff --git a/config/chongyue.yaml b/config/chongyue.yaml index fedd4ab..0ec39c3 100644 --- a/config/chongyue.yaml +++ b/config/chongyue.yaml @@ -1,4 +1,3 @@ -date: 2023/01 filename: dyn_illust_char_2024_chyue logo: logo_sui fallback_name: char_2024_chyue_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(255, 133, 34) codename: zh-CN: 重岳 - en-US: Chongyue \ No newline at end of file + en-US: Chongyue +offical_id: "202301606" \ No newline at end of file diff --git a/config/dusk.yaml b/config/dusk.yaml index e3b25f3..63164ff 100644 --- a/config/dusk.yaml +++ b/config/dusk.yaml @@ -1,4 +1,3 @@ -date: 2021/02 filename: dyn_illust_char_2015_dusk logo: logo_sui fallback_name: char_2015_dusk_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(9, 212, 208) codename: zh-CN: 夕 - en-US: Dusk \ No newline at end of file + en-US: Dusk +offical_id: "202203263" \ No newline at end of file diff --git a/config/dusk_everything_is_a_miracle.yaml b/config/dusk_everything_is_a_miracle.yaml index 723f9f4..957ccc3 100644 --- a/config/dusk_everything_is_a_miracle.yaml +++ b/config/dusk_everything_is_a_miracle.yaml @@ -1,4 +1,3 @@ -date: 2022/01 filename: dyn_illust_char_2015_dusk_nian#7 logo: logo_sui fallback_name: char_2015_dusk_nian#7 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(78, 201, 187) codename: zh-CN: 染尘烟 · 夕 - en-US: Everything is a Miracle / Dusk \ No newline at end of file + en-US: Everything is a Miracle / Dusk +offical_id: "20220321" \ No newline at end of file diff --git a/config/eyjafjalla_the_hvit_aska.yaml b/config/eyjafjalla_the_hvit_aska.yaml index e078a8a..e9221ae 100644 --- a/config/eyjafjalla_the_hvit_aska.yaml +++ b/config/eyjafjalla_the_hvit_aska.yaml @@ -1,4 +1,3 @@ -date: 2023/07 filename: dyn_illust_char_1016_agoat2 logo: logo_Leithanien fallback_name: char_1016_agoat2_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 5 viewport_bottom: 5 invert_filter: true -color: rgb(34, 187, 255) codename: zh-CN: 纯烬艾雅法拉 en-US: Eyjafjalla the Hvít Aska +offical_id: "202307865" \ No newline at end of file diff --git a/config/gavial.yaml b/config/gavial.yaml index ee6a766..7d9e6e4 100644 --- a/config/gavial.yaml +++ b/config/gavial.yaml @@ -1,4 +1,3 @@ -date: 2022/08 filename: dyn_illust_char_1026_gvial2 logo: logo_rhodes_override fallback_name: char_1026_gvial2_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: false -color: rgb(29, 185, 53) codename: zh-CN: 百练嘉维尔 - en-US: Gavial the Invincible \ No newline at end of file + en-US: Gavial the Invincible +offical_id: "202208258" \ No newline at end of file diff --git a/config/gavial_the_invincible_holiday_hd26.yaml b/config/gavial_the_invincible_holiday_hd26.yaml index 97f8c83..62c224b 100644 --- a/config/gavial_the_invincible_holiday_hd26.yaml +++ b/config/gavial_the_invincible_holiday_hd26.yaml @@ -1,4 +1,3 @@ -date: 2023/07 filename: dyn_illust_char_1026_gvial2_summer#12 logo: logo_rhodes_override fallback_name: char_1026_gvial2_summer#12 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: false -color: rgb(163, 220, 247) codename: zh-CN: 悠然假日 HD26 · 百炼嘉维尔 en-US: Holiday HD26 / Gavial the Invincible +offical_id: "202307886" \ No newline at end of file diff --git a/config/goldenglow_summer_flowers_fa394.yaml b/config/goldenglow_summer_flowers_fa394.yaml index 6129b88..82bfcba 100644 --- a/config/goldenglow_summer_flowers_fa394.yaml +++ b/config/goldenglow_summer_flowers_fa394.yaml @@ -1,4 +1,3 @@ -date: 2023/07 filename: dyn_illust_char_377_gdglow_summer#12 logo: logo_victoria fallback_name: char_377_gdglow_summer#12 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgba(253, 188, 208, 0.97) codename: zh-CN: 夏卉 FA394 · 澄闪 en-US: Summer Flowers FA394 / Goldenglow +offical_id: "202307824" \ No newline at end of file diff --git a/config/kaltsit_remnant.yaml b/config/kaltsit_remnant.yaml index 26584dd..7eb3602 100644 --- a/config/kaltsit_remnant.yaml +++ b/config/kaltsit_remnant.yaml @@ -1,4 +1,3 @@ -date: 2023/04 filename: dyn_illust_char_003_kalts_boc#6 logo: logo_rhodes_override fallback_name: char_003_kalts_boc#6 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: false -color: rgb(118, 165, 185) codename: zh-CN: 残余 · 凯尔希 en-US: Remnant / Kal'tsit +offical_id: "202304833" \ No newline at end of file diff --git a/config/lee_trust_your_eyes.yaml b/config/lee_trust_your_eyes.yaml index 4053417..eaf0cc1 100644 --- a/config/lee_trust_your_eyes.yaml +++ b/config/lee_trust_your_eyes.yaml @@ -1,4 +1,3 @@ -date: 2022/10 filename: dyn_illust_char_322_lmlee_witch#3 logo: logo_lee fallback_name: char_322_lmlee_witch#3 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(206, 0, 0) codename: zh-CN: 手到牌来 · 老鲤 - en-US: Trust Your Eyes / Lee \ No newline at end of file + en-US: Trust Your Eyes / Lee +offical_id: "202210279" \ No newline at end of file diff --git a/config/ling.yaml b/config/ling.yaml index 143565e..dae84eb 100644 --- a/config/ling.yaml +++ b/config/ling.yaml @@ -1,4 +1,3 @@ -date: 2022/01 filename: dyn_illust_char_2023_ling logo: logo_sui fallback_name: char_2023_ling_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(15, 206, 216) codename: zh-CN: 令 - en-US: Ling \ No newline at end of file + en-US: Ling +offical_id: "20220383" \ No newline at end of file diff --git a/config/ling_it_does_wash_the_strings.yaml b/config/ling_it_does_wash_the_strings.yaml index 8dc8cfa..7fc09df 100644 --- a/config/ling_it_does_wash_the_strings.yaml +++ b/config/ling_it_does_wash_the_strings.yaml @@ -1,4 +1,3 @@ -date: 2023/01 filename: dyn_illust_char_2023_ling_nian#9 logo: logo_sui fallback_name: char_2023_ling_nian#9 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(37, 148, 197) codename: zh-CN: 濯缨 · 令 - en-US: It Does Wash the Strings / Ling \ No newline at end of file + en-US: It Does Wash the Strings / Ling +offical_id: "202301647" \ No newline at end of file diff --git a/config/ling_towering_is_cliff_of_nostalgia.yaml b/config/ling_towering_is_cliff_of_nostalgia.yaml index 56eeded..d06ef98 100644 --- a/config/ling_towering_is_cliff_of_nostalgia.yaml +++ b/config/ling_towering_is_cliff_of_nostalgia.yaml @@ -1,4 +1,3 @@ -date: 2023/08 filename: dyn_illust_char_2023_ling_ncg#1 logo: logo_sui fallback_name: char_2023_ling_ncg#1 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(183, 227, 243) codename: zh-CN: 崖高梦远 · 令 en-US: Towering is Cliff of Nostalgia +offical_id: "202308807" \ No newline at end of file diff --git a/config/mizuki_summer_feast.yaml b/config/mizuki_summer_feast.yaml index 529b2a6..9421082 100644 --- a/config/mizuki_summer_feast.yaml +++ b/config/mizuki_summer_feast.yaml @@ -1,4 +1,3 @@ -date: 2022/12 filename: dyn_illust_char_437_mizuki_sale#7 logo: logo_higashi fallback_name: char_437_mizuki_sale#7 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(156, 210, 246) codename: zh-CN: 夏日餮宴 · 水月 - en-US: Summer Feast / Mizuki \ No newline at end of file + en-US: Summer Feast / Mizuki +offical_id: "202211685" \ No newline at end of file diff --git a/config/muelsyse.yaml b/config/muelsyse.yaml index 9961ee3..5d8b8aa 100644 --- a/config/muelsyse.yaml +++ b/config/muelsyse.yaml @@ -1,4 +1,3 @@ -date: 2023/04 filename: dyn_illust_char_249_mlyss logo: logo_rhine fallback_name: char_249_mlyss_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 3 viewport_bottom: 2 invert_filter: true -color: rgb(146, 212, 143) codename: zh-CN: 缪尔赛思 en-US: Muelsyse +offical_id: "202304611" \ No newline at end of file diff --git a/config/mwynar_w_dali.yaml b/config/mwynar_w_dali.yaml index defd714..c0d1139 100644 --- a/config/mwynar_w_dali.yaml +++ b/config/mwynar_w_dali.yaml @@ -1,4 +1,3 @@ -date: 2023/11 filename: dyn_illust_char_4064_mlynar_epoque#28 logo: logo_kazimierz fallback_name: char_4064_mlynar_epoque#28 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(51, 63, 115) codename: zh-CN: 远路 · 玛恩纳 en-US: W Dali / Młynar +offical_id: "202310850" \ No newline at end of file diff --git a/config/nearl.yaml b/config/nearl.yaml index efc8a5f..38d27b0 100644 --- a/config/nearl.yaml +++ b/config/nearl.yaml @@ -1,4 +1,3 @@ -date: 2021/11 filename: dyn_illust_char_1014_nearl2 logo: logo_kazimierz fallback_name: char_1014_nearl2_2 @@ -7,7 +6,7 @@ viewport_right: 3 viewport_top: 10 viewport_bottom: 0 invert_filter: true -color: rgba(253, 236, 189, 0.95) codename: zh-CN: 耀骑士临光 - en-US: Nearl the Radiant Knight \ No newline at end of file + en-US: Nearl the Radiant Knight +offical_id: "20220304" \ No newline at end of file diff --git a/config/nearl_relight.yaml b/config/nearl_relight.yaml index 05a8fc0..4dafe9d 100644 --- a/config/nearl_relight.yaml +++ b/config/nearl_relight.yaml @@ -1,4 +1,3 @@ -date: 2022/11 filename: dyn_illust_char_1014_nearl2_epoque#17 logo: logo_kazimierz fallback_name: char_1014_nearl2_epoque#17 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(141, 213, 228) codename: zh-CN: 复现荣光 · 耀骑士临光 - en-US: Relight / Nearl \ No newline at end of file + en-US: Relight / Nearl +offical_id: "202210623" \ No newline at end of file diff --git a/config/nian.yaml b/config/nian.yaml index 7ce2dfd..c390d9c 100644 --- a/config/nian.yaml +++ b/config/nian.yaml @@ -1,4 +1,3 @@ -date: 2020/01 filename: dyn_illust_char_2014_nian logo: logo_sui fallback_name: char_2014_nian_2 @@ -7,7 +6,7 @@ viewport_right: 2 viewport_top: 3 viewport_bottom: 5 invert_filter: true -color: rgb(255, 48, 0) codename: zh-CN: 年 - en-US: Nian \ No newline at end of file + en-US: Nian +offical_id: "202203231" \ No newline at end of file diff --git a/config/nian_unfettered_freedom.yaml b/config/nian_unfettered_freedom.yaml index 29deb34..3e21192 100644 --- a/config/nian_unfettered_freedom.yaml +++ b/config/nian_unfettered_freedom.yaml @@ -1,4 +1,3 @@ -date: 2021/02 filename: dyn_illust_char_2014_nian_nian#4 logo: logo_sui fallback_name: char_2014_nian_nian#4 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(187, 163, 106) codename: zh-CN: 乐逍遥 · 年 - en-US: Unfettered Freedom / Nian \ No newline at end of file + en-US: Unfettered Freedom / Nian +offical_id: "20220362" \ No newline at end of file diff --git a/config/passager_dream_in_a_moment.yaml b/config/passager_dream_in_a_moment.yaml index bf15daf..053196d 100644 --- a/config/passager_dream_in_a_moment.yaml +++ b/config/passager_dream_in_a_moment.yaml @@ -1,4 +1,3 @@ -date: 2022/11 filename: dyn_illust_char_472_pasngr_epoque#17 logo: logo_sargon fallback_name: char_472_pasngr_epoque#17 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(231, 166, 144) codename: zh-CN: 今昔须臾之梦 · 异客 - en-US: Dream in a Moment / Passager \ No newline at end of file + en-US: Dream in a Moment / Passager +offical_id: "202210664" \ No newline at end of file diff --git a/config/phatom_focus.yaml b/config/phatom_focus.yaml index 0653420..dfd019a 100644 --- a/config/phatom_focus.yaml +++ b/config/phatom_focus.yaml @@ -1,4 +1,3 @@ -date: 2022/04 filename: dyn_illust_char_250_phatom_sale#4 logo: logo_victoria fallback_name: char_250_phatom_sale#4 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 5 viewport_bottom: 1 invert_filter: true -color: rgb(158, 2, 2) codename: zh-CN: 焦点 · 傀影 - en-US: Focus / Phatom \ No newline at end of file + en-US: Focus / Phatom +offical_id: "202203222" \ No newline at end of file diff --git a/config/pozemka_snowy_plains_in_words.yaml b/config/pozemka_snowy_plains_in_words.yaml index faa87b7..9caef85 100644 --- a/config/pozemka_snowy_plains_in_words.yaml +++ b/config/pozemka_snowy_plains_in_words.yaml @@ -1,4 +1,3 @@ -date: 2023/02 filename: dyn_illust_char_4055_bgsnow_wild#7 logo: logo_rhodes_override fallback_name: char_4055_bgsnow_wild#7 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: false -color: rgb(145, 220, 253) codename: zh-CN: 字句中的雪原 · 鸿雪 - en-US: Snowy Plains in Words / Позёмка \ No newline at end of file + en-US: Snowy Plains in Words / Позёмка +offical_id: "202302698" \ No newline at end of file diff --git a/config/rosmontis.yaml b/config/rosmontis.yaml index bb5450d..3aa9708 100644 --- a/config/rosmontis.yaml +++ b/config/rosmontis.yaml @@ -1,4 +1,3 @@ -date: 2020/11 filename: dyn_illust_char_391_rosmon logo: logo_elite fallback_name: char_391_rosmon_2 @@ -7,7 +6,7 @@ viewport_right: -14 viewport_top: -38 viewport_bottom: -1 invert_filter: true -color: rgb(23, 210, 236) codename: zh-CN: 迷迭香 - en-US: Rosmontis \ No newline at end of file + en-US: Rosmontis +offical_id: "20220378" \ No newline at end of file diff --git a/config/rosmontis_become_anew.yaml b/config/rosmontis_become_anew.yaml index 20824fa..890225a 100644 --- a/config/rosmontis_become_anew.yaml +++ b/config/rosmontis_become_anew.yaml @@ -1,4 +1,3 @@ -date: 2022/11 filename: dyn_illust_char_391_rosmon_epoque#17 logo: logo_elite fallback_name: char_391_rosmon_epoque#17 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(116, 177, 222) codename: zh-CN: 拥抱新生 · 迷迭香 - en-US: Become Anew / Rosmontis \ No newline at end of file + en-US: Become Anew / Rosmontis +offical_id: "202210632" \ No newline at end of file diff --git a/config/skadi.yaml b/config/skadi.yaml index aec5627..9f398bf 100644 --- a/config/skadi.yaml +++ b/config/skadi.yaml @@ -1,4 +1,3 @@ -date: 2021/05 filename: dyn_illust_char_1012_skadi2 logo: logo_egir fallback_name: char_1012_skadi2_2 @@ -7,7 +6,7 @@ viewport_right: -10 viewport_top: 0 viewport_bottom: -12 invert_filter: true -color: rgb(226, 96, 96) codename: zh-CN: 浊心斯卡蒂 - en-US: Skadi the Corrupting Heart \ No newline at end of file + en-US: Skadi the Corrupting Heart +offical_id: "20220396" \ No newline at end of file diff --git a/config/skadi_sublimation.yaml b/config/skadi_sublimation.yaml index c505de0..95b9398 100644 --- a/config/skadi_sublimation.yaml +++ b/config/skadi_sublimation.yaml @@ -1,4 +1,3 @@ -date: 2022/05 filename: dyn_illust_char_1012_skadi2_boc#4 logo: logo_egir fallback_name: char_1012_skadi2_boc#4 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgba(95, 116, 187, 0.74) codename: zh-CN: 升华 · 浊心斯卡蒂 - en-US: Sublimation / Skadi the Corrupting Heart \ No newline at end of file + en-US: Sublimation / Skadi the Corrupting Heart +offical_id: "202204205" \ No newline at end of file diff --git a/config/specter.yaml b/config/specter.yaml index 9b67de6..d1d6336 100644 --- a/config/specter.yaml +++ b/config/specter.yaml @@ -1,4 +1,3 @@ -date: 2022/05 filename: dyn_illust_char_1023_ghost2 logo: logo_abyssal fallback_name: char_1023_ghost2_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgba(14, 124, 203, 0.86) codename: zh-CN: 归溟幽灵鲨 - en-US: Specter the Unchained \ No newline at end of file + en-US: Specter the Unchained +offical_id: "202204284" \ No newline at end of file diff --git a/config/specter_born_as_one.yaml b/config/specter_born_as_one.yaml index 0e561cd..9929514 100644 --- a/config/specter_born_as_one.yaml +++ b/config/specter_born_as_one.yaml @@ -1,4 +1,3 @@ -date: 2023/04 filename: dyn_illust_char_1023_ghost2_boc#6 logo: logo_abyssal fallback_name: char_1023_ghost2_boc#6 @@ -7,7 +6,7 @@ viewport_right: 1 viewport_top: 0 viewport_bottom: 1 invert_filter: true -color: rgb(140, 7, 7) codename: zh-CN: 生而为一 · 归溟幽灵鲨 en-US: Born as One / Specter the Unchained +offical_id: "202304670" \ No newline at end of file diff --git a/config/surtr_colorful_wonderland.yaml b/config/surtr_colorful_wonderland.yaml index d9e028b..86476d6 100644 --- a/config/surtr_colorful_wonderland.yaml +++ b/config/surtr_colorful_wonderland.yaml @@ -1,4 +1,3 @@ -date: 2022/08 filename: dyn_illust_char_350_surtr_summer#9 logo: logo_rhodes_override fallback_name: char_350_surtr_summer#9 @@ -7,7 +6,7 @@ viewport_right: 6 viewport_top: 1 viewport_bottom: 0 invert_filter: false -color: rgb(177, 226, 249) codename: zh-CN: 缤纷奇境 CW03 · 史尔特尔 - en-US: Colorful Wonderland CW03 / Surtr \ No newline at end of file + en-US: Colorful Wonderland CW03 / Surtr +offical_id: "202208297" \ No newline at end of file diff --git a/config/texas_the_omertosa.yaml b/config/texas_the_omertosa.yaml index e29b708..71c3c18 100644 --- a/config/texas_the_omertosa.yaml +++ b/config/texas_the_omertosa.yaml @@ -1,4 +1,3 @@ -date: 2022/11 filename: dyn_illust_char_1028_texas2 logo: logo_penguin fallback_name: char_1028_texas2_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgba(34, 37, 255, 0.9) codename: zh-CN: 缄默德克萨斯 - en-US: Texas the Omertosa \ No newline at end of file + en-US: Texas the Omertosa +offical_id: "202210210" \ No newline at end of file diff --git a/config/texas_the_omertosa_wingbreaker.yaml b/config/texas_the_omertosa_wingbreaker.yaml index 4ed0192..d47c3df 100644 --- a/config/texas_the_omertosa_wingbreaker.yaml +++ b/config/texas_the_omertosa_wingbreaker.yaml @@ -1,4 +1,3 @@ -date: 2023/11 filename: dyn_illust_char_1028_texas2_iteration#1 logo: logo_penguin fallback_name: char_1028_texas2_iteration#1 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(222, 2, 7) codename: zh-CN: 破翼者 · 缄默德克萨斯 en-US: Wingbreaker / Texas the Omertosa +offical_id: "202310899" \ No newline at end of file diff --git a/config/virtuosa.yaml b/config/virtuosa.yaml index 67a247c..2b9bb03 100644 --- a/config/virtuosa.yaml +++ b/config/virtuosa.yaml @@ -1,4 +1,3 @@ -date: 2023/11 filename: dyn_illust_char_245_cello logo: logo_Laterano fallback_name: char_245_cello_2 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 0 viewport_bottom: 0 invert_filter: true -color: rgb(189, 103, 7) codename: zh-CN: 塑心 en-US: Virtuosa +offical_id: "202310848" \ No newline at end of file diff --git a/config/w.yaml b/config/w.yaml index bc86100..b4c54ce 100644 --- a/config/w.yaml +++ b/config/w.yaml @@ -1,4 +1,3 @@ -date: 2020/05 filename: dyn_illust_char_113_cqbw logo: logo_babel fallback_name: char_113_cqbw_2 @@ -7,7 +6,7 @@ viewport_right: -3 viewport_top: 0 viewport_bottom: 1 invert_filter: true -color: rgb(228, 54, 56) codename: zh-CN: W - en-US: W \ No newline at end of file + en-US: W +offical_id: "20220319" \ No newline at end of file diff --git a/config/w_wonder.yaml b/config/w_wonder.yaml index 9ee8532..83ba93c 100644 --- a/config/w_wonder.yaml +++ b/config/w_wonder.yaml @@ -1,4 +1,3 @@ -date: 2020/11 filename: dyn_illust_char_113_cqbw_epoque#7 logo: logo_babel fallback_name: char_113_cqbw_epoque#7 @@ -7,7 +6,7 @@ viewport_right: 0 viewport_top: 1 viewport_bottom: -4 invert_filter: true -color: rgba(0, 0, 0, 0.83) codename: zh-CN: 恍惚 · W - en-US: Wonder / W \ No newline at end of file + en-US: Wonder / W +offical_id: "202206246" \ No newline at end of file diff --git a/libs/config.js b/libs/config.js index b3462c2..2a92f16 100644 --- a/libs/config.js +++ b/libs/config.js @@ -3,22 +3,27 @@ import path from 'path' import { read } from './yaml.js' import { getOperatorId } from './charword_table.js' -export default function () { - return process(read(path.join(__projectRoot, 'config.yaml'))) +export default function (officalInfo) { + return process(read(path.join(__projectRoot, 'config.yaml')), officalInfo) } -function process(config) { +function process(config, officalInfo) { for (const [operatorName, operator] of Object.entries(config.operators)) { + const operatorInfo = officalInfo.find(operator.offical_id) // add title operator.title = `${config.share.title["en-US"]}${operator.codename["en-US"]} - ${config.share.title["zh-CN"]}${operator.codename["zh-CN"]}` // add type - operator.type = operator.codename["zh-CN"].includes('·') ? 'skin' : 'operator' + operator.type = operatorInfo.type // add link operator.link = operatorName // id operator.id = getOperatorId(operator).replace(/^(char_)(\d+)(_.+)$/g, '$2') + + operator.color = operatorInfo.color + + operator.date = operatorInfo.date } return config diff --git a/libs/initializer.js b/libs/initializer.js index 8976ad4..737d0c8 100644 --- a/libs/initializer.js +++ b/libs/initializer.js @@ -5,13 +5,19 @@ import { read as readYAML } from './yaml.js' import { mkdir, writeSync } from './file.js' import { appendMainConfig } from './append.js' -export default function init(operatorName, extractedDir) { +export default function init(operatorName, extractedDir, officalInfo) { + const officalId = process.argv[4] + const template = readYAML(path.join(__projectRoot, 'config', '_template.yaml')) extractedDir.forEach((dir) => { mkdir(dir) }) - const date = new Date() - const template = readYAML(path.join(__projectRoot, 'config', '_template.yaml')) - template.date = `${date.getFullYear()}/${(date.getMonth() + 1).toString().padStart(2, '0') }` + const currentOpertor = officalInfo.find(officalId); + if (currentOpertor === undefined) { + throw new Error('Invalid operator id') + } + template.offical_id = currentOpertor.id + template.codename = currentOpertor.codename + writeSync(stringify(template), path.join(__projectRoot, 'config', `${operatorName}.yaml`)) appendMainConfig(operatorName) } \ No newline at end of file diff --git a/libs/logo_info.js b/libs/logo_info.js deleted file mode 100644 index b091c32..0000000 --- a/libs/logo_info.js +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable no-undef */ -import path from 'path'; -import { writeSync, readSync } from "./file.js" -import Downloader from "./downloader.js" - -export default class LogoInfo { - #downloader = new Downloader() - #sharedPath = path.join(__projectRoot, __config.folder.operator, __config.folder.share) - - async process() { - const logoTable = await this.#download() - const nameFileMapping = {} - Object.keys(logoTable.forceToGroupDict).forEach(key => { - nameFileMapping[logoTable.forceToGroupDict[key]] = `${key}.png`; - }); - // writeSync(JSON.stringify(list, null), path.join(this.#sharedPath, `logo_table.json`)) - } - - async #download() { - const logoTable = await this.#downloader.github(`https://api.github.com/repos/Kengxxiao/ArknightsGameData/commits?path=zh_CN/gamedata/art/handbookpos_table.json`, `https://raw.githubusercontent.com/Kengxxiao/ArknightsGameData/master/zh_CN/gamedata/art/handbookpos_table.json`, path.join(this.#sharedPath, `handbookpos_table.json`)) - return logoTable - } - - lookup() { - const logoTable = JSON.parse(readSync(path.join(this.#sharedPath, `logo_table.json`))) - - - } -} diff --git a/libs/offical_info.js b/libs/offical_info.js new file mode 100644 index 0000000..3e6fb1a --- /dev/null +++ b/libs/offical_info.js @@ -0,0 +1,83 @@ +import jsdom from 'jsdom'; +import fetch from "node-fetch"; +import path from "path"; +import { writeSync, readSync } from "./file.js"; + +export default class OfficalInfo { + // eslint-disable-next-line no-undef + #data = JSON.parse(readSync(path.join(__projectRoot, 'offical_update.json'))) + #idMapping = {} + + constructor() { + Object.keys(this.#data).forEach((key) => { + this.#idMapping[this.#data[key].id] + if (typeof this.#data[key] === 'object') { + this.#data[key].forEach((operator) => { + this.#idMapping[operator.id] = { + date: key, + ...operator + } + }) + } + }) + } + + find(id) { + return this.#idMapping[id] + } + + async update() { + const f = await fetch("https://ak.hypergryph.com/archive/dynamicCompile/") + const html_text = await f.text() + + const dom = new jsdom.JSDOM(html_text); + const rows = dom.window.document.body.querySelector(".dynList").querySelectorAll(".row") + + const dict = { + length: 0 + } + + for (const row of rows) { + const date = row.querySelector(".date").textContent.trim() + const operators = [] + + const charCards = row.querySelectorAll(".charCard") + + if (dict.length === 0) { + dict.latest = date + } + + for (const charCard of charCards) { + const color = charCard.style.color + const codename = { + "zh-CN": charCard.querySelector(".info").querySelector(".name").querySelector(".text").textContent.trim(), + "en-US": charCard.querySelector(".info").querySelector(".codename").textContent.trim() + } + const rawType = charCard.querySelector(".typeIcon").querySelector("svg").querySelector("use").getAttribute("xlink:href") + const link = "https://ak.hypergryph.com" + charCard.getAttribute("href") + const linkSplited = link.split("/") + const id = linkSplited[linkSplited.length - 1].replace(".html", "") + + let type; + switch (rawType) { + case "#skin-type-icon-hanger": + type = "skin" + break; + case "#skin-type-icon-promotion2": + type = "operator" + break; + } + operators.push({ + color, + codename, + type, + link, + id + }) + dict.length++ + } + dict[date] = operators + } + writeSync(JSON.stringify(dict, null, 4), path.join('offical_update.json')) + } +} diff --git a/libs/offical_update.js b/libs/offical_update.js deleted file mode 100644 index 77a9505..0000000 --- a/libs/offical_update.js +++ /dev/null @@ -1,59 +0,0 @@ -import jsdom from 'jsdom'; -import fetch from "node-fetch"; -import path from "path"; -import { writeSync } from "./file.js"; - -export default async function () { - const f = await fetch("https://ak.hypergryph.com/archive/dynamicCompile/") - const html_text = await f.text() - - const dom = new jsdom.JSDOM(html_text); - const rows = dom.window.document.body.querySelector(".dynList").querySelectorAll(".row") - - const dict = { - length: 0 - } - - for (const row of rows) { - const date = row.querySelector(".date").textContent.trim() - const operators = [] - - const charCards = row.querySelectorAll(".charCard") - - if (dict.length === 0) { - dict.latest = date - } - - for (const charCard of charCards) { - const color = charCard.style.color - const codename = { - "zh-CN": charCard.querySelector(".info").querySelector(".name").querySelector(".text").textContent.trim(), - "en-US": charCard.querySelector(".info").querySelector(".codename").textContent.trim() - } - const rawType = charCard.querySelector(".typeIcon").querySelector("svg").querySelector("use").getAttribute("xlink:href") - const link = "https://ak.hypergryph.com" + charCard.getAttribute("href") - const linkSplited = link.split("/") - const id = linkSplited[linkSplited.length - 1].replace(".html", "") - - let type; - switch (rawType) { - case "#skin-type-icon-hanger": - type = "skin" - break; - case "#skin-type-icon-promotion2": - type = "operator" - break; - } - operators.push({ - color, - codename, - type, - link, - id - }) - dict.length++ - } - dict[date] = operators - } - writeSync(JSON.stringify(dict, null, 4), path.join('offical_update.json')) -} diff --git a/vite.config.js b/vite.config.js index 43f2df4..a1b1a84 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,12 +9,14 @@ import { rmdir } from './libs/file.js' import Music from './libs/music.js'; import Background from './libs/background.js' import directory from './libs/directory.js' +import OfficalInfo from './libs/offical_info.js'; import { PerfseePlugin } from '@perfsee/rollup' global.__projectRoot = path.dirname(fileURLToPath(import.meta.url)) class ViteRunner { - #globalConfig = getConfig() + #officalInfo = new OfficalInfo() + #globalConfig = getConfig(this.#officalInfo) #mode #baseViteConfig = { plugins: [splitVendorChunkPlugin()], @@ -195,7 +197,8 @@ class ViteRunner { async function main() { if (process.env.npm_lifecycle_event.includes('vite')) { - global.__config = getConfig() + const officalInfo = new OfficalInfo() + global.__config = getConfig(officalInfo) const background = new Background() await background.process() const backgrounds = ['operator_bg.png', ...background.files]