KLTeamInfoItem.lua 1001 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ---@class KLTeamInfoItem:UIKmlLuaPanelBase
  2. ---@field view KLTeamInfoItemView
  3. local KLTeamInfoItem = class(UIKmlLuaPanelBase)
  4. local this =KLTeamInfoItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:Refresh()
  10. end
  11. ---注册UI事件和服务器消息
  12. function this:RegistEvents()
  13. end
  14. function this:RefreshItem(data)
  15. GUI:Text_setString(self.view.state,data.state)
  16. local icon = "10"
  17. if data.career == 2 then
  18. icon = "12"
  19. elseif data.career == 3 then
  20. icon = "13"
  21. elseif data.career == 4 then
  22. icon = "14"
  23. elseif data.career == 5 then
  24. icon = "15"
  25. elseif data.career == 6 then
  26. icon = "16"
  27. end
  28. GUI:Image_loadTexture(self.view.icon,icon,"Atlas/MUIcon.spriteatlas")
  29. GUI:setVisible(self.view.select,data.select)
  30. GUI:setVisible(self.view.leaderIcon,data.isLeader)
  31. GUI:Text_setString(self.view.playerName,data.name)
  32. end
  33. function this:Close()
  34. end
  35. return this