From 6f28d800b1739372c699ede76a735e937dcc0f68 Mon Sep 17 00:00:00 2001 From: Haoyu Xu Date: Mon, 31 Oct 2022 23:59:14 -0400 Subject: [PATCH] feat(live2d): add texas, relight/neral, become anew/rosmon, dream/passager TODO: missing fallback image for texas --- README.md | 4 ++++ config.yaml | 4 ++++ config/nearl_relight.yaml | 26 ++++++++++++++++++++++++++ config/passager_dream_in_a_moment.yaml | 26 ++++++++++++++++++++++++++ config/rosmontis_become_anew.yaml | 26 ++++++++++++++++++++++++++ config/texas_the_omertosa.yaml | 26 ++++++++++++++++++++++++++ lib/builder.py | 6 +++--- lib/config.py | 2 -- 8 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 config/nearl_relight.yaml create mode 100644 config/passager_dream_in_a_moment.yaml create mode 100644 config/rosmontis_become_anew.yaml create mode 100644 config/texas_the_omertosa.yaml diff --git a/README.md b/README.md index 12bf402..a8e5cfc 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ A project that builds showcase webpage for Arknights Live2D-equipped operators. | Gavial the Invincible | [Link](https://arknights.halyul.dev/gavial/) | [Link](https://steamcommunity.com/sharedfiles/filedetails/?id=2847605961) | | Colorful Wonderland / Surtr | [Link](https://arknights.halyul.dev/surtr_colorful_wonderland/) | [Link](https://steamcommunity.com/sharedfiles/filedetails/?id=2847602015) | | Trust Your Eyes / Lee | [Link](https://arknights.halyul.dev/lee_trust_your_eyes/) | [Link](https://steamcommunity.com/sharedfiles/filedetails/?id=2879452075) | +| Texas the Omertosa | [Link](https://arknights.halyul.dev/texas_the_omertosa/) | [Link](https://steamcommunity.com/sharedfiles/filedetails/?id=2879452075) | +| Relight / Neral | [Link](https://arknights.halyul.dev/nearl_relight/) | [Link](https://steamcommunity.com/sharedfiles/filedetails/?id=2879452075) | +| Become Anew / Rosmontis | [Link](https://arknights.halyul.dev/rosmontis_become_anew/) | [Link](https://steamcommunity.com/sharedfiles/filedetails/?id=2879452075) | +| Dream in a Moment / Passager | [Link](https://arknights.halyul.dev/passager_dream_in_a_moment/) | [Link](https://steamcommunity.com/sharedfiles/filedetails/?id=2879452075) | - For Windows users: Use [Wallpaper Engine](https://www.wallpaperengine.io/en) or other softwares that support using webpage as desktop wallpaper. - For macOS users: Use [Plash](https://github.com/sindresorhus/Plash), however, I don't have macOS machine, so your mileage may vary. diff --git a/config.yaml b/config.yaml index d5a239a..335d227 100644 --- a/config.yaml +++ b/config.yaml @@ -21,6 +21,10 @@ operators: gavial: !include config/gavial.yaml surtr_colorful_wonderland: !include config/surtr_colorful_wonderland.yaml lee_trust_your_eyes: !include config/lee_trust_your_eyes.yaml + texas_the_omertosa: !include config/texas_the_omertosa.yaml + nearl_relight: !include config/nearl_relight.yaml + rosmontis_become_anew: !include config/rosmontis_become_anew.yaml + passager_dream_in_a_moment: !include config/passager_dream_in_a_moment.yaml server: operator_folder: ./operator/ release_folder: ./release/ diff --git a/config/nearl_relight.yaml b/config/nearl_relight.yaml new file mode 100644 index 0000000..8dfd301 --- /dev/null +++ b/config/nearl_relight.yaml @@ -0,0 +1,26 @@ +_operator_settings.js: + fallbackImage_height: 2048 + fallbackImage_width: 2048 + filename: dyn_illust_char_1014_nearl2_epoque#17 + fps: 60 + opacity: 30 + viewport_bottom: 0 + viewport_left: 0 + viewport_right: 0 + viewport_top: 0 +index.html: + fallback_name: char_1014_nearl2_epoque%2317 + id: char_1014_nearl2%2317 + operator_logo: logo_kazimierz + title: 'Arknights: Relight / Neral - 明日方舟:复现荣光·耀骑士临光' + version: ${func:get_version()} +project.json: + description: 'Arknights: Relight / Neral Live 2D\n明日方舟:复现荣光·耀骑士临光 Live 2D\nThe model is extracted from game with Spine support.\n模型来自游戏内提取,支持Spine\nPlease set your FPS target in Wallpaper Engine > Settings > Performance > FPS\n请在 Wallpaper Engine > 设置 > 性能 > FPS 下设置FPS\n\nLive preview on: https://arknights.halyul.dev/nearl_relight\nGithub: https://github.com/Halyul/aklive2d' + title: ${var:index.html->title} + ui_logo_opacity: ${var:_operator_settings.js->opacity} + ui_logo_ratio: 61.8 + ui_operator_logo: 'true' + ui_position_padding_bottom: ${var:_operator_settings.js->viewport_bottom} + ui_position_padding_left: ${var:_operator_settings.js->viewport_left} + ui_position_padding_right: ${var:_operator_settings.js->viewport_right} + ui_position_padding_top: ${var:_operator_settings.js->viewport_top} \ No newline at end of file diff --git a/config/passager_dream_in_a_moment.yaml b/config/passager_dream_in_a_moment.yaml new file mode 100644 index 0000000..a765a44 --- /dev/null +++ b/config/passager_dream_in_a_moment.yaml @@ -0,0 +1,26 @@ +_operator_settings.js: + fallbackImage_height: 2048 + fallbackImage_width: 2048 + filename: dyn_illust_char_472_pasngr_epoque#17 + fps: 60 + opacity: 30 + viewport_bottom: 0 + viewport_left: 0 + viewport_right: 0 + viewport_top: 0 +index.html: + fallback_name: char_472_pasngr_epoque%2317 + id: char_472_pasngr%2317 + operator_logo: logo_sargon + title: 'Arknights: Dream in a Moment / Passager - 明日方舟:今昔须臾之梦 · 异客' + version: ${func:get_version()} +project.json: + description: 'Arknights: Dream in a Moment / Passager Live 2D\n明日方舟:今昔须臾之梦 · 异客 Live 2D\nThe model is extracted from game with Spine support.\n模型来自游戏内提取,支持Spine\nPlease set your FPS target in Wallpaper Engine > Settings > Performance > FPS\n请在 Wallpaper Engine > 设置 > 性能 > FPS 下设置FPS\n\nLive preview on: https://arknights.halyul.dev/passager_dream_in_a_moment\nGithub: https://github.com/Halyul/aklive2d' + title: ${var:index.html->title} + ui_logo_opacity: ${var:_operator_settings.js->opacity} + ui_logo_ratio: 61.8 + ui_operator_logo: 'true' + ui_position_padding_bottom: ${var:_operator_settings.js->viewport_bottom} + ui_position_padding_left: ${var:_operator_settings.js->viewport_left} + ui_position_padding_right: ${var:_operator_settings.js->viewport_right} + ui_position_padding_top: ${var:_operator_settings.js->viewport_top} \ No newline at end of file diff --git a/config/rosmontis_become_anew.yaml b/config/rosmontis_become_anew.yaml new file mode 100644 index 0000000..843e4e0 --- /dev/null +++ b/config/rosmontis_become_anew.yaml @@ -0,0 +1,26 @@ +_operator_settings.js: + fallbackImage_height: 2048 + fallbackImage_width: 2048 + filename: dyn_illust_char_391_rosmon_epoque#17 + fps: 60 + opacity: 30 + viewport_bottom: 0 + viewport_left: 0 + viewport_right: 0 + viewport_top: 0 +index.html: + fallback_name: char_391_rosmon_epoque%2317 + id: char_391_rosmon%2317 + operator_logo: logo_elite + title: 'Arknights: Become Anew / Rosmontis - 明日方舟:复现荣光·迷迭香' + version: ${func:get_version()} +project.json: + description: 'Arknights: Become Anew / Rosmontis Live 2D\n明日方舟:复现荣光·迷迭香 Live 2D\nThe model is extracted from game with Spine support.\n模型来自游戏内提取,支持Spine\nPlease set your FPS target in Wallpaper Engine > Settings > Performance > FPS\n请在 Wallpaper Engine > 设置 > 性能 > FPS 下设置FPS\n\nLive preview on: https://arknights.halyul.dev/rosmontis_become_anew\nGithub: https://github.com/Halyul/aklive2d' + title: ${var:index.html->title} + ui_logo_opacity: ${var:_operator_settings.js->opacity} + ui_logo_ratio: 61.8 + ui_operator_logo: 'true' + ui_position_padding_bottom: ${var:_operator_settings.js->viewport_bottom} + ui_position_padding_left: ${var:_operator_settings.js->viewport_left} + ui_position_padding_right: ${var:_operator_settings.js->viewport_right} + ui_position_padding_top: ${var:_operator_settings.js->viewport_top} \ No newline at end of file diff --git a/config/texas_the_omertosa.yaml b/config/texas_the_omertosa.yaml new file mode 100644 index 0000000..bb1a919 --- /dev/null +++ b/config/texas_the_omertosa.yaml @@ -0,0 +1,26 @@ +_operator_settings.js: + fallbackImage_height: 2048 + fallbackImage_width: 2048 + filename: dyn_illust_char_1028_texas2 + fps: 60 + opacity: 30 + viewport_bottom: 0 + viewport_left: 0 + viewport_right: 0 + viewport_top: 0 +index.html: + fallback_name: null + id: char_1028_texas2 + operator_logo: logo_penguin + title: 'Arknights: Texas the Omertosa - 明日方舟:缄默德克萨斯' + version: ${func:get_version()} +project.json: + description: 'Arknights: Texas the Omertosa Live 2D\r\n明日方舟:缄默德克萨斯 Live 2D\r\nThe model is extracted from game with Spine support.\r\n模型来自游戏内提取,支持Spine\r\nPlease set your FPS target in Wallpaper Engine > Settings > Performance > FPS\r\n请在Wallpaper Engine > 设置 > 性能 > FPS 下设置FPS\r\n\r\nLive preview on: https://arknights.halyul.dev/texas_the_omertosa\r\nGithub: https://github.com/Halyul/aklive2d' + title: ${var:index.html->title} + ui_logo_opacity: ${var:_operator_settings.js->opacity} + ui_logo_ratio: 61.8 + ui_operator_logo: 'true' + ui_position_padding_bottom: ${var:_operator_settings.js->viewport_bottom} + ui_position_padding_left: ${var:_operator_settings.js->viewport_left} + ui_position_padding_right: ${var:_operator_settings.js->viewport_right} + ui_position_padding_top: ${var:_operator_settings.js->viewport_top} \ No newline at end of file diff --git a/lib/builder.py b/lib/builder.py index 6cfdf08..990eb39 100644 --- a/lib/builder.py +++ b/lib/builder.py @@ -66,7 +66,7 @@ class Builder: source=self.config["operator"]["source_folder"].format(name=operator_name), target=self.config["operator"]["target_folder"].format(name=operator_name), common_name=self.config["operators"][operator_name]["_operator_settings.js"]["filename"], - fallback_name=self.config["operators"][operator_name]["index.html"]["fallback_name"].replace("%23", "#"), + fallback_name=self.config["operators"][operator_name]["index.html"]["fallback_name"].replace("%23", "#") if self.config["operators"][operator_name]["index.html"]["fallback_name"] is not None else None, id_name=self.config["operators"][operator_name]["index.html"]["id"].replace("%23", "#") ) @@ -195,8 +195,8 @@ class Builder: source_path = file_paths["source"] target_path = file_paths["target"] fallback_name = file_paths["fallback_name"] - - AlphaComposite(source_path + fallback_name, target_path + "../{}".format(fallback_name)) + if fallback_name is not None: + AlphaComposite(source_path + fallback_name, target_path + "../{}".format(fallback_name)) def __json_to_base64(self, path, dict=None, key=None): with open(pathlib.Path.cwd().joinpath(path), "r") as f: diff --git a/lib/config.py b/lib/config.py index 2a264f2..60e720b 100644 --- a/lib/config.py +++ b/lib/config.py @@ -33,12 +33,10 @@ class Config: operator_logo=str, title=str, version=str, - fallback_name=str, ), "_operator_settings.js": dict( fallbackImage_height=int, fallbackImage_width=int, - filename=str, fps=int, viewport_left=int, viewport_right=int,