调整翻页文本层级

This commit is contained in:
尚美 2025-07-02 23:35:57 +08:00
parent 6cf68a845d
commit 6c26659a91
5 changed files with 26 additions and 40 deletions

View File

@ -908,8 +908,7 @@ function SM_ItemCollectionUI:ShowItemPreview(slot, panel)
SM_Collections.MainFrame.RightSidePanel.MountNama:SetText(itemName or "")
end
if SM_Collections.MainFrame.RightSidePanel.introText then
SM_Collections.MainFrame.RightSidePanel.introText:SetText("物品ID: " ..
currentItemID .. "\n类型: " .. slot.name)
SM_Collections.MainFrame.RightSidePanel.introText:SetText("物品ID: " .. currentItemID .. "\n类型: " .. slot.name)
end
SM_ItemCollectionUI:UpdateAttributes(currentItemID, slot.invType)
end
@ -956,8 +955,7 @@ function SM_ItemCollectionUI:ShowItemPreview(slot, panel)
SM_Collections.MainFrame.RightSidePanel.MountNama:SetText(itemName or "")
end
if SM_Collections.MainFrame.RightSidePanel.introText then
SM_Collections.MainFrame.RightSidePanel.introText:SetText("物品ID: " .. itemID .. "\n类型: " .. slot
.name)
SM_Collections.MainFrame.RightSidePanel.introText:SetText("物品ID: " .. itemID .. "\n类型: " .. slot.name)
end
self:UpdateAttributes(itemID, slot.invType)
end
@ -1065,10 +1063,9 @@ function SM_ItemCollectionUI:CreatePageButtons(panel, slot)
self.pageButtons.next = nextBtn
-- 页码文本
local pageText = panel:CreateFontString(nil, "OVERLAY", "GameFontNormal")
local pageText = panel.previewFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
pageText:SetPoint("BOTTOM", panel, "BOTTOM", 80, 40)
pageText:SetText(string.format("第 %d / %d 页", self.currentPage, self.totalPages))
pageText:SetDrawLayer("OVERLAY", 7) -- 使用子层级7确保在OVERLAY层的最顶部
pageText:Show()
self.pageButtons.text = pageText
end

View File

@ -75,7 +75,6 @@ end
-- 处理属性数据
function SM_Collections:HandleAttributesData(msg)
print("[收藏系统] 处理属性数据:", msg)
local data = self:MessageSplit(msg, "|")
local attributes = {}
for i = 1, #data, 3 do
@ -119,12 +118,9 @@ function SM_Collections:HandleItemAttributesData(msg)
Name = data[i],
value = tonumber(data[i + 1]),
valueType = data[i + 2],
isPositive = data[i + 3] == "1" -- 使用服务端发送的标志
isPositive = data[i + 3] == "1" -- 使用服务端发送的标志
}
print("Name= " .. attribute.Name .. ", value= " .. attribute.value ..
", valueType= " .. attribute.valueType .. ", isPositive= " .. tostring(attribute.isPositive))
table.insert(allAttributes, attribute)
end
end

View File

@ -84,9 +84,7 @@ function OnItemClick(button, itemData, itemType, panel)
panel.model:Show()
panel.model:SetCreature(creatureDisplayID)
else
print("无法显示模型: ",
panel and "面板存在" or "面板不存在",
panel and panel.model and "模型存在" or "模型不存在",
print("无法显示模型: ", panel and "面板存在" or "面板不存在", panel and panel.model and "模型存在" or "模型不存在",
creatureDisplayID and creatureDisplayID > 0 and "有效的显示ID" or "无效的显示ID")
end
@ -360,7 +358,7 @@ function SM_Collections:CreateListItems(parent, data, itemType, model, nameText,
selectedTexture:SetAllPoints(button)
selectedTexture:SetTexture("Interface\\AddOns\\SM_CollectionSystem\\Textures\\liebiaoditu_kuang_C")
selectedTexture:SetBlendMode("ADD")
selectedTexture:SetVertexColor(0, 1, 1, 1) -- 金黄色高亮
--selectedTexture:SetVertexColor(0, 1, 1, 1) -- 金黄色高亮
selectedTexture:Hide()
button.selectedTexture = selectedTexture
@ -564,16 +562,12 @@ function SM_Collections:CreateListItems(parent, data, itemType, model, nameText,
button:SetScript("OnDoubleClick", function()
-- 根据itemType发送不同的消息
if itemType == "mount" then
print("双击召唤坐骑", item.id)
SendAddonMessage("SM_C_SUMMON_MOUNT", item.id .. " " .. 1, "GUILD")
elseif itemType == "companion" then
print("双击召唤小伙伴", item.id)
SendAddonMessage("SM_C_SUMMON_COMPANION", item.id .. " " .. 1, "GUILD")
elseif itemType == "card" then
print("双击使用卡牌", item.id)
SendAddonMessage("SM_C_USE_CARD", item.id, "GUILD")
elseif itemType == "item" then
print("双击查看物品", item.id)
SendAddonMessage("SM_C_VIEW_ITEM", item.id, "GUILD")
end
end)
@ -722,7 +716,6 @@ function SM_Collections:UpdateAttributesForItem(item, parentFrame, itemType)
local valueText = button:CreateFontString(nil, "OVERLAY")
valueText:SetPoint("RIGHT", -5, 0)
valueText:SetFont("Fonts\\ZYKai_T.ttf", 10, "MONOCHROME")
print("isPositive= ", isPositive)
local formattedValue = isPositive and ("+ " .. AttributeValue) or ("- " .. AttributeValue)
valueText:SetText(formattedValue)
@ -1014,7 +1007,7 @@ function SM_Collections:RefreshCollectionStatus(itemType, itemID, isObtained)
if not button.newTexture then
local newTexture = button:CreateTexture(nil, "OVERLAY")
newTexture:SetSize(32, 28)
newTexture:SetPoint("TOPRIGHT", button, "TOPRIGHT", 10, 10)
newTexture:SetPoint("TOPRIGHT", button, "TOPRIGHT", -10, 10)
newTexture:SetTexture("Interface\\AddOns\\SM_CollectionSystem\\Textures\\New_Icon")
button.newTexture = newTexture

Binary file not shown.

Binary file not shown.