From 8c4ff7e148e141039a60f614b09c3a6d775eaa28 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Tue, 13 Oct 2020 17:21:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81=E7=A4=BC=E5=8C=85=20?= =?UTF-8?q?=E5=AE=8C=E4=BA=8B=E5=84=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UpGradePackage/UpGradePackagePanel.lua | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua b/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua index 429ff3a405..7be45f659d 100644 --- a/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua @@ -4,6 +4,7 @@ local this = UpGradePackagePanel local RechargeConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)--整表数据 local upgradeConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",21)--五档奖励数据 +local fightLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig) local rechargeNum = 0 local cursortingOrder = 0 @@ -61,7 +62,7 @@ function this:BindEvent() curIndex = curIndex - 1 if curGiftList[curType][curIndex] then else - while(curType <= 0) do + while(curType >= 0) do if not activityType[curType] then curType = LengthOfTable(activityType) else @@ -152,9 +153,9 @@ function this:SetCurTypeAndIndex() return curGiftList[curType][curIndex] else for k,v in pairs(curGiftList) do - for i = 1 ,#v do + if v and #v > 0 then curType = k - curIndex = i + curIndex = 1 return curGiftList[curType][curIndex] end end @@ -163,13 +164,13 @@ function this:SetCurTypeAndIndex() end function this:Refresh() + local num = self:GetInfoList() if num < 1 then this:ClosePanel() return end rechargeData = this:SetCurTypeAndIndex() - for k,v in pairs(activityType) do Util.GetGameObject(self.gameObject,v.comp):SetActive(false) end @@ -182,7 +183,36 @@ function this:Refresh() level = (math.floor(PlayerManager.level/10)-1)*10+8 end rechargeNum= VipManager.GetChargedNum() - this.tip.text = curType == 1 and Language[12000]..level..Language[12001] or "" + + + if curType == 1 then + this.tip.text = Language[12000]..level..Language[12001] or "" + elseif curType == 3 then + local specialConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,91).Value + local num = tonumber(specialConfig) + local value = fightLevelConfig[FightPointPassManager.lastPassFightId].SortId + local value2 = ConfigManager.GetConfigDataByKey(ConfigName.MainLevelConfig,"SortId",math.floor(value/num)*num).Name + this.tip.text ="恭喜您通关"..value2..",我们为您准备了超值礼包,帮助您快速通关" + elseif curType == 4 then + local specialConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,90).Value + local str = string.split(specialConfig,"|") + local nums = string.split(str[1],"#") + local canGet = false + local value = MonsterCampManager.monsterWave + local value2 + if value < tonumber(nums[#nums]) then + local temp = tonumber(nums[#nums]) -tonumber(nums[#nums-1]) + value2 = math.floor(value/temp) * temp + else + value2 = math.floor(value - tonumber(nums[#nums])/tonumber(str[2]))* tonumber(str[2]) + tonumber(nums[#nums]) + end + this.tip.text ="恭喜您通过心魔试炼"..value2.."层,我们为您准备了超值礼包,帮助您快速通关" + else + this.tip.text = "" + end + -- this.tip.text = curType == 1 and Language[12000]..level..Language[12001] or "" + + this.arrowsLeft:SetActive(num > 1) this.arrowsRight:SetActive(num > 1) curGiftId = rechargeData.goodsId