diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua index 8ce23f40c..4c95ebca6 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleGiftPanel.lua @@ -283,7 +283,7 @@ function this.RefreshWindowData() end ) - local proList=IncarnationManager.GetproDesLst(GiftManager.GetHeroGiftAddPro(curHeroData.dynamicId),"00FF00") + local proList=GiftManager.GetHeroGiftAddPro(curHeroData.dynamicId) table.insert(proList,string.format("英雄潜能等级+%s",GiftManager.GetHeroGiftAddPotencyLv(curHeroData.dynamicId))) local originalList=GiftManager.GetHeroGiftAddOriginalPro(curHeroData.dynamicId) if proList and #proList>0 then @@ -298,15 +298,11 @@ function this.RefreshWindowData() end len=this.proGrid.transform.childCount for i=1,len do - if i<=#proList-1 then - this.proGrid.transform:GetChild(i-1).gameObject:SetActive(true) - LogError("originalList[i]======================"..originalList[i]) - this.proGrid.transform:GetChild(i-1):GetComponent("Text").text=proList[i]--.. - --string.format(" 命格加成+%s (%s%%)",math.floor(originalList[i]*GiftManager.GetPlayerGiftAdd()/100), GiftManager.GetPlayerGiftAdd()) - --..string.format(" 特训加成+%s (%s%%)",math.floor(originalList[i]*HeroManager.ReturnGiftAtt()),HeroManager.ReturnGiftAtt()) - elseif i==#proList then - this.proGrid.transform:GetChild(i-1).gameObject:SetActive(true) - this.proGrid.transform:GetChild(i-1):GetComponent("Text").text=proList[i] + if i<=#proList then + --this.proGrid.transform:GetChild(i-1).gameObject:SetActive(true) + --LogError("originalList[i]======================"..originalList[i]) + --this.proGrid.transform:GetChild(i-1):GetComponent("Text").text=proList[i] + this.SingleProShowData({proId=i,proVal=proList[i]},this.proGrid.transform:GetChild(i-1).gameObject) else this.proGrid.transform:GetChild(i-1).gameObject:SetActive(false) end @@ -319,7 +315,32 @@ function this.RefreshWindowData() --显示下面可赠送的 this:OnClickTabBtn(1) end - +function this.SingleProShowData(data,go) + go:SetActive(true) + for i = 1, 2 do + local curGo = go .transform:GetChild(i-1).gameObject + if #data > 1 then + curGo:SetActive(true) + Util.GetGameObject(curGo, "proName"):GetComponent("Text").text = GetLanguageStrById(propertyConfig[data[i].proId].Info)..":" + local proVale = Util.GetGameObject(curGo, "proVale"):GetComponent("Text") + if propertyConfig[data[i].proId].Style == 1 then--绝对值 + proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal) + elseif propertyConfig[data[i].proId].Style == 2 then--百分百 + -- 暴击默认 10% 前端加显示 + -- LogError("str:"..data[i].proId.." ".. GetLanguageStrById(propertyConfig[data[i].proId].Info)) + if data[i].proId == 55 then + proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal*100 + 1000) + else + proVale.text = GetPropertyFormatStr(propertyConfig[data[i].proId].Style, data[i].proVal*100) + end + + end + Util.GetGameObject(curGo, "proIcon"):GetComponent("Image").sprite = Util.LoadSprite(propertyConfig[data[i].proId].Icon) + else + curGo:SetActive(false) + end + end +end --显示上面几个 function this.SingleUpItemShow(_go,data,_index)