|
|
@@ -166,22 +166,22 @@ cc.Class({
|
|
|
|
|
|
// 自动存储数据
|
|
|
/**
|
|
|
- * todo 如果退出游戏,触发一次存储。
|
|
|
+ * remove version: todo 去除自动存储
|
|
|
*/
|
|
|
- this.AutoSaveData = function () {
|
|
|
- this.pushData(true);
|
|
|
- };
|
|
|
- this.schedule(this.AutoSaveData, 15);
|
|
|
+ // this.AutoSaveData = function () {
|
|
|
+ // this.pushData(true);
|
|
|
+ // };
|
|
|
+ // this.schedule(this.AutoSaveData, 15);
|
|
|
} else {
|
|
|
// 清除
|
|
|
cc.log("本地数据重新开始,并且不初始化");
|
|
|
// this.onClearAllData();
|
|
|
this.Init();
|
|
|
this.InitSceneInfo();
|
|
|
- this.AutoSaveData = function () {
|
|
|
- this.pushData(false);
|
|
|
- };
|
|
|
- this.schedule(this.AutoSaveData, 10);
|
|
|
+ // this.AutoSaveData = function () {
|
|
|
+ // this.pushData(false);
|
|
|
+ // };
|
|
|
+ // this.schedule(this.AutoSaveData, 10);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -211,8 +211,8 @@ cc.Class({
|
|
|
*/
|
|
|
InitSceneInfo() {
|
|
|
//根据顺序生成
|
|
|
- //初始化时间ui
|
|
|
- cc.find("GameNode/ManageTimer").getComponent('ManageTimer').Init();
|
|
|
+ //remove version:todo 去除初始化时间ui
|
|
|
+ // cc.find("GameNode/ManageTimer").getComponent('ManageTimer').Init();
|
|
|
//初始化金钱ui,gold,diamond, cnt,snb,
|
|
|
cc.find("GameNode/ManageGolden").getComponent('ManageGolden').InitManageGlodenUI();
|
|
|
//领取ui
|
|
|
@@ -237,18 +237,24 @@ cc.Class({
|
|
|
/**
|
|
|
* 原本游戏设定是先生产道路,现在为了方便处理等房屋生产后,再处理公路
|
|
|
* dapp设定: 如果固定土地冲突,删除对应的公路
|
|
|
+ * remove version:todo 去除生成公路
|
|
|
*/
|
|
|
- this.onSpawnHighway();
|
|
|
+ // this.onSpawnHighway();
|
|
|
//初始化生成人物
|
|
|
/**
|
|
|
* dapp设定: 如果固定土地位置冲突,把人物生成位置放置到主路
|
|
|
* onSpawnWorkerAIFromStoredData 此函数处理
|
|
|
+ *
|
|
|
*/
|
|
|
- cc.find('GameNode/ManageWorker').getComponent('ManageWorker').InitWorkerAI();
|
|
|
-
|
|
|
- let _BFirstLoadGame = this.readData ? this.readData.BFirstLoadGame : 0;
|
|
|
+ // remove version:todo 去除生成公人
|
|
|
+ // cc.find('GameNode/ManageWorker').getComponent('ManageWorker').InitWorkerAI();
|
|
|
+ /**
|
|
|
+ * remove version:todo 去除新手教程
|
|
|
+ */
|
|
|
//初始化新手教学
|
|
|
- GlobalD.ManageTask.InitTask(_BFirstLoadGame);
|
|
|
+ // let _BFirstLoadGame = this.readData ? this.readData.BFirstLoadGame : 0;
|
|
|
+ // GlobalD.ManageTask.InitTask(_BFirstLoadGame);
|
|
|
+
|
|
|
this.ManageUI.getComponent('ManageUI').Init();
|
|
|
},
|
|
|
InitNextworkData() {
|
|
|
@@ -912,7 +918,7 @@ cc.Class({
|
|
|
|
|
|
//清除所有的数据
|
|
|
onClearAllData() {
|
|
|
- this.unschedule(this.AutoSaveData);
|
|
|
+ // this.unschedule(this.AutoSaveData);
|
|
|
//任务索引
|
|
|
cc.sys.localStorage.removeItem('userdata');
|
|
|
//跳回登录场景
|
|
|
@@ -1023,7 +1029,7 @@ cc.Class({
|
|
|
}
|
|
|
this.isExchangeSeed = true;
|
|
|
//先暂停存储
|
|
|
- this.unschedule(this.AutoSaveData);
|
|
|
+ // this.unschedule(this.AutoSaveData);
|
|
|
|
|
|
utils.post(utils.api.exchangeSeeds, { diamondAmount: diamondAmount, seedId: 8 }, (flag, value) => {
|
|
|
console.log("兑换flag", flag);
|
|
|
@@ -1043,7 +1049,7 @@ cc.Class({
|
|
|
|
|
|
this.isExchangeSeed = false;
|
|
|
//重新开启存储
|
|
|
- this.schedule(this.AutoSaveData, 15);
|
|
|
+ // this.schedule(this.AutoSaveData, 15);
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
@@ -1223,21 +1229,6 @@ cc.Class({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- //偷取用户果实
|
|
|
- onStealFruit(data, callback) {
|
|
|
- if (this.isOnAddFruit) {
|
|
|
- console.log("偷取果实过快!");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.isOnAddFruit = true;
|
|
|
- utils.post(utils.api.stealFruit, data, (flag, value) => {
|
|
|
- this.isOnAddFruit = false;
|
|
|
- if (flag)
|
|
|
- callback(value);
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
//出售果实
|
|
|
onSaleFruit(data, callback) {
|
|
|
if (this.isOnSaleFruit) {
|