KLTalentNameItem.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---@class KLTalentNameItem:UIKmlLuaPanelBase
  2. ---@field view KLTalentNameItemView
  3. ---@field talentType cfg_equip_angelTalentGroup_column
  4. local KLTalentNameItem = class(UIKmlLuaPanelBase)
  5. local this = KLTalentNameItem
  6. ---创建时调用一次
  7. function this:Init()
  8. end
  9. ---注册UI事件和服务器消息
  10. function this:RegistEvents()
  11. GUI:AddOnClickEvent(self.view.name_bg, self, self.LoadTalent)
  12. end
  13. ---界面显示时调用一次
  14. function this:Show()
  15. end
  16. ---创建或者刷新界面数据时调用
  17. function this:Refresh()
  18. end
  19. ---@param talentType cfg_equip_angelTalentGroup_column
  20. function this:UpdateUI(talentType)
  21. self.talentType = talentType
  22. local atlas = "Atlas/UIArchangel.spriteatlas"
  23. GUI:Image_loadTexture(self.view.talent_name, talentType.talentGroupIcon[2], atlas)
  24. GUI:Image_loadTexture(self.view.talent_icon, talentType.talentGroupIcon[1], atlas)
  25. end
  26. function this:LoadTalent()
  27. self.baseUI:LoadTalent(self.talentType.talentGroup)
  28. end
  29. function this:Select(talentGroup)
  30. if talentGroup == self.talentType.talentGroup then
  31. local src = self.talentType.talentGroupMenuIcon
  32. self.baseUI:ChangeBG(src)
  33. end
  34. GUI:setVisible(self.view.select, talentGroup == self.talentType.talentGroup)
  35. end
  36. function this:Close()
  37. end
  38. return this