doadin / Baggins

zlib License
6 stars 7 forks source link

Quality icons? #83

Closed WanderingFox closed 1 year ago

WanderingFox commented 1 year ago

Would it be possible to add quality icons to items (in the same way item upgrade arrows are added)?

Like how the profession window shows them: image

doadin commented 1 year ago

I think so but im not sure how to get this info from the game, Ill look into it.

WanderingFox commented 1 year ago

The icons appear to be in the atlas professionqualityicons as:

Not sure how to get the quality of the item in the bag though.

image

WanderingFox commented 1 year ago

Looks like it's done something like this in the blizz source (not sure how much is actually needed for baggins though since this is ripped out of the profession ui):

quality = C_TradeSkillUI.GetItemReagentQualityByItemInfo(itemIDOrLink) or  C_TradeSkillUI.GetItemCraftedQualityByItemInfo(itemIDOrLink);
button.ProfessionQualityOverlay = button:CreateTexture(nil, "OVERLAY");
button.ProfessionQualityOverlay:SetPoint("TOPLEFT", -3, 2);
button.ProfessionQualityOverlay:SetDrawLayer("OVERLAY", 7);
local atlas = ("Professions-Icon-Quality-Tier%d-Inv"):format(quality);
button.ProfessionQualityOverlay:SetAtlas(atlas, TextureKitConstants.UseAtlasSize);
ItemButtonMixin.UpdateCraftedProfessionsQualityShown(button);
doadin commented 1 year ago

Added: e6a67bd8b050398c52b01155ad4fef9dccc9945d Included in v4.6.9 . Let me know if you have any issues with it. Thanks!