DropTheCheapestThing

DropTheCheapestThing

129k Downloads

Bagnon 8.2.17 beta and later

Road-block opened this issue ยท 0 comments

commented

https://www.curseforge.com/wow/addons/bagnon/files/2836697

Bagnon structure has changed so the DropTheCheapestThing Bagnon plugin needs changing to

local core = LibStub("AceAddon-3.0"):GetAddon("DropTheCheapestThing")

if Bagnon then
    local Item = Bagnon.Item
    local UpdateBorder = Item.UpdateBorder
    local r, g, b = GetItemQualityColor(0)

    function Item:UpdateBorder(...)
        -- First, do the core bagnon behavior for stuff like new-item flashing
        UpdateBorder(self, ...)
        self.JunkIcon:Hide()

        -- Now override if we have junk
        local link = self:GetItem()
        if link then
            local id = tonumber(strmatch(link, 'item:(%d+)'))
            local bag, slot = self:GetBag(), self:GetID()
            if not (type(bag) == "number") then
                return
            end
            local bagslot = core.encode_bagslot(bag, slot)
            if core.slot_contents[bagslot] then
                self.IconGlow:SetVertexColor(r, g, b, 0.5)
                self.IconGlow:SetShown(r)
                self.JunkIcon:Show()
            end
        end
    end

    core.RegisterCallback("Bagnon", "Junk_Update", function()
        Bagnon.Frames:Update()
    end)
end

ItemSlot referenced for previous version no longer exists.
Bagnon:UpdateFrames() also no longer exists.

Note: This is still a beta version so if the goal was to support both the current release version and the upcoming there would have to be some conditional/fallback logic for those 2 changes.