“物品收藏”中为获取的属性加成文本灰色显示
This commit is contained in:
parent
7d57073759
commit
c5f085f175
@ -207,6 +207,18 @@ function SM_ItemCollectionUI:UpdateAttributes(itemID, itemType)
|
||||
|
||||
local rightSidePanel = SM_Collections.MainFrame.RightSidePanel
|
||||
|
||||
-- 检查物品是否已获得
|
||||
local itemData = nil
|
||||
if SM_CollectionsDB and SM_CollectionsDB.itemCache and SM_CollectionsDB.itemCache.items then
|
||||
for _, item in ipairs(SM_CollectionsDB.itemCache.items) do
|
||||
if tonumber(item.id) == tonumber(itemID) then
|
||||
itemData = item
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
local isObtained = itemData and itemData.obtained
|
||||
|
||||
-- 清理其他收藏界面的属性按钮
|
||||
if rightSidePanel.AttributeBonusFrame then
|
||||
local children = { rightSidePanel.AttributeBonusFrame:GetChildren() }
|
||||
@ -297,14 +309,26 @@ function SM_ItemCollectionUI:UpdateAttributes(itemID, itemType)
|
||||
nameText:SetPoint("LEFT", 10, 0)
|
||||
nameText:SetFont("Fonts\\ZYKai_T.ttf", 10, "MONOCHROME")
|
||||
nameText:SetText(attribute.name)
|
||||
nameText:SetTextColor(1, 1, 1)
|
||||
|
||||
-- 根据物品是否已获得设置文本颜色
|
||||
if isObtained then
|
||||
nameText:SetTextColor(1, 1, 1) -- 白色
|
||||
else
|
||||
nameText:SetTextColor(0.5, 0.5, 0.5) -- 灰色
|
||||
end
|
||||
|
||||
-- 属性数值文本
|
||||
local valueText = button:CreateFontString(nil, "OVERLAY")
|
||||
valueText:SetPoint("RIGHT", -5, 0)
|
||||
valueText:SetFont("Fonts\\ZYKai_T.ttf", 10, "MONOCHROME")
|
||||
valueText:SetText(attribute.value)
|
||||
valueText:SetTextColor(0, 1, 0) -- 绿色显示属性
|
||||
|
||||
-- 根据物品是否已获得设置文本颜色
|
||||
if isObtained then
|
||||
valueText:SetTextColor(0, 1, 0) -- 绿色
|
||||
else
|
||||
valueText:SetTextColor(0.5, 0.5, 0.5) -- 灰色
|
||||
end
|
||||
|
||||
button:Show()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user