xod-wow/LiteBag

Currency tracking is capping at 1 for no reason?

Closed this issue · 1 comments

Look into this.

Seems to now be hard coded to the width of the BackpackTokenFrame:

function BackpackTokenFrameMixin:GetMaxTokensWatched()
        if not self.tokenWidth then
                local info = C_XMLUtil.GetTemplateInfo("BackpackTokenTemplate");
                self.tokenWidth = info and info.width or 50;
        end

        -- You can always track at least one token
        return math.max(math.floor(self:GetWidth() / self.tokenWidth), 1);
end
function TokenFrame_SetTokenWatched(id, watched)
        if watched then
                local maxWatched = BackpackTokenFrame:GetMaxTokensWatched();
                if GetNumWatchedTokens() >= maxWatched then
                        UIErrorsFrame:AddMessage(TOO_MANY_WATCHED_TOKENS:format(maxWatched), 1.0, 0.1, 0.1, 1.0);
                        return;
                end
        end

        C_CurrencyInfo.SetCurrencyBackpack(id, watched);
        TokenFrame_Update();
        BackpackTokenFrame:Update();
end