【鸿蒙阵修改】

dev_chengFeng
guowei 2021-01-15 19:40:47 +08:00
parent 05ddee7ae8
commit fddced81a3
2 changed files with 27 additions and 47 deletions

View File

@ -43,8 +43,7 @@ function HongMengEnvoyPanel:InitComponent()
self:InitEnvoyItemList(ItemPfb, parent)
Gold = BagManager.GetTotalItemNum(UpViewRechargeType.Gold)
GrowthAmulet = BagManager.GetTotalItemNum(UpViewRechargeType.GrowthAmulet)
end
function HongMengEnvoyPanel:InitEnvoyItemList(ItemPfb, parent)
@ -122,6 +121,8 @@ function HongMengEnvoyPanel:BindEvent()
-- body
return
end
Gold = BagManager.GetTotalItemNum(UpViewRechargeType.Gold)
GrowthAmulet = BagManager.GetTotalItemNum(UpViewRechargeType.GrowthAmulet)
if Gold >= data.LevelUp[1][2] then
-- body
if GrowthAmulet >= data.LevelUp[2][2] then
@ -145,9 +146,9 @@ function HongMengEnvoyPanel:BindEvent()
if Gold >= data.LevelUp[1][2] then
-- body
self.TextGold.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[1][2])
self.TextGold.text = string.format("<color=#D1D1D1>%d</color>",data.LevelUp[1][2])
if GrowthAmulet >= data.LevelUp[2][2] then
self.TextGrowthAmulet.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[2][2])
self.TextGrowthAmulet.text = string.format("<color=#D1D1D1>%d</color>",data.LevelUp[2][2])
else
self.TextGrowthAmulet.text = string.format("<color=#E15558>%d</color>",data.LevelUp[2][2])
end
@ -155,7 +156,7 @@ function HongMengEnvoyPanel:BindEvent()
self.TextGold.text = string.format("<color=#E15558>%d</color>",data.LevelUp[1][2])
if GrowthAmulet >= data.LevelUp[2][2] then
self.TextGrowthAmulet.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[2][2])
self.TextGrowthAmulet.text = string.format("<color=#D1D1D1>%d</color>",data.LevelUp[2][2])
else
self.TextGrowthAmulet.text = string.format("<color=#E15558>%d</color>",data.LevelUp[2][2])
@ -306,7 +307,8 @@ end
function HongMengEnvoyPanel:OnOpen(equipSId)
--NetManager.PlayerInfoRequest(LoadingPanel.OnStep)
self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, {showType = UpViewOpenType.ShowLeft})
Gold = BagManager.GetTotalItemNum(UpViewRechargeType.Gold)
GrowthAmulet = BagManager.GetTotalItemNum(UpViewRechargeType.GrowthAmulet)
for i = 1, #self.EnvoyItemList do
-- body
self.EnvoyItemList[i]:OnOpen()

View File

@ -93,12 +93,11 @@ function this:InitBox()
this.ScrollView:SetData(keys,function (index, go)
local key = keys[index]
-- print(index)
this.SingleBoxDataShow(go, this.tab[key], index)
-- local TimerText = Util.GetGameObject(go.transform,"Box/Empty/Image/Text"):GetComponent("Text")
-- local Empty = Util.GetGameObject(go.transform,"Box/Empty")
end)
end,false,false)
--print(LengthOfTable(ItemList))
@ -392,16 +391,11 @@ function this:Refesh(id)
local keys = GameDataBase.SheetBase.GetKeys(this.tab) --获取数据长度
this.ScrollView:SetData(keys,function (index, go)
local key = keys[index]
this.SingleBoxDataShow(go, this.tab[key],index)
-- local TimerText = Util.GetGameObject(go.transform,"Box/Empty/Image/Text"):GetComponent("Text")
-- local Empty = Util.GetGameObject(go.transform,"Box/Empty")
-- ItemList[go] ={}
-- ItemList[go].index = index
-- ItemList[go].TimerText = TimerText
this.SingleBoxDataShow(go, this.tab[key], index)
-- ItemList[go].Empty = Empty
end)
end,true,true)
end
function this:OpenBoxFun()
if tempData then
@ -453,16 +447,11 @@ function this:UpdateHero(Herodata)
this.ScrollView:SetData(keys,function (index, go)
local key = keys[index]
this.SingleBoxDataShow(go, this.tab[key],index)
-- local TimerText = Util.GetGameObject(go.transform,"Box/Empty/Image/Text"):GetComponent("Text")
-- local Empty = Util.GetGameObject(go.transform,"Box/Empty")
-- ItemList[go] ={}
-- ItemList[go].index = index
-- ItemList[go].TimerText = TimerText
this.SingleBoxDataShow(go, this.tab[key], index)
-- ItemList[go].Empty = Empty
end)
end,true,true)
this.RunTimerFun()
end
@ -503,18 +492,12 @@ function this:UnLoadFun(msg)
ItemList = {}
this.ScrollView:SetData(keys,function (index, go)
local key = keys[index]
this.SingleBoxDataShow(go, this.tab[key],index)
-- local TimerText = Util.GetGameObject(go.transform,"Box/Empty/Image/Text"):GetComponent("Text")
-- local Empty = Util.GetGameObject(go.transform,"Box/Empty")
-- ItemList[go] ={}
-- ItemList[go].index = index
-- ItemList[go].TimerText = TimerText
this.SingleBoxDataShow(go, this.tab[key], index)
-- ItemList[go].Empty = Empty
end)
end,true,true)
this.RunTimerFun()
end
@ -523,16 +506,11 @@ function this:OnlyRefeshHeroLv()
local keys = GameDataBase.SheetBase.GetKeys(this.tab) --获取数据长度
this.ScrollView:SetData(keys,function (index, go)
local key = keys[index]
this.SingleBoxDataShow(go, this.tab[key],index)
-- local TimerText = Util.GetGameObject(go.transform,"Box/Empty/Image/Text"):GetComponent("Text")
-- local Empty = Util.GetGameObject(go.transform,"Box/Empty")
-- ItemList[go] ={}
-- ItemList[go].index = index
-- ItemList[go].TimerText = TimerText
this.SingleBoxDataShow(go, this.tab[key], index)
-- ItemList[go].Empty = Empty
end)
end,true,true)
end
--界面关闭时调用(用于子类重写)