KLMapNpcIconItem.lua 894 B

12345678910111213141516171819202122232425262728293031323334
  1. ---@class KLMapNpcIconItem:UIKmlLuaPanelBase
  2. ---@field view KLMapNpcIconItemView
  3. local KLMapNpcIconItem = class(UIKmlLuaPanelBase)
  4. local this =KLMapNpcIconItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:Refresh()
  10. if self.args then
  11. ---@type cfg_npclist_column
  12. local npcTbl = self.args[1]
  13. local showName = self.args[2]
  14. GUI:Text_setString(self.view.txt_name, showName and npcTbl.showInMinimap or "")
  15. if not string.isNullOrEmpty(npcTbl.icon) then
  16. GUI:setVisible(self.view.icon,true)
  17. GUI:Image_loadTexture(self.view.icon,npcTbl.icon,"Atlas/UIMapPanel.spriteatlas")
  18. else
  19. GUI:setVisible(self.view.icon,false)
  20. end
  21. end
  22. end
  23. ---注册UI事件和服务器消息
  24. function this:RegistEvents()
  25. end
  26. function this:Close()
  27. end
  28. return this