recover events
This commit is contained in:
parent
c8ca08cb78
commit
bf57367562
@ -1565,7 +1565,7 @@ callBook_s
|
|||||||
|
|
||||||
/* callBook_s
|
/* callBook_s
|
||||||
tooltip : callBook: 呼出怪物手册;返回游戏后将继续执行后面的事件
|
tooltip : callBook: 呼出怪物手册;返回游戏后将继续执行后面的事件
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=waitAsync%ef%bc%9a%e7%ad%89%e5%be%85%e6%89%80%e6%9c%89%e5%bc%82%e6%ad%a5%e4%ba%8b%e4%bb%b6%e6%89%a7%e8%a1%8c%e5%ae%8c%e6%af%95
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=callBook%ef%bc%9a%e5%91%bc%e5%87%ba%e6%80%aa%e7%89%a9%e6%89%8b%e5%86%8c
|
||||||
colour : this.soundColor
|
colour : this.soundColor
|
||||||
var code = '{"type": "callBook"},\n';
|
var code = '{"type": "callBook"},\n';
|
||||||
return code;
|
return code;
|
||||||
@ -1578,7 +1578,7 @@ callSave_s
|
|||||||
|
|
||||||
/* callSave_s
|
/* callSave_s
|
||||||
tooltip : callSave: 呼出存档页面;之后读此档将执行eachArrive
|
tooltip : callSave: 呼出存档页面;之后读此档将执行eachArrive
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=waitAsync%ef%bc%9a%e7%ad%89%e5%be%85%e6%89%80%e6%9c%89%e5%bc%82%e6%ad%a5%e4%ba%8b%e4%bb%b6%e6%89%a7%e8%a1%8c%e5%ae%8c%e6%af%95
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=callSave%ef%bc%9a%e5%91%bc%e5%87%ba%e5%ad%98%e6%a1%a3%e7%95%8c%e9%9d%a2
|
||||||
colour : this.soundColor
|
colour : this.soundColor
|
||||||
var code = '{"type": "callSave"},\n';
|
var code = '{"type": "callSave"},\n';
|
||||||
return code;
|
return code;
|
||||||
@ -1591,7 +1591,7 @@ callLoad_s
|
|||||||
|
|
||||||
/* callLoad_s
|
/* callLoad_s
|
||||||
tooltip : callLoad: 呼出存档页面;返回游戏后将继续执行后面的事件
|
tooltip : callLoad: 呼出存档页面;返回游戏后将继续执行后面的事件
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/event?id=waitAsync%ef%bc%9a%e7%ad%89%e5%be%85%e6%89%80%e6%9c%89%e5%bc%82%e6%ad%a5%e4%ba%8b%e4%bb%b6%e6%89%a7%e8%a1%8c%e5%ae%8c%e6%af%95
|
helpUrl : https://h5mota.com/games/template/docs/#/event?id=callLoad%ef%bc%9a%e5%91%bc%e5%87%ba%e8%af%bb%e6%a1%a3%e7%95%8c%e9%9d%a2
|
||||||
colour : this.soundColor
|
colour : this.soundColor
|
||||||
var code = '{"type": "callLoad"},\n';
|
var code = '{"type": "callLoad"},\n';
|
||||||
return code;
|
return code;
|
||||||
|
|||||||
@ -886,13 +886,8 @@ actions.prototype.clickBook = function(x,y) {
|
|||||||
}
|
}
|
||||||
// 返回
|
// 返回
|
||||||
if (x>=10 && x<=12 && y==12) {
|
if (x>=10 && x<=12 && y==12) {
|
||||||
if (core.status.event.interval != null) {
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
var data = core.status.event.interval;
|
return;
|
||||||
core.ui.closePanel();
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
core.doAction();
|
|
||||||
}
|
}
|
||||||
else if (core.status.event.ui != null) {
|
else if (core.status.event.ui != null) {
|
||||||
core.status.boxAnimateObjs = [];
|
core.status.boxAnimateObjs = [];
|
||||||
@ -926,13 +921,8 @@ actions.prototype.keyDownBook = function (keycode) {
|
|||||||
////// 怪物手册界面时,放开某个键的操作 //////
|
////// 怪物手册界面时,放开某个键的操作 //////
|
||||||
actions.prototype.keyUpBook = function (keycode) {
|
actions.prototype.keyUpBook = function (keycode) {
|
||||||
if (keycode==27 || keycode==88) {
|
if (keycode==27 || keycode==88) {
|
||||||
if (core.status.event.interval != null) {
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
var data = core.status.event.interval;
|
return;
|
||||||
core.ui.closePanel();
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
core.doAction();
|
|
||||||
}
|
}
|
||||||
else if (core.status.event.ui != null) {
|
else if (core.status.event.ui != null) {
|
||||||
core.status.boxAnimateObjs = [];
|
core.status.boxAnimateObjs = [];
|
||||||
@ -1663,13 +1653,7 @@ actions.prototype.clickSL = function(x,y) {
|
|||||||
}
|
}
|
||||||
// 返回
|
// 返回
|
||||||
if (x>=10 && x<=12 && y==12) {
|
if (x>=10 && x<=12 && y==12) {
|
||||||
if (core.status.event.interval != null) {
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
var data = core.status.event.interval;
|
|
||||||
core.ui.closePanel();
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
core.doAction();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
@ -1784,13 +1768,7 @@ actions.prototype.keyUpSL = function (keycode) {
|
|||||||
var page = parseInt(index/10), offset=index%10;
|
var page = parseInt(index/10), offset=index%10;
|
||||||
|
|
||||||
if (keycode==27 || keycode==88 || (core.status.event.id == 'save' && keycode==83) || (core.status.event.id == 'load' && keycode==68)) {
|
if (keycode==27 || keycode==88 || (core.status.event.id == 'save' && keycode==83) || (core.status.event.id == 'load' && keycode==68)) {
|
||||||
if (core.status.event.interval != null) {
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
var data = core.status.event.interval;
|
|
||||||
core.ui.closePanel();
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
core.doAction();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
|
|||||||
@ -1967,13 +1967,7 @@ control.prototype.checkStatus = function (name, need, item) {
|
|||||||
control.prototype.openBook = function (need) {
|
control.prototype.openBook = function (need) {
|
||||||
if (core.isReplaying()) return;
|
if (core.isReplaying()) return;
|
||||||
|
|
||||||
if (core.status.event.id == 'book' && core.isset(core.status.event.interval)) {
|
if (core.status.event.id == 'book' && core.events.recoverEvents(core.status.event.interval)) {
|
||||||
var data = core.status.event.interval;
|
|
||||||
core.ui.closePanel();
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
core.doAction();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2050,13 +2044,7 @@ control.prototype.openQuickShop = function (need) {
|
|||||||
control.prototype.save = function(need) {
|
control.prototype.save = function(need) {
|
||||||
if (core.isReplaying()) return;
|
if (core.isReplaying()) return;
|
||||||
|
|
||||||
if (core.status.event.id == 'save' && core.isset(core.status.event.interval)) {
|
if (core.status.event.id == 'save' && core.events.recoverEvents(core.status.event.interval)) {
|
||||||
var data = core.status.event.interval;
|
|
||||||
core.ui.closePanel();
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
core.doAction();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2073,13 +2061,7 @@ control.prototype.save = function(need) {
|
|||||||
control.prototype.load = function (need) {
|
control.prototype.load = function (need) {
|
||||||
if (core.isReplaying()) return;
|
if (core.isReplaying()) return;
|
||||||
|
|
||||||
if (core.status.event.id == 'load' && core.isset(core.status.event.interval)) {
|
if (core.status.event.id == 'load' && core.events.recoverEvents(core.status.event.interval)) {
|
||||||
var data = core.status.event.interval;
|
|
||||||
core.ui.closePanel();
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
core.doAction();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2140,14 +2122,8 @@ control.prototype.doSL = function (id, type) {
|
|||||||
core.saves.saveIndex=id;
|
core.saves.saveIndex=id;
|
||||||
core.setLocalStorage('saveIndex', core.saves.saveIndex);
|
core.setLocalStorage('saveIndex', core.saves.saveIndex);
|
||||||
}
|
}
|
||||||
if (core.status.event.interval != null) {
|
if (core.events.recoverEvents(core.status.event.interval)) {
|
||||||
var data = core.status.event.interval;
|
|
||||||
core.ui.closePanel();
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
core.drawTip("存档成功!");
|
core.drawTip("存档成功!");
|
||||||
core.doAction();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
|
|||||||
@ -1291,6 +1291,21 @@ events.prototype.insertAction = function (action, x, y, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 恢复一个事件 //////
|
||||||
|
events.prototype.recoverEvents = function (data) {
|
||||||
|
if (core.isset(data)) {
|
||||||
|
core.ui.closePanel();
|
||||||
|
core.lockControl();
|
||||||
|
core.status.event.id = 'action';
|
||||||
|
core.status.event.data = data;
|
||||||
|
setTimeout(function () {
|
||||||
|
core.doAction();
|
||||||
|
}, 30);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////// 获得面前的物品(轻按) //////
|
////// 获得面前的物品(轻按) //////
|
||||||
events.prototype.getNextItem = function() {
|
events.prototype.getNextItem = function() {
|
||||||
if (!core.status.heroStop || !core.flags.enableGentleClick) return false;
|
if (!core.status.heroStop || !core.flags.enableGentleClick) return false;
|
||||||
|
|||||||
@ -146,16 +146,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
|
|
||||||
// 如果是读档,则进行检查
|
// 如果是读档,则进行检查
|
||||||
if (fromLoad) {
|
if (fromLoad) {
|
||||||
var data = core.getFlag("__events__");
|
core.events.recoverEvents(core.getFlag("__events__"));
|
||||||
if (core.isset(data)) {
|
|
||||||
// 是事件中的存档... 恢复现场
|
|
||||||
core.lockControl();
|
|
||||||
core.status.event.id = 'action';
|
|
||||||
core.status.event.data = data;
|
|
||||||
setTimeout(function () {
|
|
||||||
core.doAction();
|
|
||||||
}, 30);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// 每次抵达楼层执行的事件
|
// 每次抵达楼层执行的事件
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user