toolboxReplay
This commit is contained in:
parent
6b23361b61
commit
ba7eccbf5e
@ -1851,20 +1851,22 @@ return code;
|
||||
|
||||
|
||||
autoSave_s
|
||||
: '自动存档'
|
||||
: '自动存档' '不提示' Bool Newline
|
||||
|
||||
|
||||
/* autoSave_s
|
||||
tooltip : autoSave: 自动存档
|
||||
helpUrl : https://h5mota.com/games/template/_docs/#/event?id=autoSave%ef%bc%9a%e8%87%aa%e5%8a%a8%e5%ad%98%e6%a1%a3
|
||||
colour : this.soundColor
|
||||
var code = '{"type": "autoSave"},\n';
|
||||
default : [false]
|
||||
Bool_0 = Bool_0 ? (', "nohint": true') : '';
|
||||
var code = '{"type": "autoSave"'+Bool_0+'},\n';
|
||||
return code;
|
||||
*/;
|
||||
|
||||
|
||||
callLoad_s
|
||||
: '呼出读档页面'
|
||||
: '呼出读档页面' Newline
|
||||
|
||||
|
||||
/* callLoad_s
|
||||
@ -1903,7 +1905,7 @@ return code;
|
||||
|
||||
|
||||
clearMap_1_s
|
||||
: '清空画布'
|
||||
: '清空画布' Newline
|
||||
|
||||
/* clearMap_1_s
|
||||
tooltip : clearMap: 清除画布
|
||||
@ -3202,7 +3204,7 @@ ActionParser.prototype.parseAction = function() {
|
||||
break;
|
||||
case "autoSave": // 自动存档
|
||||
this.next = MotaActionBlocks['autoSave_s'].xmlText([
|
||||
this.next]);
|
||||
this.nohint, this.next]);
|
||||
break;
|
||||
case "callLoad": // 呼出读档界面
|
||||
this.next = MotaActionBlocks['callLoad_s'].xmlText([
|
||||
|
||||
@ -15,13 +15,15 @@ editor_file = function (editor, callback) {
|
||||
var filename = 'project/floors/' + editor.currentFloorId + '.js';
|
||||
var datastr = ['main.floors.', editor.currentFloorId, '=\n'];
|
||||
|
||||
for(var ii=0,name;name=['map','bgmap','fgmap'][ii];ii++){
|
||||
var mapArray=editor[name].map(function (v) {
|
||||
return v.map(function (v) {
|
||||
return v.idnum || v || 0
|
||||
})
|
||||
});
|
||||
editor.currentFloorData[name]=mapArray;
|
||||
if (core.floorIds.indexOf(editor.currentFloorId) >= 0) {
|
||||
for(var ii=0,name;name=['map','bgmap','fgmap'][ii];ii++){
|
||||
var mapArray=editor[name].map(function (v) {
|
||||
return v.map(function (v) {
|
||||
return v.idnum || v || 0
|
||||
})
|
||||
});
|
||||
editor.currentFloorData[name]=mapArray;
|
||||
}
|
||||
}
|
||||
|
||||
// format 更改实现方式以支持undefined删除
|
||||
|
||||
@ -113,7 +113,8 @@ actions.prototype.doRegisteredAction = function (action) {
|
||||
|
||||
actions.prototype._checkReplaying = function () {
|
||||
if (core.isReplaying() && core.status.event.id != 'save'
|
||||
&& (core.status.event.id || "").indexOf('book') != 0 && core.status.event.id != 'viewMaps')
|
||||
&& (core.status.event.id || "").indexOf('book') != 0 && core.status.event.id != 'viewMaps'
|
||||
&& core.status.event.id != 'toolbox' && core.status.event.id != 'equipbox')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@ -170,6 +171,10 @@ actions.prototype._sys_onkeyUp_replay = function (e) {
|
||||
core.viewMapReplay();
|
||||
else if (e.keyCode == 78) // N
|
||||
core.stepReplay();
|
||||
else if (e.keyCode == 84) // T
|
||||
core.toolboxReplay();
|
||||
else if (e.keyCode == 81) // Q
|
||||
core.equipboxReplay();
|
||||
else if (e.keyCode >= 49 && e.keyCode <= 51) // 1-3
|
||||
core.setReplaySpeed(e.keyCode - 48);
|
||||
else if (e.keyCode == 52) // 4
|
||||
@ -1317,7 +1322,10 @@ actions.prototype._clickToolbox = function (x, y) {
|
||||
// 装备栏
|
||||
if (x >= this.LAST - 2 && y == 0) {
|
||||
core.ui.closePanel();
|
||||
core.openEquipbox();
|
||||
if (core.isReplaying())
|
||||
core.equipboxReplay();
|
||||
else
|
||||
core.openEquipbox();
|
||||
return;
|
||||
}
|
||||
if (x >= this.LAST - 2 && y == this.LAST) {
|
||||
@ -1376,6 +1384,7 @@ actions.prototype._clickToolboxIndex = function (index) {
|
||||
if (select >= items.length) return;
|
||||
var itemId = items[select];
|
||||
if (itemId == core.status.event.data.selectId) {
|
||||
if (core.isReplaying()) return;
|
||||
core.events.tryUseItem(itemId);
|
||||
}
|
||||
else {
|
||||
@ -1478,7 +1487,10 @@ actions.prototype._keyDownToolbox = function (keycode) {
|
||||
actions.prototype._keyUpToolbox = function (keycode) {
|
||||
if (keycode == 81) {
|
||||
core.ui.closePanel();
|
||||
core.openEquipbox();
|
||||
if (core.isReplaying())
|
||||
core.equipboxReplay();
|
||||
else
|
||||
core.openEquipbox();
|
||||
return;
|
||||
}
|
||||
if (keycode == 84 || keycode == 27 || keycode == 88) {
|
||||
@ -1498,7 +1510,10 @@ actions.prototype._clickEquipbox = function (x, y) {
|
||||
// 道具栏
|
||||
if (x >= this.LAST - 2 && y == 0) {
|
||||
core.ui.closePanel();
|
||||
core.openToolbox();
|
||||
if (core.isReplaying())
|
||||
core.toolboxReplay();
|
||||
else
|
||||
core.openToolbox();
|
||||
return;
|
||||
}
|
||||
// 返回
|
||||
@ -1547,6 +1562,7 @@ actions.prototype._clickEquipboxIndex = function (index) {
|
||||
if (index < this.LAST) {
|
||||
if (index >= core.status.globalAttribute.equipName.length) return;
|
||||
if (index == core.status.event.selection && core.status.hero.equipment[index]) {
|
||||
if (core.isReplaying()) return;
|
||||
core.unloadEquip(index);
|
||||
core.status.route.push("unEquip:" + index);
|
||||
}
|
||||
@ -1554,6 +1570,7 @@ actions.prototype._clickEquipboxIndex = function (index) {
|
||||
else {
|
||||
var equips = Object.keys(core.status.hero.items.equips || {}).sort();
|
||||
if (index == core.status.event.selection) {
|
||||
if (core.isReplaying()) return;
|
||||
var equipId = equips[index - this.LAST + (core.status.event.data.page - 1) * this.LAST];
|
||||
core.loadEquip(equipId);
|
||||
core.status.route.push("equip:" + equipId);
|
||||
@ -1645,7 +1662,10 @@ actions.prototype._keyUpEquipbox = function (keycode, altKey) {
|
||||
}
|
||||
if (keycode == 84) {
|
||||
core.ui.closePanel();
|
||||
core.openToolbox();
|
||||
if (core.isReplaying())
|
||||
core.toolboxReplay();
|
||||
else
|
||||
core.openToolbox();
|
||||
return;
|
||||
}
|
||||
if (keycode == 81 || keycode == 27 || keycode == 88) {
|
||||
|
||||
@ -1223,6 +1223,28 @@ control.prototype.viewMapReplay = function () {
|
||||
core.ui.drawMaps();
|
||||
}
|
||||
|
||||
control.prototype.toolboxReplay = function () {
|
||||
if (!core.isPlaying() || !core.isReplaying()) return;
|
||||
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
||||
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
||||
return core.drawTip("请等待当前事件的处理结束");
|
||||
|
||||
core.lockControl();
|
||||
core.status.event.id='toolbox';
|
||||
core.ui.drawToolbox();
|
||||
}
|
||||
|
||||
control.prototype.equipboxReplay = function () {
|
||||
if (!core.isPlaying() || !core.isReplaying()) return;
|
||||
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
||||
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
||||
return core.drawTip("请等待当前事件的处理结束");
|
||||
|
||||
core.lockControl();
|
||||
core.status.event.id='equipbox';
|
||||
core.ui.drawEquipbox();
|
||||
}
|
||||
|
||||
////// 是否正在播放录像 //////
|
||||
control.prototype.isReplaying = function () {
|
||||
return (core.status.replay||{}).replaying;
|
||||
|
||||
@ -1603,7 +1603,7 @@ events.prototype._action_callSave = function (data, x, y, prefix) {
|
||||
|
||||
events.prototype._action_autoSave = function (data, x, y, prefix) {
|
||||
core.autosave();
|
||||
core.drawTip("已自动存档");
|
||||
if (!data.nohint) core.drawTip("已自动存档");
|
||||
core.doAction();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user