askRate & Fix getSaves
This commit is contained in:
parent
10479803a8
commit
a80383e0fb
@ -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);
|
||||
}
|
||||
|
||||
////// 获得所有存在存档的存档位 //////
|
||||
|
||||
@ -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();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user