Skip to content

Commit 5f9511a

Browse files
Update README
1 parent dde8b18 commit 5f9511a

File tree

2 files changed

+34
-13
lines changed

2 files changed

+34
-13
lines changed

README.en.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@ You can refer to the source code of `dist/autoload.js` to see the available conf
4545

4646
| Option | Type | Default Value | Description |
4747
| ------ | ---- | ------------- | ----------- |
48-
| `waifuPath` | `string` | `https://fastly.jsdelivr.net/npm/live2d-widgets@1/waifu-tips.json` | Path to the widget resources, can be modified |
48+
| `waifuPath` | `string` | `https://fastly.jsdelivr.net/npm/live2d-widgets@1/dist/waifu-tips.json` | Path to the widget resources, can be modified |
4949
| `cdnPath` | `string` | `https://fastly.jsdelivr.net/gh/fghrsh/live2d_api/` | CDN path |
50+
| `cubism2Path` | `string` | `https://fastly.jsdelivr.net/npm/live2d-widgets@1/dist/live2d.min.js` | Path to Cubism 2 Core |
51+
| `cubism5Path` | `string` | `https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js` | Path to Cubism 5 Core |
5052
| `modelId` | `number` | `0` | Default model id |
5153
| `tools` | `string[]` | see `autoload.js` | Buttons of the loaded tools |
5254
| `drag` | `boolean` | `false` | Make the widget draggable |
5355
| `logLevel` | `string` | `error` | Log level: `error`, `warn`, `info`, `trace` |
5456

5557
## Model Repository
5658

