Prechádzať zdrojové kódy

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

kaka 4 rokov pred
rodič
commit
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.nextMake = null;
+            gData.gameData.setNextProduct(false);
+
             console.log('-----');
             let flyRed = await gData.gameData.updateNewTaskProgress();
             return flyRed;
@@ -149,7 +152,7 @@ export class FactoryIcon extends cc.Component {
             //     gData.gameData.gameStyle.dpFlyRedAni();
             // }
 
-            
+
         }
         else {
             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);
 
             let flyRed = await gData.gameData.updateNewTaskProgress();
+
+            gData.gameData.nextMake = null;
+            gData.gameData.setNextProduct(false);
+
             return flyRed;
         }
         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.nextMake = null;
+            gData.gameData.setNextProduct(false);
+            
             let flyRed = await gData.gameData.updateNewTaskProgress();
             return flyRed;
             // if (flyRed) {

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

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