Explorar o código

修复一键生产选中物品在选中生产后没有刷新选中下一个产品bug

kaka %!s(int64=4) %!d(string=hai) anos
pai
achega
fc59e5cd60

+ 4 - 1
assets/script/before/main/FactoryIcon.ts

@@ -141,6 +141,9 @@ export class FactoryIcon extends cc.Component {
 
 
             gData.gameData.isProducting = false;
             gData.gameData.isProducting = false;
 
 
+            gData.gameData.nextMake = null;
+            gData.gameData.setNextProduct(false);
+
             console.log('-----');
             console.log('-----');
             let flyRed = await gData.gameData.updateNewTaskProgress();
             let flyRed = await gData.gameData.updateNewTaskProgress();
             return flyRed;
             return flyRed;
@@ -149,7 +152,7 @@ export class FactoryIcon extends cc.Component {
             //     gData.gameData.gameStyle.dpFlyRedAni();
             //     gData.gameData.gameStyle.dpFlyRedAni();
             // }
             // }
 
 
-            
+
         }
         }
         else {
         else {
             mk.tip.pop('商品已满!')
             mk.tip.pop('商品已满!')

+ 4 - 0
assets/script/before/main/FarmIcon.ts

@@ -184,6 +184,10 @@ export class FarmIcon extends cc.Component {
             this.plantIcon.getComponent(cc.Animation).on(cc.Animation.EventType.FINISHED, this.onPlantAnimationFinish, this);
             this.plantIcon.getComponent(cc.Animation).on(cc.Animation.EventType.FINISHED, this.onPlantAnimationFinish, this);
 
 
             let flyRed = await gData.gameData.updateNewTaskProgress();
             let flyRed = await gData.gameData.updateNewTaskProgress();
+
+            gData.gameData.nextMake = null;
+            gData.gameData.setNextProduct(false);
+
             return flyRed;
             return flyRed;
         }
         }
         else {
         else {

+ 3 - 0
assets/script/before/main/PastureIcon.ts

@@ -227,6 +227,9 @@ export default class PastureIcon extends cc.Component {
 
 
             gData.gameData.isProducting = false;
             gData.gameData.isProducting = false;
 
 
+            gData.gameData.nextMake = null;
+            gData.gameData.setNextProduct(false);
+            
             let flyRed = await gData.gameData.updateNewTaskProgress();
             let flyRed = await gData.gameData.updateNewTaskProgress();
             return flyRed;
             return flyRed;
             // if (flyRed) {
             // if (flyRed) {

+ 0 - 12
assets/script/game/data/GameData.ts

@@ -498,27 +498,15 @@ export class GameData {
                 break;
                 break;
             case 1:
             case 1:
                 flyRed = await gData.farmSystem.btnMake();
                 flyRed = await gData.farmSystem.btnMake();
-                this.nextMake = null;
-                this.setNextProduct(false);
                 gData.adData.checkPopRed();
                 gData.adData.checkPopRed();
-
-                //flyRed = await this.updateNewTaskProgress();
                 break;
                 break;
             case 2:
             case 2:
                 flyRed = await gData.pastureSystem.btnMake();
                 flyRed = await gData.pastureSystem.btnMake();
-                this.nextMake = null;
-                this.setNextProduct(false);
                 gData.adData.checkPopRed();
                 gData.adData.checkPopRed();
-
-                //flyRed = await this.updateNewTaskProgress();
                 break;
                 break;
             case 3:
             case 3:
                 flyRed = await gData.factorySystem.btnMake();
                 flyRed = await gData.factorySystem.btnMake();
-                this.nextMake = null;
-                this.setNextProduct(false);
                 gData.adData.checkPopRed();
                 gData.adData.checkPopRed();
-
-                //flyRed = await this.updateNewTaskProgress();
                 break;
                 break;
         }
         }
         return flyRed;
         return flyRed;