Commit 9d86b3b6 authored by AU-Pro-mac's avatar AU-Pro-mac

a

parent 3db49fcc
......@@ -2554,7 +2554,6 @@ var Root = (function (_super) {
Root.prototype.gameAgain = function () {
return __awaiter(this, void 0, void 0, function () {
var userInfoRes;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -2568,7 +2567,7 @@ var Root = (function (_super) {
this.userInfo = userInfoRes.data;
console.log('CSD-GAME this.userInfo:', userInfoRes.data);
if (this.userInfo.noGameTime && this.userInfo.noGameTime == 1) {
Main_1.GDispatcher.addEventListener("outCallBackToPage", function () { _this.gameOver('back'); }, this);
Main_1.GDispatcher.addEventListener("outCallBackToPage", this.backOutCall, this);
return [2];
}
else {
......@@ -2624,6 +2623,11 @@ var Root = (function (_super) {
});
});
};
Root.prototype.backOutCall = function () {
Main_1.GDispatcher.removeEventListener('gameReset', this.gameAgain, this);
Main_1.GDispatcher.removeEventListener('outCallBackToPage', this.backOutCall, this);
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.backToPage, {}, function (s, res) { console.log('back_To_Page'); });
};
Root.prototype.gameScoreChange = function (score) {
this.scoreBoard.updateScore(score);
};
......@@ -2685,7 +2689,6 @@ var Root = (function (_super) {
this.touchArea.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDownArea, this);
this.touchArea.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.onMouseUpArea, this);
this.backBtn.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, function () { _this.gameOver('back'); }, this);
Main_1.GDispatcher.removeEventListener("outCallBackToPage", function () { _this.gameOver('back'); });
};
return Root;
}(FYGE.Container));
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2556,7 +2556,6 @@ var Root = (function (_super) {
Root.prototype.gameAgain = function () {
return __awaiter(this, void 0, void 0, function () {
var userInfoRes;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -2570,7 +2569,7 @@ var Root = (function (_super) {
this.userInfo = userInfoRes.data;
console.log('CSD-GAME this.userInfo:', userInfoRes.data);
if (this.userInfo.noGameTime && this.userInfo.noGameTime == 1) {
Main_1.GDispatcher.addEventListener("outCallBackToPage", function () { _this.gameOver('back'); }, this);
Main_1.GDispatcher.addEventListener("outCallBackToPage", this.backOutCall, this);
return [2];
}
else {
......@@ -2626,6 +2625,11 @@ var Root = (function (_super) {
});
});
};
Root.prototype.backOutCall = function () {
Main_1.GDispatcher.removeEventListener('gameReset', this.gameAgain, this);
Main_1.GDispatcher.removeEventListener('outCallBackToPage', this.backOutCall, this);
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.backToPage, {}, function (s, res) { console.log('back_To_Page'); });
};
Root.prototype.gameScoreChange = function (score) {
this.scoreBoard.updateScore(score);
};
......@@ -2687,7 +2691,6 @@ var Root = (function (_super) {
this.touchArea.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDownArea, this);
this.touchArea.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.onMouseUpArea, this);
this.backBtn.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, function () { _this.gameOver('back'); }, this);
Main_1.GDispatcher.removeEventListener("outCallBackToPage", function () { _this.gameOver('back'); });
};
return Root;
}(FYGE.Container));
......
......@@ -136,7 +136,7 @@ export default class Root extends FYGE.Container {
// 若返回信息中 显示没有游戏次数
if (this.userInfo.noGameTime && this.userInfo.noGameTime == 1) {
GDispatcher.addEventListener("outCallBackToPage", () => { this.gameOver('back') }, this)
GDispatcher.addEventListener("outCallBackToPage", this.backOutCall, this)
return
// 否则 执行正常开始逻辑
} else {
......@@ -189,6 +189,12 @@ export default class Root extends FYGE.Container {
}
// GDispatcher.dispatchEvent('gameOver-csd', {score: score})
}
backOutCall () {
GDispatcher.removeEventListener('gameReset', this.gameAgain, this)
GDispatcher.removeEventListener('outCallBackToPage', this.backOutCall, this)
sendTbNet(TbNetName.backToPage, {}, (s, res) => { console.log('back_To_Page') })
}
// 分数变动
gameScoreChange (score) {
......@@ -256,7 +262,6 @@ export default class Root extends FYGE.Container {
this.touchArea.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDownArea, this)
this.touchArea.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.onMouseUpArea, this)
this.backBtn.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, () => { this.gameOver('back') }, this)
GDispatcher.removeEventListener("outCallBackToPage", () => { this.gameOver('back') })
// 取消监听再来一局
// throw new Error("Method not implemented.")
}
......
......@@ -2556,7 +2556,6 @@ var Root = (function (_super) {
Root.prototype.gameAgain = function () {
return __awaiter(this, void 0, void 0, function () {
var userInfoRes;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -2570,7 +2569,7 @@ var Root = (function (_super) {
this.userInfo = userInfoRes.data;
console.log('CSD-GAME this.userInfo:', userInfoRes.data);
if (this.userInfo.noGameTime && this.userInfo.noGameTime == 1) {
Main_1.GDispatcher.addEventListener("outCallBackToPage", function () { _this.gameOver('back'); }, this);
Main_1.GDispatcher.addEventListener("outCallBackToPage", this.backOutCall, this);
return [2];
}
else {
......@@ -2626,6 +2625,11 @@ var Root = (function (_super) {
});
});
};
Root.prototype.backOutCall = function () {
Main_1.GDispatcher.removeEventListener('gameReset', this.gameAgain, this);
Main_1.GDispatcher.removeEventListener('outCallBackToPage', this.backOutCall, this);
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.backToPage, {}, function (s, res) { console.log('back_To_Page'); });
};
Root.prototype.gameScoreChange = function (score) {
this.scoreBoard.updateScore(score);
};
......@@ -2687,7 +2691,6 @@ var Root = (function (_super) {
this.touchArea.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDownArea, this);
this.touchArea.removeEventListener(FYGE.MouseEvent.MOUSE_UP, this.onMouseUpArea, this);
this.backBtn.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, function () { _this.gameOver('back'); }, this);
Main_1.GDispatcher.removeEventListener("outCallBackToPage", function () { _this.gameOver('back'); });
};
return Root;
}(FYGE.Container));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment