源战役客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

74 行
2.0 KiB

  1. CSMainExploitRankItem = CSMainExploitRankItem or BaseClass(BaseItem)
  2. local CSMainExploitRankItem = CSMainExploitRankItem
  3. function CSMainExploitRankItem:__init()
  4. self.base_file = "csMain"
  5. self.layout_file = "CSMainExploitRankItem"
  6. self.model = CSMainModel:getInstance()
  7. self:Load()
  8. end
  9. function CSMainExploitRankItem:Load_callback()
  10. self.nodes = {
  11. "sex:img", "rankIcon:img:obj", "vipCon",
  12. "rank:tmp", "name:tmp", "guildName:tmp", "exploitNum:tmp", "militaryRank:img",
  13. }
  14. self:GetChildren(self.nodes)
  15. self.vipItem = RoleVipItem.New(self.vipCon)
  16. self:AddEvents()
  17. if self.need_refreshData then
  18. self:UpdateView()
  19. end
  20. end
  21. function CSMainExploitRankItem:AddEvents( )
  22. end
  23. function CSMainExploitRankItem:UpdateView( )
  24. self.name_tmp.text = GetCSLongName(self.data.name,self.data.ser_num)
  25. if self.data.gname and self.data.gname ~= "" then
  26. self.guildName_tmp.text = self.data.gname
  27. else
  28. self.guildName_tmp.text = "暂无社团"
  29. end
  30. self.exploitNum_tmp.text = self.data.score
  31. self.vipItem:SetData(self.data.vip_flag, self.data.sup_vip_type)
  32. local sex_res = self.data.sex == 1 and "com_boy" or "com_girl"
  33. lua_resM:setImageSprite(self, self.sex_img, "common_asset", sex_res, true)
  34. SetAnchoredPositionX(self.sex, -288+self.name_tmp.preferredWidth+15)
  35. lua_resM:setOutsideImageSprite(self, self.militaryRank_img, GameResPath.GetMilitaryImage("military_ranks_"..self.data.post), true)
  36. if self.data.rank >= 1 and self.data.rank <= 5 then
  37. self.rankIcon_obj:SetActive(true)
  38. self.rank_tmp.text = ""
  39. lua_resM:setImageSprite(self, self.rankIcon_img, "csMain_asset","cs_main_rank_"..self.data.rank,true)
  40. else
  41. self.rank_tmp.text = self.data.rank
  42. self.rankIcon_obj:SetActive(false)
  43. end
  44. end
  45. function CSMainExploitRankItem:SetData( data,index )
  46. self.data = data
  47. self.index = index
  48. if self.is_loaded then
  49. self.need_refreshData = false
  50. self:UpdateView()
  51. else
  52. self.need_refreshData = true
  53. end
  54. end
  55. function CSMainExploitRankItem:__delete( )
  56. if self.vipItem then
  57. self.vipItem:DeleteMe()
  58. self.vipItem = nil
  59. end
  60. end