local HeroConst = require "app/module/hero/hero_const"

local BossGuideHeroCell = class("BossGuideHeroCell", BaseCell)

function BossGuideHeroCell:init()
	local uiMap = self:getUIMap()
	self.heroCell = uiMap["hero_cell.hero_large_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_LARGE_CELL)
	self.heroCell:addClickListener(function()
		if self.heroId then
			ModuleManager.HeroManager:showSingleHeroShowUI(self.heroId)
		end
	end)
	self.nameTx = uiMap["hero_cell.name_text"]
	self.descTx = uiMap["hero_cell.desc_text"]
end

function BossGuideHeroCell:refresh(heroId, suggestId)
	self.heroId = heroId
	self.heroCell:refreshByHeroInfo(heroId, GConst.EMPTY_STRING, 0)

	local heroTextInfo = I18N:getConfig("hero")[heroId]
	if heroTextInfo then
		self.nameTx:setText(heroTextInfo.name)
	end
	self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst["HERO_SUGGEST_DESC_" .. suggestId]))
end

return BossGuideHeroCell