WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   New items Highlighted (https://www.wowinterface.com/forums/showthread.php?t=59653)

darkness3885 08-25-23 07:43 AM

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)



All times are GMT -6. The time now is 09:12 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI