Explorar o código

9月4日 唐勇飞书优化内容

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

+ 39 - 39
assets/resources/game/coregame/coregame.prefab

@@ -7040,7 +7040,7 @@
     },
     "_enabled": true,
     "buildID": 30003,
-    "sortID": 0,
+    "sortID": 2,
     "_id": ""
   },
   {
@@ -11859,7 +11859,7 @@
     },
     "_enabled": true,
     "buildID": 30002,
-    "sortID": 0,
+    "sortID": 1,
     "_id": ""
   },
   {
@@ -23114,7 +23114,7 @@
       "ctor": "Float64Array",
       "array": [
         70,
-        -63,
+        -40.259,
         0,
         0,
         0,
@@ -23533,7 +23533,7 @@
       "ctor": "Float64Array",
       "array": [
         -10,
-        -53,
+        -30.259,
         0,
         0,
         0,
@@ -23580,7 +23580,7 @@
         "__id__": 663
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [],
     "_prefab": {
       "__id__": 667
@@ -35394,8 +35394,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -40607,8 +40607,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -45948,8 +45948,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -51158,8 +51158,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -56371,8 +56371,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -61712,8 +61712,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -66922,8 +66922,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -72135,8 +72135,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -77476,8 +77476,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -82686,8 +82686,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -87899,8 +87899,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -98450,8 +98450,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -103663,8 +103663,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -109004,8 +109004,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -114214,8 +114214,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -119427,8 +119427,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },
@@ -124768,8 +124768,8 @@
         0,
         0,
         1,
-        0.6,
-        0.6,
+        0.8,
+        0.8,
         1
       ]
     },

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

@@ -107,6 +107,9 @@ export class FactoryIcon extends cc.Component {
                 gData.factorySystem.currSelectFactory = this;
                 gData.plantData.openPanel(this.tab, this.configID);
                 break;
+            case FactroyState.Producting:
+                mk.ui.openPanel('module/speedUpUI/speedUp');
+                break;
             case FactroyState.Ripe:
                 gData.factorySystem.currSelectFactory = this;
                 gData.harvestData.openPanel(this.configID, this.data.productID, this.onHarvest.bind(this));

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

@@ -121,7 +121,7 @@ export class FarmIcon extends cc.Component {
                 gData.plantData.openPanel(ProductType.nzw, this.configID);
                 break;
             case FarmState.Growing:
-
+                mk.ui.openPanel('module/speedUpUI/speedUp');
                 break;
             case FarmState.Ripe:
                 gData.farmSystem.currSelectFarm = this;
@@ -159,7 +159,7 @@ export class FarmIcon extends cc.Component {
             gData.farmSystem.currSelectFarm = this;
 
             gData.adData.checkPopRed();
-            
+
             gData.gameData.addProductMakeTimesById(this.plantID);
 
             this.plantIcon.spriteFrame = await mk.loader.load("game/coregame/texture/plant_icons/plantIcon_" + this.plantID, cc.SpriteFrame);

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

@@ -168,7 +168,7 @@ export default class PastureIcon extends cc.Component {
                 }
                 break;
             case PastureState.Growing:
-
+                mk.ui.openPanel('module/speedUpUI/speedUp');
                 break;
             case PastureState.Ripe:
                 gData.harvestData.openPanel(this.configID, this.data.productID, this.onHarvest.bind(this));

+ 3 - 0
assets/script/before/map/MapMove.ts

@@ -16,6 +16,9 @@ export class MapMove extends cc.Component {
     start() {
         this.canvas = cc.find('Canvas');
         this.node.on(cc.Node.EventType.TOUCH_START, this.onMapTouchBegin, this);
+
+        //初始地图位置
+        this.node.setPosition(cc.v2(72, 348));
     }
 
     onDestroy() {

+ 1 - 1
assets/script/before/view/data/ADUnlockData.ts

@@ -25,7 +25,7 @@ export default class ADUnlockData extends Data {
         }
         else {
             gData.gameData.setFarmDataMap(this.curConfigID, farm);
-            gData.gameData.setNextProduct();
         }
+        gData.gameData.setNextProduct();
     }
 }

+ 3 - 0
assets/script/before/view/data/PlantData.ts

@@ -11,6 +11,9 @@ export default class PlantData {
     productArr = [];
     /** 刷新下一个要解锁数据 */
     init_itemIndex = -1;
+
+    /** 刷新下一个开锁条件数据 */
+    init_lock = -1;
     /**
      * 打开生产产品界面
      * @param tab 产品类型

+ 15 - 0
assets/script/before/view/ui/ADClearSickPanel.ts

@@ -51,6 +51,21 @@ export default class ADClearSickPanel extends cc.Component {
                 // gData.adUnlockData.unlockFarm();
                 gData.adClearSickData.clearSick();
                 mk.ui.closePanel(this.node.name);
+
+                let des = '';
+                switch (gData.adClearSickData.tab) {
+                    case ProductType.nzw:
+                        des = '已消灭害虫';
+                        break;
+                    case ProductType.dw:
+                        des = '已恢复健康';
+                        break;
+                    default:
+                        des = '已恢复供电';
+                        break;
+                }
+
+                mk.tip.pop(des);
             }
         });
     }

+ 3 - 10
assets/script/before/view/ui/PlantPanel.ts

@@ -13,21 +13,14 @@ export default class PlantPanel extends cc.Component {
 
     start() {
         gData.plantData.init_itemIndex = -1;
+        gData.plantData.init_lock = -1;
         this.initScollView();
     }
 
-    update() {
-        if (gData.plantData.init_itemIndex != -1) {
-            let index = this.getItemDataByID();
-            this.tableView.contentMoveByIndex(index, 0.1);
-            gData.plantData.init_itemIndex = -1;
-        }
-    }
-
-    getItemDataByID() {
+    getItemDataByID(id) {
         let len = this.list_data.length;
         for (var i = 0; i < len; i++) {
-            if (this.list_data[i].picture == gData.plantData.init_itemIndex) {
+            if (this.list_data[i].picture == id) {
                 return i;
             }
         }

+ 12 - 0
assets/script/before/view/uiItem/PlantItem.ts

@@ -29,6 +29,18 @@ export default class PlantItem extends cc.Component {
         await this.initItem(list_data);
     }
 
+    update() {
+        if (gData.plantData.init_itemIndex == this.data.picture) {
+            this.initItem(this.data);
+            gData.plantData.init_itemIndex = -1;
+        }
+
+        if (gData.plantData.init_lock == this.data.picture) {
+            this.initItem(this.data);
+            gData.plantData.init_lock = -1;
+        }
+    }
+
     /**
      * 数据分发
      * @param list_data 数据列表

+ 5 - 7
assets/script/game/component/TableView.ts

@@ -42,9 +42,9 @@ export default class TableView extends cc.Component {
     @property({ displayName: "初始化时所有子节点隐藏" })
     private isHideAllChild: boolean = false;
 
-    @property({displayName: '数据长度限制', tooltip: '总数据小于限制长度调大间距'})
+    @property({ displayName: '数据长度限制', tooltip: '总数据小于限制长度调大间距' })
     private limitDataLen: number = -1;
-    @property({displayName: '间距增加数值', visible(){return this.limitDataLen != -1}})
+    @property({ displayName: '间距增加数值', visible() { return this.limitDataLen != -1 } })
     private addOffset: number = 10;
 
     /** 数据 */
@@ -132,10 +132,8 @@ export default class TableView extends cc.Component {
         this.initItemData = true;
         this.count = 0;
         if (isSkipInit) return;
-        if(this.limitDataLen != -1)
-        {
-            if(this.itemData.length <= this.limitDataLen)
-            {
+        if (this.limitDataLen != -1) {
+            if (this.itemData.length <= this.limitDataLen) {
                 this.itemInterval += this.addOffset;
             }
         }
@@ -153,7 +151,7 @@ export default class TableView extends cc.Component {
         //水平居中
         if (this.direction == Direction.horizontal) {
             if (this.content.width < this.layerWith) {
-                this.node.x = (this.layerWith - this.content.width) * 0.5 + this.itemInterval/2;
+                this.node.x = (this.layerWith - this.content.width) * 0.5 + this.itemInterval / 2;
             }
         }
     }

+ 1 - 1
assets/script/game/data/AdData.ts

@@ -344,7 +344,7 @@ export class AdData {
 
     getPerByEcpm() {
         //test
-        return 0.3;
+        return 1;
 
         let forceAd = gData.gameData.configs.forceAd;
         let len = forceAd.length;

+ 21 - 2
assets/script/game/data/GameData.ts

@@ -244,6 +244,7 @@ export class GameData {
         this.setPastureDataMapByServer();
         this.setFactoryDataMapByServer();
         this.initSetMaxProduct();
+        this.initProductTimes();
         this.initLeftTimes();
         this.initFarmMapGetRewardData();
     }
@@ -409,6 +410,7 @@ export class GameData {
     firstCheckNext() {
         if (!this.hasFirstCheck && gData.pastureSystem.pastureIcons.length >= 3 && gData.factorySystem.factoryIcons.length >= 6) {
             this.hasFirstCheck = true;
+            Util.objSortByKey(gData.pastureSystem.pastureIcons, 'sortID');
             gData.gameData.setNextProduct(false);
         }
     }
@@ -500,6 +502,9 @@ export class GameData {
                 this._farmDataMap.set(this._farmData[i].id, this._farmData[i]);
             }
         }
+
+        //初始化产品最大次数
+
     }
 
 
@@ -571,14 +576,20 @@ export class GameData {
         let curConfig = this.getProductMap(id);
         let nextConfig = this.getProductMap(nextID);
 
-        if (id == this.getMaxProduct(this.configs.tab)) {
-            gData.plantData.init_itemIndex = id;
+        if (id == this.getMaxProduct(curConfig.tab)) {
+            if (nextConfig) {
+                gData.plantData.init_itemIndex = nextID;
+            }
         }
 
         if (nextConfig) {
             if (nextConfig.tab == curConfig.tab && nextID > this.getMaxProduct(curConfig.tab)) {
                 if (nextConfig.unlock == 1 && nextConfig.value <= times) {
                     this.setMaxProduct(curConfig.tab, nextID);
+                    let nConfig = this.getProductMap(nextID + 1);
+                    if (nConfig) {
+                        gData.plantData.init_lock = nextID + 1;
+                    }
                 }
             }
         }
@@ -831,6 +842,14 @@ export class GameData {
         }
     }
 
+    private initProductTimes() {
+        this._productMakeTimesData = this.getProp(GameProp.productMakeTimes);
+        let len = this._productMakeTimesData.length;
+        for (var i = 0; i < len; i++) {
+            this._productMakeTimesMap.set(this._productMakeTimesData[i].id, this._productMakeTimesData[i].times);
+        }
+    }
+
     /** 农场升级时解锁工厂,检查最大可种植/生产商品 */
     public checkGradeUpUnLock() {
         for (var key in ProductType) {

+ 2 - 1
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml

@@ -39,7 +39,8 @@
             android:label="@string/app_name"
             android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
             android:launchMode="singleTask"
-            android:taskAffinity="" >
+            android:taskAffinity=""
+            android:keepScreenOn="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />