It works fine except I cannot get it to register on login or UI reload that the mouse is not over the frame and to automatically hide to begin with. Currently I ahve to go mouseover the frame and then mouseout to get it to hide, then everything works, fine.
2.) I set the frame strat to BACKGROUND and then it does not register when the mouse is over the region. Combined with the first issue then buttons sit there like normal and do not hide. If I set the strata to HIGH then it shows and hides the buttons fine but the frame is in the way and you cant actually click any buttons. I remedied this by changing the strata from HIGH to BACKGROUND on mouseout and mouseover respectively.
With the current code I have the strata changes and I can click buttons and they show while my mouse is over the buttons and it works ok. I am concerned that this strata thing will somehow interfere with something in the future. i would rather SetAlpha or Show/Hide.
3.) With the current code when I am in combat the top three buttons do not show on mouseover, these are the anchor buttons so I think it has something to do with that, they are Character, Spellbook and Talents. Character is parented to the frame I created, Spellbook to Character and Talents to Spellbook.
It also is not changing the strata of the frame as I cannot click buttons while in combat as the frame is still set to "HIGH" and is in the way.
I thought maybe it has to do with the frame overall since these are all ostensibly parented to the same frame via other buttons. Using HookScript doesn't work, nothing happens, no lua errors either.
Thanks in advance for any help.
The code in question is in the "--Micro Menu Buttons" section except for the table at the top defining "MicroButtons"
-- Just use the default UI's list of micro buttons instead of making
-- your own.
local MICRO_BUTTONS = MICRO_BUTTONS
-- Create a frame to hold all the micro buttons:
local f = CreateFrame("Frame", "MicroButtonHolder", UIParent)
f:SetPoint("BOTTOMLEFT", 548, 2)
f:SetHeight(58) -- height of 1 micro button
f:SetWidth((28 * 12) - (3 * 11)) -- width of 1 micro button * 12 + space between each button * 11
-- Parent all the micro buttons to the holder frame, and reparent them
-- to it again when the default UI tries to change their parent:
local function ReparentMicroButtons()
if InCombatLockdown() then
print("ERROR: Cannot reparent micro buttons in combat!")
else
for i = 1, #MICRO_BUTTONS do
local button = _G[MICRO_BUTTONS[i]]
button:SetParent(f)
button:SetFrameLevel(f:GetFrameLevel() + 1)
end
end
end
-- The ReparentMicroButtons function doesn't ever seem to get called,
-- but it exists, so better hook it anyway.
hooksecurefunc("UpdateMicroButtonsParent", ReparentMicroButtons)
ReparentMicroButtons()
-- Add scripts to detect mouse enter/leave and react accordingly:
local function CheckForMouseOut()
if not f:IsMouseOver() then
f:SetScript("OnUpdate", nil)
f:SetAlpha(0)
end
end
local function OnEnter()
-- I'm just going to be lazy here and start checking when the mouse
-- enters the frame. The check is pretty cheap, and you're not
-- spending a huge amount of time hovering over the frame anyway.
f:SetScript("OnUpdate", CheckForMouseOut)
end
f:SetScript("OnEnter", OnEnter)
for i = 1, #MICRO_BUTTONS do
local button = _G[MICRO_BUTTONS[i]]
-- Motion scripts while disabled is already enabled on the buttons,
-- but better re-set it anyway just to make sure.
button:SetMotionScriptsWhileDisabled(true)
button:HookScript("OnEnter", OnEnter)
end
[HTML]
Message: Interface\AddOns\DejaUI\DejaBars.lua:26: attempt to call global 'hooksecurefunction' (a nil value)
Time: 09/11/12 14:34:46
Count: 1
Stack: Interface\AddOns\DejaUI\DejaBars.lua:26: in main chunk
1.) First I used the code Phanx helped me with for hiding and showing the CompactRaidFrameManager in this thread:http://forums.curseforge.com/showthread.php?t=20170
It works fine except I cannot get it to register on login or UI reload that the mouse is not over the frame and to automatically hide to begin with. Currently I ahve to go mouseover the frame and then mouseout to get it to hide, then everything works, fine.
2.) I set the frame strat to BACKGROUND and then it does not register when the mouse is over the region. Combined with the first issue then buttons sit there like normal and do not hide. If I set the strata to HIGH then it shows and hides the buttons fine but the frame is in the way and you cant actually click any buttons. I remedied this by changing the strata from HIGH to BACKGROUND on mouseout and mouseover respectively.
With the current code I have the strata changes and I can click buttons and they show while my mouse is over the buttons and it works ok. I am concerned that this strata thing will somehow interfere with something in the future. i would rather SetAlpha or Show/Hide.
3.) With the current code when I am in combat the top three buttons do not show on mouseover, these are the anchor buttons so I think it has something to do with that, they are Character, Spellbook and Talents. Character is parented to the frame I created, Spellbook to Character and Talents to Spellbook.
It also is not changing the strata of the frame as I cannot click buttons while in combat as the frame is still set to "HIGH" and is in the way.
I thought maybe it has to do with the frame overall since these are all ostensibly parented to the same frame via other buttons. Using HookScript doesn't work, nothing happens, no lua errors either.
Thanks in advance for any help.
The code in question is in the "--Micro Menu Buttons" section except for the table at the top defining "MicroButtons"
http://www.wowace.com/paste/6198/
[HTML]
Message: Interface\AddOns\DejaUI\DejaBars.lua:26: attempt to call global 'hooksecurefunction' (a nil value)
Time: 09/11/12 14:34:46
Count: 1
Stack: Interface\AddOns\DejaUI\DejaBars.lua:26: in main chunk
Locals: MICRO_BUTTONS =
1 = "CharacterMicroButton"
2 = "SpellbookMicroButton"
3 = "TalentMicroButton"
4 = "AchievementMicroButton"
5 = "QuestLogMicroButton"
6 = "GuildMicroButton"
7 = "PVPMicroButton"
8 = "LFDMicroButton"
9 = "EJMicroButton"
10 = "CompanionsMicroButton"
11 = "MainMenuMicroButton"
12 = "HelpMicroButton"
}
f = MicroButtonHolder {
0 = <userdata>
}
ReparentMicroButtons = <function> defined @Interface\AddOns\DejaUI\DejaBars.lua:13
(*temporary) = nil
(*temporary) = "UpdateMicroButtonsParent"
(*temporary) = <function> defined @Interface\AddOns\DejaUI\DejaBars.lua:13
(*temporary) = "attempt to call global 'hooksecurefunction' (a nil value)"
[/HTML]
:)