diff --git a/ItemCollection/SM_ItemCollectionUI.lua b/ItemCollection/SM_ItemCollectionUI.lua index 82d6857..84f2d2c 100644 --- a/ItemCollection/SM_ItemCollectionUI.lua +++ b/ItemCollection/SM_ItemCollectionUI.lua @@ -864,7 +864,7 @@ function SM_ItemCollectionUI:ShowItemPreview(slot, panel) self:SetModelType(model, "main") --设置模型类型 主手 end model:Undress() --脱下装备 - local success, error = pcall(function() + local success, error = pcall(function() model:TryOn(itemID) --穿上装备 end) local weaponCameraID @@ -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") - pageText:SetPoint("BOTTOM", panel, "BOTTOM", 80, 40) - pageText:SetText(string.format("第 %d / %d 页", self.currentPage, self.totalPages)) - pageText:SetDrawLayer("OVERLAY", 7) -- 使用子层级7,确保在OVERLAY层的最顶部 + 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:Show() self.pageButtons.text = pageText end diff --git a/SM_Events.lua b/SM_Events.lua index c9fa030..3e01471 100644 --- a/SM_Events.lua +++ b/SM_Events.lua @@ -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 @@ -109,26 +108,23 @@ function SM_Collections:HandleItemAttributesData(msg) local allAttributes = {} -- 处理每一行属性数据 - for _, line in ipairs(lines) do - local data = self:MessageSplit(line, "|") - - -- 每4个元素为一组进行循环处理(属性名、属性值、属性类型、是否正面) - for i = 1, #data, 4 do - if data[i] and data[i + 1] and data[i + 2] and data[i + 3] then - local attribute = { - Name = data[i], - value = tonumber(data[i + 1]), - valueType = data[i + 2], - 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 - end + for _, line in ipairs(lines) do + local data = self:MessageSplit(line, "|") + + -- 每4个元素为一组进行循环处理(属性名、属性值、属性类型、是否正面) + for i = 1, #data, 4 do + if data[i] and data[i + 1] and data[i + 2] and data[i + 3] then + local attribute = { + Name = data[i], + value = tonumber(data[i + 1]), + valueType = data[i + 2], + isPositive = data[i + 3] == "1" -- 使用服务端发送的标志 + } + + table.insert(allAttributes, attribute) + end + end + end -- 检查是否存在待处理的回调函数 if self.pendingCallbacks and self.pendingCallbacks.item_attributes then diff --git a/SM_UI_SplitPanel.lua b/SM_UI_SplitPanel.lua index ca8d3ba..76ad2d4 100644 --- a/SM_UI_SplitPanel.lua +++ b/SM_UI_SplitPanel.lua @@ -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 diff --git a/Textures/liebiaoditu_kuang_B.blp b/Textures/liebiaoditu_kuang_B.blp index 15c375b..0370c49 100644 Binary files a/Textures/liebiaoditu_kuang_B.blp and b/Textures/liebiaoditu_kuang_B.blp differ diff --git a/Textures/liebiaoditu_kuang_C.blp b/Textures/liebiaoditu_kuang_C.blp index ef8771d..4e005aa 100644 Binary files a/Textures/liebiaoditu_kuang_C.blp and b/Textures/liebiaoditu_kuang_C.blp differ