|
@@ -5837,6 +5837,7 @@
|
|
|
this.ui.nameTxt.text = data.name;
|
|
|
this.ui.n_jiaGe.text = data.price + "";
|
|
|
this.ui.n_zuanShi.text = data.price + "";
|
|
|
+ let baseUrl = "asset/sound/ogg/";
|
|
|
this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
|
|
|
}
|
|
|
buyDj() {
|
|
@@ -5875,9 +5876,11 @@
|
|
|
this.itemNums = Object.keys(cfgTable.ballrodData).length;
|
|
|
this.ui.myNode.myList.numItems = this.itemNums;
|
|
|
this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
|
|
|
+ console.log('zh:obj=' + this.ui.myNode.djList);
|
|
|
this.daoJuArr = [];
|
|
|
this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
|
|
|
this.ui.myNode.djList.numItems = this.itemNumsForDj;
|
|
|
+ console.log('zh:999=' + this.itemNumsForDj);
|
|
|
}
|
|
|
show(type) {
|
|
|
super.show();
|
|
@@ -5906,12 +5909,14 @@
|
|
|
if (type == "qiugan") {
|
|
|
this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
|
|
|
this.ui.myNode.n_daoju.c1.selectedIndex = 1;
|
|
|
+ this.ui.myNode.c1.selectedIndex = 0;
|
|
|
this.ui.myNode.myList.visible = true;
|
|
|
this.ui.myNode.djList.visible = false;
|
|
|
}
|
|
|
else {
|
|
|
this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
|
|
|
this.ui.myNode.n_daoju.c1.selectedIndex = 0;
|
|
|
+ this.ui.myNode.c1.selectedIndex = 1;
|
|
|
this.ui.myNode.myList.visible = false;
|
|
|
this.ui.myNode.djList.visible = true;
|
|
|
}
|
|
@@ -7317,10 +7322,12 @@
|
|
|
let yy = this.ui.secretary.height;
|
|
|
let scale = xGame.common.getSecretaryScale();
|
|
|
let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
|
|
|
- console.log("zh:playSecretaryIdle", data);
|
|
|
xGame.common.secretary.play(data, 0, true, parent);
|
|
|
}
|
|
|
startGame(type) {
|
|
|
+ if (!this.isReadyForLoadNetSource()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
xGame.common.gameMode = type;
|
|
|
Moyu.sendDataEvent("PlayGame", { type: type });
|
|
|
console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
|
|
@@ -7427,7 +7434,23 @@
|
|
|
zhouSaiMonth() {
|
|
|
console.log('zh: zhouSaiMonth 被调用');
|
|
|
}
|
|
|
+ isReadyForLoadNetSource() {
|
|
|
+ let reqCount = xGame.cfgMgr.httpReqCount;
|
|
|
+ let ok = xGame.cfgMgr.httpReqOkCount;
|
|
|
+ if (reqCount > ok) {
|
|
|
+ xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
|
|
|
+ console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
|
|
|
+ Laya.timer.once(5000, this, () => {
|
|
|
+ xGame.cfgMgr.getConfigFromServer();
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
startPlaceBall() {
|
|
|
+ if (!this.isReadyForLoadNetSource()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
xGame.uiMgr.Show(UILevelDisplay);
|
|
|
}
|
|
|
hide() {
|
|
@@ -15356,8 +15379,8 @@
|
|
|
this.n6 = (this.getChild("n6"));
|
|
|
this.nameTxt = (this.getChild("nameTxt"));
|
|
|
this.rodImg = (this.getChild("rodImg"));
|
|
|
- this.levelNode = (this.getChild("levelNode"));
|
|
|
this.eftRod = (this.getChild("eftRod"));
|
|
|
+ this.levelNode = (this.getChild("levelNode"));
|
|
|
this.purchaseBtn = (this.getChild("purchaseBtn"));
|
|
|
}
|
|
|
}
|
|
@@ -17437,26 +17460,30 @@
|
|
|
gameName: "TQ",
|
|
|
gameUserName: "zhangSan"
|
|
|
});
|
|
|
- console.log('zh:第1个请求');
|
|
|
+ console.log('zh:第1个请求getClassicCfg');
|
|
|
const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
|
|
|
this.classicCfg = classicCfg;
|
|
|
this.httpReqOkCount++;
|
|
|
- console.log('zh:第2个请求');
|
|
|
+ console.log('zh:第2个请求getLevelCfg');
|
|
|
const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
|
|
|
this.levelCfg = levelCfg;
|
|
|
this.httpReqOkCount++;
|
|
|
- console.log('zh:第3个请求');
|
|
|
+ console.log('zh:第3个请求 getPlaceBallCfg');
|
|
|
const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
|
|
|
this.placeBallCfg = placeBallCfg;
|
|
|
this.httpReqOkCount++;
|
|
|
- console.log('zh:第4个请求npc');
|
|
|
+ console.log('zh:第4个请求 npc');
|
|
|
const npc = yield this.sendPostAsync('getNpc', reqData);
|
|
|
this.npcJson = npc.Data;
|
|
|
this.httpReqOkCount++;
|
|
|
console.log('zh:所有配置加载完成');
|
|
|
}
|
|
|
catch (error) {
|
|
|
- console.error('请求失败:', error);
|
|
|
+ console.error('❌请求失败:', error);
|
|
|
+ Laya.timer.once(500, this, () => {
|
|
|
+ console.log('zh:✅重新尝试加载网络资源');
|
|
|
+ xGame.cfgMgr.getConfigFromServer();
|
|
|
+ });
|
|
|
}
|
|
|
finally {
|
|
|
if (this.httpReqCount > this.httpReqOkCount) {
|
|
@@ -17481,17 +17508,17 @@
|
|
|
resolve(parsedData);
|
|
|
}
|
|
|
else {
|
|
|
- console.log(`zh:res = ${JSON.stringify(res)}`);
|
|
|
+ console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
|
|
|
reject(new Error(`Request failed with code: ${code}`));
|
|
|
}
|
|
|
}
|
|
|
catch (error) {
|
|
|
- console.error(`error=${error}`);
|
|
|
+ console.error(`ERROR=${error}`);
|
|
|
alert("Please check your network connection.");
|
|
|
reject(error);
|
|
|
}
|
|
|
finally {
|
|
|
- console.log(`zh:${action}`);
|
|
|
+ console.log(`zh:${action}的请求处理完毕`);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -22364,6 +22391,7 @@
|
|
|
this.ui.nameTxt.text = data.name;
|
|
|
this.ui.n_jiaGe.text = data.price + "";
|
|
|
this.ui.n_zuanShi.text = data.price + "";
|
|
|
+ let baseUrl = "asset/sound/ogg/";
|
|
|
this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
|
|
|
}
|
|
|
buyDj() {
|
|
@@ -22402,9 +22430,11 @@
|
|
|
this.itemNums = Object.keys(cfgTable.ballrodData).length;
|
|
|
this.ui.myNode.myList.numItems = this.itemNums;
|
|
|
this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
|
|
|
+ console.log('zh:obj=' + this.ui.myNode.djList);
|
|
|
this.daoJuArr = [];
|
|
|
this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
|
|
|
this.ui.myNode.djList.numItems = this.itemNumsForDj;
|
|
|
+ console.log('zh:999=' + this.itemNumsForDj);
|
|
|
}
|
|
|
show(type) {
|
|
|
super.show();
|
|
@@ -22433,12 +22463,14 @@
|
|
|
if (type == "qiugan") {
|
|
|
this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
|
|
|
this.ui.myNode.n_daoju.c1.selectedIndex = 1;
|
|
|
+ this.ui.myNode.c1.selectedIndex = 0;
|
|
|
this.ui.myNode.myList.visible = true;
|
|
|
this.ui.myNode.djList.visible = false;
|
|
|
}
|
|
|
else {
|
|
|
this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
|
|
|
this.ui.myNode.n_daoju.c1.selectedIndex = 0;
|
|
|
+ this.ui.myNode.c1.selectedIndex = 1;
|
|
|
this.ui.myNode.myList.visible = false;
|
|
|
this.ui.myNode.djList.visible = true;
|
|
|
}
|
|
@@ -23528,10 +23560,12 @@
|
|
|
let yy = this.ui.secretary.height;
|
|
|
let scale = xGame.common.getSecretaryScale();
|
|
|
let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
|
|
|
- console.log("zh:playSecretaryIdle", data);
|
|
|
xGame.common.secretary.play(data, 0, true, parent);
|
|
|
}
|
|
|
startGame(type) {
|
|
|
+ if (!this.isReadyForLoadNetSource()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
xGame.common.gameMode = type;
|
|
|
Moyu.sendDataEvent("PlayGame", { type: type });
|
|
|
console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
|
|
@@ -23638,7 +23672,23 @@
|
|
|
zhouSaiMonth() {
|
|
|
console.log('zh: zhouSaiMonth 被调用');
|
|
|
}
|
|
|
+ isReadyForLoadNetSource() {
|
|
|
+ let reqCount = xGame.cfgMgr.httpReqCount;
|
|
|
+ let ok = xGame.cfgMgr.httpReqOkCount;
|
|
|
+ if (reqCount > ok) {
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
|
|
|
+ console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
|
|
|
+ Laya.timer.once(5000, this, () => {
|
|
|
+ xGame.cfgMgr.getConfigFromServer();
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
startPlaceBall() {
|
|
|
+ if (!this.isReadyForLoadNetSource()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
xGame.uiMgr.Show(UILevelDisplay$1);
|
|
|
}
|
|
|
hide() {
|