From 306ab999b9290741ef57ef2eefe03cebd9997334 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Sun, 26 Sep 2021 19:47:18 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=3D=3D=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=E7=99=BD=E9=87=91=E8=A3=85=E5=A4=87=E5=90=88?= =?UTF-8?q?=E6=88=90=E7=BA=A2=E7=82=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Compound/view/CompoundPanel_Equip.lua | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua b/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua index da5d498e2a..489703e13e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua +++ b/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua @@ -127,8 +127,9 @@ function this.ShowTitleData(curEquipStarsConfig) this.ShowTitleEquipData(this.compoundEquip,curSelectEquip,curEquipStarsConfig) --得到静态表中合成当前装备需要的装备 + local config=equipStarsConfig[curSelectEquip.Star - 1] curNeedEquip = ConfigManager.GetConfigDataByDoubleKey(ConfigName.EquipConfig,"Position",curSelectEquip.Position,"Star",curSelectEquip.Star - 1) - this.ShowTitleEquipData(this.needEquip,curNeedEquip,equipStarsConfig[curSelectEquip.Star - 1])--需要的材料 + this.ShowTitleEquipData(this.needEquip,curNeedEquip,config)--需要的材料 --得到背包中中合成当前装备需要的装备 local allCanCompoundEquips = EquipManager.GetBagCompoundEquipDatasByequipSData(curSelectEquip) @@ -136,11 +137,24 @@ function this.ShowTitleData(curEquipStarsConfig) for i=1,#allCanCompoundEquips do num=num+allCanCompoundEquips[i].num end - this.progressText.text = num .. "/" .. equipStarsConfig[curSelectEquip.Star - 1].RankupCount - this.progressImage.fillAmount = num / equipStarsConfig[curSelectEquip.Star - 1].RankupCount - compoundNum = math.floor(num / equipStarsConfig[curSelectEquip.Star - 1].RankupCount) - compoundMaxNum = math.floor(num / equipStarsConfig[curSelectEquip.Star - 1].RankupCount) - this.ShowGoldNum(equipStarsConfig[curSelectEquip.Star - 1],compoundNum) + this.progressText.text = num .. "/" .. config.RankupCount + this.progressImage.fillAmount = num / config.RankupCount + --compoundNum = math.floor(num /config.RankupCount) + compoundNum=0 + compoundMaxNum = math.floor(num / config.RankupCount) + for i = 1,compoundMaxNum do + local items=config.RankupResources + local isEnough=true + for j = 1, #items do + if BagManager.GetItemCountById(items[j][1])< items[j][2]*i then + isEnough=false + end + end + if isEnough then + compoundNum=i + end + end + this.ShowGoldNum(config,compoundNum) end function this.ShowGoldNum(upEquipStarsConfig,compoundNum) needGoldNum = compoundNum * upEquipStarsConfig.RankupResources[1][2] @@ -210,7 +224,25 @@ function this.SingleItemDataShow(_go,_itemData,curEquipStarsConfig) local choosed =Util.GetGameObject(_go.transform, "choosed") choosed:SetActive(curSelectEquip.Id == _itemData .Id) local redPoint = Util.GetGameObject(_go.transform,"redPoint") - redPoint:SetActive(bagPosEquips[curEquipStarsConfig.Id - 1] and bagPosEquips[curEquipStarsConfig.Id - 1] >= equipStarsConfig[curEquipStarsConfig.Id - 1].RankupCount) + local isShow=false + local config=equipStarsConfig[curEquipStarsConfig.Id - 1] + if bagPosEquips[curEquipStarsConfig.Id - 1] then + isShow=true + if bagPosEquips[curEquipStarsConfig.Id - 1]< config.RankupCount then + isShow=false + end + if isShow then + local items=config.RankupResources + for i = 1, #items do + if items[i][2]>BagManager.GetItemCountById(items[i][1]) then + isShow=false + break + end + end + end + end + + redPoint:SetActive(isShow) if curSelectEquip.Id == _itemData .Id then curSelectGO = _go end