Procházet zdrojové kódy

完成进度条需求

SunnyLinSD před 6 roky
rodič
revize
53d788ac4b
1 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 9 1
      assets/scripts/levelHome/LevelHomeItem.js

+ 9 - 1
assets/scripts/levelHome/LevelHomeItem.js

@@ -490,7 +490,6 @@ cc.Class({
             this.rateProgressBar.progress = 1;
             this.countdownLabel.string = DWTool.calculateTime(0);
         }
-        this.levelProgressBar.progress = buildingInfo.level / Global.BuildingManager.getLevelCount(buildingInfo.buildingId);
 
         this.levelProgressLabel.string = `LV.${buildingInfo.level}`;
 
@@ -638,6 +637,14 @@ cc.Class({
             // 判断是否已经解锁
             if (buildingInfo.isUnlocked) {
 
+                /**
+                 * 2018年09月26日 要求将进度条改成每25级就清空, 重新走, 原来的实现如下:
+                 * this.levelProgressBar.progress = buildingInfo.level / Global.BuildingManager.getLevelCount(buildingInfo.buildingId);
+                 */
+
+                let ratio = buildingInfo.level % 25;
+                this.levelProgressBar.progress = ratio / 25;
+
                 this.artistList.active = true;
                 this.lockNode.active = false;
                 this.costLabel.string = DWTool.coinParse(buildingInfo.nextUpScore);
@@ -705,6 +712,7 @@ cc.Class({
 
         } else {
             this.rate = buildingInfo.rate;
+            this.levelProgressBar.progress = 1.0;
             this.setState(RoomState.Full);
         }
     },