Przeglądaj źródła

修复一些bug

kaka 4 lat temu
rodzic
commit
191957573f

Plik diff jest za duży
+ 374 - 281
assets/resources/game/coregame/coregame.prefab


+ 23 - 14
assets/resources/game/prefab/uiPanel/ADClearSickPanel.prefab

@@ -293,7 +293,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "labDes",
+    "_name": "标题",
     "_objFlags": 0,
     "_parent": {
       "__id__": 2
@@ -401,7 +401,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "立即获得文本",
+    "_name": "描述",
     "_objFlags": 0,
     "_parent": {
       "__id__": 2
@@ -1144,7 +1144,7 @@
       "__id__": 1
     },
     "component": "",
-    "_componentId": "0c4f2VNCqNOEaoWvFRThSJc",
+    "_componentId": "71919vKJEFKFoYN99f49WIs",
     "handler": "clickWatchVideo",
     "customEventData": ""
   },
@@ -1259,21 +1259,11 @@
       "__id__": 1
     },
     "component": "",
-    "_componentId": "0c4f2VNCqNOEaoWvFRThSJc",
+    "_componentId": "71919vKJEFKFoYN99f49WIs",
     "handler": "onClickClose",
     "customEventData": ""
   },
   {
-    "__type__": "0c4f2VNCqNOEaoWvFRThSJc",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 1
-    },
-    "_enabled": true,
-    "_id": ""
-  },
-  {
     "__type__": "ac053zwqaRD6IJmTlQWmefZ",
     "_name": "",
     "_objFlags": 0,
@@ -1293,6 +1283,25 @@
     "_id": ""
   },
   {
+    "__type__": "71919vKJEFKFoYN99f49WIs",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "labTitle": {
+      "__id__": 8
+    },
+    "labDes": {
+      "__id__": 11
+    },
+    "sp": {
+      "__id__": 16
+    },
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1

+ 9 - 7
assets/script/before/main/FactoryIcon.ts

@@ -123,18 +123,20 @@ export class FactoryIcon extends cc.Component {
                 break;
             case FactroyState.Sick:
                 // mk.tip.pop(`生虫了!`);
-                gData.adClearSickData.openPanel(this.configID);
+                gData.adClearSickData.openPanel(this.tab, this.configID);
                 break;
         }
     }
 
     public make(id) {
-        let config = gData.gameData.getProductMap(id);
-        let growSpan = Date.now() + config.time * 1000;
-        this.data.state = FactroyState.Producting;
-        this.data.productID = config.picture;
-        this.data.growSpan = growSpan;
-        gData.gameData.setFactoryDataMap(this.configID, this.data);
+        if (this.data.state == FactroyState.Empty) {
+            let config = gData.gameData.getProductMap(id);
+            let growSpan = Date.now() + config.time * 1000;
+            this.data.state = FactroyState.Producting;
+            this.data.productID = config.picture;
+            this.data.growSpan = growSpan;
+            gData.gameData.setFactoryDataMap(this.configID, this.data);
+        }
     }
 
     onRipe() {

+ 5 - 4
assets/script/before/main/FarmCountDown.ts

@@ -9,7 +9,7 @@ export class FarmCountDown extends cc.Component {
     @property({ type: cc.Component.EventHandler, tooltip: "生虫回调" }) onSick: cc.Component.EventHandler = null;
     @property({ type: cc.Component.EventHandler, tooltip: "加速按钮回调" }) onSpeedButton: cc.Component.EventHandler = null;
     @property({ type: cc.Node, tooltip: "常驻计时器组" }) normalGroup: cc.Node = null;
-    @property({ type: cc.ProgressBar, tooltip: "常驻进度条" }) normalProgress: cc.ProgressBar = null;
+    @property({ type: cc.Sprite, tooltip: "常驻进度条" }) normalProgress: cc.Sprite = null;
     @property({ type: BitmapFontC, tooltip: "常驻计时" }) normalCount: BitmapFontC = null;
     @property({ type: cc.Node, tooltip: "可收获图标" }) ripedIcon: cc.Node = null;
     @property({ type: cc.Node, tooltip: "生病图标" }) sickIcon: cc.Node = null;
@@ -32,7 +32,7 @@ export class FarmCountDown extends cc.Component {
             this.sickIcon.active = false;
             this.counting = true;
             this.normalCount.string = '';
-            this.normalProgress.progress = 0;
+            this.normalProgress.fillRange = 0;
         }
     }
 
@@ -41,7 +41,7 @@ export class FarmCountDown extends cc.Component {
         if (this.counting && now < this.ripeTime) {
             let timeString = Util.ParseTime2Format(Math.floor((this.ripeTime - now) * 0.001), 'm:s');
             this.normalCount.string = timeString;
-            this.normalProgress.progress = 1 - ((this.ripeTime - now) / (this.totleTime * 1000));
+            this.normalProgress.fillRange = 1 - ((this.ripeTime - now) / (this.totleTime * 1000));
         } else if (this.counting && now > this.ripeTime) {
             if (!this.isRipeInit) {
                 this.isRipeInit = true;
@@ -77,8 +77,9 @@ export class FarmCountDown extends cc.Component {
      * @param state 0 生虫 1 成熟
      */
     setState(state) {
-        this.normalProgress.progress = 0;
+        this.normalProgress.fillRange = 0;
         this.normalCount.string = '';
+        this.normalGroup.active = false;
         if (state == 0) {
             this.sickIcon.active = true;
             this.ripedIcon.active = false;

+ 1 - 1
assets/script/before/main/FarmIcon.ts

@@ -121,7 +121,7 @@ export class FarmIcon extends cc.Component {
                 break;
             case FarmState.Sick:
                 // mk.tip.pop(`生虫了!`);
-                gData.adClearSickData.openPanel(this.configID);
+                gData.adClearSickData.openPanel(ProductType.nzw, this.configID);
                 break;
         }
     }

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

@@ -1,6 +1,6 @@
 /** 养殖类 */
 
-import { AnimalState, PastureState } from "../../game/data/GameData";
+import { AnimalState, PastureState, ProductType } from "../../game/data/GameData";
 import Animals from "../view/Animals";
 import ProductShow from "../view/ProductShow";
 import { FarmCountDown } from "./FarmCountDown";
@@ -162,7 +162,7 @@ export default class PastureIcon extends cc.Component {
                 break;
             case PastureState.Sick:
                 // mk.tip.pop(`生虫了!`);
-                gData.adClearSickData.openPanel(this.configID);
+                gData.adClearSickData.openPanel(ProductType.dw, this.configID);
                 break;
         }
     }
@@ -195,7 +195,6 @@ export default class PastureIcon extends cc.Component {
         this.clean();
 
         this.data.state = PastureState.Empty;
-        this.data.productID = 0;
         this.data.growSpan = 0;
         gData.gameData.setPastureDataMap(this.configID, this.data);
     }

+ 16 - 4
assets/script/before/view/data/ADClearSickData.ts

@@ -1,20 +1,32 @@
 /** 清除害虫数据类 */
 
-import { FarmState } from "../../../game/data/GameData";
+import { FactroyState, FarmState, PastureState, ProductType } from "../../../game/data/GameData";
 
 const { ccclass } = cc._decorator;
 
 @ccclass
 export default class ADClearSickData {
     curConfigID = -1;
-    openPanel(id) {
+    tab = null;
+    openPanel(tab, id) {
+        this.tab = tab;
         this.curConfigID = id;
         mk.ui.openPanel('game/prefab/uiPanel/ADClearSickPanel');
     }
 
     clearSick() {
-        let farm = gData.gameData.getFarmDataMap(this.curConfigID);
-        farm.state = FarmState.Ripe;
+        if (this.tab == ProductType.nzw) {
+            let farm = gData.gameData.getFarmDataMap(this.curConfigID);
+            farm.state = FarmState.Ripe;
+        }
+        else if (this.tab == ProductType.dw) {
+            let pasture = gData.gameData.getPastureDataMap(this.curConfigID);
+            pasture.state = PastureState.Ripe;
+        }
+        else {
+            let factory = gData.gameData.getFactoryDataMap(this.curConfigID);
+            factory.state = FactroyState.Ripe;
+        }
         gData.gameData.needFreshArr.push(this.curConfigID);
     }
 }

+ 28 - 1
assets/script/before/view/ui/ADClearSickPanel.ts

@@ -1,21 +1,48 @@
 /** 清除害虫 */
 
+import { ProductType } from "../../../game/data/GameData";
+
 const { ccclass, property } = cc._decorator;
 
 @ccclass
 export default class ADClearSickPanel extends cc.Component {
+    @property({ type: cc.Label, tooltip: "标题" }) labTitle: cc.Label = null;
+    @property({ type: cc.Label, tooltip: "描述" }) labDes: cc.Label = null;
+    @property({ type: cc.Sprite, tooltip: "故障图标" }) sp: cc.Sprite = null;
+
+    async onLoad() {
+        switch (gData.adClearSickData.tab) {
+            case ProductType.nzw:
+                this.labTitle.string = '农作物生虫了';
+                this.labDes.string = '看视频消灭害虫';
+                this.sp.spriteFrame = await mk.loader.load('game/coregame/texture/warning/warning_1', cc.SpriteFrame);
+                break;
+            case ProductType.dw:
+                this.labTitle.string = '动物生病了';
+                this.labDes.string = '看视频治疗动物';
+                this.sp.spriteFrame = await mk.loader.load('game/coregame/texture/warning/warning_2', cc.SpriteFrame);
+                break;
+            default:
+                this.labTitle.string = '工厂出故障了';
+                this.labDes.string = '看视频修复工厂';
+                this.sp.spriteFrame = await mk.loader.load('game/coregame/texture/warning/warning_3', cc.SpriteFrame);
+                break;
+        }
+    }
+
     clickWatchVideo() {
         mk.ad.watchAd((success: boolean) => {
             mk.console.log("watchAD:" + success);
             if (success) {
                 // gData.adUnlockData.unlockFarm();
                 gData.adClearSickData.clearSick();
-                mk.ui.closePanel(this.node.name)
+                mk.ui.closePanel(this.node.name);
             }
         });
     }
 
     onClickClose() {
         //关闭banner广告等
+        mk.ui.closePanel(this.node.name);
     }
 }

+ 2 - 2
build/jsb-link/frameworks/runtime-src/proj.android-studio/.idea/modules/app/kxnly.iml

@@ -193,10 +193,10 @@
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/debug" type="java-resource" generated="true" />
-      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out" isTestSource="true" generated="true" />
-      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />

Plik diff jest za duży
+ 723 - 110
build/jsb-link/js backups (useful for debugging)/main.index.js


+ 2 - 2
packages-hot-update/cfg.json

@@ -8,7 +8,7 @@
         "https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/EasyEliminateTest/baseRemote/",
         "https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/EasyEliminate/baseRemote/"
     ],
-    "buildTime": 1629859008891,
-    "genTime": 1629859008891,
+    "buildTime": 1629890775955,
+    "genTime": 1629890775955,
     "genVersion": null
 }

+ 1 - 1
settings/project.json

@@ -36,6 +36,6 @@
       "enable": false
     }
   },
-  "last-module-event-record-time": 1629276046252,
+  "last-module-event-record-time": 1629886477994,
   "start-scene": "6f522a54-3e0e-404d-a06c-bec8b4307c95"
 }

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików