Thread Tools Display Modes
Prev Previous Post   Next Post Next
08-25-23, 07:43 AM   #1
darkness3885
A Kobold Labourer
Join Date: Aug 2023
Posts: 1
New items Highlighted

Hello, I am new to this forum and I have registered, because I am looking for information about a modification that I am trying to make to the game, it is something very "simple", I will detail it.
In the example game WoW Classic or Wow ltk classic, when looting items or buying items, the new items will be highlighted. I have tried several ways to implement it in wow ltk the old client but I don't get it.
Thank you and excuse my English I use a translator since I only speak Spanish.
Code:
local frame = CreateFrame("Frame")

function frame:OnEvent(event, arg1)
    if event == "BAG_UPDATE" then
        for bag = 0, 4 do
            for slot = 1, GetContainerNumSlots(bag) do
                local itemLink = GetContainerItemLink(bag, slot)
                if itemLink then
                    local _, _, _, _, _, _, _, _, _, _, _, itemClassID, itemSubClassID = GetItemInfo(itemLink)
                    local isNewItem = C_NewItems.IsNewItem(bag, slot)
                    
                    if isNewItem then
                        local itemButton = _G["ContainerFrame" .. bag + 1 .. "Item" .. slot]
                        if itemButton then
                            itemButton.NewItemTexture:Show() -- Mostrar la textura de nuevo ítem
                        end
                    end
                end
            end
        end
    end
end

frame:RegisterEvent("BAG_UPDATE")
frame:SetScript("OnEvent", frame.OnEvent)
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » New items Highlighted

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off