合成装备刷新界面

dev_chengFeng
jiaoyangna 2020-07-07 17:51:02 +08:00
parent c6bfa772e5
commit 0f611408b8
1 changed files with 18 additions and 2 deletions

View File

@ -23,7 +23,8 @@ local curNeedEquip = {}
local curSelectEquip = {}
local curSelectGO
local materidaIsCan = false
local bagPosEquips = {}
local bagPosEquips = {}
local needGoldNum = 0
function this:InitComponent(gameObject)
this.tabBox = Util.GetGameObject(gameObject, "CompoundPanel_Equip/TabBox")
this.needGoldText = Util.GetGameObject(gameObject, "CompoundPanel_Equip/compoundBtn/needGoldText"):GetComponent("Text")
@ -66,14 +67,27 @@ function this:BindEvent()
end
function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold,this.ShowGoldNum0)
end
function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold,this.ShowGoldNum0)
end
function this.ShowGoldNum0()
if needGoldNum > BagManager.GetItemCountById(14) then
materidaIsCan = false
this.needGoldText.text = string.format("<color=#FF0011>%s</color>", needGoldNum)
else
materidaIsCan = true
this.needGoldText.text =string.format("<color=#FCF5D3FF>%s</color>", needGoldNum)
end
end
function this:OnShow(...)
curIndex = 1
sortingOrder =0
needGoldNum=0
this.TabCtrl = TabBox.New()
this.TabCtrl:SetTabAdapter(this.TabAdapter)
this.TabCtrl:SetChangeTabCallBack(this.SwitchView)
@ -118,7 +132,7 @@ function this.ShowTitleData(curEquipStarsConfig)
this.ShowGoldNum(equipStarsConfig[curSelectEquip.Star - 1],compoundNum)
end
function this.ShowGoldNum(upEquipStarsConfig,compoundNum)
local needGoldNum = compoundNum * upEquipStarsConfig.RankupResources[1][2]
needGoldNum = compoundNum * upEquipStarsConfig.RankupResources[1][2]
if needGoldNum > BagManager.GetItemCountById(upEquipStarsConfig.RankupResources[1][1]) then
materidaIsCan = false
this.needGoldText.text = string.format("<color=#FF0011>%s</color>", needGoldNum)
@ -330,9 +344,11 @@ function this.SwitchView(index)
end
function this:OnClose()
needGoldNum=0
end
function this:OnDestroy()
needGoldNum=0
end
return this