56 lines
1.5 KiB
Lua
56 lines
1.5 KiB
Lua
local CommonFormationUI = class("CommonFormationUI", BaseUI)
|
|
|
|
function CommonFormationUI:showCommonBG()
|
|
return false
|
|
end
|
|
|
|
function CommonFormationUI:getPrefabPath()
|
|
return "assets/prefabs/ui/common/common_formation_ui.prefab"
|
|
end
|
|
|
|
function CommonFormationUI:getCurrencyParams()
|
|
if self.currencyParams == nil then
|
|
self.currencyParams = {
|
|
itemIds = {
|
|
GConst.ItemConst.ITEM_ID_GEM,
|
|
},
|
|
showType = GConst.CURRENCY_TYPE.HORIZONTAL
|
|
}
|
|
end
|
|
|
|
return self.currencyParams
|
|
end
|
|
|
|
function CommonFormationUI:ctor(params)
|
|
self.formationType = params.formationType
|
|
end
|
|
|
|
function CommonFormationUI:onLoadRootComplete()
|
|
local uiMap = self.root:genAllChildren()
|
|
|
|
uiMap["common_formation_ui.banner.btn_ok.tx_ok"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_24))
|
|
uiMap["common_formation_ui.banner.btn_ok"]:addClickListener(function()
|
|
self:closeUI()
|
|
end)
|
|
|
|
local heroUI = uiMap["common_formation_ui.hero_ui"]
|
|
heroUI:initPrefabHelper()
|
|
heroUI:genAllChildren()
|
|
self.heroComp = heroUI:addLuaComponent("app/ui/hero/hero_comp")
|
|
|
|
self:bind(DataManager.HeroData, "isDirty", function()
|
|
self:onRefresh()
|
|
end)
|
|
self:bind(DataManager.BagData.ItemData, "dirty", function()
|
|
self:onRefresh()
|
|
end)
|
|
self:addEventListener(EventManager.CUSTOM_EVENT.GO_SHOP, function()
|
|
self:closeUI()
|
|
end)
|
|
end
|
|
|
|
function CommonFormationUI:onRefresh()
|
|
self.heroComp:refresh(self.formationType)
|
|
end
|
|
|
|
return CommonFormationUI |