View Single Post
06-01-17, 05:47 AM   #1
Eommus
An Aku'mai Servant
Join Date: Apr 2017
Posts: 34
Hide "Main Action Bar" and "Bottom Left Bar"

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:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("ADDON_LOADED")
  3.  
  4. local function ActionBarsHide(self, event, arg1, ...)
  5.      if (event == "ADDON_LOADED" and arg1 == "MyAddonName") then
  6.         MainActionBar:Hide() -- not working
  7.         MultiBarBottomLeft:Hide() -- not working
  8.         -- print("test") -- working
  9.         f:UnregisterEvent("ADDON_LOADED")
  10.      end
  11. end
  12.  
  13. 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.
  Reply With Quote