autosave in events
This commit is contained in:
parent
cbd2f650a5
commit
32b73796da
@ -1480,29 +1480,21 @@ control.prototype._replayAction_key = function (action) {
|
|||||||
|
|
||||||
////// 自动存档 //////
|
////// 自动存档 //////
|
||||||
control.prototype.autosave = function (removeLast) {
|
control.prototype.autosave = function (removeLast) {
|
||||||
var inEvent = false; // 检测是否是事件中的自动存档
|
|
||||||
if (core.status.event.id!=null) {
|
|
||||||
if (core.status.event.id!='action') return;
|
|
||||||
inEvent = true;
|
|
||||||
}
|
|
||||||
var x=null;
|
var x=null;
|
||||||
if (removeLast) x=core.status.route.pop();
|
if (removeLast) {
|
||||||
if (inEvent) {
|
x=core.status.route.pop();
|
||||||
core.setFlag("__events__", core.clone(core.status.event.data));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
core.status.route.push("turn:"+core.getHeroLoc('direction'));
|
core.status.route.push("turn:"+core.getHeroLoc('direction'));
|
||||||
}
|
}
|
||||||
|
if (core.status.event.id == 'action') // 事件中的自动存档
|
||||||
|
core.setFlag("__events__", core.clone(core.status.event.data));
|
||||||
core.saves.autosave.data = core.saveData();
|
core.saves.autosave.data = core.saveData();
|
||||||
core.saves.autosave.updated = true;
|
core.saves.autosave.updated = true;
|
||||||
core.saves.ids[0] = true;
|
core.saves.ids[0] = true;
|
||||||
if (inEvent) {
|
core.removeFlag("__events__");
|
||||||
core.removeFlag("__events__");
|
if (removeLast) {
|
||||||
}
|
|
||||||
else {
|
|
||||||
core.status.route.pop();
|
core.status.route.pop();
|
||||||
|
if (x) core.status.route.push(x);
|
||||||
}
|
}
|
||||||
if (x) core.status.route.push(x);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////// 实际进行自动存档 //////
|
/////// 实际进行自动存档 //////
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user