Thread: bBag IconBorder
View Single Post
10-06-15, 02:18 AM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Well, the default UI function that actually updates the bag items does this to show+color or hide the border based on the item's rarity:

lua Code:
  1. function ContainerFrame_Update(frame)
  2.     local id = frame:GetID();
  3.     local name = frame:GetName();
  4.     -- (snip)
  5.     for i=1, frame.size, 1 do
  6.         itemButton = _G[name.."Item"..i];
  7.         texture, itemCount, locked, quality, readable, _, _, isFiltered, noValue = GetContainerItemInfo(id, itemButton:GetID());
  8.         -- (snip)
  9.         if (quality) then
  10.             if (quality >= LE_ITEM_QUALITY_COMMON and BAG_ITEM_QUALITY_COLORS[quality]) then
  11.                 itemButton.IconBorder:Show();
  12.                 itemButton.IconBorder:SetVertexColor(BAG_ITEM_QUALITY_COLORS[quality].r, BAG_ITEM_QUALITY_COLORS[quality].g, BAG_ITEM_QUALITY_COLORS[quality].b);
  13.             else
  14.                 itemButton.IconBorder:Hide();
  15.             end
  16.             -- (snip)
  17.         else
  18.             itemButton.IconBorder:Hide();
  19.         end

... and your code just changes the IconBorder texture:

lua Code:
  1. local function skin(frame)
  2.     -- (snip)
  3.     frame.IconBorder:SetTexture("Interface\\AddOns\\bBag\\border")
  4.     -- (snip)
  5.     frame.IconBorder:SetHeight(40)                    
  6.     frame.IconBorder:SetWidth(40)
  7.     frame.IconBorder:SetAlpha(0)

... but based on this it should never be visible in the first place, since your code sets the alpha (opacity/visibility) to 0 on load and never changes it, the default UI code never touches the alpha, and nothing in your code does anything else with the texture.

Are you sure you don't have any other addons touching your bags?

Place the cursor over a bag item in-game and run this:

Code:
/run local t = GetMouseFocus().IconBorder local r, g, b = t:GetVertexColor() print("Shown?", t:IsShown(), "Alpha", floor(t:GetAlpha() * 100 + 0.5), "R", floor(r * 255 + 0.5), "G", floor(g * 255 + 0.5), "B", floor(b * 255 + 0.5))
If it reports that it's not shown and/or the alpha is 0, but you see a border, then you definitely have something else going on.

If it reports that it is shown and the alpha is greater than 0, try this:

Code:
/run GetMouseFocus().IconBorder:Hide()
Does the border disappear? Again, if not, then you have some other addon interfering.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote