diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4
index bc5e64cd..54c2834a 100644
--- a/_server/MotaAction.g4
+++ b/_server/MotaAction.g4
@@ -271,16 +271,19 @@ return code;
//changeFloor 事件编辑器入口之一
changeFloor_m
- : '楼梯, 传送门' BGNL? Newline Floor_List IdString? Stair_List 'x' Number ',' 'y' Number '朝向' DirectionEx_List '动画时间' IntString? '穿透性' IgnoreChangeFloor_List BEND
+ : '楼梯, 传送门' BGNL? Newline Floor_List IdString? Stair_List 'x' PosString? ',' 'y' PosString? '朝向' DirectionEx_List '动画时间' IntString? '穿透性' IgnoreChangeFloor_List BEND
/* changeFloor_m
tooltip : 楼梯, 传送门, 如果目标楼层有多个楼梯, 写upFloor或downFloor可能会导致到达的楼梯不确定, 这时候请使用loc方式来指定具体的点位置
helpUrl : https://h5mota.com/games/template/_docs/#/element?id=%e8%b7%af%e9%9a%9c%ef%bc%8c%e6%a5%bc%e6%a2%af%ef%bc%8c%e4%bc%a0%e9%80%81%e9%97%a8
-default : [null,"MTx",null,0,0,null,"",null]
+default : [null,"MTx",null,"","",null,"",null]
var toFloorId = IdString_0;
if (Floor_List_0!='floorId') toFloorId = Floor_List_0;
-var loc = ', "loc": ['+Number_0+', '+Number_1+']';
+var loc = '';
+if (PosString_0 && PosString_1) {
+ loc = ', "loc": ['+PosString_0+', '+PosString_1+']';
+}
if (Stair_List_0===':now') loc = '';
else if (Stair_List_0!=='loc')loc = ', "stair": "'+Stair_List_0+'"';
if (DirectionEx_List_0 == 'null') DirectionEx_List_0 = '';
@@ -430,8 +433,10 @@ action
| drawArrow_s
| fillPolygon_s
| strokePolygon_s
- | fillCircle_s
- | strokeCircle_s
+ | fillEllipse_s
+ | strokeEllipse_s
+ | fillArc_s
+ | strokeArc_s
| drawImage_s
| drawImage_1_s
| drawIcon_s
@@ -1187,7 +1192,7 @@ return code;
*/;
changeFloor_s
- : '楼层切换' Floor_List IdString? Stair_List 'x' Number ',' 'y' Number '朝向' DirectionEx_List '动画时间' IntString? Newline
+ : '楼层切换' Floor_List IdString? Stair_List 'x' PosString? ',' 'y' PosString? '朝向' DirectionEx_List '动画时间' IntString? Newline
/* changeFloor_s
@@ -1197,8 +1202,11 @@ default : [null,"",null,"","",null,"",null]
colour : this.dataColor
var toFloorId = IdString_0;
if (Floor_List_0!='floorId') toFloorId = Floor_List_0;
-toFloorId = toFloorId ? (', "floorId": ' + toFloorId) : '';
-var loc = ', "loc": ['+Number_0+', '+Number_1+']';
+toFloorId = toFloorId ? (', "floorId": "' + toFloorId +'"') : '';
+var loc = '';
+if (PosString_0 && PosString_1) {
+ loc = ', "loc": ['+PosString_0+', '+PosString_1+']';
+}
if (Stair_List_0===':now') loc = '';
else if (Stair_List_0!=='loc')loc = ', "stair": "'+Stair_List_0+'"';
if (DirectionEx_List_0 == 'null') DirectionEx_List_0 = '';
@@ -2242,29 +2250,31 @@ return code;
*/;
fillRect_s
- : '绘制矩形' '起点像素' 'x' PosString 'y' PosString '宽' PosString '高' PosString '颜色' ColorString? Colour Newline
+ : '绘制矩形' '起点像素' 'x' PosString 'y' PosString '宽' PosString '高' PosString '圆角半径' PosString? '颜色' ColorString? Colour Newline
/* fillRect_s
tooltip : fillRect:绘制矩形
helpUrl : https://h5mota.com/games/template/_docs/#/event?id=fillRect%ef%bc%9a%e7%bb%98%e5%88%b6%e7%9f%a9%e5%bd%a2
colour : this.subColor
-default : ["0","0","flag:x","300","",null]
+default : ["0","0","flag:x","300","","",null]
ColorString_0 = ColorString_0 ? (', "style": ['+ColorString_0+']') : '';
-var code = '{"type": "fillRect", "x": '+PosString_0+', "y": '+PosString_1+', "width": '+PosString_2+', "height": '+PosString_3+ColorString_0+'},\n';
+PosString_4 = PosString_4 ? (', "radius": '+PosString_4) : '';
+var code = '{"type": "fillRect", "x": '+PosString_0+', "y": '+PosString_1+', "width": '+PosString_2+', "height": '+PosString_3+PosString_4+ColorString_0+'},\n';
return code;
*/;
strokeRect_s
- : '绘制矩形边框' '起点像素' 'x' PosString 'y' PosString '宽' PosString '高' PosString '颜色' ColorString? Colour '线宽' IntString? Newline
+ : '绘制矩形边框' '起点像素' 'x' PosString 'y' PosString '宽' PosString '高' PosString '圆角半径' PosString? '颜色' ColorString? Colour '线宽' IntString? Newline
/* strokeRect_s
tooltip : strokeRect:绘制矩形边框
helpUrl : https://h5mota.com/games/template/_docs/#/event?id=strokeRect%ef%bc%9a%e7%bb%98%e5%88%b6%e7%9f%a9%e5%bd%a2%e8%be%b9%e6%a1%86
colour : this.subColor
-default : ["0","0","flag:x","300","",null,""]
+default : ["0","0","flag:x","300","","",null,""]
ColorString_0 = ColorString_0 ? (', "style": ['+ColorString_0+']') : '';
IntString_0 = IntString_0 ? (', "lineWidth": '+IntString_0) : '';
-var code = '{"type": "strokeRect", "x": '+PosString_0+', "y": '+PosString_1+', "width": '+PosString_2+', "height": '+PosString_3+ColorString_0+IntString_0+'},\n';
+PosString_4 = PosString_4 ? (', "radius": '+PosString_4) : '';
+var code = '{"type": "strokeRect", "x": '+PosString_0+', "y": '+PosString_1+', "width": '+PosString_2+', "height": '+PosString_3+PosString_4+ColorString_0+IntString_0+'},\n';
return code;
*/;
@@ -2337,33 +2347,64 @@ var code = '{"type": "strokePolygon", "nodes": ['+EvalString_0+']'+ColorString_0
return code;
*/;
-fillCircle_s
- : '绘制圆' '圆心' 'x' PosString 'y' PosString '半径' PosString '颜色' ColorString? Colour Newline
+fillEllipse_s
+ : '绘制椭圆' '中心' 'x' PosString 'y' PosString '长半径' PosString '短半径' PosString '顺时针旋转度数' PosString? '颜色' ColorString? Colour Newline
-/* fillCircle_s
-tooltip : fillCircle:绘制圆
-helpUrl : https://h5mota.com/games/template/_docs/#/event?id=fillCircle%ef%bc%9a%e7%bb%98%e5%88%b6%e5%9c%86
+/* fillEllipse_s
+tooltip : fillEllipse:绘制椭圆
+helpUrl : https://h5mota.com/games/template/_docs/#/event?id=fillEllipse%ef%bc%9a%e7%bb%98%e5%88%b6%e5%9c%86
colour : this.subColor
-default : ["0","0","100","",null]
+default : ["0","0","100","100","0","",null]
ColorString_0 = ColorString_0 ? (', "style": ['+ColorString_0+']') : '';
-var code = '{"type": "fillCircle", "x": '+PosString_0+', "y": '+PosString_1+', "r": '+PosString_2+ColorString_0+'},\n';
+PosString_4 = PosString_4 ? (', "angle": ' + PosString_4) : '';
+var code = '{"type": "fillEllipse", "x": '+PosString_0+', "y": '+PosString_1+', "a": '+PosString_2+', "b": '+PosString_3+PosString_4+ColorString_0+'},\n';
return code;
*/;
-strokeCircle_s
- : '绘制圆边框' '圆心' 'x' PosString 'y' PosString '半径' PosString '颜色' ColorString? Colour '线宽' IntString? Newline
+strokeEllipse_s
+ : '绘制椭圆边框' '中心' 'x' PosString 'y' PosString '长半径' PosString '短半径' PosString '顺时针旋转度数' PosString? '颜色' ColorString? Colour '线宽' IntString? Newline
-/* strokeCircle_s
-tooltip : strokeCircle:绘制圆边框
-helpUrl : https://h5mota.com/games/template/_docs/#/event?id=strokeCircle%ef%bc%9a%e7%bb%98%e5%88%b6%e5%9c%86%e8%be%b9%e6%a1%86
+/* strokeEllipse_s
+tooltip : strokeEllipse:绘制椭圆边框
+helpUrl : https://h5mota.com/games/template/_docs/#/event?id=strokeEllipse%ef%bc%9a%e7%bb%98%e5%88%b6%e5%9c%86%e8%be%b9%e6%a1%86
colour : this.subColor
-default : ["0","0","100","",null,""]
+default : ["0","0","100","100","0","",null,""]
ColorString_0 = ColorString_0 ? (', "style": ['+ColorString_0+']') : '';
IntString_0 = IntString_0 ? (', "lineWidth": '+IntString_0) : '';
-var code = '{"type": "strokeCircle", "x": '+PosString_0+', "y": '+PosString_1+', "r": '+PosString_2+ColorString_0+IntString_0+'},\n';
+PosString_4 = PosString_4 ? (', "angle": ' + PosString_4) : '';
+var code = '{"type": "strokeEllipse", "x": '+PosString_0+', "y": '+PosString_1+', "a": '+PosString_2+', "b": '+PosString_3+PosString_4+ColorString_0+IntString_0+'},\n';
return code;
*/;
+fillArc_s
+ : '绘制扇形' '中心' 'x' PosString 'y' PosString '半径' PosString '起点角度' PosString '终点角度' PosString '颜色' ColorString? Colour Newline
+
+/* fillArc_s
+tooltip : fillArc:绘制扇形
+helpUrl : https://h5mota.com/games/template/_docs/#/event?id=fillEllipse%ef%bc%9a%e7%bb%98%e5%88%b6%e5%9c%86
+colour : this.subColor
+default : ["0","0","100","0","90","",null,""]
+ColorString_0 = ColorString_0 ? (', "style": ['+ColorString_0+']') : '';
+var code = '{"type": "fillArc", "x": '+PosString_0+', "y": '+PosString_1+', "r": '+PosString_2+', "start": '+PosString_3+', "end": '+PosString_4+ColorString_0+'},\n';
+return code;
+*/;
+
+
+strokeArc_s
+ : '绘制弧' '中心' 'x' PosString 'y' PosString '半径' PosString '起点角度' PosString '终点角度' PosString '颜色' ColorString? Colour '线宽' IntString? Newline
+
+/* strokeArc_s
+tooltip : strokeArc:绘制弧
+helpUrl : https://h5mota.com/games/template/_docs/#/event?id=fillEllipse%ef%bc%9a%e7%bb%98%e5%88%b6%e5%9c%86
+colour : this.subColor
+default : ["0","0","100","0","90","",null,""]
+ColorString_0 = ColorString_0 ? (', "style": ['+ColorString_0+']') : '';
+IntString_0 = IntString_0 ? (', "lineWidth": '+IntString_0) : '';
+var code = '{"type": "strokeArc", "x": '+PosString_0+', "y": '+PosString_1+', "r": '+PosString_2+', "start": '+PosString_3+', "end": '+PosString_4+ColorString_0+IntString_0+'},\n';
+return code;
+*/;
+
+
drawImage_s
: '绘制图片' EvalString '起点像素' 'x' PosString 'y' PosString '宽' PosString? '高' PosString? Newline
@@ -2507,9 +2548,15 @@ expression
: expression Arithmetic_List expression
| negate_e
| bool_e
+ | idFixedList_e
+ | idFlag_e
+ | idTemp_e
+ | idIdList_e
| idString_e
- | evFlag_e
- | evTemp_e
+ | enemyattr_e
+ | blockId_e
+ | blockCls_e
+ | equip_e
| evalString_e
@@ -2571,90 +2618,77 @@ var code = IdString_0;
return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/;
-//这一条不会被antlr识别,总是会被归到idString_e
-idString_1_e
+idIdList_e
: Id_List ':' IdText
-/* idString_1_e
+/* idIdList_e
colour : this.idstring_eColor
default : [null,"自定义flag"]
-//todo 将其output改成'idString_e'
var code = MotaActionFunctions.replaceFromName(MotaActionFunctions.replaceToName(Id_List_0+':'+IdText_0));
return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/;
-//这一条不会被antlr识别,总是会被归到idString_e
-idString_2_e
+idFixedList_e
: FixedId_List
-/* idString_2_e
+/* idFixedList_e
colour : this.idstring_eColor
-//todo 将其output改成'idString_e'
var code = FixedId_List_0;
return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/;
-//这一条不会被antlr识别,总是会被归到idString_e
-idString_3_e
+enemyattr_e
: '怪物' IdString '的' EnemyId_List
-/* idString_3_e
-colour : this.idstring_eColor
+/* enemyattr_e
default : ['greenSlime',"攻击"]
-//todo 将其output改成'idString_e'
var code = 'enemy:'+IdString_0+':'+EnemyId_List_0;
return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/;
-//这一条不会被antlr识别,总是会被归到idString_e
-idString_4_e
+blockId_e
: '图块ID:' Int ',' Int
-/* idString_4_e
-colour : this.idstring_eColor
+/* blockId_e
default : [0,0]
var code = 'blockId:'+Int_0+','+Int_1;
return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/;
-//这一条不会被antlr识别,总是会被归到idString_e
-idString_5_e
+blockCls_e
: '图块类别:' Int ',' Int
-/* idString_5_e
-colour : this.idstring_eColor
+/* blockCls_e
default : [0,0]
var code = 'blockCls:'+Int_0+','+Int_1;
return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/;
-//这一条不会被antlr识别,总是会被归到idString_e
-idString_6_e
+equip_e
: '装备孔:' Int
-/* idString_6_e
-colour : this.idstring_eColor
+/* equip_e
default : [0]
var code = 'equip:'+Int_0;
return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/;
-evFlag_e
+idFlag_e
: '独立开关' Letter_List
-/* evFlag_e
+/* idFlag_e
colour : this.idstring_eColor
default : ["A"]
var code = "switch:"+Letter_List_0;
@@ -2662,11 +2696,11 @@ return [code, Blockly.JavaScript.ORDER_ATOMIC];
*/;
-evTemp_e
+idTemp_e
: '临时变量' Letter_List
-/* evTemp_e
+/* idTemp_e
colour : this.idstring_eColor
default : ["A"]
var code = "temp:"+Letter_List_0;
@@ -2899,14 +2933,10 @@ this.evisitor.mapColor=175;
/* Function_1
delete(this.block('negate_e').inputsInline);
-this.block('idString_1_e').output='idString_e';
-this.block('idString_2_e').output='idString_e';
-this.block('idString_3_e').output='idString_e';
-this.block('idString_4_e').output='idString_e';
-this.block('idString_5_e').output='idString_e';
-this.block('idString_6_e').output='idString_e';
-this.block('evFlag_e').output='idString_e';
-this.block('evTemp_e').output='idString_e';
+this.block('idIdList_e').output='idString_e';
+this.block('idFixedList_e').output='idString_e';
+this.block('idFlag_e').output='idString_e';
+this.block('idTemp_e').output='idString_e';
*/
/* Functions
@@ -2932,9 +2962,9 @@ ActionParser.prototype.parse = function (obj,type) {
case 'changeFloor':
if(!obj)obj={};
- if(!this.isset(obj.loc)) {
- obj.loc=[0,0];
- if (!this.isset(obj.stair)) obj.stair=':now';
+ if (!obj.loc) {
+ obj.loc = obj.loc || ['',''];
+ obj.stair = obj.stair || ':now';
}
if (obj.floorId==':before'||obj.floorId==':next'||obj.floorId==':now') {
obj.floorType=obj.floorId;
@@ -2957,7 +2987,7 @@ ActionParser.prototype.parse = function (obj,type) {
var text_choices = null;
for(var ii=obj.length-1,choice;choice=obj[ii];ii--) {
text_choices=MotaActionBlocks['levelCase'].xmlText([
- MotaActionBlocks['evalString_e'].xmlText([choice.need]),choice.title,choice.clear||false,this.parseList(choice.action),text_choices]);
+ this.expandEvalBlock([choice.need]),choice.title,choice.clear||false,this.parseList(choice.action),text_choices]);
}
return MotaActionBlocks['level_m'].xmlText([text_choices]);
@@ -3235,8 +3265,8 @@ ActionParser.prototype.parseAction = function() {
data.floorType=data.floorId;
delete data.floorId;
}
- return MotaActionBlocks['changeFloor_s'].xmlText([
- data.floorType||'floorId',data.floorId,data.stair||'loc',data.loc[0],data.loc[1],obj.direction,
+ this.next = MotaActionBlocks['changeFloor_s'].xmlText([
+ data.floorType||'floorId',data.floorId,data.stair||'loc',data.loc[0],data.loc[1],data.direction,
data.time, this.next]);
break;
case "changePos": // 直接更换勇士位置, 不切换楼层
@@ -3414,14 +3444,14 @@ ActionParser.prototype.parseAction = function() {
break
case "setValue":
this.next = MotaActionBlocks['setValue_s'].xmlText([
- this.tryToUseEvFlag_e('idString_e', [data.name]), data["operator"]||'=',
- MotaActionBlocks['evalString_e'].xmlText([data.value]),
+ this.expandIdBlock([data.name]), data["operator"]||'=',
+ this.expandEvalBlock([data.value]),
data.norefresh || false,
this.next]);
break;
case "setEnemy":
this.next = MotaActionBlocks['setEnemy_s'].xmlText([
- data.id, data.name, MotaActionBlocks['evalString_e'].xmlText([data.value]), this.next]);
+ data.id, data.name, this.expandEvalBlock([data.value]), this.next]);
break;
case "setFloor":
this.next = MotaActionBlocks['setFloor_s'].xmlText([
@@ -3450,14 +3480,14 @@ ActionParser.prototype.parseAction = function() {
case "if": // 条件判断
if (data["false"]) {
this.next = MotaActionBlocks['if_s'].xmlText([
- this.tryToUseEvFlag_e('evalString_e', [data.condition]),
+ this.expandEvalBlock([data.condition]),
this.insertActionList(data["true"]),
this.insertActionList(data["false"]),
this.next]);
}
else {
this.next = MotaActionBlocks['if_1_s'].xmlText([
- this.tryToUseEvFlag_e('evalString_e', [data.condition]),
+ this.expandEvalBlock([data.condition]),
this.insertActionList(data["true"]),
this.next]);
}
@@ -3473,11 +3503,10 @@ ActionParser.prototype.parseAction = function() {
var case_caseList = null;
for(var ii=data.caseList.length-1,caseNow;caseNow=data.caseList[ii];ii--) {
case_caseList=MotaActionBlocks['switchCase'].xmlText([
- this.isset(caseNow.case)?MotaActionBlocks['evalString_e'].xmlText([caseNow.case]):"值",caseNow.nobreak,this.insertActionList(caseNow.action),case_caseList]);
+ this.isset(caseNow.case)?this.expandEvalBlock([caseNow.case]):"值",caseNow.nobreak,this.insertActionList(caseNow.action),case_caseList]);
}
this.next = MotaActionBlocks['switch_s'].xmlText([
- // MotaActionBlocks['evalString_e'].xmlText([data.condition]),
- this.tryToUseEvFlag_e('evalString_e', [data.condition]),
+ this.expandEvalBlock([data.condition]),
case_caseList,this.next]);
break;
case "choices": // 提供选项
@@ -3494,30 +3523,28 @@ ActionParser.prototype.parseAction = function() {
break;
case "for": // 循环遍历
this.next = MotaActionBlocks['for_s'].xmlText([
- this.tryToUseEvFlag_e('evalString_e', [data.name]),
+ this.expandEvalBlock([data.name]),
data.from || 0, data.to || 0, data.step || 0,
this.insertActionList(data.data),
this.next]);
break;
case "forEach": // 循环遍历列表
this.next = MotaActionBlocks['forEach_s'].xmlText([
- this.tryToUseEvFlag_e('evalString_e', [data.name]),
+ this.expandEvalBlock([data.name]),
JSON.stringify(data.list),
this.insertActionList(data.data),
this.next]);
break;
case "while": // 前置条件循环处理
this.next = MotaActionBlocks['while_s'].xmlText([
- // MotaActionBlocks['evalString_e'].xmlText([data.condition]),
- this.tryToUseEvFlag_e('evalString_e', [data.condition]),
+ this.expandEvalBlock([data.condition]),
this.insertActionList(data.data),
this.next]);
break;
case "dowhile": // 后置条件循环处理
this.next = MotaActionBlocks['dowhile_s'].xmlText([
this.insertActionList(data.data),
- // MotaActionBlocks['evalString_e'].xmlText([data.condition]),
- this.tryToUseEvFlag_e('evalString_e', [data.condition]),
+ this.expandEvalBlock([data.condition]),
this.next]);
break;
case "break": // 跳出循环
@@ -3657,13 +3684,13 @@ ActionParser.prototype.parseAction = function() {
case "fillRect": // 绘制矩形
data.style = this.Colour(data.style);
this.next = MotaActionBlocks['fillRect_s'].xmlText([
- data.x, data.y, data.width, data.height, data.style, 'rgba('+data.style+')', this.next
+ data.x, data.y, data.width, data.height, data.radius, data.style, 'rgba('+data.style+')', this.next
]);
break;
case "strokeRect": // 绘制矩形边框
data.style = this.Colour(data.style);
this.next = MotaActionBlocks['strokeRect_s'].xmlText([
- data.x, data.y, data.width, data.height, data.style, 'rgba('+data.style+')', data.lineWidth, this.next
+ data.x, data.y, data.width, data.height, data.radius, data.style, 'rgba('+data.style+')', data.lineWidth, this.next
]);
break;
case "drawLine": // 绘制线段
@@ -3700,16 +3727,28 @@ ActionParser.prototype.parseAction = function() {
x_str.join(','), y_str.join(','), data.style, 'rgba('+data.style+')', data.lineWidth, this.next
]);
break;
- case "fillCircle": // 绘制圆
+ case "fillEllipse": // 绘制椭圆
data.style = this.Colour(data.style);
- this.next = MotaActionBlocks['fillCircle_s'].xmlText([
- data.x, data.y, data.r, data.style, 'rgba('+data.style+')', this.next
+ this.next = MotaActionBlocks['fillEllipse_s'].xmlText([
+ data.x, data.y, data.a, data.b, data.angle, data.style, 'rgba('+data.style+')', this.next
]);
break;
- case "strokeCircle": // 绘制圆边框
+ case "strokeEllipse": // 绘制椭圆边框
data.style = this.Colour(data.style);
- this.next = MotaActionBlocks['strokeCircle_s'].xmlText([
- data.x, data.y, data.r, data.style, 'rgba('+data.style+')', data.lineWidth, this.next
+ this.next = MotaActionBlocks['strokeEllipse_s'].xmlText([
+ data.x, data.y, data.a, data.b, data.angle, data.style, 'rgba('+data.style+')', data.lineWidth, this.next
+ ]);
+ break;
+ case "fillArc": // 绘制弧
+ data.style = this.Colour(data.style);
+ this.next = MotaActionBlocks['fillArc_s'].xmlText([
+ data.x, data.y, data.r, data.start, data.end, data.style, 'rgba('+data.style+')', this.next
+ ]);
+ break;
+ case "strokeArc": // 绘制弧
+ data.style = this.Colour(data.style);
+ this.next = MotaActionBlocks['strokeArc_s'].xmlText([
+ data.x, data.y, data.r, data.start, data.end, data.style, 'rgba('+data.style+')', data.lineWidth, this.next
]);
break;
case "drawImage": // 绘制图片
@@ -3826,18 +3865,53 @@ ActionParser.prototype.Colour = function(color) {
return color?JSON.stringify(color).slice(1,-1):null;
}
-ActionParser.prototype.tryToUseEvFlag_e = function(defaultType, args, isShadow, comment) {
- var match=/^switch:([A-Z])$/.exec(args[0])
+ActionParser.prototype.matchId = function(args, isShadow, comment) {
+ var rt=function(xml){
+ return {xml:xml,ret:true}
+ }
+ var match = /nothing/.exec('nothing')
+ // 固定列表
+ var FixedId_List=MotaActionBlocks.idFixedList_e.json.args0[0].options; // [["生命", "status:hp"], ...]
+ match=new RegExp('^('+FixedId_List.map(function(v){return v[1]}).join('|')+')$').exec(args[0])
+ if(match){
+ return rt(MotaActionBlocks['idFixedList_e'].xmlText(args, isShadow, comment));
+ }
+ // 独立开关
+ match=/^switch:([A-Z])$/.exec(args[0])
if(match){
args[0]=match[1]
- return MotaActionBlocks['evFlag_e'].xmlText(args, isShadow, comment);
+ return rt(MotaActionBlocks['idFlag_e'].xmlText(args, isShadow, comment));
}
+ // 临时变量
match=/^temp:([A-Z])$/.exec(args[0])
if(match){
args[0]=match[1]
- return MotaActionBlocks['evTemp_e'].xmlText(args, isShadow, comment);
+ return rt(MotaActionBlocks['idTemp_e'].xmlText(args, isShadow, comment));
}
- return MotaActionBlocks[defaultType||'evalString_e'].xmlText(args, isShadow, comment);
+ // id列表
+ var Id_List = MotaActionBlocks.idIdList_e.json.args0[0].options; // [["变量", "flag"], ...]
+ match=new RegExp('^('+Id_List.map(function(v){return v[1]}).join('|')+'):([a-zA-Z0-9_\\u4E00-\\u9FCC]+)$').exec(args[0])
+ if(match){
+ args=[match[1],match[2]].concat(args.slice(1))
+ return rt(MotaActionBlocks['idIdList_e'].xmlText(args, isShadow, comment));
+ }
+ return {xml:'',ret:false}
+}
+
+ActionParser.prototype.expandIdBlock = function(args, isShadow, comment) {
+ var ret=this.matchId(args, isShadow, comment)
+ if (ret.ret) return ret.xml;
+ return MotaActionBlocks['idString_e'].xmlText(args, isShadow, comment);
+}
+
+ActionParser.prototype.expandEvalBlock = function(args, isShadow, comment) {
+ var ret=this.matchId(args, isShadow, comment)
+ if (ret.ret) return ret.xml;
+ // todo
+ // 1. 将「数值设置」的名称尽可能替换掉;如果是 FixedId_List 那就用它;否则如果是 独立开关/临时变量 那就用对应的;否则用 A:B 的那个框
+ // 2. 将「值块」尽可能替换掉,主要是「独立开关」,「临时变量」,「非 - 独立开关」,「非-临时变量」;以及true/false替换成勾选框;对于其他变量/属性等之类也尽可能进行替换
+
+ return MotaActionBlocks['evalString_e'].xmlText(args, isShadow, comment);
}
MotaActionFunctions.actionParser = new ActionParser();
diff --git a/_server/editor.js b/_server/editor.js
index 56487191..6f282c4c 100644
--- a/_server/editor.js
+++ b/_server/editor.js
@@ -55,6 +55,7 @@ function editor() {
editModeSelect :document.getElementById('editModeSelect'),
mid2 : document.getElementById('mid2'),
clearLastUsedBtn: document.getElementById('clearLastUsedBtn'),
+ lastUsedTitle: document.getElementById('lastUsedTitle'),
lastUsedDiv: document.getElementById('lastUsedDiv'),
lastUsed: document.getElementById('lastUsed'),
lastUsedCtx: document.getElementById('lastUsed').getContext('2d'),
@@ -105,6 +106,7 @@ function editor() {
lockMode: false,
// 最近使用的图块
+ lastUsedType: null,
lastUsed: [],
};
@@ -406,16 +408,35 @@ editor.prototype.updateMap = function () {
this.updateLastUsedMap();
}
+editor.prototype.setLastUsedType = function (type) {
+ if (type == editor.uivalues.lastUsedType) return;
+ editor.uivalues.lastUsedType = type;
+ var _buildHtml = function (type, text) {
+ if (type == null) return "" + text + "";
+ else return `${text}`;
+ }
+ editor.dom.lastUsedTitle.innerHTML
+ = type == 'frequent' ? (_buildHtml('recent', '最近使用') + " | " + _buildHtml(null, '最常使用'))
+ : (_buildHtml(null, '最近使用') + " | " + _buildHtml('frequent', '最常使用'));
+ this.updateLastUsedMap();
+}
+
editor.prototype.updateLastUsedMap = function () {
+ var lastUsed = editor.uivalues.lastUsed.sort(function (a, b) {
+ if ((a.istop || 0) != (b.istop || 0)) return (b.istop || 0) - (a.istop || 0);
+ return (b[editor.uivalues.lastUsedType] || 0) - (a[editor.uivalues.lastUsedType] || 0);
+ });
+
// 绘制最近使用事件
var ctx = editor.dom.lastUsedCtx;
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
ctx.strokeStyle = 'rgba(255,128,0,0.85)';
+ ctx.fillStyle = 'rgba(255,0,0,0.85)';
ctx.lineWidth = 4;
- for (var i = 0; i < editor.uivalues.lastUsed.length; ++i) {
+ for (var i = 0; i < lastUsed.length; ++i) {
try {
var x = i % core.__SIZE__, y = parseInt(i / core.__SIZE__);
- var info = editor.uivalues.lastUsed[i];
+ var info = lastUsed[i];
if (!info || !info.images) continue;
if (info.isTile && core.material.images.tilesets[info.images]) {
ctx.drawImage(core.material.images.tilesets[info.images], 32 * info.x, 32 * info.y, 32, 32, x*32, y*32, 32, 32);
@@ -425,6 +446,9 @@ editor.prototype.updateLastUsedMap = function () {
var per_height = info.images.endsWith('48') ? 48 : 32;
ctx.drawImage(core.material.images[info.images], 0, info.y * per_height, 32, per_height, x * 32, y * 32, 32, 32);
}
+ if (info.istop) {
+ ctx.fillRect(32 * x, 32 * y + 24, 8, 8);
+ }
if (selectBox.isSelected() && editor.info.id == info.id) {
ctx.strokeRect(32 * x + 2, 32 * y + 2, 28, 28);
}
@@ -458,6 +482,7 @@ editor.prototype.drawInitData = function (icons) {
// editor.uivalues.folded = true;
editor.uivalues.foldPerCol = editor.config.get('foldPerCol', 50);
// var imgNames = Object.keys(images); //还是固定顺序吧;
+ editor.setLastUsedType(editor.config.get('lastUsedType', 'recent'));
editor.uivalues.lastUsed = editor.config.get("lastUsed", []);
var imgNames = ["terrains", "animates", "enemys", "enemy48", "items", "npcs", "npc48", "autotile"];
diff --git a/_server/editor_blockly.js b/_server/editor_blockly.js
index c1908d51..df6ed146 100644
--- a/_server/editor_blockly.js
+++ b/_server/editor_blockly.js
@@ -97,7 +97,7 @@ editor_blockly = function () {
],
'数据相关':[
MotaActionBlocks['setValue_s'].xmlText([
- MotaActionBlocks['idString_1_e'].xmlText(['status','生命']), '=', '', false
+ MotaActionBlocks['idIdList_e'].xmlText(['status','生命']), '=', '', false
]),
MotaActionBlocks['setEnemy_s'].xmlText(),
MotaActionBlocks['setFloor_s'].xmlText(),
@@ -202,8 +202,10 @@ editor_blockly = function () {
MotaActionBlocks['drawArrow_s'].xmlText(),
MotaActionBlocks['fillPolygon_s'].xmlText(),
MotaActionBlocks['strokePolygon_s'].xmlText(),
- MotaActionBlocks['fillCircle_s'].xmlText(),
- MotaActionBlocks['strokeCircle_s'].xmlText(),
+ MotaActionBlocks['fillEllipse_s'].xmlText(),
+ MotaActionBlocks['strokeEllipse_s'].xmlText(),
+ MotaActionBlocks['fillArc_s'].xmlText(),
+ MotaActionBlocks['strokeArc_s'].xmlText(),
MotaActionBlocks['drawImage_s'].xmlText(),
MotaActionBlocks['drawImage_1_s'].xmlText(),
MotaActionBlocks['drawIcon_s'].xmlText(),
@@ -217,20 +219,20 @@ editor_blockly = function () {
],
'值块':[
MotaActionBlocks['setValue_s'].xmlText([
- MotaActionBlocks['idString_1_e'].xmlText(['status','生命']), '=', '', false
+ MotaActionBlocks['idIdList_e'].xmlText(['status','生命']), '=', '', false
]),
MotaActionBlocks['expression_arithmetic_0'].xmlText(),
- MotaActionBlocks['evFlag_e'].xmlText(),
- MotaActionBlocks['evTemp_e'].xmlText(),
+ MotaActionBlocks['idFlag_e'].xmlText(),
+ MotaActionBlocks['idTemp_e'].xmlText(),
MotaActionBlocks['negate_e'].xmlText(),
MotaActionBlocks['bool_e'].xmlText(),
MotaActionBlocks['idString_e'].xmlText(),
- MotaActionBlocks['idString_1_e'].xmlText(),
- MotaActionBlocks['idString_2_e'].xmlText(),
- MotaActionBlocks['idString_3_e'].xmlText(),
- MotaActionBlocks['idString_4_e'].xmlText(),
- MotaActionBlocks['idString_5_e'].xmlText(),
- MotaActionBlocks['idString_6_e'].xmlText(),
+ MotaActionBlocks['idIdList_e'].xmlText(),
+ MotaActionBlocks['idFixedList_e'].xmlText(),
+ MotaActionBlocks['enemyattr_e'].xmlText(),
+ MotaActionBlocks['blockId_e'].xmlText(),
+ MotaActionBlocks['blockCls_e'].xmlText(),
+ MotaActionBlocks['equip_e'].xmlText(),
MotaActionBlocks['evalString_e'].xmlText(),
],
'常见事件模板':[
@@ -398,22 +400,22 @@ function omitedcheckUpdateFunction(event) {
}
}
if(editor_blockly.workspace.topBlocks_.length>=2){
- codeAreaHL.setValue('入口方块只能有一个');
+ editor_blockly.setValue('入口方块只能有一个');
return;
}
var eventType = document.getElementById('entryType').value;
if(editor_blockly.workspace.topBlocks_.length==1){
var blockType = editor_blockly.workspace.topBlocks_[0].type;
if(blockType!==eventType+'_m'){
- codeAreaHL.setValue('入口方块类型错误');
+ editor_blockly.setValue('入口方块类型错误');
return;
}
}
try {
var code = Blockly.JavaScript.workspaceToCode(workspace).replace(/\\\\(i|c|d|e|z)/g, '\\\\\\\\$1');
- codeAreaHL.setValue(code);
+ editor_blockly.setValue(code);
} catch (error) {
- codeAreaHL.setValue(String(error));
+ editor_blockly.setValue(String(error));
if (error instanceof OmitedError){
var blockName = error.blockName;
var varName = error.varName;
@@ -529,13 +531,19 @@ function omitedcheckUpdateFunction(event) {
xhr.open('GET', '_server/MotaAction.g4', true);
xhr.send(null);
- codeAreaHL = CodeMirror.fromTextArea(document.getElementById("codeArea"), {
+ var codeAreaHL = CodeMirror.fromTextArea(document.getElementById("codeArea"), {
lineNumbers: true,
matchBrackets: true,
lineWrapping: true,
continueComments: "Enter",
- extraKeys: {"Ctrl-Q": "toggleComment"}
+ extraKeys: {"Ctrl-Q": "toggleComment"},
});
+ codeAreaHL.on('changes', function () {
+ editor_blockly.highlightParse(!changeFromBlockly);
+ changeFromBlockly = false;
+ });
+ var changeFromBlockly = false;
+ var shouldNotifyParse = false;
editor_blockly.showXML = function () {
var xml = Blockly.Xml.workspaceToDom(editor_blockly.workspace);
@@ -561,6 +569,11 @@ function omitedcheckUpdateFunction(event) {
}
}
+ editor_blockly.setValue = function (value) {
+ changeFromBlockly = true;
+ codeAreaHL.setValue(value);
+ }
+
editor_blockly.parse = function () {
MotaActionFunctions.parse(
eval('obj=' + codeAreaHL.getValue().replace(/[<>&]/g, function (c) {
@@ -580,7 +593,7 @@ function omitedcheckUpdateFunction(event) {
var type = args.type;
if (!type) return false;
editor_blockly.id = id_;
- codeAreaHL.setValue(input.value);
+ editor_blockly.setValue(input.value);
document.getElementById('entryType').value = type;
editor_blockly.parse();
editor_blockly.show();
@@ -604,6 +617,13 @@ function omitedcheckUpdateFunction(event) {
}
}
+ var blocklyParseBtn = document.getElementById('blocklyParse');
+ editor_blockly.highlightParse = function (shouldHighLight) {
+ if (shouldNotifyParse == shouldHighLight) return;
+ shouldNotifyParse = shouldHighLight;
+ blocklyParseBtn.style.background = shouldNotifyParse ? '#FFCCAA' : 'unset';
+ }
+
editor_blockly.cancel = function () {
editor_blockly.id = '';
editor_blockly.hide();
@@ -614,15 +634,19 @@ function omitedcheckUpdateFunction(event) {
editor_blockly.id = '';
return;
}
+ if (shouldNotifyParse) {
+ alert('你尚未解析修改后的内容,请进行解析或放弃操作');
+ return;
+ }
if(editor_blockly.workspace.topBlocks_.length>=2){
- codeAreaHL.setValue('入口方块只能有一个');
+ editor_blockly.setValue('入口方块只能有一个');
return;
}
var eventType = document.getElementById('entryType').value;
if(editor_blockly.workspace.topBlocks_.length==1){
var blockType = editor_blockly.workspace.topBlocks_[0].type;
if(blockType!==eventType+'_m'){
- codeAreaHL.setValue('入口方块类型错误');
+ editor_blockly.setValue('入口方块类型错误');
return;
}
}
@@ -684,7 +708,7 @@ function omitedcheckUpdateFunction(event) {
var types = [
"previewUI_s", "clearMap_s", "clearMap_1_s", "setAttribute_s", "fillText_s",
"fillBoldText_s", "fillRect_s", "strokeRect_s", "drawLine_s",
- "drawArrow_s", "fillPolygon_s", "strokePolygon_s", "fillCircle_s", "strokeCircle_s",
+ "drawArrow_s", "fillPolygon_s", "strokePolygon_s", "fillEllipse_s", "strokeEllipse_s", "fillArc_s", "strokeArc_s",
"drawImage_s", "drawImage_1_s", "drawIcon_s", "drawBackground_s", "drawSelector_s", "drawSelector_1_s",
"waitContext_2"
];
@@ -826,9 +850,9 @@ function omitedcheckUpdateFunction(event) {
// id: [x, y, floorId, forceFloor]
var selectPointBlocks = {
- "changeFloor_m": ["Number_0", "Number_1", "IdString_0", true],
+ "changeFloor_m": ["PosString_0", "PosString_1", "IdString_0", true],
"jumpHero_s": ["PosString_0", "PosString_1"],
- "changeFloor_s": ["Number_0", "Number_1", "IdString_0", true],
+ "changeFloor_s": ["PosString_0", "PosString_1", "IdString_0", true],
"changePos_s": ["PosString_0", "PosString_1"],
"battle_1_s": ["PosString_0", "PosString_1"],
"openDoor_s": ["PosString_0", "PosString_1", "IdString_0"],
@@ -1011,7 +1035,7 @@ function omitedcheckUpdateFunction(event) {
}
// 对怪物ID提供补全
- if ((type == 'idString_3_e' || type == 'battle_s' || type == 'setEnemy_s') && name == 'IdString_0') {
+ if ((type == 'enemyattr_e' || type == 'battle_s' || type == 'setEnemy_s') && name == 'IdString_0') {
return filter(allEnemys, content);
}
diff --git a/_server/editor_listen.js b/_server/editor_listen.js
index 7fff8ff5..f5994f4e 100644
--- a/_server/editor_listen.js
+++ b/_server/editor_listen.js
@@ -35,6 +35,7 @@ editor_listen_wrapper = function (editor) {
editor.dom.clearLoc.onmousedown = editor.uifunctions.clearLoc_click
editor.dom.lastUsed.onmousedown = editor.uifunctions.lastUsed_click;
+ editor.dom.lastUsed.oncontextmenu = function (e) { e.preventDefault(); }
editor.dom.clearLastUsedBtn.onclick = editor.uifunctions.clearLastUsedBtn_click;
editor.dom.lockMode.onchange = editor.uifunctions.lockMode_onchange;
diff --git a/_server/editor_mappanel.js b/_server/editor_mappanel.js
index fcfb0fd3..f6c7687c 100644
--- a/_server/editor_mappanel.js
+++ b/_server/editor_mappanel.js
@@ -257,7 +257,17 @@ editor_mappanel_wrapper = function (editor) {
}
// console.log(editor.map);
if (editor.info.y != null) {
- editor.uivalues.lastUsed = [editor.info].concat(editor.uivalues.lastUsed.filter(function (e) { return e.id != editor.info.id}));
+ var found = false;
+ editor.uivalues.lastUsed.forEach(function (one) {
+ if (one.id == editor.info.id) {
+ found = true;
+ one.recent = new Date().getTime();
+ one.frequent = (one.frequent || 0) + 1;
+ }
+ })
+ if (!found) {
+ editor.uivalues.lastUsed.push(Object.assign({}, editor.info, {recent: new Date().getTime(), frequent: 1}));
+ }
editor.config.set("lastUsed", editor.uivalues.lastUsed);
}
editor.updateMap();
@@ -781,16 +791,34 @@ editor_mappanel_wrapper = function (editor) {
var x = parseInt(px / 32), y = parseInt(py / 32);
var index = x + core.__SIZE__ * y;
if (index >= editor.uivalues.lastUsed.length) return;
- editor.setSelectBoxFromInfo(editor.uivalues.lastUsed[index]);
- return;
+ var lastUsed = editor.uivalues.lastUsed.sort(function (a, b) {
+ if ((a.istop || 0) != (b.istop || 0)) return (b.istop || 0) - (a.istop || 0);
+ return (b[editor.uivalues.lastUsedType] || 0) - (a[editor.uivalues.lastUsedType] || 0);
+ });
+
+ if (e.button == 2) {
+ lastUsed[index].istop = lastUsed[index].istop ? 0 : 1;
+ printf("已"+(lastUsed[index].istop ? '置顶' : '取消置顶')+"该图块");
+ editor.config.set('lastUsed', editor.uivalues.lastUsed);
+ editor.updateLastUsedMap();
+ return false;
+ }
+ var one = Object.assign({}, lastUsed[index]);
+ delete one['recent'];
+ delete one['frequent'];
+ delete one['istop'];
+ editor.setSelectBoxFromInfo(one);
+ return false;
}
editor.uifunctions.clearLastUsedBtn_click = function () {
if (editor.isMobile) return;
-
- editor.uivalues.lastUsed = [];
- editor.config.set('lastUsed', []);
- editor.updateLastUsedMap();
+
+ if (confirm("你确定要清理全部最近使用图块么?\n所有最近使用和最常使用图块(含置顶图块)都将被清除;此过程不可逆!")) {
+ editor.uivalues.lastUsed = [];
+ editor.config.set('lastUsed', []);
+ editor.updateLastUsedMap();
+ }
}
/////////////////////////////////////////////////////////////////////////////
diff --git a/_server/editor_mode.js b/_server/editor_mode.js
index 5ca0f7b0..d7b8e728 100644
--- a/_server/editor_mode.js
+++ b/_server/editor_mode.js
@@ -97,14 +97,12 @@ editor_mode = function (editor) {
}
editor_mode.prototype.onmode = function (mode, callback) {
- //setTimeout(function(){
- if (editor_mode.mode != mode) {
- if (mode === 'save') editor_mode.doActionList(editor_mode.mode, editor_mode.actionList, callback);
- if (editor_mode.mode === 'nextChange' && mode) editor_mode.showMode(mode);
- if (mode !== 'save') editor_mode.mode = mode;
- editor_mode.actionList = [];
- }
- //})
+ if (editor_mode.mode != mode) {
+ if (mode === 'save') editor_mode.doActionList(editor_mode.mode, editor_mode.actionList, callback);
+ if (editor_mode.mode === 'nextChange' && mode) editor_mode.showMode(mode);
+ if (mode !== 'save') editor_mode.mode = mode;
+ editor_mode.actionList = [];
+ }
}
editor_mode.prototype.showMode = function (mode) {
diff --git a/_server/editor_table.js b/_server/editor_table.js
index 1788515b..d36d1da2 100644
--- a/_server/editor_table.js
+++ b/_server/editor_table.js
@@ -27,7 +27,8 @@ editor_table_wrapper = function (editor) {
return /* html */`\n`
}
editor_table.prototype.checkboxSet = function (value, keys, prefixStrings) {
- if (!(value instanceof Array)) value = [];
+ if (value == null) value = [];
+ if (!(value instanceof Array)) value = [value];
keys=Array.from(keys)
prefixStrings=Array.from(prefixStrings)
for (var index = 0; index < value.length; index++) {
@@ -224,8 +225,10 @@ editor_table_wrapper = function (editor) {
var listen = function (guids) {
// 每个叶节点的事件绑定
+ var tableid = editor.util.guid();
+ editor.mode.currentTable=tableid;
guids.forEach(function (guid) {
- editor.table.guidListen(guid, obj, commentObj)
+ editor.table.guidListen(guid, tableid, obj, commentObj)
});
}
return { "HTML": outstr.join(''), "guids": guids, "listen": listen };
@@ -309,7 +312,7 @@ editor_table_wrapper = function (editor) {
* 监听一个guid对应的表格项
* @param {String} guid
*/
- editor_table.prototype.guidListen = function (guid, obj, commentObj) {
+ editor_table.prototype.guidListen = function (guid, tableid, obj, commentObj) {
// tr>td[title=field]
// >td[title=comment,cobj=cobj:json]
// >td>div>input[value=thiseval]
@@ -318,6 +321,7 @@ editor_table_wrapper = function (editor) {
var field = thisTr.children[0].getAttribute('title');
var cobj = JSON.parse(thisTr.children[1].getAttribute('cobj'));
var modeNode = thisTr.parentNode;
+ thisTr.setAttribute('tableid',tableid)
while (!editor_mode._ids.hasOwnProperty(modeNode.getAttribute('id'))) {
modeNode = modeNode.parentNode;
}
@@ -341,6 +345,7 @@ editor_table_wrapper = function (editor) {
*/
editor_table.prototype.onchange = function (guid, obj, commentObj, thisTr, input, field, cobj, modeNode) {
editor_mode.onmode(editor_mode._ids[modeNode.getAttribute('id')]);
+ if (editor.mode.currentTable!=thisTr.getAttribute('tableid')) return;
var thiseval = null;
if (input.checked != null) input.value = input.checked;
try {
diff --git a/_server/editor_ui.js b/_server/editor_ui.js
index 4965f1ea..cc9588ed 100644
--- a/_server/editor_ui.js
+++ b/_server/editor_ui.js
@@ -792,8 +792,10 @@ editor_ui_wrapper = function (editor) {
}
// 试听音频
if (one.endsWith('.mp3') || one.endsWith('.wmv') || one.endsWith('.ogg') || one.endsWith('.wav')) {
- html += "";
- html += '';
+ html += "";
+ html += `0:00 / 0:00
+
+ `;
}
html += '
';
});
@@ -824,19 +826,41 @@ editor_ui_wrapper = function (editor) {
}
uievent._previewMaterialAudio = function (button) {
- var br = button.nextElementSibling;
+ var span = button.nextElementSibling;
+ var br = span.nextElementSibling;
var audio = br.nextElementSibling;
+ var progress = audio.nextElementSibling;
if (br.style.display == 'none') {
- button.innerText = '折叠';
+ button.innerText = '暂停';
br.style.display = 'block';
- audio.style.display = 'block';
+ progress.style.display = 'block';
+ span.style.display = 'inline';
+ audio.play();
} else {
- button.innerText = '试听';
+ button.innerText = '播放';
br.style.display = 'none';
- audio.style.display = 'none';
+ progress.style.display='none';
+ span.style.display = 'none';
+ audio.pause();
}
}
+ uievent._previewMaterialAudio_onTimeUpdate = function (audio) {
+ var _format = function (time) { return parseInt(time/60) + ":" + core.setTwoDigits(parseInt(time) % 60); }
+ if (audio.duration > 0) {
+ audio.previousElementSibling.previousElementSibling.innerText = _format(audio.currentTime) + " / " + _format(audio.duration);
+ audio.nextElementSibling.setAttribute('value', audio.currentTime / audio.duration);
+ }
+ }
+
+ uievent._previewMaterialAudio_seek = function (element, event) {
+ var audio = element.previousElementSibling;
+ var value = event.offsetX * element.max / element.offsetWidth;
+ element.setAttribute("value", value);
+ audio.currentTime = audio.duration * value;
+ if (audio.paused) audio.play();
+ }
+
editor.constructor.prototype.uievent=uievent;
}
\ No newline at end of file
diff --git a/_server/table/data.comment.js b/_server/table/data.comment.js
index 4e6f5320..7e0a246f 100644
--- a/_server/table/data.comment.js
+++ b/_server/table/data.comment.js
@@ -91,6 +91,18 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_docs": "本塔使用音效",
"_data": "在此存放所有的SE,和文件名一致 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
},
+ "fonts": {
+ "_leaf": true,
+ "_type": "material",
+ "_range": "editor.mode.checkUnique(thiseval)",
+ "_directory": "./project/fonts/",
+ "_transform": (function (one) {
+ if (one.endsWith(".ttf")) return one.substring(0, one.lastIndexOf('.'));
+ return null;
+ }).toString(),
+ "_docs": "本塔使用字体",
+ "_data": "在此存放所有可能使用的字体 \n 字体名不能使用中文,不能带空格或特殊字符"
+ },
"nameMap": {
"_leaf": true,
"_type": "textarea",
diff --git a/editor-mobile.html b/editor-mobile.html
index 143408e6..dabddf55 100644
--- a/editor-mobile.html
+++ b/editor-mobile.html
@@ -219,7 +219,7 @@
-
+
最近使用的图块列表(Ctrl+滚轮放缩)
+(Ctrl+滚轮放缩,右键置顶)