57-
This repository does not include any models. You need to configure a separate model repository and set it via the `cdnPath` option.
59+
This repository does not include any models. You need to configure a separate model repository and set it via the `cdnPath` option.
5860
Older versions of the `initWidget` function supported the `apiPath` parameter, which required users to set up their own backend. You can refer to [live2d_api](https://github.com/fghrsh/live2d_api) for details. The backend interface would integrate model resources and dynamically generate JSON description files. Since version 1.0, these features have been implemented on the frontend, so a dedicated `apiPath` is no longer required. All model resources can be provided statically. As long as `model_list.json` and the corresponding `textures.cache` for each model exist, features such as outfit changing are supported.
5961

6062
## Development
@@ -68,18 +70,27 @@ If the options provided in the "Configuration" section above are not enough to m
6870
- `waifu-tips.js` is automatically generated by `build/waifu-tips.js` and it is not recommended to modify it directly.
6971
- `waifu.css` is the style sheet for the widget.
7072
- `waifu-tips.json` defines the triggering conditions (`selector`, CSS selector) and the displayed text when triggered (`text`).
71-
By default, the CSS selector rules in `waifu-tips.json` are effective for the Hexo [NexT theme](http://github.com/next-theme/hexo-theme-next), but you may need to modify or add new content to make it suitable for your own website.
73+
By default, the CSS selector rules in `waifu-tips.json` are effective for the Hexo [NexT theme](https://github.com/next-theme/hexo-theme-next), but you may need to modify or add new content to make it suitable for your own website.
7274
**Warning: The content in `waifu-tips.json` may not be suitable for all age groups or appropriate to access during work. Please ensure their suitability when using them.**
7375

7476
To deploy the development testing environment of this project locally, you need to install Node.js and npm, then execute the following commands:
7577

7678
```bash
7779
git clone https://github.com/stevenjoezhang/live2d-widget.git
7880
npm install
81+
```
82+
83+
If you need to use Cubism 3 or newer models, please download and extract the Cubism SDK for Web separately into the `src` directory, for example, `src/CubismSdkForWeb-5-r.4`. Due to Live2D license agreements (including the Live2D Proprietary Software License Agreement and Live2D Open Software License Agreement), this project cannot include the source code of Cubism SDK for Web.
84+
If you only need to use Cubism 2 models, you can skip this step. The code in this repository complies with the Redistributable Code terms of the Live2D license agreements.
85+
Once completed, use the following command to compile and bundle the project.
86+
87+
88+
```bash
7989
npm run build
8090
```
8191

82-
The TypeScript code in the `src` directory is compiled into the `build` directory, and the code in the `build` directory is further bundled into the `dist` directory.
92+
The TypeScript code in the `src` directory is compiled into the `build` directory, and the code in the `build` directory is further bundled into the `dist` directory.
93+
To support both Cubism 2 and Cubism 3 (and newer) models while minimizing code size, Cubism Core and related code are loaded dynamically based on the detected model version.
8394

8495
## Deploy
8596

@@ -187,7 +198,7 @@ https://www.live2d.com/en/
187198

188199
This repository does not contain any models. The copyrights of all Live2D models, images, and motion data used for demonstration purposes belong to their respective original authors. They are provided for research and learning purposes only and should not be used for commercial purposes.
189200

190-
The code in this repository (excluding parts covered by the Cubism Live2D Proprietary Software License and the Live2D Open Software License) is released under the GNU General Public License v3
201+
The code in this repository (excluding parts covered by the Live2D Proprietary Software License and the Live2D Open Software License) is released under the GNU General Public License v3
191202
http://www.gnu.org/licenses/gpl-3.0.html
192203

193204
Please comply with the relevant licenses when using any Live2D-related code:
@@ -199,7 +210,7 @@ License for Live2D Cubism SDK 5:
199210
Live2D Cubism Core is provided under the Live2D Proprietary Software License.
200211
https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html
201212
Live2D Cubism Components are provided under the Live2D Open Software License.
202-
http://www.live2d.com/eula/live2d-open-software-license-agreement_en.html
213+
https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html
203214

204215
## Update Log
205216

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@
4545

4646
| 选项 | 类型 | 默认值 | 说明 |
4747
| - | - | - | - |
48-
| `waifuPath` | `string` | `https://fastly.jsdelivr.net/npm/live2d-widgets@1/waifu-tips.json` | 看板娘资源路径,可自行修改 |
48+
| `waifuPath` | `string` | `https://fastly.jsdelivr.net/npm/live2d-widgets@1/dist/waifu-tips.json` | 看板娘资源路径,可自行修改 |
4949
| `cdnPath` | `string` | `https://fastly.jsdelivr.net/gh/fghrsh/live2d_api/` | CDN 路径 |
50+
| `cubism2Path` | `string` | `https://fastly.jsdelivr.net/npm/live2d-widgets@1/dist/live2d.min.js` | Cubism 2 Core 路径 |
51+
| `cubism5Path` | `string` | `https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js` | Cubism 5 Core 路径 |
5052
| `modelId` | `number` | `0` | 默认模型 id |
5153
| `tools` | `string[]` |`autoload.js` | 加载的小工具按钮 |
5254
| `drag` | `boolean` | `false` | 支持拖动看板娘 |
5355
| `logLevel` | `string` | `error` | 日志等级,支持 `error``warn``info``trace` |
5456

5557
## 模型仓库
5658

57-
本仓库中并不包含任何模型,需要单独配置模型仓库,并通过 `cdnPath` 选项进行设置。
59+
本仓库中并不包含任何模型,需要单独配置模型仓库,并通过 `cdnPath` 选项进行设置。
5860
旧版本的 `initWidget` 函数支持 `apiPath` 参数,这要求用户自行搭建后端,可以参考 [live2d_api](https://github.com/fghrsh/live2d_api)。后端接口会对模型资源进行整合并动态生成 JSON 描述文件。自 1.0 版本起,相关功能已通过前端实现,因此不再需要专门的 `apiPath`,所有模型资源都可通过静态方式提供。只要存在 `model_list.json` 和模型对应的 `textures.cache`,即可支持换装等功能。
5961

6062
## 开发
@@ -68,18 +70,26 @@
6870
- `waifu-tips.js` 是由 `build/waifu-tips.js` 自动打包生成的,不建议直接修改;
6971
- `waifu.css` 是看板娘的样式表;
7072
- `waifu-tips.json` 中定义了触发条件(`selector`,CSS 选择器)和触发时显示的文字(`text`)。
71-
`waifu-tips.json` 中默认的 CSS 选择器规则是对 Hexo 的 [NexT 主题](http://github.com/next-theme/hexo-theme-next) 有效的,为了适用于你自己的网页,可能需要自行修改,或增加新内容。
73+
`waifu-tips.json` 中默认的 CSS 选择器规则是对 Hexo 的 [NexT 主题](https://github.com/next-theme/hexo-theme-next) 有效的,为了适用于你自己的网页,可能需要自行修改,或增加新内容。
7274
**警告:`waifu-tips.json` 中的内容可能不适合所有年龄段,或不宜在工作期间访问。在使用时,请自行确保它们是合适的。**
7375

7476
要在本地部署本项目的开发测试环境,你需要安装 Node.js 和 npm,然后执行以下命令:
7577

7678
```bash
7779
git clone https://github.com/stevenjoezhang/live2d-widget.git
7880
npm install
81+
```
82+
83+
如果需要使用 Cubism 3 及更新的模型,请单独下载并解压 Cubism SDK for Web 到 `src` 目录下,例如 `src/CubismSdkForWeb-5-r.4`。受 Live2D 许可协议(包括 Live2D Proprietary Software License Agreement 和 Live2D Open Software License Agreement)限制,本项目无法包含 Cubism SDK for Web 的源码。
84+
如果只需要使用 Cubism 2 版本的模型,可以跳过此步骤。本仓库使用的代码满足 Live2D 许可协议中 Redistributable Code 相关条款。
85+
完成后,使用以下命令进行编译和打包。
86+
87+
```bash
7988
npm run build
8089
```
8190

82-
`src` 目录中的 TypeScript 代码会被编译到 `build` 目录中,`build` 目录中的代码会被进一步打包到 `dist` 目录中。
91+
`src` 目录中的 TypeScript 代码会被编译到 `build` 目录中,`build` 目录中的代码会被进一步打包到 `dist` 目录中。
92+
为了能够兼容 Cubism 2 和 Cubism 3 及更新的模型,并减小代码体积,Cubism Core 及相关的代码会根据检测到的模型版本动态加载。
8393

8494
## 部署
8595

@@ -189,7 +199,7 @@ https://www.live2d.com/en/
189199

190200
本仓库并不包含任何模型,用作展示的所有 Live2D 模型、图片、动作数据等版权均属于其原作者,仅供研究学习,不得用于商业用途。
191201

192-
本仓库的代码(不包括受 Cubism Live2D Proprietary Software License 和 Live2D Open Software License 约束的部分)基于 GNU General Public License v3 协议开源
202+
本仓库的代码(不包括受 Live2D Proprietary Software License 和 Live2D Open Software License 约束的部分)基于 GNU General Public License v3 协议开源
193203
http://www.gnu.org/licenses/gpl-3.0.html
194204

195205
Live2D 相关代码的使用请遵守对应的许可:
@@ -199,9 +209,9 @@ Live2D Cubism SDK 2.1 的许可证:
199209

200210
Live2D Cubism SDK 5 的许可证:
201211
Live2D Cubism Core は Live2D Proprietary Software License で提供しています。
202-
https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html
212+
https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_cn.html
203213
Live2D Cubism Components は Live2D Open Software License で提供しています。
204-
http://www.live2d.com/eula/live2d-open-software-license-agreement_en.html
214+
https://www.live2d.com/eula/live2d-open-software-license-agreement_cn.html
205215

206216
## 更新日志
207217

0 commit comments

Comments
 (0)