diff --git a/aklive2d.js b/aklive2d.js index bcaf099..a2c7078 100644 --- a/aklive2d.js +++ b/aklive2d.js @@ -220,6 +220,9 @@ async function main() { }, { key: "music_mapping", value: JSON.stringify(musicMapping) + }, { + key: "use_json", + value: __config.operators[OPERATOR_NAME].use_json } ]), envPath) diff --git a/config/_template.yaml b/config/_template.yaml index afdb568..1636ee8 100644 --- a/config/_template.yaml +++ b/config/_template.yaml @@ -8,4 +8,5 @@ viewport_bottom: 0 invert_filter: false codename: zh-CN: 假日威龙陈 - en-US: Ch'en/Chen the Holungday \ No newline at end of file + en-US: Ch'en/Chen the Holungday +use_json: false \ No newline at end of file diff --git a/config/chen.yaml b/config/chen.yaml index e700a96..ac69d1c 100644 --- a/config/chen.yaml +++ b/config/chen.yaml @@ -9,4 +9,5 @@ invert_filter: false codename: zh-CN: 假日威龙陈 en-US: Ch'en/Chen the Holungday +use_json: false 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 2535d45..ccca6d9 100644 --- a/config/chen_ten_thousand_mountains.yaml +++ b/config/chen_ten_thousand_mountains.yaml @@ -9,4 +9,5 @@ invert_filter: false codename: zh-CN: 万重山 · 假日威龙陈 en-US: Ten Thousand Mountains / Ch'en/Chen the Holungday +use_json: false offical_id: "202304659" \ No newline at end of file diff --git a/config/chongyue.yaml b/config/chongyue.yaml index 0ec39c3..89eafa1 100644 --- a/config/chongyue.yaml +++ b/config/chongyue.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 重岳 en-US: Chongyue +use_json: false offical_id: "202301606" \ No newline at end of file diff --git a/config/chongyue_alighting.yaml b/config/chongyue_alighting.yaml index 371d0a6..bd86a62 100644 --- a/config/chongyue_alighting.yaml +++ b/config/chongyue_alighting.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 何处栖 · 重岳 en-US: Alighting / Chongyue +use_json: false offical_id: "202401812" diff --git a/config/dusk.yaml b/config/dusk.yaml index 63164ff..97c3837 100644 --- a/config/dusk.yaml +++ b/config/dusk.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 夕 en-US: Dusk +use_json: false 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 957ccc3..f609749 100644 --- a/config/dusk_everything_is_a_miracle.yaml +++ b/config/dusk_everything_is_a_miracle.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 染尘烟 · 夕 en-US: Everything is a Miracle / Dusk +use_json: false 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 e9221ae..80113ef 100644 --- a/config/eyjafjalla_the_hvit_aska.yaml +++ b/config/eyjafjalla_the_hvit_aska.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 纯烬艾雅法拉 en-US: Eyjafjalla the Hvít Aska +use_json: false offical_id: "202307865" \ No newline at end of file diff --git a/config/gavial.yaml b/config/gavial.yaml index 7d9e6e4..6f655c8 100644 --- a/config/gavial.yaml +++ b/config/gavial.yaml @@ -9,4 +9,5 @@ invert_filter: false codename: zh-CN: 百练嘉维尔 en-US: Gavial the Invincible +use_json: false 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 62c224b..ec0b9d3 100644 --- a/config/gavial_the_invincible_holiday_hd26.yaml +++ b/config/gavial_the_invincible_holiday_hd26.yaml @@ -9,4 +9,5 @@ invert_filter: false codename: zh-CN: 悠然假日 HD26 · 百炼嘉维尔 en-US: Holiday HD26 / Gavial the Invincible +use_json: false 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 82bfcba..06cb4b7 100644 --- a/config/goldenglow_summer_flowers_fa394.yaml +++ b/config/goldenglow_summer_flowers_fa394.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 夏卉 FA394 · 澄闪 en-US: Summer Flowers FA394 / Goldenglow +use_json: false offical_id: "202307824" \ No newline at end of file diff --git a/config/ines_under_the_flaming_dome.yaml b/config/ines_under_the_flaming_dome.yaml index 36cb1b9..ffd7ba2 100644 --- a/config/ines_under_the_flaming_dome.yaml +++ b/config/ines_under_the_flaming_dome.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 燃烧天穹下 · 伊内丝 en-US: Under the Flaming Dome / Ines +use_json: false offical_id: "202404087" diff --git a/config/kaltsit_remnant.yaml b/config/kaltsit_remnant.yaml index 7eb3602..48b5ab6 100644 --- a/config/kaltsit_remnant.yaml +++ b/config/kaltsit_remnant.yaml @@ -9,4 +9,5 @@ invert_filter: false codename: zh-CN: 残余 · 凯尔希 en-US: Remnant / Kal'tsit +use_json: false 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 eaf0cc1..59291fd 100644 --- a/config/lee_trust_your_eyes.yaml +++ b/config/lee_trust_your_eyes.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 手到牌来 · 老鲤 en-US: Trust Your Eyes / Lee +use_json: false offical_id: "202210279" \ No newline at end of file diff --git a/config/lin_heavenly_mirage.yaml b/config/lin_heavenly_mirage.yaml index b071da7..b249e44 100644 --- a/config/lin_heavenly_mirage.yaml +++ b/config/lin_heavenly_mirage.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 列瑶台 · 林 en-US: Heavenly Mirage / Lin +use_json: false offical_id: "202401034" diff --git a/config/ling.yaml b/config/ling.yaml index dae84eb..2519d28 100644 --- a/config/ling.yaml +++ b/config/ling.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 令 en-US: Ling +use_json: false 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 7fc09df..fb78094 100644 --- a/config/ling_it_does_wash_the_strings.yaml +++ b/config/ling_it_does_wash_the_strings.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 濯缨 · 令 en-US: It Does Wash the Strings / Ling +use_json: false 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 d06ef98..2211ea9 100644 --- a/config/ling_towering_is_cliff_of_nostalgia.yaml +++ b/config/ling_towering_is_cliff_of_nostalgia.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 崖高梦远 · 令 en-US: Towering is Cliff of Nostalgia +use_json: false offical_id: "202308807" \ No newline at end of file diff --git a/config/mizuki_summer_feast.yaml b/config/mizuki_summer_feast.yaml index 9421082..778cee7 100644 --- a/config/mizuki_summer_feast.yaml +++ b/config/mizuki_summer_feast.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 夏日餮宴 · 水月 en-US: Summer Feast / Mizuki +use_json: false offical_id: "202211685" \ No newline at end of file diff --git a/config/muelsyse.yaml b/config/muelsyse.yaml index 5d8b8aa..ee8cbd7 100644 --- a/config/muelsyse.yaml +++ b/config/muelsyse.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 缪尔赛思 en-US: Muelsyse +use_json: false offical_id: "202304611" \ No newline at end of file diff --git a/config/muelsyse_young_branch.yaml b/config/muelsyse_young_branch.yaml index a14b7cf..168cab8 100644 --- a/config/muelsyse_young_branch.yaml +++ b/config/muelsyse_young_branch.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 新枝 · 缪尔赛思 en-US: Young Branch / Muelsyse +use_json: false offical_id: "202404090" diff --git a/config/mwynar_w_dali.yaml b/config/mwynar_w_dali.yaml index c0d1139..602beb1 100644 --- a/config/mwynar_w_dali.yaml +++ b/config/mwynar_w_dali.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 远路 · 玛恩纳 en-US: W Dali / Młynar +use_json: false offical_id: "202310850" \ No newline at end of file diff --git a/config/nearl.yaml b/config/nearl.yaml index 38d27b0..624ca66 100644 --- a/config/nearl.yaml +++ b/config/nearl.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 耀骑士临光 en-US: Nearl the Radiant Knight +use_json: false offical_id: "20220304" \ No newline at end of file diff --git a/config/nearl_relight.yaml b/config/nearl_relight.yaml index 4dafe9d..4acb82e 100644 --- a/config/nearl_relight.yaml +++ b/config/nearl_relight.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 复现荣光 · 耀骑士临光 en-US: Relight / Nearl +use_json: false offical_id: "202210623" \ No newline at end of file diff --git a/config/nian.yaml b/config/nian.yaml index c390d9c..db3b68a 100644 --- a/config/nian.yaml +++ b/config/nian.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 年 en-US: Nian +use_json: false offical_id: "202203231" \ No newline at end of file diff --git a/config/nian_unfettered_freedom.yaml b/config/nian_unfettered_freedom.yaml index 3e21192..babce75 100644 --- a/config/nian_unfettered_freedom.yaml +++ b/config/nian_unfettered_freedom.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 乐逍遥 · 年 en-US: Unfettered Freedom / Nian +use_json: false 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 053196d..308e896 100644 --- a/config/passager_dream_in_a_moment.yaml +++ b/config/passager_dream_in_a_moment.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 今昔须臾之梦 · 异客 en-US: Dream in a Moment / Passager +use_json: false offical_id: "202210664" \ No newline at end of file diff --git a/config/phatom_focus.yaml b/config/phatom_focus.yaml index dfd019a..1bac1c0 100644 --- a/config/phatom_focus.yaml +++ b/config/phatom_focus.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 焦点 · 傀影 en-US: Focus / Phatom +use_json: false 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 9caef85..3112273 100644 --- a/config/pozemka_snowy_plains_in_words.yaml +++ b/config/pozemka_snowy_plains_in_words.yaml @@ -9,4 +9,5 @@ invert_filter: false codename: zh-CN: 字句中的雪原 · 鸿雪 en-US: Snowy Plains in Words / Позёмка +use_json: false offical_id: "202302698" \ No newline at end of file diff --git a/config/reed_the_frame_shadow_curator.yaml b/config/reed_the_frame_shadow_curator.yaml index 224b316..3053ffa 100644 --- a/config/reed_the_frame_shadow_curator.yaml +++ b/config/reed_the_frame_shadow_curator.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 博物 · 焰影苇草 en-US: Curator / Reed The Flame Shadow +use_json: false offical_id: "202401871" diff --git a/config/reed_the_frame_shadow_summer_flower.yaml b/config/reed_the_frame_shadow_summer_flower.yaml new file mode 100644 index 0000000..eef8978 --- /dev/null +++ b/config/reed_the_frame_shadow_summer_flower.yaml @@ -0,0 +1,13 @@ +filename: dyn_illust_char_1020_reed2_summer#17 +logo: logo_dublinn +fallback_name: char_1020_reed2_summer#17 +viewport_left: 0 +viewport_right: 0 +viewport_top: 0 +viewport_bottom: 0 +invert_filter: true +codename: + zh-CN: 夏卉 FA075 · 焰影苇草 + en-US: Summer Flowers FA075 / Reed The Flame Shadow +use_json: true +offical_id: "202407051" \ No newline at end of file diff --git a/config/rosmontis.yaml b/config/rosmontis.yaml index 3aa9708..de1c6ac 100644 --- a/config/rosmontis.yaml +++ b/config/rosmontis.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 迷迭香 en-US: Rosmontis +use_json: false offical_id: "20220378" \ No newline at end of file diff --git a/config/rosmontis_become_anew.yaml b/config/rosmontis_become_anew.yaml index 890225a..ef90f3e 100644 --- a/config/rosmontis_become_anew.yaml +++ b/config/rosmontis_become_anew.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 拥抱新生 · 迷迭香 en-US: Become Anew / Rosmontis +use_json: false offical_id: "202210632" \ No newline at end of file diff --git a/config/shu.yaml b/config/shu.yaml index e47f76c..e94c531 100644 --- a/config/shu.yaml +++ b/config/shu.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 黍 en-US: Shu +use_json: false offical_id: "202401025" diff --git a/config/silverash_never_melting_ice.yaml b/config/silverash_never_melting_ice.yaml index 44ed3b4..1912493 100644 --- a/config/silverash_never_melting_ice.yaml +++ b/config/silverash_never_melting_ice.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 不融冰 · 银灰 en-US: Never-Melting Ice / SilverAsh +use_json: false offical_id: "202404066" diff --git a/config/skadi.yaml b/config/skadi.yaml index 9f398bf..6ec5b91 100644 --- a/config/skadi.yaml +++ b/config/skadi.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 浊心斯卡蒂 en-US: Skadi the Corrupting Heart +use_json: false offical_id: "20220396" \ No newline at end of file diff --git a/config/skadi_sublimation.yaml b/config/skadi_sublimation.yaml index 95b9398..a8d27d4 100644 --- a/config/skadi_sublimation.yaml +++ b/config/skadi_sublimation.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 升华 · 浊心斯卡蒂 en-US: Sublimation / Skadi the Corrupting Heart +use_json: false offical_id: "202204205" \ No newline at end of file diff --git a/config/skadi_the_corrupting_heart_red_countess.yaml b/config/skadi_the_corrupting_heart_red_countess.yaml index b5242c0..80f187c 100644 --- a/config/skadi_the_corrupting_heart_red_countess.yaml +++ b/config/skadi_the_corrupting_heart_red_countess.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 红女爵 · 浊心斯卡蒂 en-US: Red Countess / Skadi the Corrupting Heart +use_json: false offical_id: "202404008" diff --git a/config/specter.yaml b/config/specter.yaml index d1d6336..aea229e 100644 --- a/config/specter.yaml +++ b/config/specter.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 归溟幽灵鲨 en-US: Specter the Unchained +use_json: false 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 9929514..f020da8 100644 --- a/config/specter_born_as_one.yaml +++ b/config/specter_born_as_one.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 生而为一 · 归溟幽灵鲨 en-US: Born as One / Specter the Unchained +use_json: false offical_id: "202304670" \ No newline at end of file diff --git a/config/surtr_colorful_wonderland.yaml b/config/surtr_colorful_wonderland.yaml index 86476d6..b47f794 100644 --- a/config/surtr_colorful_wonderland.yaml +++ b/config/surtr_colorful_wonderland.yaml @@ -9,4 +9,5 @@ invert_filter: false codename: zh-CN: 缤纷奇境 CW03 · 史尔特尔 en-US: Colorful Wonderland CW03 / Surtr +use_json: false offical_id: "202208297" \ No newline at end of file diff --git a/config/texas_the_omertosa.yaml b/config/texas_the_omertosa.yaml index 71c3c18..5389116 100644 --- a/config/texas_the_omertosa.yaml +++ b/config/texas_the_omertosa.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 缄默德克萨斯 en-US: Texas the Omertosa +use_json: false 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 d47c3df..5cce145 100644 --- a/config/texas_the_omertosa_wingbreaker.yaml +++ b/config/texas_the_omertosa_wingbreaker.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 破翼者 · 缄默德克萨斯 en-US: Wingbreaker / Texas the Omertosa +use_json: false offical_id: "202310899" \ No newline at end of file diff --git a/config/virtuosa.yaml b/config/virtuosa.yaml index 2b9bb03..b269693 100644 --- a/config/virtuosa.yaml +++ b/config/virtuosa.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 塑心 en-US: Virtuosa +use_json: false offical_id: "202310848" \ No newline at end of file diff --git a/config/w.yaml b/config/w.yaml index b4c54ce..4e4feff 100644 --- a/config/w.yaml +++ b/config/w.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: W en-US: W +use_json: false offical_id: "20220319" \ No newline at end of file diff --git a/config/w_wonder.yaml b/config/w_wonder.yaml index 83ba93c..ddd6673 100644 --- a/config/w_wonder.yaml +++ b/config/w_wonder.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 恍惚 · W en-US: Wonder / W +use_json: false offical_id: "202206246" \ No newline at end of file diff --git a/config/wisadel.yaml b/config/wisadel.yaml index 62ca2cf..bd32f96 100644 --- a/config/wisadel.yaml +++ b/config/wisadel.yaml @@ -9,4 +9,5 @@ invert_filter: true codename: zh-CN: 维什戴尔 en-US: Wisadel +use_json: false offical_id: "202404049" diff --git a/libs/assets_processor.js b/libs/assets_processor.js index 12be9ca..65d0b7d 100644 --- a/libs/assets_processor.js +++ b/libs/assets_processor.js @@ -43,14 +43,20 @@ export default class AssetsProcessor { const croppedBuffer = await this.#alphaCompositer.crop(portraitBuffer, rect) await write(croppedBuffer, path.join(this.#operatorSourceFolder, this.#operatorName, `${fallback_name}_portrait.png`)) - return await this.generateAssets(__config.operators[this.#operatorName].filename, extractedDir) + return await this.generateAssets(__config.operators[this.#operatorName].filename, extractedDir, __config.operators[this.#operatorName].use_json) } - async generateAssets(filename, extractedDir) { + async generateAssets(filename, extractedDir, useJSON=false) { const BASE64_BINARY_PREFIX = 'data:application/octet-stream;base64,' const BASE64_PNG_PREFIX = 'data:image/png;base64,' const assetsJson = {} - const skelFilename = `${filename}.skel` + + let skelFilename; + if (useJSON) { + skelFilename = `${filename}.json` + } else { + skelFilename = `${filename}.skel` + } const skel = await read(path.join(extractedDir, skelFilename), null) const atlasFilename = `${filename}.atlas` const atlas = await read(path.join(extractedDir, atlasFilename)) diff --git a/showcase/src/components/player.js b/showcase/src/components/player.js index d7b07dd..33e971d 100644 --- a/showcase/src/components/player.js +++ b/showcase/src/components/player.js @@ -9,8 +9,7 @@ let isPlayingInteract = false; export default function spinePlayer(el) { el.hidden = false - return new spine.SpinePlayer(el, { - skelUrl: `./assets/${import.meta.env.VITE_FILENAME}.skel`, + const playerConfig = { atlasUrl: `./assets/${import.meta.env.VITE_FILENAME}.atlas`, rawDataURIs: assets, premultipliedAlpha: true, @@ -62,5 +61,11 @@ export default function spinePlayer(el) { window.settings.success() window.music.success() }, - }) + } + if (import.meta.env.VITE_USE_JSON === "true") { + playerConfig.jsonUrl = `./assets/${import.meta.env.VITE_FILENAME}.json` + } else { + playerConfig.skelUrl = `./assets/${import.meta.env.VITE_FILENAME}.skel` + } + return new spine.SpinePlayer(el, playerConfig) } \ No newline at end of file