hopefully my next mistake is just as obvious
im trying to hide the backgrounds of the default backpacks, running the commands individually ingame as /script works fine, i thought i might be missing an event, but after 2 hrs browsing API documentation i cant see any events im missing. [EDIT]hmm it seems the BAG_OPEN isnt fireing it works on BAG_UPDATE.
Code:
------------
--Hide Bag Backgrounds
------------
local hiding = CreateFrame("Frame", "stealthbagz");
hiding:RegisterEvent("PLAYER_ENTERING_WORLD")
hiding:RegisterEvent("BAG_UPDATE")
hiding:RegisterEvent("BAG_OPEN")
local function hideBG(self, event, ...)
for i = 1, NUM_CONTAINER_FRAMES do
_G["ContainerFrame"..i.."CloseButton"]:Hide() -- works fine
_G["ContainerFrame"..i.."BackgroundTop"]:Hide()
_G["ContainerFrame"..i.."BackgroundBottom"]:Hide()
_G["ContainerFrame"..i.."BackgroundMiddle1"]:Hide()
end
end
hiding:SetScript("OnEvent", hideBG);