From 89e135d088241a67edf9818dd968409ca1d3c4ff Mon Sep 17 00:00:00 2001 From: "DESKTOP-RH64908\\Administrator" <1545929779@qq.com> Date: Mon, 12 Aug 2024 14:35:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E5=85=B5=E6=9C=80=E9=AB=98=E7=AD=89?= =?UTF-8?q?=E7=BA=A7=E6=8A=A5=E9=94=99=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 68f77e83c82c00d550bb02c99fbc32d310a94ee7) --- .../Modules/Fight/FightPointPassMainPanel.lua | 15 ++++++++++++--- .../~Lua/Modules/Gem/SmallSoldierLvInfoPanel.lua | 12 +++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua index 7c7c24ab3e..b92aafedcd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua @@ -608,10 +608,19 @@ end function this.RefreshSoliderInfo() this.RefreshBossInfo() this.lvTxt.text=SmallSoldierManager.level + LogError("SmallSoldierManager.level===="..SmallSoldierManager.level) local lotteryConfig=ConfigManager.GetConfigData(ConfigName.SoldiersLotteryConfig,SmallSoldierManager.level) - this.lvBarTxt.text=string.format("兵力:%s/%s",BagManager.GetItemCountById(lotteryConfig.Soldiers[1]),lotteryConfig.Soldiers[2]) - this.btnlvRed:SetActive(BagManager.GetItemCountById(lotteryConfig.Soldiers[1])>lotteryConfig.Soldiers[2]) - this.lvBar.fillAmount = BagManager.GetItemCountById(lotteryConfig.Soldiers[1])/lotteryConfig.Soldiers[2] + + if lotteryConfig.Soldiers[1] and lotteryConfig.Soldiers[2] then + this.btnlvRed:SetActive(BagManager.GetItemCountById(lotteryConfig.Soldiers[1])>lotteryConfig.Soldiers[2]) + this.lvBar.fillAmount = BagManager.GetItemCountById(lotteryConfig.Soldiers[1])/lotteryConfig.Soldiers[2] + this.lvBarTxt.text=string.format("兵力:%s/%s",BagManager.GetItemCountById(lotteryConfig.Soldiers[1]),lotteryConfig.Soldiers[2]) + else + this.btnlvRed:SetActive(false) + this.lvBar.fillAmount = 1 + this.lvBarTxt.text=string.format("兵力:%s/%s",BagManager.GetItemCountById(lotteryConfig.Soldiers[1]),0) + end + this.btn_change:SetActive(SmallSoldierManager.changeSolider~=nil) if SmallSoldierManager.changeSolider then local changeConfig=ConfigManager.GetConfigData(ConfigName.SoldiersSetting,SmallSoldierManager.changeSolider.id) diff --git a/Assets/ManagedResources/~Lua/Modules/Gem/SmallSoldierLvInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/Gem/SmallSoldierLvInfoPanel.lua index bf47d6a1d2..a7a7c47905 100644 --- a/Assets/ManagedResources/~Lua/Modules/Gem/SmallSoldierLvInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Gem/SmallSoldierLvInfoPanel.lua @@ -6,7 +6,7 @@ local lotteryConfig=ConfigManager.GetConfig(ConfigName.SoldiersLotteryConfig) local specialConfig=ConfigManager.GetConfigData(ConfigName.SpecialConfig,178).Value local aaa=string.split(specialConfig,"#") local list={} - +local isMax=false local activityId=0 local curLv=0 local progress=0 @@ -62,6 +62,10 @@ function SmallSoldierLvInfoPanel:BindEvent() end) Util.AddClick(self.btn_go,function() + if isMax then + PopupTipPanel.ShowTip("已提升到最高等级") + return + end if isCan==false then PopupTipPanel.ShowTip("兵力不足") return @@ -114,6 +118,11 @@ local itemList={} function SmallSoldierLvInfoPanel:OnShow() curLv=SmallSoldierManager.level local nextLv=curLv+1 + if nextLv>50 then + nextLv=50 + isMax=true + + end --local self.curlv.text="当前等级:"..curLv self.nextlv.text="下一等级:"..nextLv @@ -168,6 +177,7 @@ function SmallSoldierLvInfoPanel:OnShow() if SmallSoldierManager.upEndTime>0 then self:ShowLeftTime() end + self.ScrollView:SetData(lotteryData, function (index, go) self:SingleDataShow(go,lotteryData[index]) end,false)