【ID1010233】

【宝物详情优化】在装备界面和情报界面增加宝物共鸣属性显示
dev_chengFeng
jiaoyangna 2021-09-01 19:20:34 +08:00
parent 75fc33c18b
commit 9ab223d577
3 changed files with 2027 additions and 5 deletions

View File

@ -731,4 +731,18 @@ function this.GetEquipTreasureResolveItems2(itemId, itemNum)
end
end
function this.GetTreasureData(did)
local data = EquipTreasureManager.GetSingleTreasureByIdDyn(did)
if not data then
data = MonsterCampManager.GetSingleTreasureByIdDyn(did)
end
if not data then
data = ExpeditionManager.GetSingleTreasureByIdDyn(did)
end
if not data then
data = GoodFriendManager.GetSingleTreasureByIdDyn(did)
end
return data
end
return EquipTreasureManager

View File

@ -25,11 +25,15 @@ function RoleEquipTreasureChangePopup:InitComponent()
this.RefinePropertyList = {}
this.TreePropertyList = {}
this.TreePropertyList2 = {}
this.strongPropertyList = {}
this.RefineMonsterPropertyList = {}
for i = 1, 2 do
this.BasePropertyList[i] = {}
this.RefinePropertyList[i] = {}
this.TreePropertyList[i] = {}
this.TreePropertyList2[i] = {}
this.strongPropertyList[i] = {}
this.RefineMonsterPropertyList[i] = {}
end
this.preList = {}
this.treasurePanel = {}
@ -69,7 +73,17 @@ function RoleEquipTreasureChangePopup:InitComponent()
this.treasurePanel[i].TreeAttri = Util.GetGameObject(this.treasurePanel[i].bgScroll, "grid/treeAttri")
this.treasurePanel[i].TreeAttriNum = Util.GetGameObject(this.treasurePanel[i].TreeAttri, "name/attriNum"):GetComponent("Text")
this.treasurePanel[i].TreeAttriGrid = Util.GetGameObject(this.treasurePanel[i].TreeAttri, "grid")
this.treasurePanel[i].TreeAttri:SetActive(false)
this.treasurePanel[i].TreeAttri:SetActive(false)
--强化共鸣
this.treasurePanel[i].strongAttri = Util.GetGameObject(this.treasurePanel[i].bgScroll, "grid/strongAttri")
this.treasurePanel[i].strongAttriNum = Util.GetGameObject(this.treasurePanel[i].strongAttri, "name/attriName"):GetComponent("Text")
this.treasurePanel[i].strongAttriGrid = Util.GetGameObject(this.treasurePanel[i].strongAttri, "grid")
this.treasurePanel[i].strongAttri:SetActive(false)
--精炼共鸣
this.treasurePanel[i].refineMasterAttri = Util.GetGameObject(this.treasurePanel[i].bgScroll, "grid/refineMasterAttri")
this.treasurePanel[i].refineMasterAttriNum = Util.GetGameObject(this.treasurePanel[i].refineMasterAttri, "name/attriName"):GetComponent("Text")
this.treasurePanel[i].refineMasterAttriGrid = Util.GetGameObject(this.treasurePanel[i].refineMasterAttri, "grid")
this.treasurePanel[i].refineMasterAttri:SetActive(false)
end
end
@ -361,6 +375,15 @@ function this.ShowEquipData(i)
local baseInfo = EquipTreasureManager.GetCurLvPropertyValue(1,equipData[i].levelPool,equipData[i].lv)
this.treasurePanel[i].BaseAttriNum.text = string.format("[强化等级:%s/%s]",equipData[i].lv,equipData[i].maxLv)
this.SetPropertyShow1(baseInfo,this.BasePropertyList[i],this.treasurePanel[i].BaseAttriGrid)
if equipData[i].upHeroDid == "" or equipData[i].upHeroDid == "0" then
this.treasurePanel[i].strongAttri.gameObject:SetActive(false)
this.treasurePanel[i].refineMasterAttri:SetActive(false)
else
--强化共鸣
this.GongMingSetData(1,this.strongPropertyList[i],this.treasurePanel[i].strongAttriGrid,this.treasurePanel[i].strongAttriNum,this.treasurePanel[i].strongAttri)
--精炼共鸣
this.GongMingSetData(2,this.RefineMonsterPropertyList[i],this.treasurePanel[i].refineMasterAttriGrid,this.treasurePanel[i].refineMasterAttriNum,this.treasurePanel[i].refineMasterAttri)
end
--(精炼属性)
local refineInfo = EquipTreasureManager.GetCurLvPropertyValue(2,equipData[i].refinePool,equipData[i].refineLv,true)
this.treasurePanel[i].RefineAttriNum.text = string.format("[精炼等级:%s/%s]",equipData[i].refineLv,equipData[i].maxRefineLv)
@ -385,6 +408,91 @@ function this.ShowEquipData(i)
this.treasurePanel[i].StrongRed:SetActive(HeroManager.CheckIsUpTreasure(equipData[i].idDyn,1))
this.treasurePanel[i].RefineRed:SetActive(HeroManager.CheckIsUpTreasure(equipData[i].idDyn,2))
end
end
function this.GongMingSetData(curTabIndex,proPreList,grid,title,go)
--获取穿戴宝物强化/精炼的最小等级
local minLv--最小等级
local maxlv --最大等级
if #curHeroData.jewels < 2 then
go.gameObject:SetActive(false)
return
end
go.gameObject:SetActive(true)
for i = 1, #curHeroData.jewels do
local curEquipTreasureData = EquipTreasureManager.GetTreasureData(curHeroData.jewels[i])
if curTabIndex == 1 then
if minLv then
if curEquipTreasureData.lv < minLv then
minLv = curEquipTreasureData.lv
end
else
minLv = curEquipTreasureData.lv
end
if maxlv then
if curEquipTreasureData.maxLv < maxlv then
maxlv = curEquipTreasureData.maxLv
end
else
maxlv = curEquipTreasureData.maxLv
end
elseif curTabIndex == 2 then
if minLv then
if curEquipTreasureData.refineLv < minLv then
minLv = curEquipTreasureData.refineLv
end
else
minLv = curEquipTreasureData.refineLv
end
if maxlv then
if curEquipTreasureData.maxRefineLv < maxlv then
maxlv = curEquipTreasureData.maxRefineLv
end
else
maxlv = curEquipTreasureData.maxRefineLv
end
end
end
local curJewelResonanceConfig = nil
local allCurTypeJewelResonanceConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.JewelResonanceConfig,"Type",curTabIndex)
table.sort(allCurTypeJewelResonanceConfig,function(a,b)
return a.SortId<b.SortId
end)
for i = 1, #allCurTypeJewelResonanceConfig do
--获取当前强化/精炼 大师等级数据
if allCurTypeJewelResonanceConfig[i].Level <= minLv then
if curJewelResonanceConfig then
if curJewelResonanceConfig.SortId < allCurTypeJewelResonanceConfig[i].SortId then
curJewelResonanceConfig = allCurTypeJewelResonanceConfig[i]
end
else
curJewelResonanceConfig = allCurTypeJewelResonanceConfig[i]
end
end
end
if curJewelResonanceConfig.SortId < 1 then
go.gameObject:SetActive(false)
return
end
go.gameObject:SetActive(true)
if curTabIndex == 1 then
title.text = string.format("<color=#FE2F33>强化大师%s级</color>",curJewelResonanceConfig.SortId)
else
title.text = string.format("<color=#FE2F33>精炼大师%s级</color>",curJewelResonanceConfig.SortId)
end
for i = 1, math.max(#curJewelResonanceConfig.Property,#proPreList) do
if not curJewelResonanceConfig.Property[i] then
proPreList[i].gameObject:SetActive(false)
else
if not proPreList[i] then
proPreList[i] = newObjToParent(this.TextPre,grid.transform)
end
proPreList[i].gameObject:SetActive(true)
local str = GetLanguageStrById(propertyConfig[curJewelResonanceConfig.Property[i][1]].Info).."+"..GetPropertyFormatStr(propertyConfig[curJewelResonanceConfig.Property[i][1]].Style,curJewelResonanceConfig.Property[i][2])
proPreList[i].transform:GetComponent("Text").text = string.format("<color=#66FF00>%s</color>",str)
end
end
end
--神应专用