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