mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-11-11 20:02:57 +08:00
Compare commits
11 Commits
ce1435be3a
...
42a9efe431
| Author | SHA1 | Date | |
|---|---|---|---|
| 42a9efe431 | |||
| 44b7711265 | |||
| 8b6dc81ee1 | |||
| b8be68d66d | |||
| 0856c12aee | |||
| 991d94568b | |||
| 90671fa6dd | |||
| 860cbd7ea6 | |||
| 10620bd2f8 | |||
| a858069e6d | |||
| d0857634d4 |
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
当你**制作完游戏**后,点击构建游戏,即可自动构建游戏,构建结果在 `dist` 文件夹,会自动打包到 `dist.zip` 压缩包,发塔或更新上传此压缩包即可。
|
当你**制作完游戏**后,点击构建游戏,即可自动构建游戏,构建结果在 `dist` 文件夹,会自动打包到 `dist.zip` 压缩包,发塔或更新上传此压缩包即可。
|
||||||
|
|
||||||
此帮助文档远比 2.x 的文档易读,也更容易理解,建议多阅读此文档来解决自己的问题,如果问题很复杂,或是短时间内解决不了,再去造塔群询问。
|
此帮助文档远比 2.x 的文档易读,也更容易理解,但是遇到问题时我们依然建议直接在造塔群询问,因为你可能不能判断文档中是否有关于你的问题的解答。
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
graph TD
|
graph TD
|
||||||
|
|||||||
@ -6,8 +6,10 @@
|
|||||||
Unexpected error when posting danmaku. Error info: $1
|
Unexpected error when posting danmaku. Error info: $1
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:发送弹幕时发生报错。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:查看后面的 Error info,检查报错信息内容,按照报错信息修复问题。
|
|
||||||
|
- 报错原因:发送弹幕时发生报错。
|
||||||
|
- 解决方案:查看后面的 Error info,检查报错信息内容,按照报错信息修复问题。
|
||||||
|
|
||||||
## ERROR CODE 2
|
## ERROR CODE 2
|
||||||
|
|
||||||
@ -15,8 +17,8 @@ Unexpected error when posting danmaku. Error info: $1
|
|||||||
Unexpected loading error in loading resource '$1/$2'. Error info: $3
|
Unexpected loading error in loading resource '$1/$2'. Error info: $3
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:加载资源时发生报错,可能是资源不存在,或者是网络问题。
|
- 报错原因:加载资源时发生报错,可能是资源不存在,或者是网络问题。
|
||||||
- 解决方案:查看后面的 Error info,检查报错信息内容,按照报错信息修复问题。
|
- 解决方案:查看后面的 Error info,检查报错信息内容,按照报错信息修复问题。
|
||||||
|
|
||||||
## ERROR CODE 3
|
## ERROR CODE 3
|
||||||
|
|
||||||
@ -24,8 +26,10 @@ Unexpected loading error in loading resource '$1/$2'. Error info: $3
|
|||||||
Syntax error in parsing CSS: Unexpected ':'. Col: $1. CSS string: '$2
|
Syntax error in parsing CSS: Unexpected ':'. Col: $1. CSS string: '$2
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:检查弹幕 CSS 语法是否正确。
|
|
||||||
|
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
||||||
|
- 解决方案:检查弹幕 CSS 语法是否正确。
|
||||||
|
|
||||||
## ERROR CODE 4
|
## ERROR CODE 4
|
||||||
|
|
||||||
@ -33,8 +37,10 @@ Syntax error in parsing CSS: Unexpected ':'. Col: $1. CSS string: '$2
|
|||||||
Syntax error in parsing CSS: Unexpected ';'. Col: $1. CSS string: '$2'
|
Syntax error in parsing CSS: Unexpected ';'. Col: $1. CSS string: '$2'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:检查弹幕 CSS 语法是否正确。
|
|
||||||
|
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
||||||
|
- 解决方案:检查弹幕 CSS 语法是否正确。
|
||||||
|
|
||||||
## ERROR CODE 5
|
## ERROR CODE 5
|
||||||
|
|
||||||
@ -42,8 +48,10 @@ Syntax error in parsing CSS: Unexpected ';'. Col: $1. CSS string: '$2'
|
|||||||
Syntax error in parsing CSS: Missing property name after '-'. Col: $1. CSS string: '$2'
|
Syntax error in parsing CSS: Missing property name after '-'. Col: $1. CSS string: '$2'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:检查弹幕 CSS 语法是否正确。
|
|
||||||
|
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
||||||
|
- 解决方案:检查弹幕 CSS 语法是否正确。
|
||||||
|
|
||||||
## ERROR CODE 6
|
## ERROR CODE 6
|
||||||
|
|
||||||
@ -51,8 +59,10 @@ Syntax error in parsing CSS: Missing property name after '-'. Col: $1. CSS strin
|
|||||||
Syntax error in parsing CSS: Unexpected end of css, expecting ':'. Col: $1. CSS string: '$2'
|
Syntax error in parsing CSS: Unexpected end of css, expecting ':'. Col: $1. CSS string: '$2'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:检查弹幕 CSS 语法是否正确。
|
|
||||||
|
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
||||||
|
- 解决方案:检查弹幕 CSS 语法是否正确。
|
||||||
|
|
||||||
## ERROR CODE 7
|
## ERROR CODE 7
|
||||||
|
|
||||||
@ -60,8 +70,10 @@ Syntax error in parsing CSS: Unexpected end of css, expecting ':'. Col: $1. CSS
|
|||||||
Syntax error in parsing CSS: Unexpected end of css, expecting property value. Col: $1. CSS string: '$2'
|
Syntax error in parsing CSS: Unexpected end of css, expecting property value. Col: $1. CSS string: '$2'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:检查弹幕 CSS 语法是否正确。
|
|
||||||
|
- 报错原因:解析 CSS 时报错,一般是在发送弹幕时引起。
|
||||||
|
- 解决方案:检查弹幕 CSS 语法是否正确。
|
||||||
|
|
||||||
## ERROR CODE 8
|
## ERROR CODE 8
|
||||||
|
|
||||||
@ -69,8 +81,10 @@ Syntax error in parsing CSS: Unexpected end of css, expecting property value. Co
|
|||||||
Post danmaku with not allowed css. Info: $1
|
Post danmaku with not allowed css. Info: $1
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:弹幕 CSS 中使用了不允许的 css 属性类型。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:目前仅支持 `color` `background-color` `font-size: x%` 属性。
|
|
||||||
|
- 报错原因:弹幕 CSS 中使用了不允许的 css 属性类型。
|
||||||
|
- 解决方案:目前仅支持 `color` `background-color` `font-size: x%` 属性。
|
||||||
|
|
||||||
## ERROR CODE 9
|
## ERROR CODE 9
|
||||||
|
|
||||||
@ -78,8 +92,8 @@ Post danmaku with not allowed css. Info: $1
|
|||||||
Cannot initialize shader program. Error info: $1
|
Cannot initialize shader program. Error info: $1
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:不能够初始化着色器脚本,可能是着色器代码中有语法错误,或者是定义了不存在的变量等。
|
- 报错原因:不能够初始化着色器脚本,可能是着色器代码中有语法错误,或者是定义了不存在的变量等。
|
||||||
- 解决方案:查看报错内容,根据报错内容解决。
|
- 解决方案:查看报错内容,根据报错内容解决。
|
||||||
|
|
||||||
## ERROR CODE 10
|
## ERROR CODE 10
|
||||||
|
|
||||||
@ -87,8 +101,8 @@ Cannot initialize shader program. Error info: $1
|
|||||||
Cannot compile $1 shader. Error info: $2
|
Cannot compile $1 shader. Error info: $2
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:不能编译着色器脚本,可能是语法错误,设备不支持 OpenGL 等原因。
|
- 报错原因:不能编译着色器脚本,可能是语法错误,设备不支持 OpenGL 等原因。
|
||||||
- 解决方案:查看报错内容,根据报错内容解决。
|
- 解决方案:查看报错内容,根据报错内容解决。
|
||||||
|
|
||||||
## ERROR CODE 11
|
## ERROR CODE 11
|
||||||
|
|
||||||
@ -96,8 +110,8 @@ Cannot compile $1 shader. Error info: $2
|
|||||||
Cache depth cannot larger than 31.
|
Cache depth cannot larger than 31.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:`BlockCache` 最大允许 31 层深度缓存。
|
- 报错原因:`BlockCache` 最大允许 31 层深度缓存。
|
||||||
- 解决方案:降低缓存深度。
|
- 解决方案:降低缓存深度。
|
||||||
|
|
||||||
## ERROR CODE 12
|
## ERROR CODE 12
|
||||||
|
|
||||||
@ -105,8 +119,8 @@ Cache depth cannot larger than 31.
|
|||||||
Cannot move while status is not 'moving'. Call 'readyMove' first.
|
Cannot move while status is not 'moving'. Call 'readyMove' first.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:调用移动时没有调用 `readyMove` 准备移动。
|
- 报错原因:调用移动时没有调用 `readyMove` 准备移动。
|
||||||
- 解决方案:在移动前先调用 `readyMove`。
|
- 解决方案:在移动前先调用 `readyMove`。
|
||||||
|
|
||||||
## ERROR CODE 13
|
## ERROR CODE 13
|
||||||
|
|
||||||
@ -118,8 +132,8 @@ Cannot move while status is not 'moving'. Call 'readyMove' first.
|
|||||||
Cannot find log message for $1 code $2.
|
Cannot find log message for $1 code $2.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:不能找到错误代码 $2 的消息。
|
- 报错原因:不能找到错误代码 $2 的消息。
|
||||||
- 解决方案:避免使用 `logger` 输出不存在的错误代码。
|
- 解决方案:避免使用 `logger` 输出不存在的错误代码。
|
||||||
|
|
||||||
## ERROR CODE 17
|
## ERROR CODE 17
|
||||||
|
|
||||||
@ -127,17 +141,17 @@ Cannot find log message for $1 code $2.
|
|||||||
Cannot use shader program for shader element that does not belong to it.
|
Cannot use shader program for shader element that does not belong to it.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:在一个着色器上使用了不属于这个着色器的着色器程序。
|
- 报错原因:在一个着色器上使用了不属于这个着色器的着色器程序。
|
||||||
- 解决方案:确保使用的着色器程序是由着色器对象自身创建的。
|
- 解决方案:确保使用的着色器程序是由着色器对象自身创建的。
|
||||||
|
|
||||||
## ERROR CODE 18
|
## ERROR CODE 18
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
Cannot delete shader program for shader element that does not belong to
|
Cannot delete shader program for shader element that does not belong to it.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:在一个着色器上删除了不属于这个着色器的着色器程序。
|
- 报错原因:在一个着色器上删除了不属于这个着色器的着色器程序。
|
||||||
- 解决方案:确保删除的着色器程序是由着色器对象自身创建的。
|
- 解决方案:确保删除的着色器程序是由着色器对象自身创建的。
|
||||||
|
|
||||||
## ERROR CODE 19
|
## ERROR CODE 19
|
||||||
|
|
||||||
@ -145,8 +159,8 @@ Cannot delete shader program for shader element that does not belong to
|
|||||||
Cannot create MotaRenderer instance for nonexistent canvas.
|
Cannot create MotaRenderer instance for nonexistent canvas.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:在一个不存在的画布上创建了渲染器对象。
|
- 报错原因:在一个不存在的画布上创建了渲染器对象。
|
||||||
- 解决方案:确保目标画布存在。
|
- 解决方案:确保目标画布存在。
|
||||||
|
|
||||||
## ERROR CODE 20
|
## ERROR CODE 20
|
||||||
|
|
||||||
@ -154,8 +168,8 @@ Cannot create MotaRenderer instance for nonexistent canvas.
|
|||||||
Cannot create render element for tag '$1', since there's no registration for it.
|
Cannot create render element for tag '$1', since there's no registration for it.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:不能创建 $1 标签,因为没有注册这个标签。
|
- 报错原因:不能创建 $1 标签,因为没有注册这个标签。
|
||||||
- 解决方案:确保你已经在 `tagMap` 注册了这个标签。
|
- 解决方案:确保你已经在 `tagMap` 注册了这个标签。
|
||||||
|
|
||||||
## ERROR CODE 21
|
## ERROR CODE 21
|
||||||
|
|
||||||
@ -163,8 +177,8 @@ Cannot create render element for tag '$1', since there's no registration for it.
|
|||||||
Incorrect render prop type is delivered. key: '$1', expected type: '$2', delivered type: '$3'
|
Incorrect render prop type is delivered. key: '$1', expected type: '$2', delivered type: '$3'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:向元素中传入了错误类型的参数(props)。
|
- 报错原因:向元素中传入了错误类型的参数(props)。
|
||||||
- 解决方案:确保传入元素的 $1 参数的类型是 $2。
|
- 解决方案:确保传入元素的 $1 参数的类型是 $2。
|
||||||
|
|
||||||
## ERROR CODE 22
|
## ERROR CODE 22
|
||||||
|
|
||||||
@ -172,8 +186,8 @@ Incorrect render prop type is delivered. key: '$1', expected type: '$2', deliver
|
|||||||
Incorrect props for custom tag. Please ensure you have delivered 'item' prop and other required props.
|
Incorrect props for custom tag. Please ensure you have delivered 'item' prop and other required props.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:没有向 `cutsom` 标签传入 `item` 参数。
|
- 报错原因:没有向 `cutsom` 标签传入 `item` 参数。
|
||||||
- 解决方案:确保传入了 `item` 参数和需要的所有参数。
|
- 解决方案:确保传入了 `item` 参数和需要的所有参数。
|
||||||
|
|
||||||
## ERROR CODE 23
|
## ERROR CODE 23
|
||||||
|
|
||||||
@ -181,8 +195,8 @@ Incorrect props for custom tag. Please ensure you have delivered 'item' prop and
|
|||||||
Cannot get reader when fetching '$1'.
|
Cannot get reader when fetching '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:流式加载 URL $1 时不能获取 `StreamReader`。
|
- 报错原因:流式加载 URL $1 时不能获取 `StreamReader`。
|
||||||
- 解决方案:检查加载的 URL 是否合法,检查浏览器版本是否过老。
|
- 解决方案:检查加载的 URL 是否合法,检查浏览器版本是否过老。
|
||||||
|
|
||||||
## ERROR CODE 24
|
## ERROR CODE 24
|
||||||
|
|
||||||
@ -190,8 +204,8 @@ Cannot get reader when fetching '$1'.
|
|||||||
Cannot decode source type of '$1', since there is no registered decoder for that type.
|
Cannot decode source type of '$1', since there is no registered decoder for that type.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:音频系统中的流式音频源不能解析 $1 格式的音频,因为没有对应的解码器。
|
- 报错原因:音频系统中的流式音频源不能解析 $1 格式的音频,因为没有对应的解码器。
|
||||||
- 解决方案:如果不是 `opus` `ogg` 格式的音频,请使用 `ElementSource`。
|
- 解决方案:如果不是 `opus` `ogg` 格式的音频,请使用 `ElementSource`。
|
||||||
|
|
||||||
## ERROR CODE 25
|
## ERROR CODE 25
|
||||||
|
|
||||||
@ -199,8 +213,8 @@ Cannot decode source type of '$1', since there is no registered decoder for that
|
|||||||
Unknown audio type. Header: '$1'
|
Unknown audio type. Header: '$1'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:未知的音频类型。
|
- 报错原因:未知的音频类型。
|
||||||
- 解决方案:目前仅支持 `mp3` `wav` `flac` `opus` `ogg` `aac` 格式的音频。
|
- 解决方案:目前仅支持 `mp3` `wav` `flac` `opus` `ogg` `aac` 格式的音频。
|
||||||
|
|
||||||
## ERROR CODE 26
|
## ERROR CODE 26
|
||||||
|
|
||||||
@ -208,5 +222,5 @@ Unknown audio type. Header: '$1'
|
|||||||
Uncaught error when fetching stream data from '$1'. Error info: $2.
|
Uncaught error when fetching stream data from '$1'. Error info: $2.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 报错原因:流式加载时报错。
|
- 报错原因:流式加载时报错。
|
||||||
- 解决方案:查看报错内容,根据报错内容解决问题。
|
- 解决方案:查看报错内容,根据报错内容解决问题。
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
Resource with type of 'none' is loaded.
|
Resource with type of 'none' is loaded.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能加载 `none` 类型的资源。
|
- 警告原因:不能加载 `none` 类型的资源。
|
||||||
- 解决方案:加载资源时填写资源类型。
|
- 解决方案:加载资源时填写资源类型。
|
||||||
|
|
||||||
## WARN CODE 2
|
## WARN CODE 2
|
||||||
|
|
||||||
@ -15,8 +15,8 @@ Resource with type of 'none' is loaded.
|
|||||||
Repeat load of resource '$1/$2'.
|
Repeat load of resource '$1/$2'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:同一个资源被加载了两次。
|
- 警告原因:同一个资源被加载了两次。
|
||||||
- 解决方案:避免对同一个资源调用两次加载。
|
- 解决方案:避免对同一个资源调用两次加载。
|
||||||
|
|
||||||
## WARN CODE 3
|
## WARN CODE 3
|
||||||
|
|
||||||
@ -24,8 +24,10 @@ Repeat load of resource '$1/$2'.
|
|||||||
Unknown danmaku tag: $1
|
Unknown danmaku tag: $1
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:出现了未知的弹幕标签(指 `[xxx:xxx]`)
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:目前仅支持 `[i:xxx]` 标签,如果需要显示方括号,请使用 `\[\]`。
|
|
||||||
|
- 警告原因:出现了未知的弹幕标签(指 `[xxx:xxx]`)
|
||||||
|
- 解决方案:目前仅支持 `[i:xxx]` 标签,如果需要显示方括号,请使用 `\[\]`。
|
||||||
|
|
||||||
## WARN CODE 4
|
## WARN CODE 4
|
||||||
|
|
||||||
@ -33,8 +35,10 @@ Unknown danmaku tag: $1
|
|||||||
Ignored a mismatched ']' in danmaku.
|
Ignored a mismatched ']' in danmaku.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:出现了不能匹配的右方括号。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:如果需要显示方括号,请使用 `\[\]`。
|
|
||||||
|
- 警告原因:出现了不能匹配的右方括号。
|
||||||
|
- 解决方案:如果需要显示方括号,请使用 `\[\]`。
|
||||||
|
|
||||||
## WARN CODE 5
|
## WARN CODE 5
|
||||||
|
|
||||||
@ -42,8 +46,10 @@ Ignored a mismatched ']' in danmaku.
|
|||||||
Repeat post danmaku.
|
Repeat post danmaku.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:同一个弹幕被发送了两次。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:确保一个弹幕实例只调用了一次 `post` 方法。
|
|
||||||
|
- 警告原因:同一个弹幕被发送了两次。
|
||||||
|
- 解决方案:确保一个弹幕实例只调用了一次 `post` 方法。
|
||||||
|
|
||||||
## WARN CODE 6
|
## WARN CODE 6
|
||||||
|
|
||||||
@ -51,8 +57,10 @@ Repeat post danmaku.
|
|||||||
Registered special danmaku element: $1.
|
Registered special danmaku element: $1.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:要注册的弹幕标签已经存在。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:避免使用同一个标签名,如果内容不一样请换一个标签名。
|
|
||||||
|
- 警告原因:要注册的弹幕标签已经存在。
|
||||||
|
- 解决方案:避免使用同一个标签名,如果内容不一样请换一个标签名。
|
||||||
|
|
||||||
## WARN CODE 7
|
## WARN CODE 7
|
||||||
|
|
||||||
@ -64,8 +72,8 @@ Registered special danmaku element: $1.
|
|||||||
Incomplete render data is put. None will be filled to the lacked data.
|
Incomplete render data is put. None will be filled to the lacked data.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:使用 `<layer>` 标签时,向地图渲染传入了不完整的地图信息(数据长度不是指定宽度的倍数),不完整的部分将会补零。
|
- 警告原因:使用 `<layer>` 标签时,向地图渲染传入了不完整的地图信息(数据长度不是指定宽度的倍数),不完整的部分将会补零。
|
||||||
- 解决方案:确保传入的地图信息长度是 `width` 参数的倍数。
|
- 解决方案:确保传入的地图信息长度是 `width` 参数的倍数。
|
||||||
|
|
||||||
## WARN CODE 9
|
## WARN CODE 9
|
||||||
|
|
||||||
@ -73,8 +81,8 @@ Incomplete render data is put. None will be filled to the lacked data.
|
|||||||
Data transfered is partially (or totally) out of range. Overflowed data will be ignored.
|
Data transfered is partially (or totally) out of range. Overflowed data will be ignored.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:使用 `<layer>` 标签时,传入地图的渲染数据有一部分(或全部都)在地图之外,在地图之外的部分将会被忽略。
|
- 警告原因:使用 `<layer>` 标签时,传入地图的渲染数据有一部分(或全部都)在地图之外,在地图之外的部分将会被忽略。
|
||||||
- 解决方案:确保传入的地图信息没有在地图之外的部分。
|
- 解决方案:确保传入的地图信息没有在地图之外的部分。
|
||||||
|
|
||||||
## WARN CODE 10
|
## WARN CODE 10
|
||||||
|
|
||||||
@ -82,8 +90,8 @@ Data transfered is partially (or totally) out of range. Overflowed data will be
|
|||||||
Cannot resolve big image of enemy '$1'.
|
Cannot resolve big image of enemy '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:无法解析怪物 $1 的大怪物贴图(绑定贴图),可能是因为图片不存在。
|
- 警告原因:无法解析怪物 $1 的大怪物贴图(绑定贴图),可能是因为图片不存在。
|
||||||
- 解决方案:确保此怪物绑定的贴图已经在全塔属性注册。
|
- 解决方案:确保此怪物绑定的贴图已经在全塔属性注册。
|
||||||
|
|
||||||
## WARN CODE 11
|
## WARN CODE 11
|
||||||
|
|
||||||
@ -91,8 +99,8 @@ Cannot resolve big image of enemy '$1'.
|
|||||||
Cannot resolve material $1. Material not exists.
|
Cannot resolve material $1. Material not exists.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能解析指定类型 $1 的素材,因为对应的素材文件不存在。
|
- 警告原因:不能解析指定类型 $1 的素材,因为对应的素材文件不存在。
|
||||||
- 解决方案:检查 `enemys.png` `npcs.png` 等素材文件是否存在。
|
- 解决方案:检查 `enemys.png` `npcs.png` 等素材文件是否存在。
|
||||||
|
|
||||||
## WARN CODE 12
|
## WARN CODE 12
|
||||||
|
|
||||||
@ -100,7 +108,7 @@ Cannot resolve material $1. Material not exists.
|
|||||||
Cannot mark buffable with a non-number status. Key: '$1'.
|
Cannot mark buffable with a non-number status. Key: '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 暂时碰不到这个报错。
|
- 暂时碰不到这个报错。
|
||||||
|
|
||||||
## WARN CODE 13
|
## WARN CODE 13
|
||||||
|
|
||||||
@ -108,7 +116,7 @@ Cannot mark buffable with a non-number status. Key: '$1'.
|
|||||||
Cannot set buff of non-number status. Key: '$1'.
|
Cannot set buff of non-number status. Key: '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 暂时碰不到这个报错。
|
- 暂时碰不到这个报错。
|
||||||
|
|
||||||
## WARN CODE 14
|
## WARN CODE 14
|
||||||
|
|
||||||
@ -116,7 +124,7 @@ Cannot set buff of non-number status. Key: '$1'.
|
|||||||
Cannot add status of non-number status. Key: '$1'.
|
Cannot add status of non-number status. Key: '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 暂时碰不到这个报错。
|
- 暂时碰不到这个报错。
|
||||||
|
|
||||||
## WARN CODE 15
|
## WARN CODE 15
|
||||||
|
|
||||||
@ -124,8 +132,8 @@ Cannot add status of non-number status. Key: '$1'.
|
|||||||
Cannot get item of a non-item block on loc: $1,$2,$3.
|
Cannot get item of a non-item block on loc: $1,$2,$3.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能获取一个不存在物品的图块上的物品对象。
|
- 警告原因:不能获取一个不存在物品的图块上的物品对象。
|
||||||
- 解决方案:提前判断那一格是不是物品,或确保要获取的格子包含物品。
|
- 解决方案:提前判断那一格是不是物品,或确保要获取的格子包含物品。
|
||||||
|
|
||||||
## WARN CODE 16
|
## WARN CODE 16
|
||||||
|
|
||||||
@ -133,7 +141,7 @@ Cannot get item of a non-item block on loc: $1,$2,$3.
|
|||||||
Override repeated state key: '$1'.
|
Override repeated state key: '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 暂时碰不到这个报错。
|
- 暂时碰不到这个报错。
|
||||||
|
|
||||||
## WARN CODE 17
|
## WARN CODE 17
|
||||||
|
|
||||||
@ -141,8 +149,8 @@ Override repeated state key: '$1'.
|
|||||||
Floor-damage extension needs 'floor-binder' extension as dependency.
|
Floor-damage extension needs 'floor-binder' extension as dependency.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:楼层伤害拓展需要以楼层绑定拓展作为依赖。
|
- 警告原因:楼层伤害拓展需要以楼层绑定拓展作为依赖。
|
||||||
- 解决方案:确保添加伤害拓展时也添加了楼层绑定拓展。
|
- 解决方案:确保添加伤害拓展时也添加了楼层绑定拓展。
|
||||||
|
|
||||||
## WARN CODE 18
|
## WARN CODE 18
|
||||||
|
|
||||||
@ -150,8 +158,10 @@ Floor-damage extension needs 'floor-binder' extension as dependency.
|
|||||||
Uncaught error in posting like info for danmaku. Danmaku id: $1.
|
Uncaught error in posting like info for danmaku. Danmaku id: $1.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:为弹幕点赞时出现报错。
|
> 应该不会遇到这个报错,因为样板并不内置弹幕系统。
|
||||||
- 解决方案:可能是网络问题,检查网络。
|
|
||||||
|
- 警告原因:为弹幕点赞时出现报错。
|
||||||
|
- 解决方案:可能是网络问题,检查网络。
|
||||||
|
|
||||||
## WARN CODE 19
|
## WARN CODE 19
|
||||||
|
|
||||||
@ -159,8 +169,10 @@ Uncaught error in posting like info for danmaku. Danmaku id: $1.
|
|||||||
Repeat light id: '$1'
|
Repeat light id: '$1'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:重复的光源 id。
|
> 应该不会遇到这个报错,因为样板并不内置点光源。
|
||||||
- 解决方案:避免光源 id 出现重复。
|
|
||||||
|
- 警告原因:重复的光源 id。
|
||||||
|
- 解决方案:避免光源 id 出现重复。
|
||||||
|
|
||||||
## WARN CODE 20
|
## WARN CODE 20
|
||||||
|
|
||||||
@ -168,8 +180,8 @@ Repeat light id: '$1'
|
|||||||
Cannot apply animation to camera operation that does not belong to it.
|
Cannot apply animation to camera operation that does not belong to it.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能向摄像机对象添加不属于它的动画操作。
|
- 警告原因:不能向摄像机对象添加不属于它的动画操作。
|
||||||
- 解决方案:确保添加的动画操作是由这个摄像机对象创建的。
|
- 解决方案:确保添加的动画操作是由这个摄像机对象创建的。
|
||||||
|
|
||||||
## WARN CODE 21
|
## WARN CODE 21
|
||||||
|
|
||||||
@ -177,8 +189,8 @@ Cannot apply animation to camera operation that does not belong to it.
|
|||||||
Cannot apply transition to camera operation that does not belong to it.
|
Cannot apply transition to camera operation that does not belong to it.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能向摄像机对象添加不属于它的渐变操作。
|
- 警告原因:不能向摄像机对象添加不属于它的渐变操作。
|
||||||
- 解决方案:确保添加的渐变操作是由这个摄像机对象创建的。
|
- 解决方案:确保添加的渐变操作是由这个摄像机对象创建的。
|
||||||
|
|
||||||
## WARN CODE 22
|
## WARN CODE 22
|
||||||
|
|
||||||
@ -186,8 +198,8 @@ Cannot apply transition to camera operation that does not belong to it.
|
|||||||
There is already an active camera for delivered render item. Consider using 'Camera.for' or disable the active camera to avoid some exceptions.
|
There is already an active camera for delivered render item. Consider using 'Camera.for' or disable the active camera to avoid some exceptions.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:在目标渲染元素上,现在已经有了一个已激活的摄像机对象,这可能导致两个摄像机操作冲突,产生问题。
|
- 警告原因:在目标渲染元素上,现在已经有了一个已激活的摄像机对象,这可能导致两个摄像机操作冲突,产生问题。
|
||||||
- 解决方案:考虑使用 [`Camera.for`](../../api/motajs-render-elements/Camera.md#Camera.for) 方法,或先禁用已激活的摄像机,再使用当前摄像机
|
- 解决方案:考虑使用 [`Camera.for`](../../api/motajs-render-elements/Camera.md#Camera.for) 方法,或先禁用已激活的摄像机,再使用当前摄像机
|
||||||
|
|
||||||
## WARN CODE 23
|
## WARN CODE 23
|
||||||
|
|
||||||
@ -195,8 +207,8 @@ There is already an active camera for delivered render item. Consider using 'Cam
|
|||||||
Render item with id of '$1' has already exists. Please avoid repeat id since it may cause issues when use 'getElementById'.
|
Render item with id of '$1' has already exists. Please avoid repeat id since it may cause issues when use 'getElementById'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:两个渲染元素的 id 出现了重复,这会导致调用 `getElementById` 时出现问题。
|
- 警告原因:两个渲染元素的 id 出现了重复,这会导致调用 `getElementById` 时出现问题。
|
||||||
- 解决方案:避免出现重复的 id。
|
- 解决方案:避免出现重复的 id。
|
||||||
|
|
||||||
## WARN CODE 24
|
## WARN CODE 24
|
||||||
|
|
||||||
@ -204,8 +216,8 @@ Render item with id of '$1' has already exists. Please avoid repeat id since it
|
|||||||
Uniform block can only be used in glsl version es 300.
|
Uniform block can only be used in glsl version es 300.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:UBO(Uniform Block Object) 只能在 GLSL ES 300 版本的着色器脚本中使用。
|
- 警告原因:UBO(Uniform Block Object) 只能在 GLSL ES 300 版本的着色器脚本中使用。
|
||||||
- 解决方案:如果需要使用 UBO,考虑换用 es 300 版本的着色器脚本。
|
- 解决方案:如果需要使用 UBO,考虑换用 es 300 版本的着色器脚本。
|
||||||
|
|
||||||
## WARN CODE 25
|
## WARN CODE 25
|
||||||
|
|
||||||
@ -213,8 +225,8 @@ Uniform block can only be used in glsl version es 300.
|
|||||||
Cannot activate weather since there's no weather with id of '$1'.
|
Cannot activate weather since there's no weather with id of '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能启用不存在的天气类型。
|
- 警告原因:不能启用不存在的天气类型。
|
||||||
- 解决方案:确保要启用的天气类型正确且存在,不存在则需要自行注册。
|
- 解决方案:确保要启用的天气类型正确且存在,不存在则需要自行注册。
|
||||||
|
|
||||||
## WARN CODE 26
|
## WARN CODE 26
|
||||||
|
|
||||||
@ -222,8 +234,8 @@ Cannot activate weather since there's no weather with id of '$1'.
|
|||||||
Cannot set attribute when only element number specified. Use 'pointer' or 'pointerI' instead.
|
Cannot set attribute when only element number specified. Use 'pointer' or 'pointerI' instead.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:使用 `defineAttribute` 时指定了不存在的顶点属性类型。
|
- 警告原因:使用 `defineAttribute` 时指定了不存在的顶点属性类型。
|
||||||
- 解决方案:如果需要传递数组,考虑使用 `defineAttribArray` 而不是 `defineAttribute`。
|
- 解决方案:如果需要传递数组,考虑使用 `defineAttribArray` 而不是 `defineAttribute`。
|
||||||
|
|
||||||
## WARN CODE 27
|
## WARN CODE 27
|
||||||
|
|
||||||
@ -231,7 +243,7 @@ Cannot set attribute when only element number specified. Use 'pointer' or 'point
|
|||||||
Cannot vertex attribute integer point when specified as float. Use 'set' or 'pointer' instead.
|
Cannot vertex attribute integer point when specified as float. Use 'set' or 'pointer' instead.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 遇不到这个报错
|
- 遇不到这个报错
|
||||||
|
|
||||||
## WARN CODE 28
|
## WARN CODE 28
|
||||||
|
|
||||||
@ -239,8 +251,8 @@ Cannot vertex attribute integer point when specified as float. Use 'set' or 'poi
|
|||||||
Redefinition of shader $1: '$2'
|
Redefinition of shader $1: '$2'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:定义了重复的着色器变量/顶点属性/UBO 等。
|
- 警告原因:定义了重复的着色器变量/顶点属性/UBO 等。
|
||||||
- 解决方案:避免对同一个变量调用多次 `defineXxxx`。
|
- 解决方案:避免对同一个变量调用多次 `defineXxxx`。
|
||||||
|
|
||||||
## WARN CODE 29
|
## WARN CODE 29
|
||||||
|
|
||||||
@ -248,8 +260,8 @@ Redefinition of shader $1: '$2'
|
|||||||
Cannot define new texture since texture index is larger than max texture count.
|
Cannot define new texture since texture index is larger than max texture count.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:定义的纹理数量超过了设备支持的上限。
|
- 警告原因:定义的纹理数量超过了设备支持的上限。
|
||||||
- 解决方案:考虑将多个纹理合并为同一个纹理作为图集,然后使用顶点属性或一致变量进行裁剪。
|
- 解决方案:考虑将多个纹理合并为同一个纹理作为图集,然后使用顶点属性或一致变量进行裁剪。
|
||||||
|
|
||||||
## WARN CODE 30
|
## WARN CODE 30
|
||||||
|
|
||||||
@ -257,8 +269,8 @@ Cannot define new texture since texture index is larger than max texture count.
|
|||||||
Cannot use indices named $1 since no definition for it. Please define it in advance.
|
Cannot use indices named $1 since no definition for it. Please define it in advance.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:要作为顶点索引的索引数组不存在,因为没有定义。
|
- 警告原因:要作为顶点索引的索引数组不存在,因为没有定义。
|
||||||
- 解决方案:提前定义索引数组。
|
- 解决方案:提前定义索引数组。
|
||||||
|
|
||||||
## WARN CODE 31
|
## WARN CODE 31
|
||||||
|
|
||||||
@ -266,8 +278,8 @@ Cannot use indices named $1 since no definition for it. Please define it in adva
|
|||||||
Cannot use indices since the indices instance is not belong to the program.
|
Cannot use indices since the indices instance is not belong to the program.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:使用的顶点索引数组不属于当前着色器程序。
|
- 警告原因:使用的顶点索引数组不属于当前着色器程序。
|
||||||
- 解决方案:确保使用的顶点索引数组是由当前着色器程序创建的。
|
- 解决方案:确保使用的顶点索引数组是由当前着色器程序创建的。
|
||||||
|
|
||||||
## WARN CODE 32
|
## WARN CODE 32
|
||||||
|
|
||||||
@ -275,8 +287,8 @@ Cannot use indices since the indices instance is not belong to the program.
|
|||||||
Sub-image exceeds texture dimensions, auto adjusting size.
|
Sub-image exceeds texture dimensions, auto adjusting size.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:使用 `IShaderTexture.sub` 时,传入的图像数据超出了纹理大小。
|
- 警告原因:使用 `IShaderTexture.sub` 时,传入的图像数据超出了纹理大小。
|
||||||
- 解决方案:确保传入的图片不会超出纹理大小。如果需要修改纹理大小,请使用 `IShaderTexture.set` 方法。
|
- 解决方案:确保传入的图片不会超出纹理大小。如果需要修改纹理大小,请使用 `IShaderTexture.set` 方法。
|
||||||
|
|
||||||
## WARN CODE 33
|
## WARN CODE 33
|
||||||
|
|
||||||
@ -284,8 +296,7 @@ Sub-image exceeds texture dimensions, auto adjusting size.
|
|||||||
Cannot modify MotaOffscreenCanvas2D that is freezed.
|
Cannot modify MotaOffscreenCanvas2D that is freezed.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能修改已冻结的画布属性。
|
- 遇不到这个报错。
|
||||||
- 解决方案:如果这个画布后续还需要修改属性,那么就不要冻结它。
|
|
||||||
|
|
||||||
## WARN CODE 34
|
## WARN CODE 34
|
||||||
|
|
||||||
@ -293,8 +304,8 @@ Cannot modify MotaOffscreenCanvas2D that is freezed.
|
|||||||
Repeated render tag registration: '$1'.
|
Repeated render tag registration: '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:注册了重复的渲染标签。
|
- 警告原因:注册了重复的渲染标签。
|
||||||
- 解决方案:确保注册的渲染标签名称不重复。
|
- 解决方案:确保注册的渲染标签名称不重复。
|
||||||
|
|
||||||
## WARN CODE 35
|
## WARN CODE 35
|
||||||
|
|
||||||
@ -302,8 +313,8 @@ Repeated render tag registration: '$1'.
|
|||||||
Cannot append child on plain render item, please ensure you have overrided 'appendChild' method in your own element.
|
Cannot append child on plain render item, please ensure you have overrided 'appendChild' method in your own element.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:默认的渲染元素中,只有一部分可以添加子元素,而其他的不能添加。
|
- 警告原因:默认的渲染元素中,只有一部分可以添加子元素,而其他的不能添加。
|
||||||
- 解决方案:不要在不能添加子元素的元素里面添加子元素。如果是自定义元素,请确保实现了 `appendChild` 方法。
|
- 解决方案:不要在不能添加子元素的元素里面添加子元素。如果是自定义元素,请确保实现了 `appendChild` 方法。
|
||||||
|
|
||||||
## WARN CODE 36
|
## WARN CODE 36
|
||||||
|
|
||||||
@ -311,8 +322,8 @@ Cannot append child on plain render item, please ensure you have overrided 'appe
|
|||||||
Cannot remove child on plain render item, please ensure you have overrided 'removeChild' method in your own element.
|
Cannot remove child on plain render item, please ensure you have overrided 'removeChild' method in your own element.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:默认的渲染元素中,只有一部分可以移除子元素,而其他的不能移除。
|
- 警告原因:默认的渲染元素中,只有一部分可以移除子元素,而其他的不能移除。
|
||||||
- 解决方案:不要在不能移除子元素的元素里面移除子元素。如果是自定义元素,请确保实现了 `removeChild` 方法。
|
- 解决方案:不要在不能移除子元素的元素里面移除子元素。如果是自定义元素,请确保实现了 `removeChild` 方法。
|
||||||
|
|
||||||
## WARN CODE 37
|
## WARN CODE 37
|
||||||
|
|
||||||
@ -320,8 +331,8 @@ Cannot remove child on plain render item, please ensure you have overrided 'remo
|
|||||||
Cannot execute 'requestSort' on plain render item, please ensure you have overrided 'requestSort' method in your own element.
|
Cannot execute 'requestSort' on plain render item, please ensure you have overrided 'requestSort' method in your own element.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:默认的渲染元素中,只有一部分可以拥有排序功能,而其他的不能排序。
|
- 警告原因:默认的渲染元素中,只有一部分可以拥有排序功能,而其他的不能排序。
|
||||||
- 解决方案:不要在不能拥有子元素的元素上调用 `requestSort`。如果是自定义元素,请确保实现了 `requestSort` 方法。
|
- 解决方案:不要在不能拥有子元素的元素上调用 `requestSort`。如果是自定义元素,请确保实现了 `requestSort` 方法。
|
||||||
|
|
||||||
## WARN CODE 38
|
## WARN CODE 38
|
||||||
|
|
||||||
@ -329,8 +340,8 @@ Cannot execute 'requestSort' on plain render item, please ensure you have overri
|
|||||||
Using plain text in jsx is strongly not recommended, since you can hardly modify its attributes. Consider using Text element instead.
|
Using plain text in jsx is strongly not recommended, since you can hardly modify its attributes. Consider using Text element instead.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:在 JSX 中直接填写文字内容是极其不推荐的,因为你几乎不能修改它的任何属性。
|
- 警告原因:在 JSX 中直接填写文字内容是极其不推荐的,因为你几乎不能修改它的任何属性。
|
||||||
- 解决方案:考虑使用 `text` 标签替代。
|
- 解决方案:考虑使用 `text` 标签替代。
|
||||||
|
|
||||||
## WARN CODE 39
|
## WARN CODE 39
|
||||||
|
|
||||||
@ -338,13 +349,13 @@ Using plain text in jsx is strongly not recommended, since you can hardly modify
|
|||||||
Plain text is not supported outside Text element.
|
Plain text is not supported outside Text element.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能在 `text` 元素外使用变量作为文字,例如:
|
- 警告原因:不能在 `text` 元素外使用变量作为文字,例如:
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
<container>{text.value}</container>
|
<container>{text.value}</container>
|
||||||
```
|
```
|
||||||
|
|
||||||
- 解决方案:换用 `text` 标签。
|
- 解决方案:换用 `text` 标签。
|
||||||
|
|
||||||
## WARN CODE 40
|
## WARN CODE 40
|
||||||
|
|
||||||
@ -352,7 +363,7 @@ Plain text is not supported outside Text element.
|
|||||||
Cannot return canvas that is not provided by this pool.
|
Cannot return canvas that is not provided by this pool.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 遇不到这个报错。
|
- 遇不到这个报错。
|
||||||
|
|
||||||
## WARN CODE 41
|
## WARN CODE 41
|
||||||
|
|
||||||
@ -360,8 +371,8 @@ Cannot return canvas that is not provided by this pool.
|
|||||||
Width of text content components must be positive. receive: $1
|
Width of text content components must be positive. receive: $1
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:`TextContent` 组件的宽度必须是正值,而你可能传入了一个负值或 0。
|
- 警告原因:`TextContent` 组件的宽度必须是正值,而你可能传入了一个负值或 0。
|
||||||
- 解决方案:确保宽度属性是正值。
|
- 解决方案:确保宽度属性是正值。
|
||||||
|
|
||||||
## WARN CODE 42
|
## WARN CODE 42
|
||||||
|
|
||||||
@ -369,8 +380,8 @@ Width of text content components must be positive. receive: $1
|
|||||||
Repeated Textbox id: '$1'.
|
Repeated Textbox id: '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:`Textbox` 组件使用了重复的 id。
|
- 警告原因:`Textbox` 组件使用了重复的 id。
|
||||||
- 解决方案:避免 `Textbox` 组件的 id 重复。
|
- 解决方案:避免 `Textbox` 组件的 id 重复。
|
||||||
|
|
||||||
## WARN CODE 43
|
## WARN CODE 43
|
||||||
|
|
||||||
@ -378,8 +389,8 @@ Repeated Textbox id: '$1'.
|
|||||||
Cannot set icon of '$1', since it does not exists. Please ensure you have delivered correct icon id or number.
|
Cannot set icon of '$1', since it does not exists. Please ensure you have delivered correct icon id or number.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:向 `icon` 元素中传入了不存在的图标。
|
- 警告原因:向 `icon` 元素中传入了不存在的图标。
|
||||||
- 解决方案:确保传入的图标 id 或数字是正确的。
|
- 解决方案:确保传入的图标 id 或数字是正确的。
|
||||||
|
|
||||||
## WARN CODE 44
|
## WARN CODE 44
|
||||||
|
|
||||||
@ -387,8 +398,8 @@ Cannot set icon of '$1', since it does not exists. Please ensure you have delive
|
|||||||
Unexpected end when loading stream audio, reason: '$1'
|
Unexpected end when loading stream audio, reason: '$1'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:加载流式音频时被意外中断。
|
- 警告原因:加载流式音频时被意外中断。
|
||||||
- 解决方案:根据原因解决。
|
- 解决方案:根据原因解决。
|
||||||
|
|
||||||
## WARN CODE 45
|
## WARN CODE 45
|
||||||
|
|
||||||
@ -396,8 +407,8 @@ Unexpected end when loading stream audio, reason: '$1'
|
|||||||
Audio route with id of '$1' has already existed. New route will override old route.
|
Audio route with id of '$1' has already existed. New route will override old route.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:id 为 $1 的音频路由已经存在,新的路由将会覆盖旧路由。
|
- 警告原因:id 为 $1 的音频路由已经存在,新的路由将会覆盖旧路由。
|
||||||
- 解决方案:确保音频路由不会重复。
|
- 解决方案:确保音频路由不会重复。
|
||||||
|
|
||||||
## WARN CODE 46
|
## WARN CODE 46
|
||||||
|
|
||||||
@ -405,8 +416,8 @@ Audio route with id of '$1' has already existed. New route will override old rou
|
|||||||
Cannot pipe new StreamReader object when stream is loading.
|
Cannot pipe new StreamReader object when stream is loading.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:在流式加载过程中无法将流加载对象泵入其他对象。
|
- 警告原因:在流式加载过程中无法将流加载对象泵入其他对象。
|
||||||
- 解决方案:在流式加载前就执行 `pipe` 方法。
|
- 解决方案:在流式加载前就执行 `pipe` 方法。
|
||||||
|
|
||||||
## WARN CODE 47
|
## WARN CODE 47
|
||||||
|
|
||||||
@ -414,8 +425,8 @@ Cannot pipe new StreamReader object when stream is loading.
|
|||||||
Audio stream decoder for audio type '$1' has already existed.
|
Audio stream decoder for audio type '$1' has already existed.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:$1 类型的音频解码器已经存在。
|
- 警告原因:$1 类型的音频解码器已经存在。
|
||||||
- 解决方案:不要为同一种类型的音频注册多种解码器。
|
- 解决方案:不要为同一种类型的音频注册多种解码器。
|
||||||
|
|
||||||
## WARN CODE 48
|
## WARN CODE 48
|
||||||
|
|
||||||
@ -423,8 +434,8 @@ Audio stream decoder for audio type '$1' has already existed.
|
|||||||
Sample rate in stream audio must be constant.
|
Sample rate in stream audio must be constant.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:流式音频中,音频的采样率应该保持一致。
|
- 警告原因:流式音频中,音频的采样率应该保持一致。
|
||||||
- 解决方案:确保音频的采样率不会改变,如果会的话,请换一个音频。
|
- 解决方案:确保音频的采样率不会改变,如果会的话,请换一个音频。
|
||||||
|
|
||||||
## WARN CODE 49
|
## WARN CODE 49
|
||||||
|
|
||||||
@ -432,8 +443,8 @@ Sample rate in stream audio must be constant.
|
|||||||
Repeated patch for '$1', key: '$2'.
|
Repeated patch for '$1', key: '$2'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:对同一个 2.x 样板接口重写了两次。
|
- 警告原因:对同一个 2.x 样板接口重写了两次。
|
||||||
- 解决方案:将两次重写合并为一次。
|
- 解决方案:将两次重写合并为一次。
|
||||||
|
|
||||||
## WARN CODE 50
|
## WARN CODE 50
|
||||||
|
|
||||||
@ -441,5 +452,5 @@ Repeated patch for '$1', key: '$2'.
|
|||||||
Unknown audio extension name: '$1'
|
Unknown audio extension name: '$1'
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:未知的文件拓展名 $1。
|
- 警告原因:未知的文件拓展名 $1。
|
||||||
- 解决方案:换一个类型的音频。
|
- 解决方案:换一个类型的音频。
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
Cannot decode sound '$1', since audio file may not supported by 2.b.
|
Cannot decode sound '$1', since audio file may not supported by 2.b.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能解码音效 $1,可能因为文件类型不支持。
|
- 警告原因:不能解码音效 $1,可能因为文件类型不支持。
|
||||||
- 解决方案:换一个音乐文件格式,建议使用 `opus` 格式。
|
- 解决方案:换一个音乐文件格式,建议使用 `opus` 格式。
|
||||||
|
|
||||||
## WARN CODE 52
|
## WARN CODE 52
|
||||||
|
|
||||||
@ -15,8 +15,8 @@ Cannot decode sound '$1', since audio file may not supported by 2.b.
|
|||||||
Cannot play sound '$1', since there is no added data named it.
|
Cannot play sound '$1', since there is no added data named it.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:播放了不存在的音效。
|
- 警告原因:播放了不存在的音效。
|
||||||
- 解决方案:确保要播放音效名称正确。
|
- 解决方案:确保要播放音效名称正确。
|
||||||
|
|
||||||
## WARN CODE 53
|
## WARN CODE 53
|
||||||
|
|
||||||
@ -24,8 +24,8 @@ Cannot play sound '$1', since there is no added data named it.
|
|||||||
Cannot $1 audio route '$2', since there is not added route named it.
|
Cannot $1 audio route '$2', since there is not added route named it.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:不能对 $2 路由执行 $1(播放、暂停等)操作,因为没有名字叫这个的音频路由。
|
- 警告原因:不能对 $2 路由执行 $1(播放、暂停等)操作,因为没有名字叫这个的音频路由。
|
||||||
- 解决方案:确保要操作的路由存在。
|
- 解决方案:确保要操作的路由存在。
|
||||||
|
|
||||||
## WARN CODE 54
|
## WARN CODE 54
|
||||||
|
|
||||||
@ -33,8 +33,8 @@ Cannot $1 audio route '$2', since there is not added route named it.
|
|||||||
Missing start tag for '$1', index: $2.
|
Missing start tag for '$1', index: $2.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:在 `TextContent` 组件中,匹配不到转义字符 $1 的起始位置。
|
- 警告原因:在 `TextContent` 组件中,匹配不到转义字符 $1 的起始位置。
|
||||||
- 解决方案:确保每个转义字符包含起始标签。
|
- 解决方案:确保每个转义字符包含起始标签。
|
||||||
|
|
||||||
## WARN CODE 55
|
## WARN CODE 55
|
||||||
|
|
||||||
@ -42,8 +42,8 @@ Missing start tag for '$1', index: $2.
|
|||||||
Unchildable tag '$1' should follow with param.
|
Unchildable tag '$1' should follow with param.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:在 `TextContent` 组件中,没有子标签的转义字符(`\i`)后面必须跟着参数。
|
- 警告原因:在 `TextContent` 组件中,没有子标签的转义字符(`\i`)后面必须跟着参数。
|
||||||
- 解决方案:确保 `\i` 后面紧跟着图标名称,例如 `\i[greenSlime]`。
|
- 解决方案:确保 `\i` 后面紧跟着图标名称,例如 `\i[greenSlime]`。
|
||||||
|
|
||||||
## WARN CODE 56
|
## WARN CODE 56
|
||||||
|
|
||||||
@ -51,8 +51,8 @@ Unchildable tag '$1' should follow with param.
|
|||||||
Method '$1' has been deprecated. Consider using '$2' instead.
|
Method '$1' has been deprecated. Consider using '$2' instead.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:接口 $1 已经弃用。
|
- 警告原因:接口 $1 已经弃用。
|
||||||
- 解决方案:考虑换为 $2。
|
- 解决方案:考虑换为 $2。
|
||||||
|
|
||||||
## WARN CODE 57
|
## WARN CODE 57
|
||||||
|
|
||||||
@ -60,8 +60,8 @@ Method '$1' has been deprecated. Consider using '$2' instead.
|
|||||||
Repeated UI controller id '$1'.
|
Repeated UI controller id '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:重复的 UI 控制器 id。
|
- 警告原因:重复的 UI 控制器 id。
|
||||||
- 解决方案:避免 UI 控制器的 id 重复。
|
- 解决方案:避免 UI 控制器的 id 重复。
|
||||||
|
|
||||||
## WARN CODE 58
|
## WARN CODE 58
|
||||||
|
|
||||||
@ -69,8 +69,8 @@ Repeated UI controller id '$1'.
|
|||||||
Fail to set ellipse round rect, since length of 'ellipse' property should only be 2, 4, 6 or 8. delivered: $1
|
Fail to set ellipse round rect, since length of 'ellipse' property should only be 2, 4, 6 or 8. delivered: $1
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:椭圆模式的圆角矩形传入的参数数组需要是 2,4,6,8 长度,而传入了 $1 长度的数组。
|
- 警告原因:椭圆模式的圆角矩形传入的参数数组需要是 2,4,6,8 长度,而传入了 $1 长度的数组。
|
||||||
- 解决方案:确保传入参数正确。
|
- 解决方案:确保传入参数正确。
|
||||||
|
|
||||||
## WARN CODE 59
|
## WARN CODE 59
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ Fail to set ellipse round rect, since length of 'ellipse' property should only b
|
|||||||
Unknown icon '$1' in parsing text content.
|
Unknown icon '$1' in parsing text content.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:在 `TextContent` 中出现了未知的图标。
|
- 警告原因:在 `TextContent` 中出现了未知的图标。
|
||||||
- 解决方案:确保 `\i` 后的图标参数正确。
|
- 解决方案:确保 `\i` 后的图标参数正确。
|
||||||
|
|
||||||
## WARN CODE 60
|
## WARN CODE 60
|
||||||
|
|
||||||
@ -87,8 +87,8 @@ Unknown icon '$1' in parsing text content.
|
|||||||
Repeated Tip id: '$1'.
|
Repeated Tip id: '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:`Tip` 组件的 id 重复。
|
- 警告原因:`Tip` 组件的 id 重复。
|
||||||
- 解决方案:避免 id 重复。
|
- 解决方案:避免 id 重复。
|
||||||
|
|
||||||
## WARN CODE 61
|
## WARN CODE 61
|
||||||
|
|
||||||
@ -96,8 +96,8 @@ Repeated Tip id: '$1'.
|
|||||||
Unexpected recursive call of $1.update?$2 in render function. Please ensure you have to do this, if you do, ignore this warn.
|
Unexpected recursive call of $1.update?$2 in render function. Please ensure you have to do this, if you do, ignore this warn.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:在渲染元素的渲染函数中出现了递归 `update` 调用,这会导致元素一直更新而且难以察觉,同时也会引起性能问题。
|
- 警告原因:在渲染元素的渲染函数中出现了递归 `update` 调用,这会导致元素一直更新而且难以察觉,同时也会引起性能问题。
|
||||||
- 解决方案:避免在渲染函数中调用 `update` 方法。如果你必须这么做,请忽视这个警告。
|
- 解决方案:避免在渲染函数中调用 `update` 方法。如果你必须这么做,请忽视这个警告。
|
||||||
|
|
||||||
## WARN CODE 62
|
## WARN CODE 62
|
||||||
|
|
||||||
@ -105,8 +105,8 @@ Unexpected recursive call of $1.update?$2 in render function. Please ensure you
|
|||||||
Recursive fallback fonts in '$1'.
|
Recursive fallback fonts in '$1'.
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:字体回退出现了循环。例如 `font1` -> `font2` -> `font1`。
|
- 警告原因:字体回退出现了循环。例如 `font1` -> `font2` -> `font1`。
|
||||||
- 解决方案:避免出现循环字体回退。
|
- 解决方案:避免出现循环字体回退。
|
||||||
|
|
||||||
## WARN CODE 63
|
## WARN CODE 63
|
||||||
|
|
||||||
@ -114,5 +114,23 @@ Recursive fallback fonts in '$1'.
|
|||||||
Uncaught promise error in waiting box component. Error reason: $1
|
Uncaught promise error in waiting box component. Error reason: $1
|
||||||
```
|
```
|
||||||
|
|
||||||
- 警告原因:在等待 box 组件(选择框、确认框等)时,出现了异步报错。
|
- 警告原因:在等待 box 组件(选择框、确认框等)时,出现了异步报错。
|
||||||
- 解决方案:根据报错内容解决问题。
|
- 解决方案:根据报错内容解决问题。
|
||||||
|
|
||||||
|
## WARN CODE 64
|
||||||
|
|
||||||
|
```txt
|
||||||
|
Text node type and block type mismatch: '$1' vs '$2'
|
||||||
|
```
|
||||||
|
|
||||||
|
- 警告原因:多行文本(TextContent)解析时节点类型和分块类型不一致。
|
||||||
|
- 解决方案:理应不会遇到这个问题,如果遇到了,请到造塔群寻求帮助。
|
||||||
|
|
||||||
|
## WARN CODE 65
|
||||||
|
|
||||||
|
```txt
|
||||||
|
Cannot bind a weather controller twice.
|
||||||
|
```
|
||||||
|
|
||||||
|
- 警告原因:一个天气控制器不能绑定到两个元素上。
|
||||||
|
- 解决方案:如果两个元素需要天气,那么请创建两个天气控制器,一个天气控制器只能绑定一个,且不能解绑。
|
||||||
|
|||||||
@ -715,6 +715,7 @@ export async function routedConfirm(
|
|||||||
const confirm = getChoiceRoute(1) === 0;
|
const confirm = getChoiceRoute(1) === 0;
|
||||||
const timeout = core.control.__replay_getTimeout();
|
const timeout = core.control.__replay_getTimeout();
|
||||||
core.status.route.push(`choices:${confirm ? 0 : 1}`);
|
core.status.route.push(`choices:${confirm ? 0 : 1}`);
|
||||||
|
core.status.replay.toReplay.shift();
|
||||||
if (timeout === 0) return confirm;
|
if (timeout === 0) return confirm;
|
||||||
const instance = controller.open(ConfirmBoxUI, {
|
const instance = controller.open(ConfirmBoxUI, {
|
||||||
...(props ?? {}),
|
...(props ?? {}),
|
||||||
@ -769,6 +770,7 @@ export async function routedChoices<T extends ChoiceKey>(
|
|||||||
const selected = getChoiceRoute(0);
|
const selected = getChoiceRoute(0);
|
||||||
const timeout = core.control.__replay_getTimeout();
|
const timeout = core.control.__replay_getTimeout();
|
||||||
core.status.route.push(`choices:${selected}`);
|
core.status.route.push(`choices:${selected}`);
|
||||||
|
core.status.replay.toReplay.shift();
|
||||||
if (timeout === 0) return choices[selected][0];
|
if (timeout === 0) return choices[selected][0];
|
||||||
const instance = controller.open(ChoicesUI, {
|
const instance = controller.open(ChoicesUI, {
|
||||||
...(props ?? {}),
|
...(props ?? {}),
|
||||||
@ -782,7 +784,7 @@ export async function routedChoices<T extends ChoiceKey>(
|
|||||||
return choices[selected][0];
|
return choices[selected][0];
|
||||||
} else {
|
} else {
|
||||||
const choice = await getChoice(controller, choices, loc, width, props);
|
const choice = await getChoice(controller, choices, loc, width, props);
|
||||||
const index = choices.findIndex(v => v[1] === choice);
|
const index = choices.findIndex(v => v[0] === choice);
|
||||||
core.status.route.push(`choices:${index}`);
|
core.status.route.push(`choices:${index}`);
|
||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -389,6 +389,10 @@ export class Damage extends RenderItem<EDamageEvent> {
|
|||||||
const font = '300 9px Verdana';
|
const font = '300 9px Verdana';
|
||||||
if (dam.damage > 0) {
|
if (dam.damage > 0) {
|
||||||
text = core.formatBigNumber(dam.damage, true);
|
text = core.formatBigNumber(dam.damage, true);
|
||||||
|
} else if (dam.ambush) {
|
||||||
|
text = `!`;
|
||||||
|
} else if (dam.repulse) {
|
||||||
|
text = '阻';
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapDam: DamageRenderable = {
|
const mapDam: DamageRenderable = {
|
||||||
|
|||||||
@ -241,10 +241,10 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const startIndex = getPosIndex(core.saves.saveIndex);
|
const startIndex = getPosIndex(core.saves.saveIndex - 1);
|
||||||
selected.value = startIndex - 1;
|
selected.value = startIndex;
|
||||||
pageRef.value?.changePage(
|
pageRef.value?.changePage(
|
||||||
Math.floor(core.saves.saveIndex / (grid.value.count - 1))
|
Math.floor((core.saves.saveIndex - 1) / (grid.value.count - 1))
|
||||||
);
|
);
|
||||||
updateDataList(now.value);
|
updateDataList(now.value);
|
||||||
});
|
});
|
||||||
@ -380,10 +380,10 @@ export const Save = defineComponent<SaveProps, SaveEmits, keyof SaveEmits>(
|
|||||||
'@save_right',
|
'@save_right',
|
||||||
() => {
|
() => {
|
||||||
const count = grid.value.count;
|
const count = grid.value.count;
|
||||||
if (selected.value < count) {
|
if (selected.value < count - 1) {
|
||||||
selected.value++;
|
selected.value++;
|
||||||
} else {
|
} else {
|
||||||
selected.value = 0;
|
selected.value = 1;
|
||||||
pageRef.value?.movePage(1);
|
pageRef.value?.movePage(1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -48,6 +48,7 @@ export function patchDamage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function renderThumbnailDamage(col: EnemyCollection) {
|
function renderThumbnailDamage(col: EnemyCollection) {
|
||||||
|
if (main.replayChecking) return;
|
||||||
core.status.damage.data = [];
|
core.status.damage.data = [];
|
||||||
core.status.damage.extraData = [];
|
core.status.damage.extraData = [];
|
||||||
|
|
||||||
|
|||||||
@ -590,6 +590,10 @@ export class HeroMover extends ObjectMoverBase {
|
|||||||
// 中毒处理
|
// 中毒处理
|
||||||
if (core.hasFlag('poison')) {
|
if (core.hasFlag('poison')) {
|
||||||
core.status.hero.hp -= core.values.poisonDamage;
|
core.status.hero.hp -= core.values.poisonDamage;
|
||||||
|
if (core.status.hero.hp <= 0) {
|
||||||
|
core.status.hero.hp = 0;
|
||||||
|
core.events.lose();
|
||||||
|
}
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,6 @@ interface PortResponse {
|
|||||||
core.status.maps[data].enemy?.calRealAttribute();
|
core.status.maps[data].enemy?.calRealAttribute();
|
||||||
core.updateStatusBar(true, true);
|
core.updateStatusBar(true, true);
|
||||||
}
|
}
|
||||||
Mota.require('@user/client-modules').Shadow.update(true);
|
|
||||||
const Binder = Mota.require(
|
const Binder = Mota.require(
|
||||||
'@user/client-modules'
|
'@user/client-modules'
|
||||||
).LayerGroupFloorBinder;
|
).LayerGroupFloorBinder;
|
||||||
|
|||||||
@ -357,6 +357,7 @@ export function initFallback() {
|
|||||||
y
|
y
|
||||||
);
|
);
|
||||||
callback?.();
|
callback?.();
|
||||||
|
delete core.animateFrame.asyncId[animate];
|
||||||
};
|
};
|
||||||
|
|
||||||
adapters['door-animate']?.all('openDoor', block).then(cb);
|
adapters['door-animate']?.all('openDoor', block).then(cb);
|
||||||
|
|||||||
@ -2,23 +2,50 @@
|
|||||||
|
|
||||||
export function initUI() {
|
export function initUI() {
|
||||||
if (main.mode === 'editor') return;
|
if (main.mode === 'editor') return;
|
||||||
const { mainUi, fixedUi, mainSetting } = Mota.require('@motajs/legacy-ui');
|
if (!main.replayChecking) {
|
||||||
|
const { mainUi, fixedUi, mainSetting } =
|
||||||
|
Mota.require('@motajs/legacy-ui');
|
||||||
|
|
||||||
ui.prototype.drawBook = function () {
|
ui.prototype.drawBook = function () {
|
||||||
if (!core.isReplaying()) return mainUi.open('book');
|
if (!core.isReplaying()) return mainUi.open('book');
|
||||||
};
|
};
|
||||||
|
|
||||||
ui.prototype._drawToolbox = function () {
|
ui.prototype._drawToolbox = function () {
|
||||||
if (!core.isReplaying()) return mainUi.open('toolbox');
|
if (!core.isReplaying()) return mainUi.open('toolbox');
|
||||||
};
|
};
|
||||||
|
|
||||||
ui.prototype._drawEquipbox = function () {
|
ui.prototype._drawEquipbox = function () {
|
||||||
if (!core.isReplaying()) return mainUi.open('equipbox');
|
if (!core.isReplaying()) return mainUi.open('equipbox');
|
||||||
};
|
};
|
||||||
|
|
||||||
ui.prototype.drawFly = function () {
|
ui.prototype.drawFly = function () {
|
||||||
if (!core.isReplaying()) return mainUi.open('fly');
|
if (!core.isReplaying()) return mainUi.open('fly');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
control.prototype.showStatusBar = function () {
|
||||||
|
if (main.mode === 'editor') return;
|
||||||
|
core.removeFlag('hideStatusBar');
|
||||||
|
if (mainSetting.getValue('ui.tips')) {
|
||||||
|
if (!fixedUi.hasName('tips')) {
|
||||||
|
fixedUi.open('tips');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
core.updateStatusBar();
|
||||||
|
};
|
||||||
|
|
||||||
|
control.prototype.hideStatusBar = function (showToolbox) {
|
||||||
|
if (main.mode === 'editor') return;
|
||||||
|
|
||||||
|
// 如果原本就是隐藏的,则先显示
|
||||||
|
if (!core.domStyle.showStatusBar) this.showStatusBar();
|
||||||
|
if (core.isReplaying()) showToolbox = true;
|
||||||
|
fixedUi.closeByName('tips');
|
||||||
|
|
||||||
|
core.setFlag('hideStatusBar', true);
|
||||||
|
core.setFlag('showToolbox', showToolbox || null);
|
||||||
|
core.updateStatusBar();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
control.prototype.updateStatusBar_update = function () {
|
control.prototype.updateStatusBar_update = function () {
|
||||||
core.control.updateNextFrame = false;
|
core.control.updateNextFrame = false;
|
||||||
@ -29,28 +56,4 @@ export function initUI() {
|
|||||||
core.control.noAutoEvents = true;
|
core.control.noAutoEvents = true;
|
||||||
Mota.require('@user/data-base').hook.emit('statusBarUpdate');
|
Mota.require('@user/data-base').hook.emit('statusBarUpdate');
|
||||||
};
|
};
|
||||||
|
|
||||||
control.prototype.showStatusBar = function () {
|
|
||||||
if (main.mode === 'editor') return;
|
|
||||||
core.removeFlag('hideStatusBar');
|
|
||||||
if (mainSetting.getValue('ui.tips')) {
|
|
||||||
if (!fixedUi.hasName('tips')) {
|
|
||||||
fixedUi.open('tips');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
core.updateStatusBar();
|
|
||||||
};
|
|
||||||
|
|
||||||
control.prototype.hideStatusBar = function (showToolbox) {
|
|
||||||
if (main.mode === 'editor') return;
|
|
||||||
|
|
||||||
// 如果原本就是隐藏的,则先显示
|
|
||||||
if (!core.domStyle.showStatusBar) this.showStatusBar();
|
|
||||||
if (core.isReplaying()) showToolbox = true;
|
|
||||||
fixedUi.closeByName('tips');
|
|
||||||
|
|
||||||
core.setFlag('hideStatusBar', true);
|
|
||||||
core.setFlag('showToolbox', showToolbox || null);
|
|
||||||
core.updateStatusBar();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,10 +26,7 @@
|
|||||||
"24": "Cannot decode source type of '$1', since there is no registered decoder for that type.",
|
"24": "Cannot decode source type of '$1', since there is no registered decoder for that type.",
|
||||||
"25": "Unknown audio type. Header: '$1'",
|
"25": "Unknown audio type. Header: '$1'",
|
||||||
"26": "Uncaught error when fetching stream data from '$1'. Error info: $2.",
|
"26": "Uncaught error when fetching stream data from '$1'. Error info: $2.",
|
||||||
"1101": "Shadow extension needs 'floor-hero' extension as dependency.",
|
"1201": "Floor-damage extension needs 'floor-binder' extension as dependency."
|
||||||
"1201": "Floor-damage extension needs 'floor-binder' extension as dependency.",
|
|
||||||
"1301": "Portal extension need 'floor-binder' extension as dependency.",
|
|
||||||
"1401": "Halo extension needs 'floor-binder' extension as dependency."
|
|
||||||
},
|
},
|
||||||
"warn": {
|
"warn": {
|
||||||
"1": "Resource with type of 'none' is loaded.",
|
"1": "Resource with type of 'none' is loaded.",
|
||||||
@ -97,7 +94,6 @@
|
|||||||
"63": "Uncaught promise error in waiting box component. Error reason: $1",
|
"63": "Uncaught promise error in waiting box component. Error reason: $1",
|
||||||
"64": "Text node type and block type mismatch: '$1' vs '$2'",
|
"64": "Text node type and block type mismatch: '$1' vs '$2'",
|
||||||
"65": "Cannot bind a weather controller twice.",
|
"65": "Cannot bind a weather controller twice.",
|
||||||
"1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency.",
|
"1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency."
|
||||||
"1101": "Cannot add new effect to point effect instance, for there's no more reserve space for it. Please increase the max count of the instance."
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ editor_uievent_wrapper = function (editor) {
|
|||||||
}
|
}
|
||||||
core.saveCanvas('uievent');
|
core.saveCanvas('uievent');
|
||||||
core.status.event.selection = data.selected || 0;
|
core.status.event.selection = data.selected || 0;
|
||||||
core.drawChoices(core.replaceText(data.text), data.choices, data.width, 'uievent');
|
core.drawChoices2(core.replaceText(data.text), data.choices, data.width, 'uievent');
|
||||||
core.status.event.selection = null;
|
core.status.event.selection = null;
|
||||||
core.loadCanvas('uievent');
|
core.loadCanvas('uievent');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -388,12 +388,6 @@ actions.prototype._sys_keyUp_lockControl = function (keyCode, altKey) {
|
|||||||
|
|
||||||
core.status.holdingKeys = [];
|
core.status.holdingKeys = [];
|
||||||
switch (core.status.event.id) {
|
switch (core.status.event.id) {
|
||||||
case 'text':
|
|
||||||
ok() && core.drawText();
|
|
||||||
break;
|
|
||||||
case 'confirmBox':
|
|
||||||
this._keyUpConfirmBox(keyCode);
|
|
||||||
break;
|
|
||||||
case 'action':
|
case 'action':
|
||||||
this._keyUpAction(keyCode);
|
this._keyUpAction(keyCode);
|
||||||
break;
|
break;
|
||||||
@ -530,9 +524,6 @@ actions.prototype._sys_ondown_lockControl = function (x, y, px, py) {
|
|||||||
case 'action':
|
case 'action':
|
||||||
this._clickAction(x, y, px, py);
|
this._clickAction(x, y, px, py);
|
||||||
break;
|
break;
|
||||||
case 'text':
|
|
||||||
core.drawText();
|
|
||||||
break;
|
|
||||||
case 'notes':
|
case 'notes':
|
||||||
this._clickNotes(x, y, px, py);
|
this._clickNotes(x, y, px, py);
|
||||||
break;
|
break;
|
||||||
@ -822,10 +813,6 @@ actions.prototype.keyDownCtrl = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
actions.prototype._sys_keyDownCtrl = function () {
|
actions.prototype._sys_keyDownCtrl = function () {
|
||||||
if (core.status.event.id == 'text') {
|
|
||||||
core.drawText();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
core.status.event.id == 'action' &&
|
core.status.event.id == 'action' &&
|
||||||
core.status.event.data.type == 'text'
|
core.status.event.data.type == 'text'
|
||||||
@ -855,10 +842,6 @@ actions.prototype.longClick = function (x, y, px, py) {
|
|||||||
|
|
||||||
actions.prototype._sys_longClick_lockControl = function (x, y, px, py) {
|
actions.prototype._sys_longClick_lockControl = function (x, y, px, py) {
|
||||||
if (!core.status.lockControl) return false;
|
if (!core.status.lockControl) return false;
|
||||||
if (core.status.event.id == 'text') {
|
|
||||||
core.drawText();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
core.status.event.id == 'action' &&
|
core.status.event.id == 'action' &&
|
||||||
core.status.event.data.type == 'text'
|
core.status.event.data.type == 'text'
|
||||||
@ -976,70 +959,10 @@ actions.prototype._clickConfirmBox = function (x, y, px, py) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
////// 键盘操作确认框时 //////
|
////// 键盘操作确认框时 //////
|
||||||
actions.prototype._keyUpConfirmBox = function (keycode) {
|
actions.prototype._keyUpConfirmBox = function (keycode) {};
|
||||||
if (keycode == 37 || keycode == 39) {
|
|
||||||
core.status.event.selection = 1 - core.status.event.selection;
|
|
||||||
core.playSound('光标移动');
|
|
||||||
core.ui.drawConfirmBox(
|
|
||||||
core.status.event.ui,
|
|
||||||
core.status.event.data.yes,
|
|
||||||
core.status.event.data.no
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (keycode == 13 || keycode == 32 || keycode == 67) {
|
|
||||||
if (core.status.event.selection == 0 && core.status.event.data.yes) {
|
|
||||||
// core.playSound('确定');
|
|
||||||
core.status.event.selection = null;
|
|
||||||
core.status.event.data.yes();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (core.status.event.selection == 1 && core.status.event.data.no) {
|
|
||||||
// core.playSound('确定');
|
|
||||||
core.status.event.selection = null;
|
|
||||||
core.status.event.data.no();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
////// 鼠标在确认框上移动时 //////
|
////// 鼠标在确认框上移动时 //////
|
||||||
actions.prototype._onMoveConfirmBox = function (x, y, px, py) {
|
actions.prototype._onMoveConfirmBox = function (x, y, px, py) {};
|
||||||
if (py >= core._PY_ / 2 && py <= core._PY_ / 2 + 64) {
|
|
||||||
if (px >= core._PX_ / 2 - 70 && px <= core._PX_ / 2 - 10) {
|
|
||||||
if (core.status.event.selection != 0) {
|
|
||||||
core.status.event.selection = 0;
|
|
||||||
core.playSound('光标移动');
|
|
||||||
if (core.status.event.id == 'action') {
|
|
||||||
core.ui.drawConfirmBox(core.status.event.ui.text);
|
|
||||||
} else {
|
|
||||||
core.ui.drawConfirmBox(
|
|
||||||
core.status.event.ui,
|
|
||||||
core.status.event.data.yes,
|
|
||||||
core.status.event.data.no
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (px >= core._PX_ / 2 + 10 && px <= core._PX_ / 2 + 70) {
|
|
||||||
if (core.status.event.selection != 1) {
|
|
||||||
core.status.event.selection = 1;
|
|
||||||
core.playSound('光标移动');
|
|
||||||
if (core.status.event.id == 'action') {
|
|
||||||
core.ui.drawConfirmBox(core.status.event.ui.text);
|
|
||||||
} else {
|
|
||||||
core.ui.drawConfirmBox(
|
|
||||||
core.status.event.ui,
|
|
||||||
core.status.event.data.yes,
|
|
||||||
core.status.event.data.no
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
actions.prototype._clickAction_text = function () {
|
actions.prototype._clickAction_text = function () {
|
||||||
// 正在淡入淡出的话不执行
|
// 正在淡入淡出的话不执行
|
||||||
|
|||||||
@ -1584,7 +1584,8 @@ control.prototype._replay_finished = function () {
|
|||||||
core.status.replay.replaying = true;
|
core.status.replay.replaying = true;
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.pauseReplay();
|
core.pauseReplay();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1639,7 +1640,8 @@ control.prototype._replay_error = function (action, callback) {
|
|||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.stopReplay(true);
|
core.stopReplay(true);
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2212,139 +2214,20 @@ control.prototype.syncSave = function (type) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
control.prototype._syncSave_http = function (type, saves) {
|
control.prototype._syncSave_http = function (type, saves) {
|
||||||
if (!saves) return core.drawText('没有要同步的存档');
|
// Deprecated.
|
||||||
var formData = new FormData();
|
|
||||||
formData.append('type', 'save');
|
|
||||||
formData.append('name', core.firstData.name);
|
|
||||||
formData.append('data', LZString.compressToBase64(JSON.stringify(saves)));
|
|
||||||
formData.append('shorten', '1');
|
|
||||||
|
|
||||||
core.http(
|
|
||||||
'POST',
|
|
||||||
'/games/sync.php',
|
|
||||||
formData,
|
|
||||||
function (data) {
|
|
||||||
var response = JSON.parse(data);
|
|
||||||
if (response.code < 0) {
|
|
||||||
core.drawText(
|
|
||||||
'出错啦!\n无法同步存档到服务器。\n错误原因:' +
|
|
||||||
response.msg
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
core.drawText(
|
|
||||||
(type == 'all'
|
|
||||||
? '所有存档'
|
|
||||||
: '存档' + core.saves.saveIndex) +
|
|
||||||
'同步成功!\n\n您的存档编号+密码: \r[yellow]' +
|
|
||||||
response.code +
|
|
||||||
response.msg +
|
|
||||||
'\r\n\n请牢记以上信息(如截图等),在从服务器\n同步存档时使用。\n\r[yellow]另外请注意,存档同步只会保存一个月的时间。\r'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function (e) {
|
|
||||||
core.drawText('出错啦!\n无法同步存档到服务器。\n错误原因:' + e);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 从服务器加载存档 //////
|
////// 从服务器加载存档 //////
|
||||||
control.prototype.syncLoad = function () {
|
control.prototype.syncLoad = function () {
|
||||||
core.myprompt('请输入存档编号+密码', null, function (idpassword) {
|
// Deprecated.
|
||||||
if (!idpassword) return core.ui._drawSyncSave();
|
|
||||||
if (
|
|
||||||
!/^\d{6}\w{4}$/.test(idpassword) &&
|
|
||||||
!/^\d{4}\w{3}$/.test(idpassword)
|
|
||||||
) {
|
|
||||||
core.drawText('不合法的存档编号+密码!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
core.ui.drawWaiting('正在同步,请稍候...');
|
|
||||||
if (idpassword.length == 7) {
|
|
||||||
core.control._syncLoad_http(
|
|
||||||
idpassword.substring(0, 4),
|
|
||||||
idpassword.substring(4)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
core.control._syncLoad_http(
|
|
||||||
idpassword.substring(0, 6),
|
|
||||||
idpassword.substring(6)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
control.prototype._syncLoad_http = function (id, password) {
|
control.prototype._syncLoad_http = function (id, password) {
|
||||||
var formData = new FormData();
|
// Deprecated.
|
||||||
formData.append('type', 'load');
|
|
||||||
formData.append('name', core.firstData.name);
|
|
||||||
formData.append('id', id);
|
|
||||||
formData.append('password', password);
|
|
||||||
|
|
||||||
core.http(
|
|
||||||
'POST',
|
|
||||||
'/games/sync.php',
|
|
||||||
formData,
|
|
||||||
function (data) {
|
|
||||||
var response = JSON.parse(data);
|
|
||||||
if (response.code == 0) {
|
|
||||||
var msg = null;
|
|
||||||
try {
|
|
||||||
msg = JSON.parse(
|
|
||||||
LZString.decompressFromBase64(response.msg)
|
|
||||||
);
|
|
||||||
} catch (e) {}
|
|
||||||
if (!msg) {
|
|
||||||
try {
|
|
||||||
msg = JSON.parse(response.msg);
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
if (msg) {
|
|
||||||
core.control._syncLoad_write(msg);
|
|
||||||
} else {
|
|
||||||
core.drawText('出错啦!\n存档解析失败!');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
core.drawText(
|
|
||||||
'出错啦!\n无法从服务器同步存档。\n错误原因:' +
|
|
||||||
response.msg
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
function (e) {
|
|
||||||
core.drawText('出错啦!\n无法从服务器同步存档。\n错误原因:' + e);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
control.prototype._syncLoad_write = function (data) {
|
control.prototype._syncLoad_write = function (data) {
|
||||||
if (data instanceof Array) {
|
// Deprecated.
|
||||||
core.status.event.selection = 1;
|
|
||||||
core.ui.drawConfirmBox(
|
|
||||||
'所有本地存档都将被覆盖,确认?',
|
|
||||||
function () {
|
|
||||||
for (var i = 1; i <= 5 * (main.savePages || 30); i++) {
|
|
||||||
if (i <= data.length)
|
|
||||||
core.setLocalForage('save' + i, data[i - 1]);
|
|
||||||
else if (core.saves.ids[i])
|
|
||||||
core.removeLocalForage('save' + i);
|
|
||||||
}
|
|
||||||
core.ui.closePanel();
|
|
||||||
core.drawText('同步成功!\n你的本地所有存档均已被覆盖。');
|
|
||||||
},
|
|
||||||
function () {
|
|
||||||
core.status.event.selection = 0;
|
|
||||||
core.ui._drawSyncSave();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
// 只覆盖单存档
|
|
||||||
core.setLocalForage('save' + core.saves.saveIndex, data, function () {
|
|
||||||
core.drawText(
|
|
||||||
'同步成功!\n单存档已覆盖至存档' + core.saves.saveIndex
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 存档到本地 //////
|
////// 存档到本地 //////
|
||||||
@ -2741,9 +2624,7 @@ control.prototype.unlockControl = function () {
|
|||||||
////// 开启debug模式 //////
|
////// 开启debug模式 //////
|
||||||
control.prototype.debug = function () {
|
control.prototype.debug = function () {
|
||||||
core.setFlag('debug', true);
|
core.setFlag('debug', true);
|
||||||
core.drawText(
|
core.drawTip('[调试模式开启]此模式下按住Ctrl键可以穿墙并忽略一切事件');
|
||||||
'\t[调试模式开启]此模式下按住Ctrl键(或Ctrl+Shift键)可以穿墙并忽略一切事件。\n此模式下将无法上传成绩。'
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
control.prototype._bindRoutePush = function () {
|
control.prototype._bindRoutePush = function () {
|
||||||
|
|||||||
@ -320,6 +320,8 @@ core.prototype.initSync = function (coreData, callback) {
|
|||||||
this._init_platform();
|
this._init_platform();
|
||||||
this._init_others();
|
this._init_others();
|
||||||
|
|
||||||
|
core.initStatus.maps = core.maps._initMaps();
|
||||||
|
|
||||||
core.loader._load(function () {
|
core.loader._load(function () {
|
||||||
core._afterLoadResources(callback);
|
core._afterLoadResources(callback);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -42,7 +42,7 @@ events.prototype._startGame_start = function (hard, seed, route, callback) {
|
|||||||
core.firstData.hero,
|
core.firstData.hero,
|
||||||
hard,
|
hard,
|
||||||
null,
|
null,
|
||||||
core.cloneArray(core.initStatus.maps)
|
core.clone(core.initStatus.maps)
|
||||||
);
|
);
|
||||||
core.setHeroLoc('x', -1);
|
core.setHeroLoc('x', -1);
|
||||||
core.setHeroLoc('y', -1);
|
core.setHeroLoc('y', -1);
|
||||||
@ -120,7 +120,6 @@ events.prototype._startGame_upload = function () {
|
|||||||
|
|
||||||
////// 游戏获胜事件 //////
|
////// 游戏获胜事件 //////
|
||||||
events.prototype.win = function (reason, norank, noexit) {
|
events.prototype.win = function (reason, norank, noexit) {
|
||||||
if (!noexit) core.status.gameOver = true;
|
|
||||||
return this.eventdata.win(reason, norank, noexit);
|
return this.eventdata.win(reason, norank, noexit);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -130,7 +129,6 @@ events.prototype.lose = function (reason) {
|
|||||||
return core.control._replay_error(reason, function () {
|
return core.control._replay_error(reason, function () {
|
||||||
core.lose(reason);
|
core.lose(reason);
|
||||||
});
|
});
|
||||||
core.status.gameOver = true;
|
|
||||||
return this.eventdata.lose(reason);
|
return this.eventdata.lose(reason);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,7 +185,8 @@ events.prototype._gameOver_confirmUpload = function (ending, norank) {
|
|||||||
if (main.isCompetition)
|
if (main.isCompetition)
|
||||||
core.events._gameOver_confirmDownload(ending);
|
core.events._gameOver_confirmDownload(ending);
|
||||||
else core.events._gameOver_doUpload(null, ending, norank);
|
else core.events._gameOver_doUpload(null, ending, norank);
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -251,7 +250,8 @@ events.prototype._gameOver_confirmDownload = function (ending) {
|
|||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
core.events._gameOver_askRate(ending);
|
core.events._gameOver_askRate(ending);
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -284,7 +284,8 @@ events.prototype._gameOver_askRate = function (ending) {
|
|||||||
function () {
|
function () {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.restart();
|
core.restart();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -301,7 +302,8 @@ events.prototype._gameOver_askRate = function (ending) {
|
|||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
core.restart();
|
core.restart();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -327,7 +329,8 @@ events.prototype.confirmRestart = function () {
|
|||||||
function () {
|
function () {
|
||||||
core.playSound('取消');
|
core.playSound('取消');
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
}
|
},
|
||||||
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1563,6 +1566,10 @@ events.prototype.__action_doAsyncFunc = function (isAsync, func) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
events.prototype._action_text = function (data) {
|
events.prototype._action_text = function (data) {
|
||||||
|
if (main.replayChecking) {
|
||||||
|
core.doAction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.__action_checkReplaying()) return;
|
if (this.__action_checkReplaying()) return;
|
||||||
const Store = Mota.require('@user/client-modules').TextboxStore;
|
const Store = Mota.require('@user/client-modules').TextboxStore;
|
||||||
const { textbox = 'main-textbox', text, icon = 'none', title = '' } = data;
|
const { textbox = 'main-textbox', text, icon = 'none', title = '' } = data;
|
||||||
@ -1592,6 +1599,10 @@ events.prototype._action_text = function (data) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
events.prototype._action_autoText = function (data) {
|
events.prototype._action_autoText = function (data) {
|
||||||
|
if (main.replayChecking) {
|
||||||
|
core.doAction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.__action_checkReplaying()) return;
|
if (this.__action_checkReplaying()) return;
|
||||||
const Store = Mota.require('@user/client-modules').TextboxStore;
|
const Store = Mota.require('@user/client-modules').TextboxStore;
|
||||||
const { textbox = 'main-textbox', text, icon = 'none', title = '' } = data;
|
const { textbox = 'main-textbox', text, icon = 'none', title = '' } = data;
|
||||||
@ -1638,6 +1649,10 @@ events.prototype._action__label = function (data, x, y, prefix) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
events.prototype._action_setText = function (data) {
|
events.prototype._action_setText = function (data) {
|
||||||
|
if (main.replayChecking) {
|
||||||
|
core.doAction();
|
||||||
|
return;
|
||||||
|
}
|
||||||
const isNil = value => value === null || value === void 0;
|
const isNil = value => value === null || value === void 0;
|
||||||
const { textbox = 'main-textbox' } = data;
|
const { textbox = 'main-textbox' } = data;
|
||||||
const Store = Mota.require('@user/client-modules').TextboxStore;
|
const Store = Mota.require('@user/client-modules').TextboxStore;
|
||||||
@ -1740,7 +1755,7 @@ events.prototype._action_confirm = function (data, x, y, prefix) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
events.prototype._action_choices = function (data, x, y, prefix) {
|
events.prototype._action_choices = function (data, x, y, prefix) {
|
||||||
core.ui.drawChoices(
|
core.ui.drawChoices2(
|
||||||
core.replaceText(data.text, prefix),
|
core.replaceText(data.text, prefix),
|
||||||
data.choices,
|
data.choices,
|
||||||
data.width
|
data.width
|
||||||
|
|||||||
@ -3682,112 +3682,12 @@ maps.prototype._moveDetachedBlock = function (
|
|||||||
opacity,
|
opacity,
|
||||||
canvases
|
canvases
|
||||||
) {
|
) {
|
||||||
var height = blockInfo.height,
|
// Deprecated.
|
||||||
posX = blockInfo.posX,
|
|
||||||
posY = blockInfo.posY,
|
|
||||||
image = blockInfo.image;
|
|
||||||
var headCanvas = canvases.headCanvas,
|
|
||||||
bodyCanvas = canvases.bodyCanvas,
|
|
||||||
damageCanvas = canvases.damageCanvas;
|
|
||||||
if (headCanvas) {
|
|
||||||
core.dymCanvas[headCanvas].clearRect(0, 0, 32, height);
|
|
||||||
core.dymCanvas[headCanvas].drawImage(
|
|
||||||
image,
|
|
||||||
posX * 32,
|
|
||||||
posY * height,
|
|
||||||
32,
|
|
||||||
height - 32,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
32,
|
|
||||||
height - 32
|
|
||||||
);
|
|
||||||
core.relocateCanvas(
|
|
||||||
headCanvas,
|
|
||||||
nowX - core.bigmap.offsetX,
|
|
||||||
nowY + 32 - height - core.bigmap.offsetY
|
|
||||||
);
|
|
||||||
core.setOpacity(headCanvas, opacity);
|
|
||||||
}
|
|
||||||
if (bodyCanvas) {
|
|
||||||
if (blockInfo.bigImage) {
|
|
||||||
var face = blockInfo.face;
|
|
||||||
if (!blockInfo.faceIds) face = 'down';
|
|
||||||
else if (!blockInfo.faceIds[face]) {
|
|
||||||
// 维持此时朝向
|
|
||||||
face = 'down';
|
|
||||||
for (var f in blockInfo.faceIds) {
|
|
||||||
if (blockInfo.faceIds[f] == blockInfo.id) {
|
|
||||||
face = f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var bigImageInfo = this._getBigImageInfo(
|
|
||||||
blockInfo.bigImage,
|
|
||||||
face,
|
|
||||||
blockInfo.posX
|
|
||||||
);
|
|
||||||
var per_width = bigImageInfo.per_width,
|
|
||||||
per_height = bigImageInfo.per_height;
|
|
||||||
core.dymCanvas[bodyCanvas].clearRect(
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
bigImageInfo.per_width,
|
|
||||||
bigImageInfo.per_height
|
|
||||||
);
|
|
||||||
core.dymCanvas[bodyCanvas].drawImage(
|
|
||||||
blockInfo.bigImage,
|
|
||||||
bigImageInfo.sx,
|
|
||||||
bigImageInfo.sy,
|
|
||||||
per_width,
|
|
||||||
per_height,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
per_width,
|
|
||||||
per_height
|
|
||||||
);
|
|
||||||
core.relocateCanvas(
|
|
||||||
bodyCanvas,
|
|
||||||
nowX - core.bigmap.offsetX + bigImageInfo.dx,
|
|
||||||
nowY - core.bigmap.offsetY + bigImageInfo.dy
|
|
||||||
);
|
|
||||||
core.setOpacity(bodyCanvas, opacity);
|
|
||||||
} else {
|
|
||||||
core.dymCanvas[bodyCanvas].clearRect(0, 0, 32, 32);
|
|
||||||
core.dymCanvas[bodyCanvas].drawImage(
|
|
||||||
image,
|
|
||||||
posX * 32,
|
|
||||||
posY * height + height - 32,
|
|
||||||
32,
|
|
||||||
32,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
32,
|
|
||||||
32
|
|
||||||
);
|
|
||||||
core.relocateCanvas(
|
|
||||||
bodyCanvas,
|
|
||||||
nowX - core.bigmap.offsetX,
|
|
||||||
nowY - core.bigmap.offsetY
|
|
||||||
);
|
|
||||||
core.setOpacity(bodyCanvas, opacity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (damageCanvas) {
|
|
||||||
core.relocateCanvas(
|
|
||||||
damageCanvas,
|
|
||||||
nowX - core.bigmap.offsetX,
|
|
||||||
nowY - core.bigmap.offsetY
|
|
||||||
);
|
|
||||||
core.setOpacity(damageCanvas, opacity);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 删除独立的block canvas //////
|
////// 删除独立的block canvas //////
|
||||||
maps.prototype._deleteDetachedBlock = function (canvases) {
|
maps.prototype._deleteDetachedBlock = function (canvases) {
|
||||||
core.deleteCanvas(canvases.headCanvas);
|
// Deprecated.
|
||||||
core.deleteCanvas(canvases.bodyCanvas);
|
|
||||||
core.deleteCanvas(canvases.damageCanvas);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
maps.prototype._getAndRemoveBlock = function (x, y) {
|
maps.prototype._getAndRemoveBlock = function (x, y) {
|
||||||
|
|||||||
@ -2228,7 +2228,7 @@ ui.prototype.textImage = function (content, lineHeight) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
////// 绘制一个选项界面 //////
|
////// 绘制一个选项界面 //////
|
||||||
ui.prototype.drawChoices = async function (content, choices, width) {
|
ui.prototype.drawChoices2 = async function (content, choices, width, noRoute) {
|
||||||
if (main.replayChecking) {
|
if (main.replayChecking) {
|
||||||
const selected = (() => {
|
const selected = (() => {
|
||||||
const route = core.status.replay.toReplay[0];
|
const route = core.status.replay.toReplay[0];
|
||||||
@ -2238,18 +2238,21 @@ ui.prototype.drawChoices = async function (content, choices, width) {
|
|||||||
return Number(route.slice(8));
|
return Number(route.slice(8));
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
core.status.replay.toReplay.shift();
|
||||||
core.insertAction(choices[selected].action);
|
core.insertAction(choices[selected].action);
|
||||||
core.doAction();
|
core.doAction();
|
||||||
} else {
|
} else {
|
||||||
const {
|
const {
|
||||||
routedChoices,
|
routedChoices,
|
||||||
|
getChoices,
|
||||||
mainUIController,
|
mainUIController,
|
||||||
HALF_WIDTH,
|
HALF_WIDTH,
|
||||||
HALF_HEIGHT,
|
HALF_HEIGHT,
|
||||||
POP_BOX_WIDTH
|
POP_BOX_WIDTH
|
||||||
} = Mota.require('@user/client-modules');
|
} = Mota.require('@user/client-modules');
|
||||||
const choice = choices.map((v, i) => [i, v.text]);
|
const choice = choices.map((v, i) => [i, v.text]);
|
||||||
const selected = await routedChoices(
|
const fn = noRoute ? getChoices : routedChoices;
|
||||||
|
const selected = await fn(
|
||||||
mainUIController,
|
mainUIController,
|
||||||
choice,
|
choice,
|
||||||
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
||||||
@ -2282,7 +2285,7 @@ ui.prototype.drawConfirmBox = async function (
|
|||||||
text,
|
text,
|
||||||
yesCallback,
|
yesCallback,
|
||||||
noCallback,
|
noCallback,
|
||||||
ctx
|
noRoute
|
||||||
) {
|
) {
|
||||||
if (main.replayChecking) {
|
if (main.replayChecking) {
|
||||||
const confirm = (() => {
|
const confirm = (() => {
|
||||||
@ -2293,6 +2296,7 @@ ui.prototype.drawConfirmBox = async function (
|
|||||||
return Number(route.slice(8)) === 1;
|
return Number(route.slice(8)) === 1;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
core.status.replay.toReplay.shift();
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
yesCallback?.();
|
yesCallback?.();
|
||||||
} else {
|
} else {
|
||||||
@ -2301,12 +2305,14 @@ ui.prototype.drawConfirmBox = async function (
|
|||||||
} else {
|
} else {
|
||||||
const {
|
const {
|
||||||
routedConfirm,
|
routedConfirm,
|
||||||
|
getConfirm,
|
||||||
mainUIController,
|
mainUIController,
|
||||||
HALF_WIDTH,
|
HALF_WIDTH,
|
||||||
HALF_HEIGHT,
|
HALF_HEIGHT,
|
||||||
POP_BOX_WIDTH
|
POP_BOX_WIDTH
|
||||||
} = Mota.require('@user/client-modules');
|
} = Mota.require('@user/client-modules');
|
||||||
const confirm = await routedConfirm(
|
const fn = noRoute ? getConfirm : routedConfirm;
|
||||||
|
const confirm = await fn(
|
||||||
mainUIController,
|
mainUIController,
|
||||||
text,
|
text,
|
||||||
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
[HALF_WIDTH, HALF_HEIGHT, void 0, void 0, 0.5, 0.5],
|
||||||
@ -2369,7 +2375,7 @@ ui.prototype._drawQuickShop = function () {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
choices.push('返回游戏');
|
choices.push('返回游戏');
|
||||||
this.drawChoices(null, choices);
|
this.drawChoices(null, choices, void 0, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
ui.prototype._drawSyncSave = function () {
|
ui.prototype._drawSyncSave = function () {
|
||||||
|
|||||||
@ -109,7 +109,7 @@ function main() {
|
|||||||
this.canvas = {};
|
this.canvas = {};
|
||||||
|
|
||||||
this.__VERSION__ = '2.10.0';
|
this.__VERSION__ = '2.10.0';
|
||||||
this.__VERSION_CODE__ = 510;
|
this.__VERSION_CODE__ = 610;
|
||||||
}
|
}
|
||||||
// >>>> body end
|
// >>>> body end
|
||||||
|
|
||||||
@ -183,15 +183,12 @@ main.prototype.loadSync = function (mode, callback) {
|
|||||||
coreData[t] = main[t];
|
coreData[t] = main[t];
|
||||||
});
|
});
|
||||||
|
|
||||||
core.initSync(coreData, callback);
|
core.initSync(coreData, () => {});
|
||||||
main.loading.emit('coreInit');
|
main.loading.emit('coreInit');
|
||||||
core.initStatus.maps = core.maps._initMaps();
|
|
||||||
core.resize();
|
core.resize();
|
||||||
main.core = core;
|
main.core = core;
|
||||||
|
|
||||||
core.completeAchievement = () => 0;
|
callback?.();
|
||||||
|
|
||||||
core.plugin = { drawLight: 0 };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
main.prototype.loadAsync = async function (mode, callback) {
|
main.prototype.loadAsync = async function (mode, callback) {
|
||||||
|
|||||||
@ -185,9 +185,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
},
|
},
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"followers": [],
|
"followers": [],
|
||||||
"steps": 0,
|
"steps": 0
|
||||||
"magicDef": 0,
|
|
||||||
"magicRed": 0
|
|
||||||
},
|
},
|
||||||
"startCanvas": [
|
"startCanvas": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -295,6 +295,7 @@ main.floors.sample1=
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "hide",
|
"type": "hide",
|
||||||
|
"remove": true,
|
||||||
"time": 500
|
"time": 500
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -17,6 +17,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
core.status.played = true;
|
core.status.played = true;
|
||||||
// 初始化人物,图标,统计信息
|
// 初始化人物,图标,统计信息
|
||||||
core.status.hero = core.clone(hero);
|
core.status.hero = core.clone(hero);
|
||||||
|
core.status.hero.buff ??= {};
|
||||||
window.hero = core.status.hero;
|
window.hero = core.status.hero;
|
||||||
window.flags = core.status.hero.flags;
|
window.flags = core.status.hero.flags;
|
||||||
core.events.setHeroIcon(core.status.hero.image, true);
|
core.events.setHeroIcon(core.status.hero.image, true);
|
||||||
@ -56,27 +57,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
} else {
|
} else {
|
||||||
flags.autoSkill ??= true;
|
flags.autoSkill ??= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 兼容性调整
|
|
||||||
const h = core.status.hero;
|
|
||||||
if (h.magicDef === void 0 || h.magicDef === null) {
|
|
||||||
h.magicDef = 0;
|
|
||||||
}
|
|
||||||
if (!core.status.hero.buff) {
|
|
||||||
const buff = {};
|
|
||||||
core.status.hero.buff = buff;
|
|
||||||
const toDelete = [];
|
|
||||||
for (const [key, value] of Object.entries(flags)) {
|
|
||||||
if (/__\w+_buff__/.test(key)) {
|
|
||||||
const name = key.slice(2, -7);
|
|
||||||
buff[name] = value;
|
|
||||||
toDelete.push(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
toDelete.forEach(v => {
|
|
||||||
delete flags[v];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
win: function (reason, norank, noexit) {
|
win: function (reason, norank, noexit) {
|
||||||
// 游戏获胜事件
|
// 游戏获胜事件
|
||||||
@ -88,30 +68,23 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
core.status.extraEvent = core.clone(core.status.event);
|
core.status.extraEvent = core.clone(core.status.event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reason === '智慧之始') {
|
|
||||||
core.status.hero.hp +=
|
|
||||||
core.itemCount('yellowKey') * 5000 +
|
|
||||||
core.itemCount('blueKey') * 15000;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 游戏获胜事件
|
// 游戏获胜事件
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
var replaying = core.isReplaying();
|
var replaying = core.isReplaying();
|
||||||
if (replaying) core.stopReplay();
|
if (replaying) core.stopReplay();
|
||||||
core.waitHeroToStop(function () {
|
core.waitHeroToStop(function () {
|
||||||
if (!noexit) {
|
|
||||||
core.clearMap('all'); // 清空全地图
|
|
||||||
core.deleteAllCanvas(); // 删除所有创建的画布
|
|
||||||
}
|
|
||||||
reason = core.replaceText(reason);
|
reason = core.replaceText(reason);
|
||||||
core.drawText(
|
core.insertAction(
|
||||||
[
|
{
|
||||||
'\t[' +
|
type: 'text',
|
||||||
(reason || '恭喜通关') +
|
text: '你的分数是' + core.status.hero.hp,
|
||||||
']你的分数是${status:hp}。'
|
title: reason ?? '恭喜通关'
|
||||||
],
|
},
|
||||||
function () {
|
void 0,
|
||||||
core.events.gameOver(reason || '', replaying, norank);
|
void 0,
|
||||||
|
() => {
|
||||||
|
core.events.gameOver(reason ?? '', replaying, norank);
|
||||||
|
if (!noexit) core.status.gameOver = true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -122,10 +95,17 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
var replaying = core.isReplaying();
|
var replaying = core.isReplaying();
|
||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
core.waitHeroToStop(function () {
|
core.waitHeroToStop(function () {
|
||||||
core.drawText(
|
core.insertAction(
|
||||||
['\t[' + (reason || '结局1') + ']你死了。\n如题。'],
|
{
|
||||||
function () {
|
type: 'text',
|
||||||
|
text: '你死了。\n如题。',
|
||||||
|
title: reason ?? '结局1'
|
||||||
|
},
|
||||||
|
void 0,
|
||||||
|
void 0,
|
||||||
|
() => {
|
||||||
core.events.gameOver(null, replaying);
|
core.events.gameOver(null, replaying);
|
||||||
|
core.status.gameOver = true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -165,21 +145,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
if (bgm instanceof Array) bgm = bgm[0];
|
if (bgm instanceof Array) bgm = bgm[0];
|
||||||
if (!core.hasFlag('__bgm__')) core.playBgm(bgm);
|
if (!core.hasFlag('__bgm__')) core.playBgm(bgm);
|
||||||
}
|
}
|
||||||
// 更改画面色调
|
|
||||||
var color = core.getFlag('__color__', null);
|
|
||||||
if (!color && core.status.maps[floorId].color)
|
|
||||||
color = core.status.maps[floorId].color;
|
|
||||||
core.clearMap('curtain');
|
|
||||||
core.status.curtainColor = color;
|
|
||||||
if (color)
|
|
||||||
core.fillRect(
|
|
||||||
'curtain',
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
core._PX_,
|
|
||||||
core._PY_,
|
|
||||||
core.arrayToRGBA(color)
|
|
||||||
);
|
|
||||||
// 更改天气
|
// 更改天气
|
||||||
var weather = core.getFlag('__weather__', null);
|
var weather = core.getFlag('__weather__', null);
|
||||||
if (!weather && core.status.maps[floorId].weather)
|
if (!weather && core.status.maps[floorId].weather)
|
||||||
@ -228,8 +193,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
core.visitFloor(floorId);
|
core.visitFloor(floorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (!flags.debug && !main.replayChecking)
|
|
||||||
// Mota.require('completion_r').checkVisitedFloor();
|
|
||||||
Mota.require('@user/data-base').hook.emit(
|
Mota.require('@user/data-base').hook.emit(
|
||||||
'afterChangeFloor',
|
'afterChangeFloor',
|
||||||
floorId
|
floorId
|
||||||
@ -342,16 +305,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
|
|
||||||
core.removeFlag('__fromLoad__');
|
core.removeFlag('__fromLoad__');
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
|
|
||||||
Mota.r(() => {
|
|
||||||
if (flags.onChase) {
|
|
||||||
const chase = Mota.require(
|
|
||||||
'@user/legacy-plugin-client'
|
|
||||||
);
|
|
||||||
const controller = chase.initChase(0);
|
|
||||||
controller.start(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Mota.require('@user/data-base').hook.emit('loadData');
|
Mota.require('@user/data-base').hook.emit('loadData');
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import { RequiredData, RequiredIconsData, ResourceType } from './types';
|
|||||||
import { splitResource, SplittedResource } from './build-resource';
|
import { splitResource, SplittedResource } from './build-resource';
|
||||||
import { formatSize } from './utils';
|
import { formatSize } from './utils';
|
||||||
|
|
||||||
|
const DEBUG_REPLAY = false;
|
||||||
|
|
||||||
const ansi = {
|
const ansi = {
|
||||||
clear: '\x1b[2J\x1b[0f'
|
clear: '\x1b[2J\x1b[0f'
|
||||||
};
|
};
|
||||||
@ -92,7 +94,8 @@ async function buildData(outDir: string, entry: string) {
|
|||||||
name: 'ProcessData',
|
name: 'ProcessData',
|
||||||
fileName: 'data',
|
fileName: 'data',
|
||||||
formats: ['iife']
|
formats: ['iife']
|
||||||
}
|
},
|
||||||
|
minify: !DEBUG_REPLAY
|
||||||
}
|
}
|
||||||
} satisfies UserConfig);
|
} satisfies UserConfig);
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,14 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
import { copy, emptyDir, ensureDir } from 'fs-extra';
|
import { copy, emptyDir, ensureDir } from 'fs-extra';
|
||||||
|
import { writeFile } from 'fs/promises';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
|
|
||||||
const base = resolve(process.cwd());
|
const base = resolve(process.cwd());
|
||||||
const template = resolve(base, 'template');
|
const template = resolve(base, 'template');
|
||||||
|
|
||||||
|
const serve = `在 2.B 样板中,不再使用先前的启动服务,而使用一个单独的软件。
|
||||||
|
你可以加造塔群 959329661 后,在群文件 - 启动服务 中获取,文件夹中会有一个专门的安装教程。`;
|
||||||
|
|
||||||
async function packTemplate() {
|
async function packTemplate() {
|
||||||
await ensureDir(template);
|
await ensureDir(template);
|
||||||
await emptyDir(template);
|
await emptyDir(template);
|
||||||
@ -41,6 +45,8 @@ async function packTemplate() {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await writeFile(resolve(template, '启动服务呢?.txt'), serve, 'utf-8');
|
||||||
|
|
||||||
console.log(`样板打包完成`);
|
console.log(`样板打包完成`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
src/types/declaration/ui.d.ts
vendored
10
src/types/declaration/ui.d.ts
vendored
@ -759,14 +759,14 @@ interface Ui {
|
|||||||
textImage(content: string, lineHeight?: number): HTMLCanvasElement;
|
textImage(content: string, lineHeight?: number): HTMLCanvasElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated 已失效,考虑换用新的渲染系统中的 `getChoices` 接口\
|
* @deprecated 可使用,考虑换用新的渲染系统中的 `getChoices` 接口\
|
||||||
* 绘制一个选项界面
|
* 绘制一个选项界面。不用 drawChoices 命名是为了避免录像验证问题。
|
||||||
*/
|
*/
|
||||||
drawChoices(
|
drawChoices2(
|
||||||
content: string,
|
content: string,
|
||||||
choices: object[],
|
choices: object[],
|
||||||
width?: number,
|
width?: number,
|
||||||
ctx?: CtxRefer
|
noRoute?: CtxRefer
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -777,7 +777,7 @@ interface Ui {
|
|||||||
text: string,
|
text: string,
|
||||||
yesCallback?: () => void,
|
yesCallback?: () => void,
|
||||||
noCallback?: () => void,
|
noCallback?: () => void,
|
||||||
ctx?: CtxRefer
|
noRoute?: boolean
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user