diff --git a/libs/control.js b/libs/control.js index 109de0e3..33ea4eac 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2447,12 +2447,14 @@ control.prototype.getSaves = function (index, callback) { return; } - var ids = Object.keys(core.saves.ids).sort(function(a,b) {return a-b;}), number = ids.length; + var ids = Object.keys(core.saves.ids).filter(function(x){return x!=0;}) + .sort(function(a,b) {return a-b;}), number = ids.length; + // 不计0 var saves = []; var load = function (index, callback) { - if (index >= number) { + if (index > number) { if (core.isset(callback)) callback(saves); return; } @@ -2464,7 +2466,7 @@ control.prototype.getSaves = function (index, callback) { load(index+1, callback); }) } - load(1, callback); + load(0, callback); } ////// 获得所有存在存档的存档位 ////// diff --git a/libs/events.js b/libs/events.js index 1db37f82..3bdf5e54 100644 --- a/libs/events.js +++ b/libs/events.js @@ -221,6 +221,27 @@ events.prototype.gameOver = function (ending, fromReplay, norank) { ending += "[比赛]"; } + var askRate = function () { + if (!core.isset(ending)) { + core.restart(); + return; + } + + core.ui.closePanel(); + core.ui.drawConfirmBox("恭喜通关本塔,你想进行评分吗?", function () { + if (core.platform.isPC) { + window.open("/score.php?name="+core.firstData.name+"&num=10", "_blank"); + core.restart(); + } + else { + window.location.href = "/score.php?name="+core.firstData.name+"&num=10"; + } + }, function () { + core.restart(); + }); + + } + // 下载录像 var confirmDownload = function () { @@ -234,9 +255,11 @@ events.prototype.gameOver = function (ending, fromReplay, norank) { 'route': core.encodeRoute(core.status.route) } core.download(core.firstData.name+"_"+core.formatDate2(new Date())+".h5route", JSON.stringify(obj)); - core.restart(); + // core.restart(); + askRate(); }, function () { - core.restart(); + // core.restart(); + askRate(); }) }