HandyNotes: Visions of N'Zoth

HandyNotes: Visions of N'Zoth

4M Downloads

Check transmog collected status against VisualID

zarillion opened this issue ยท 5 comments

commented

From CurseForge:

For rares that drop transmog, could the VisualID be checked against for completion instead of the SouceID or ItemID (whichever is being used)? Lots of rares show up as incomplete because of a transmog piece when a character already knows that particular transmog, even if they don't have that exact source for it.

See if this is possible without things getting too messy (old plugin previously required CanIMogIt to check transmog collected status for weird edge cases).

commented

How about using CTC.PlayerKnowsSource(sourceID) instead of CTC.PlayerHasTransmog(itemID).

Current:

With the changes down below:

like AllTheThings says i've collected the transmog from "Vault Guardian's Handguards"
but not from the "Sterling Hound-Handler's Gauntlets"

-- rewards.lua line 413 - 451

function Transmog:IsObtained()
    -- Check if the player knows the appearance
    local sourceID = select(2, CTC.GetItemInfo(self.item))
    if CTC.PlayerKnowsSource(sourceID) then return true end

    -- Verify the item drops for any of the players specs
    local specs = GetItemSpecInfo(self.item)
    if type(specs) == 'table' and #specs == 0 then return true end

    -- Verify the player can learn the item's appearance
    if sourceID then
        local infoReady, canCollect = CTC.PlayerCanCollectSource(sourceID)
        if infoReady and not canCollect then return true end
    end

    return false
end

function Transmog:GetStatus()
    local sourceID = select(2, CTC.GetItemInfo(self.item))
    local collected = CTC.PlayerKnowsSource(sourceID)
    local status = collected and Green(L["known"]) or Red(L["missing"])

    if not collected then
        -- check if we can't learn this item
        local sourceID = select(2, CTC.GetItemInfo(self.item))
        if not (sourceID and select(2, CTC.PlayerCanCollectSource(sourceID))) then
            status = Orange(L["unlearnable"])
        else
            -- check if the item doesn't drop
            local specs = GetItemSpecInfo(self.item)
            if type(specs) == 'table' and #specs == 0 then
                status = Orange(L["unobtainable"])
            end
        end
    end

    return status
end
commented

That looks like it fixes it for the plate item in the screenshot, but I would like to retain the behavior for the leather item where it says "known" instead of "unlearnable" when your account has the appearance. So the ideal fix would show Unlearnable => Known => Known for the 3 items in the screenshot above.

commented

Yes, I agree.

The screenshots from above are taken on my DK.
with the change collected = CTC.PlayerKnowsSource(sourceID) or CTC.PlayerHasTransmog(self.item) it will show on my DK
Unlearnable => Known => Known but unfortunately on my Druid Unlearnable => Known => Unlearnable.

commented

The PlayerKnowsSource function does not appear to work for me at all. It claims I know sources that I definitely do not. In fact, when I put it in place in the addon it claims I know every source. One example, the Beckoner's Shadowy Crystal:

image

image

I would play with it on your character as well. I see reports elsewhere that the PlayerKnowsSource does not return accurate data and cannot be relied on. Instead, we need to look at other addons like CanIMogIt and AllTheThings to figure out what API calls they are making.

commented

This should be vastly improved in the next release.