【魂宝灵宝 重新初始化数据修改】

dev_chengFeng
guowei 2021-02-20 16:45:21 +08:00 committed by DESKTOP-98AVA47\Administrator
parent dd84a4bd3f
commit 4c03ec543d
2 changed files with 25 additions and 27 deletions

View File

@ -386,7 +386,8 @@ function this:SetChooseId(id)
end
-- 设置、获取卸载的数据
function this:SetMingListIndexData(index)
SelectId = HeroManager.GetSingleHeroData(this.hongmengHeroInfos[index].heroId).dynamicId
SelectId = this.hongmengHeroInfos[index].heroId
end

View File

@ -57,32 +57,34 @@ function HongMengUnLoadPanel:RemoveListener()
end
local dataAdditon = nil
local LingDegree = -1
local HunDegree = -1
function HongMengUnLoadPanel:OnOpen(equipSId)
LogGreen("打开面板")
local data = HarmonyManager:GetUnLoadData()
local temp_hero = HeroManager.GetSingleHeroData(data)
dataAdditon = HarmonyManager:GetAdditions()
--print(data)
self.LingDegree = -1
self.HunDegree = -1
local dataRockOne = EquipTreasureManager.GetSingleTreasureByIdDyn(temp_hero.jewels[2])
local dataRockTwo = EquipTreasureManager.GetSingleTreasureByIdDyn(temp_hero.jewels[1])
if dataRockOne then
-- body
if dataRockOne.type == "魂宝" then
HunDegree = dataRockOne.oriLv
self.HunDegree = dataRockOne.oriLv
else
LingDegree = dataRockOne.oriLv
self.LingDegree = dataRockOne.oriLv
end
end
if dataRockTwo then
if dataRockTwo.type == "灵宝" then
LingDegree = dataRockTwo.oriLv
self.LingDegree = dataRockTwo.oriLv
else
HunDegree = dataRockTwo.oriLv
self.HunDegree = dataRockTwo.oriLv
end
end
this:SetItem(this.ItemOne,HarmonyManager:GetGongMingListSingle(data),0)
@ -91,7 +93,7 @@ function HongMengUnLoadPanel:OnOpen(equipSId)
this:SetText(this.OneAll,HarmonyManager:GetGongMingListSingle(data))
this:SetTextTwo(this.TwoAll,temp_hero)
end
function HongMengUnLoadPanel:SetItem(go,data,index)
@ -130,16 +132,16 @@ function HongMengUnLoadPanel:SetTextTwo(go,data)
Util.GetGameObject(go.transform,"TextRank"):GetComponent("Text").text = string.format("%s%d星",GetQuantityStrByquality(equip.Quality),equip.Stars)
end
if HunDegree > 0 then
if self.HunDegree > 0 then
-- body
Util.GetGameObject(go.transform,"TextHun"):GetComponent("Text").text = string.format("%d",HunDegree)
Util.GetGameObject(go.transform,"TextHun"):GetComponent("Text").text = string.format("%d",self.HunDegree)
else
Util.GetGameObject(go.transform,"TextHun"):GetComponent("Text").text = string.format("")
end
if LingDegree > 0 then
if self.LingDegree > 0 then
-- body
Util.GetGameObject(go.transform,"TextLing"):GetComponent("Text").text = string.format("%d",LingDegree)
Util.GetGameObject(go.transform,"TextLing"):GetComponent("Text").text = string.format("%d",self.LingDegree)
else
Util.GetGameObject(go.transform,"TextLing"):GetComponent("Text").text = string.format("")
end
@ -160,13 +162,8 @@ function HongMengUnLoadPanel:SetTextTwo(go,data)
-- Util.GetGameObject(go.transform,"TextFa"):GetComponent("Text").text = string.format("%d",data.talismanList)
end
function HongMengUnLoadPanel:SetText(go,_data)
-- local dataRock = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2])
-- local HunSoul = 0
-- if dataRock.type == "魂宝" then
-- else
-- end
print(_data.heroConfig.ReadingName)
for i = 1, #dataAdditon do
if dataAdditon[i].additionType == 1 then
if HarmonyManager.hongmengTablet>=HarmonyManager.TowerStartLimit then
@ -204,9 +201,9 @@ function HongMengUnLoadPanel:SetText(go,_data)
-- body
elseif dataAdditon[i].additionType == 3 then
if dataAdditon[i].value > 0 and HunDegree ~= -1 then
if dataAdditon[i].value > 0 and self.HunDegree ~= -1 then
-- body
local grade = dataAdditon[i].value > HunDegree and dataAdditon[i].value or HunDegree
local grade = dataAdditon[i].value > self.HunDegree and dataAdditon[i].value or self.HunDegree
Util.GetGameObject(go.transform,"TextHun"):GetComponent("Text").text = string.format("%d",grade)
-- if EquipTreasureManager.GetSingleTreasureByIdDyn(_data.jewels[2]) then
-- -- body
@ -216,11 +213,11 @@ function HongMengUnLoadPanel:SetText(go,_data)
-- end
else
if HunDegree > 0 then
if self.HunDegree > 0 then
-- body
--local grade = dataAdditon[i].value > EquipTreasureManager.GetSingleTreasureByIdDyn(_data.jewels[2]).lv and dataAdditon[i].value or EquipTreasureManager.GetSingleTreasureByIdDyn(_data.jewels[2]).lv
Util.GetGameObject(go.transform,"TextHun"):GetComponent("Text").text = string.format("%d",HunDegree)
Util.GetGameObject(go.transform,"TextHun"):GetComponent("Text").text = string.format("%d",self.HunDegree)
else
Util.GetGameObject(go.transform,"TextHun"):GetComponent("Text").text = string.format("")
end
@ -229,8 +226,8 @@ function HongMengUnLoadPanel:SetText(go,_data)
-- Util.GetGameObject(go.transform,"TextHun"):GetComponent("Text").text = string.format("%d",data[i].value)
-- body
elseif dataAdditon[i].additionType == 4 then
if dataAdditon[i].value > 0 and LingDegree ~= -1 then
local grade = dataAdditon[i].value > LingDegree and dataAdditon[i].value or LingDegree
if dataAdditon[i].value > 0 and self.LingDegree ~= -1 then
local grade = dataAdditon[i].value > self.LingDegree and dataAdditon[i].value or self.LingDegree
Util.GetGameObject(go.transform,"TextLing"):GetComponent("Text").text = string.format("%d",grade)
-- if EquipTreasureManager.GetSingleTreasureByIdDyn(_data.jewels[1]) then
-- -- body
@ -240,10 +237,10 @@ function HongMengUnLoadPanel:SetText(go,_data)
-- end
-- Util.GetGameObject(go.transform,"TextLing"):GetComponent("Text").text = string.format("%d",data[i].value)
else
if LingDegree > 0 then
if self.LingDegree > 0 then
-- body
--local grade = dataAdditon[i].value > EquipTreasureManager.GetSingleTreasureByIdDyn(_data.jewels[1]).lv and dataAdditon[i].value or EquipTreasureManager.GetSingleTreasureByIdDyn(_data.jewels[1]).lv
Util.GetGameObject(go.transform,"TextLing"):GetComponent("Text").text = string.format("%d",LingDegree)
Util.GetGameObject(go.transform,"TextLing"):GetComponent("Text").text = string.format("%d",self.LingDegree)
else
Util.GetGameObject(go.transform,"TextLing"):GetComponent("Text").text = string.format("")
end