This should works perfectly, this code will Hide your Minimap and Objective tracker frame, and it will show Minimap onEnter event:
Lua Code:
local function HideAdvancedInderface()
-- [[ ###### HIDE CERTAIN FRAMES ###### ]]
local objects = { MinimapCluster, ObjectiveTrackerFrame } -- [[We can add here more frames for hiding on Login, for example: UIErrorsFrame, PlayerFrame, TargetFrame, PetFrame, MainMenuBar and so on...]]
for _,object in pairs(objects) do
if object then
object:Hide()
end
end
-- [[ ###### HIDE/SHOW MINIMAP ON MOUSE ENTER/LEAVE ###### ]]
local function MinimapTrigger()
local frame = CreateFrame("FRAME","MinimapTrigger",UIParent)
frame:SetAllPoints(MinimapCluster)
frame:Show()
frame:SetScript("OnEnter", function() MinimapCluster:Show() end)
frame:SetScript("OnLeave", function() MinimapCluster:Hide() end)
end
MinimapTrigger()
end
HideAdvancedInderface()
If you want to hide special frame, for example target, self, focus. party, raid, then change this line:
Lua Code:
local objects = { MinimapCluster, ObjectiveTrackerFrame }
To something like this:
Lua Code:
local objects = { MinimapCluster, ObjectiveTrackerFrame, UIErrorsFrame, PlayerFrame, TargetFrame, PetFrame }
You can find Frame names by typing in game chat "/fstack" without quotes. Then hover over frame that you want to hide, and search for
Orange Fame Name, and add it to the list of objects to hide:
For your action bars I suggest you to use
Bartender of other similar AddOns.
Remember that you can't :Hide() and :Show() Action Bars in combat (Blizzard block this for security and anti-cheat/bot reason), but you can :SetAlpha([value])
P.S. Use this code after "PLAYER_ENTERING_WORLD" Event to make thing works correctly, for sure hide all frames when LogIn, other way, some frames might not be hidden.
I use XML to load my AddOn, and track an events (but most of AddOn authors uses lua), this is XML i use to load my own AddOns:
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/
..\FrameXML\UI.xsd">
<Script file="MyAddOnLuaFile.lua"/>
<Frame>
<Scripts>
<OnLoad>
self:RegisterEvent("PLAYER_ENTERING_WORLD")
</OnLoad>
<OnEvent>
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
MyGlobalFunction()
</OnEvent>
</Scripts>
</Frame>
</Ui>