Event: Comment

This commit is contained in:
ckcz123 2018-10-31 17:34:41 +08:00
parent 1e7da99ff1
commit 755919307d
4 changed files with 34 additions and 0 deletions

View File

@ -182,6 +182,7 @@ return code;
action
: text_0_s
| text_1_s
| comment_s
| autoText_s
| setText_s
| tip_s
@ -282,6 +283,19 @@ var code = '"'+title+EvalString_1+EvalString_2+'",\n';
return code;
*/;
comment_s
: '添加注释' ':' EvalString Newline
/* comment_s
tooltip : text显示一段文字剧情
helpUrl : https://ckcz123.github.io/mota-js/#/event?id=comment%ef%bc%9a%e6%b7%bb%e5%8a%a0%e6%b3%a8%e9%87%8a
default : ["可以在这里写添加任何注释内容"]
colour : this.commentColor
var code = '{"type": "comment", "text": "'+EvalString_0+'"},\n';
return code;
*/;
autoText_s
: '自动剧情文本: 标题' EvalString? '图像' IdString? '对话框效果' EvalString? '时间' Int BGNL? EvalString Newline
@ -1575,6 +1589,7 @@ this.evisitor.printColor=70;
this.evisitor.dataColor=130;
this.evisitor.eventColor=220;
this.evisitor.soundColor=20;
this.evisitor.commentColor=285;
*/
/* Function_1
@ -1704,6 +1719,9 @@ ActionParser.prototype.parseAction = function() {
this.next = MotaActionBlocks['autoText_s'].xmlText([
'','','',data.time,this.EvalString(data.text),this.next]);
break;
case "comment": // 注释
this.next = MotaActionBlocks['comment_s'].xmlText([data.text,this.next]);
break;
case "setText": // 设置剧情文本的属性
var setTextfunc = function(a){return a?JSON.stringify(a).slice(1,-1):null;}
data.title=setTextfunc(data.title);

View File

@ -56,6 +56,7 @@ editor_blockly = function () {
'显示文字':[
MotaActionBlocks['text_0_s'].xmlText(),
MotaActionBlocks['text_1_s'].xmlText(),
MotaActionBlocks['comment_s'].xmlText(),
MotaActionFunctions.actionParser.parseList({"type": "choices", "text": "是否跳过剧情", "choices": [
{"text": "是", "action": []},
{"text": "否", "action": [

View File

@ -327,6 +327,18 @@ time为可选项表示文字添加的速度。若此项设置为0将直接全
值得注意的是提示的text内容也是可以使用`${ }`来计算表达式的值的。
### comment添加注释
使用`{"type": "comment"}`可以添加一段注释
``` js
"x,y": [ // 实际执行的事件列表
{"type": "comment", "text": "这是一段会被跳过的注释内容"}
]
```
这个事件将在运行时被游戏跳过。
### setValue设置勇士的某个属性、道具个数或某个变量/Flag的值
`{"type": "setValue"}` 能修改勇士的某个属性、道具个数、或某个自定义变量或`Flag`的值。

View File

@ -392,6 +392,9 @@ events.prototype.doAction = function() {
}, data.time || 3000);
}
break;
case "comment":
this.doAction();
break;
case "setText": // 设置文本状态
["position", "offset", "bold", "titlefont", "textfont", "time"].forEach(function (t) {
if (core.isset(data[t])) core.status.textAttribute[t]=data[t];