KLUIPrivilegeBossPosItem.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ---@class KLUIPrivilegeBossPosItem:UIKmlLuaPanelBase
  2. ---@field view KLUIPrivilegeBossPosItemView
  3. local KLUIPrivilegeBossPosItem = class(UIKmlLuaPanelBase)
  4. local this = KLUIPrivilegeBossPosItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---创建或者刷新界面数据时调用
  9. function this:Refresh()
  10. end
  11. function this:RefreshItem(data,mapId,panel)
  12. --SL:LogTable(data,true)
  13. self.isOpen = true
  14. self.mapId = mapId
  15. self.panel = panel
  16. self.data = data
  17. self.monsterId = self.data.monsterId
  18. local tab = SL:GetConfigMultiKeys('cfg_repfairyland', self.mapId, 'id')
  19. local name = self.data.monsterName
  20. self.isDie = self.data.isDie
  21. local num_str = "(<color=#ff2323>0</color>/1)"
  22. if self.isDie and self.isDie == 1 then
  23. num_str = "(<color=#ff2323>1</color>/1)"
  24. end
  25. GUI:Text_setString(self.view.name,"击杀 " .. name)
  26. GUI:Text_setString(self.view.num,num_str)
  27. GUI:Text_setString(self.view.info,"击杀任务")
  28. end
  29. function this:RefreshData()
  30. if not self.isOpen then
  31. return
  32. end
  33. self.panel:GetBossList()
  34. end
  35. function this:HideItem()
  36. GUI:setVisible(self.view.level_select,false)
  37. end
  38. ---注册UI事件和服务器消息
  39. function this:RegistEvents()
  40. GUI:AddOnClickEvent(self.view.btn,self,self.Onclick)
  41. end
  42. function this:Onclick()
  43. SL:Pathfinding(self.mapId, 1, self.x, self.y)
  44. end
  45. function this:RefreshFirstData()
  46. end
  47. function this:Close()
  48. if self.Schedule then
  49. SL:UnSchedule(self.Schedule)
  50. end
  51. end
  52. return this