Hi,
I am working on a simple addon which:
1. By default, will hide the
main action bar (the action bar on the bottom left of the screen with 12 spell slots) and
bottom left action bar (which is named as "Bottom Left Bar" in Interface > ActionBars options). It will not hide any other action bars.
2. It will show the two hidden bars when I click on an NPC, a player or self.
3. It will hide them when I deselect my target via ESC or via click on the ground or a non-target object.
For Step 1, I have the following so far:
Lua Code:
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
local function ActionBarsHide(self, event, arg1, ...)
if (event == "ADDON_LOADED" and arg1 == "MyAddonName") then
MainActionBar:Hide() -- not working
MultiBarBottomLeft:Hide() -- not working
-- print("test") -- working
f:UnregisterEvent("ADDON_LOADED")
end
end
f:SetScript("OnEvent", ActionBarsHide)
Do you have an idea why
MainActionBar:Hide() and
MultiBarBottomLeft:Hide() are not working? And how I can make step 1 work?
Thanks.