This is a quick put together, I didn't write the code, just edited for my use.
Thanks goes to PortalBox Author (who's minimap button code i "borrowed").
Either click the minimap button or use macro:
Code:
/script HideFrame_toggle();
HideFrame.lua
Code:
function HideFrame_MinimapButton_Reposition()
HideFrame_MinimapButton:SetPoint("TOPLEFT","Minimap","TOPLEFT",52-(80*cos(MinimapPos)),(80*sin(MinimapPos))-52)
end
function HideFrame_OnLoad()
this:RegisterEvent("VARIABLES_LOADED");
out("• HideFrame Loaded •");
end
function HideFrame_OnEvent()
if ( event == "VARIABLES_LOADED" ) then
if (MinimapPos == NIL) then
MinimapPos = 1
end
HideFrame_MinimapButton_Reposition();
end
end
function HideFrame_MinimapButton_DraggingFrame_OnUpdate()
local xpos,ypos = GetCursorPosition()
local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom()
xpos = xmin-xpos/UIParent:GetScale()+70 -- get coordinates as differences from the center of the minimap
ypos = ypos/UIParent:GetScale()-ymin-70
MinimapPos = math.deg(math.atan2(ypos,xpos)) -- save the degrees we are relative to the minimap center
HideFrame_MinimapButton_Reposition() -- move the button
end
function HideFrame_MinimapButton_OnClick()
HideFrame_toggle(msg);
end
function out(text)
DEFAULT_CHAT_FRAME:AddMessage(text)
end
function HideFrame_toggle()
if (BT4Bar1:IsVisible()) then
BT4Bar1:Hide();
BT4Bar2:Hide();
else
BT4Bar1:Show();
BT4Bar2:Show();
end
end
HideFrame.xml
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<Script file="HideFrame.lua"/>
<Frame name="HFFrame">
<Scripts>
<OnLoad>
HideFrame_OnLoad();
</OnLoad>
<OnEvent>
HideFrame_OnEvent();
</OnEvent>
</Scripts>
</Frame>
<Button name="HideFrame_MinimapButton" parent="Minimap" frameStrata="HIGH" enableMouse="true" movable="true" hidden="false">
<Size>
<AbsDimension x="33" y="33"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Layers>
<Layer level="HIGH">
<Texture name="HideFrame_MinimapButton_Icon" file="Interface\Icons\Spell_Arcane_PortalIronforge">
<Size>
<AbsDimension x="21" y="21"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture file="Interface\Minimap\MiniMap-TrackingBorder">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="HideFrame_MinimapButton_DraggingFrame" hidden="true">
<Scripts>
<OnUpdate>
HideFrame_MinimapButton_DraggingFrame_OnUpdate()
</OnUpdate>
</Scripts>
</Frame>
</Frames>
<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
<Scripts>
<OnLoad>
this:RegisterForClicks("LeftButtonUp","RightButtonUp")
this:RegisterForDrag("LeftButton","RightButton")
</OnLoad>
<OnEnter>
GameTooltip:SetOwner(this, ANCHOR_TOPLEFT);
GameTooltip:AddLine("HideFrame")
GameTooltip:Show()
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
<OnDragStart>
this:LockHighlight()
HideFrame_MinimapButton_DraggingFrame:Show()
</OnDragStart>
<OnDragStop>
this:UnlockHighlight()
HideFrame_MinimapButton_DraggingFrame:Hide()
</OnDragStop>
<OnClick>
HideFrame_MinimapButton_OnClick() -- do your thing in here, arg1 is mouse button clicked
</OnClick>
</Scripts>
</Button>
</Ui>
HideFrame.toc
Code:
## Interface: 30000
## Title: HideFrame
## Notes:
## SavedVariables: MinimapPos
HideFrame.lua
HideFrame.xml
This only hides bar1 and 2, to add more, find the bar names.
Usually BT4Bar2, BT4Bar3 etc, and add it to the bottom of the lua file.
Feel free to edit, just thank the original author of PortalBox.
Do NOT blame me for any damage this causes, any limbs lost, pc's fried etc.
It worked fine on my pc.
Hope this helped.