源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.4 KiB

  1. EquipToolTipsZhuoYueAttr = EquipToolTipsZhuoYueAttr or BaseClass(BaseItem)
  2. EquipToolTipsZhuoYueAttr.Height = 24
  3. local EquipToolTipsZhuoYueAttr = EquipToolTipsZhuoYueAttr
  4. function EquipToolTipsZhuoYueAttr:__init()
  5. self.base_file = "common"
  6. self.layout_file = "EquipToolTipsZhuoYueAttr"
  7. self.is_delay_callback = true
  8. self.attrType = EquipToolTips.AttrType.BaseAttr
  9. self.model = EquipModel:getInstance()
  10. self.height = 24
  11. self.attr_list = {}
  12. self:Load()
  13. end
  14. function EquipToolTipsZhuoYueAttr:Load_callback()
  15. self.nodes = {
  16. "zhuoyue_bg:obj:img","attr_name_value:tmp",
  17. }
  18. self:GetChildren(self.nodes)
  19. if self.need_refreshData then
  20. self:SetData(self.data,self.index)
  21. end
  22. self:InitEvent()
  23. end
  24. function EquipToolTipsZhuoYueAttr:InitEvent()
  25. -- local function clickHandler(target)
  26. -- if target == self.touch_obj then
  27. -- end
  28. -- end
  29. -- AddClickEvent(self.touch_obj, clickHandler,2)
  30. end
  31. function EquipToolTipsZhuoYueAttr:__delete()
  32. -- for k,v in pairs(self.item_list) do
  33. -- UIObjPool:getInstance():PushItem(UIObjPool.UIType.AwardItem, v)
  34. -- end
  35. -- self.item_list = {}
  36. self:ClearUIEffect(self.zhuoyue_bg)
  37. end
  38. function EquipToolTipsZhuoYueAttr:SetData(vo,index)
  39. self.data = vo
  40. self.index = index or self.index
  41. if self.is_loaded then
  42. self.need_refreshData = false
  43. else
  44. self.need_refreshData = true
  45. return
  46. end
  47. if self.data and self.data.is_evolution_show then
  48. self.zhuoyue_bg_obj:SetActive(false)
  49. self.attr_name_value_tmp.text = HtmlColorTxt("随机新增一条属性", "#ea5f27")
  50. return
  51. end
  52. if not self.data or not self.data[1] then
  53. self.zhuoyue_bg_obj:SetActive(false)
  54. self.attr_name_value_tmp.text = string.format("<color=%s>%s 星解锁新属性</color>",ColorUtil.GRAY_DARK,self.index)
  55. return
  56. end
  57. local color = "#FFF268"
  58. self.zhuoyue_bg_obj:SetActive(true)
  59. if self.data[1] and self.data[1][1] then
  60. if self.data[1][3] >= 2 then--这类就要有特效了
  61. self:ClearUIEffect(self.zhuoyue_bg)
  62. self:AddUIEffect("ui_star", self.zhuoyue_bg, self.layer_name, Vector3(-15.5, 1.5 ,0), 0.6, true, nil, nil, nil, nil,0.8)
  63. else
  64. self:ClearUIEffect(self.zhuoyue_bg)
  65. end
  66. lua_resM:setImageSprite(self, self.zhuoyue_bg_img, "common_asset", "equip_evo_attr_pz_"..(self.data[1][3] or 1),true)
  67. local str, name, symbol, value = WordManager:GetPropertyInfo(self.data[1][1],self.data[1][2])
  68. local attr_str = name.." "..value
  69. self.attr_name_value_tmp.text = HtmlColorTxt(attr_str, color)
  70. else
  71. self:ClearUIEffect(self.zhuoyue_bg)
  72. end
  73. end