Jump to content
Sign in to follow this  
Wirt

Hide Stancebar

Recommended Posts

I'm trying to make an addon work that hides the bar for stances, auras, stealth, etc. which is shown above the actionbar down to the left.

 

I've created a directory inside WoW\Interface\AddOns named StanceBarRemover. Within this folder I've created a .toc file and a .xml file.

 

The .toc file named StanceBarRemover.toc has the following written in it:

 

## Interface: 10900
## Title: StanceBarRemover
## Version: 1.0
## Notes: Removes the Stancebar above the bottomleft actionbar
## Author: Wirt
StanceBarRemover.xml

 

The .xml file named StanceBarRemover.xml has the following written in it:

 

<Ui><Script>ShapeshiftBarFrame:Hide()</Script></Ui>

 

It doesn't work. However, when I replace ShapeshiftBarFrame:Hide() with for example MinimapZoomIn:Hide(); MinimapZoomOut:Hide() the minimap zoom buttons are hidden.

 

Also, when I type in chat or make a macro with /script ShapeshiftBarFrame:Hide() it hides the bar without trouble. But I'd like to have this automatized with the help of a simple addon instead.

 

Any ideas on why the script within the addon won't hide the stancebar?

Share this post


Link to post
Share on other sites

Just use the addons Move Anything or Discord Frame Mover which is more complete but also more complex. There is another one that was developped recently but I can't remember the exact name. 

Share this post


Link to post
Share on other sites

I guess, you need run your ShapeshiftBarFrame:Hide() on some event.

Or, if you using modui or other addon, maybe they turn shiftbar on.

Edited by EffToyz

Share this post


Link to post
Share on other sites

Make an lua file, and add it to the toc then do something like:

local eventframe = CreateFrame("Frame", "eventframe");

local function hide()
    ShapeshiftBarFrame:Hide();
    ShapeshiftBarFrame:UnregisterAllEvents();
end

eventframe:RegisterEvent("PLAYER_ENTERING_WORLD");
eventframe:SetScript("OnEvent", hide);

or 

ShapeshiftBarFrame:SetScript("OnEvent", function() 
    ShapeshiftBarFrame:Hide() 
    ShapeshiftBarFrame:UnregisterAllEvents(); 
end)

I'm not really sure whats considered the best way to do it is, but both work.

Share this post


Link to post
Share on other sites
2 hours ago, GDR01 said:

Make an lua file, and add it to the toc then do something like:


local eventframe = CreateFrame("Frame", "eventframe");

local function hide()
    ShapeshiftBarFrame:Hide();
    ShapeshiftBarFrame:UnregisterAllEvents();
end

eventframe:RegisterEvent("PLAYER_ENTERING_WORLD");
eventframe:SetScript("OnEvent", hide);

or 

ShapeshiftBarFrame:SetScript("OnEvent", function() 
    ShapeshiftBarFrame:Hide() 
    ShapeshiftBarFrame:UnregisterAllEvents(); 
end)

I'm not really sure whats considered the best way to do it is, but both work.

That really worked! Thank you. My .xml file now has the following written in it:

 

<Ui><Script>ShapeshiftBarFrame:SetScript("OnEvent", function()
    ShapeshiftBarFrame:Hide()
    ShapeshiftBarFrame:UnregisterAllEvents();
end)</Script></Ui>

 

The .toc file reads the same as shown in my previous post.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×