源战役客户端
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

EquipToolTipsZhuoYueAttr = EquipToolTipsZhuoYueAttr or BaseClass(BaseItem)
EquipToolTipsZhuoYueAttr.Height = 24
local EquipToolTipsZhuoYueAttr = EquipToolTipsZhuoYueAttr
function EquipToolTipsZhuoYueAttr:__init()
self.base_file = "common"
self.layout_file = "EquipToolTipsZhuoYueAttr"
self.is_delay_callback = true
self.attrType = EquipToolTips.AttrType.BaseAttr
self.model = EquipModel:getInstance()
self.height = 24
self.attr_list = {}
self:Load()
end
function EquipToolTipsZhuoYueAttr:Load_callback()
self.nodes = {
"zhuoyue_bg:obj:img","attr_name_value:tmp",
}
self:GetChildren(self.nodes)
if self.need_refreshData then
self:SetData(self.data,self.index)
end
self:InitEvent()
end
function EquipToolTipsZhuoYueAttr:InitEvent()
-- local function clickHandler(target)
-- if target == self.touch_obj then
-- end
-- end
-- AddClickEvent(self.touch_obj, clickHandler,2)
end
function EquipToolTipsZhuoYueAttr:__delete()
-- for k,v in pairs(self.item_list) do
-- UIObjPool:getInstance():PushItem(UIObjPool.UIType.AwardItem, v)
-- end
-- self.item_list = {}
self:ClearUIEffect(self.zhuoyue_bg)
end
function EquipToolTipsZhuoYueAttr:SetData(vo,index)
self.data = vo
self.index = index or self.index
if self.is_loaded then
self.need_refreshData = false
else
self.need_refreshData = true
return
end
if self.data and self.data.is_evolution_show then
self.zhuoyue_bg_obj:SetActive(false)
self.attr_name_value_tmp.text = HtmlColorTxt("随机新增一条属性", "#ea5f27")
return
end
if not self.data or not self.data[1] then
self.zhuoyue_bg_obj:SetActive(false)
self.attr_name_value_tmp.text = string.format("<color=%s>%s 星解锁新属性</color>",ColorUtil.GRAY_DARK,self.index)
return
end
local color = "#FFF268"
self.zhuoyue_bg_obj:SetActive(true)
if self.data[1] and self.data[1][1] then
if self.data[1][3] >= 2 then--这类就要有特效了
self:ClearUIEffect(self.zhuoyue_bg)
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)
else
self:ClearUIEffect(self.zhuoyue_bg)
end
lua_resM:setImageSprite(self, self.zhuoyue_bg_img, "common_asset", "equip_evo_attr_pz_"..(self.data[1][3] or 1),true)
local str, name, symbol, value = WordManager:GetPropertyInfo(self.data[1][1],self.data[1][2])
local attr_str = name.." "..value
self.attr_name_value_tmp.text = HtmlColorTxt(attr_str, color)
else
self:ClearUIEffect(self.zhuoyue_bg)
end
end