|
|
- goodsTooltipsAttrItem = goodsTooltipsAttrItem or BaseClass(BaseItem)
-
- function goodsTooltipsAttrItem:__init(parent_wnd, prefab_asset, layer_name)
- self.base_file = "common"
- self.layout_file = "goodsTooltipsAttrItem"
- self.layer_name = "Top"
-
- self:Load()
- end
-
- function goodsTooltipsAttrItem:Load_callback()
- self.name,
- self.value
- = GetChildTexts(self.transform, {
- "name",
- "value"
- })
- self.signImg = self:GetChild("sign"):GetComponent("Image")
- self.bg = self:GetChild("bg").gameObject
- if self.need_refreshData then
- self:SetData(self.id, self.now_value,self.boolBgActive)
- end
- end
-
- function goodsTooltipsAttrItem:SetData(id, now_value,boolBgActive)
- self.id = id
- self.now_value = now_value
- self.boolBgActive = boolBgActive
- if self.is_loaded then
- local _, name, _, value = WordManager:GetPropertyInfo(tonumber(id), now_value,nil,nil, Config.ConfigItemAttr.Module.Dress)
- self.name.text = name..":"
- self.value.text = value
- local ab_name,res_name = GameResPath.GetAttrIcon(tonumber(id))
- lua_resM:setImageSprite(self, self.signImg, ab_name,res_name,true)
- self.bg:SetActive(self.boolBgActive)
-
- else
- self.need_refreshData = true
- end
- end
-
- function goodsTooltipsAttrItem:__delete()
-
- end
-
|