MultiBarLeft doesn't seem to like my mouseover script....
Bar script itself
Lua Code:
local LeftBarPoint1 = "LEFT"
local LeftBarPoint2 = "LEFT"
local LeftBarX = 0
local LeftBarY = 100
local RightshowOnMouseover = true
--create the frame to hold the buttons
local frame4 = CreateFrame("Frame", "Bob_MultiBarLeft", UIParent, "SecureHandlerStateTemplate")
frame4:SetWidth(num*Buttonsize + (num-1)*Buttonmargin + 2*Buttonpadding)
frame4:SetHeight(Buttonsize + 2*Buttonpadding)
frame4:SetPoint(LeftBarPoint1,UIParent,LeftBarPoint2,LeftBarX,LeftBarY)
frame4:SetScale(BarScale)
--move the buttons into position and reparent them
MultiBarLeft:SetParent(frame)
MultiBarLeft:EnableMouse(false)
for i=1, num do
local button = _G["MultiBarLeftButton"..i]
table.insert(buttonList, button) --add the button object to the list
button:SetSize(Buttonsize, Buttonsize)
button:ClearAllPoints()
if i == 1 then
button:SetPoint("BOTTOMLEFT", frame4, Buttonpadding, Buttonpadding)
else
local previous = _G["MultiBarLeftButton"..i-1]
button:SetPoint("TOP", previous, "BOTTOM", 0, Buttonmargin)
end
end
--show/hide the frame on a given state driver
RegisterStateDriver(frame4, "visibility", "[petbattle] hide; [vehicleui] hide; show")
mouseover script
Lua Code:
--Show on mouseover
if LeftshowOnMouseover then
local function Fade(alpha)
if MultiBarLeft:IsShown() then
for i = 1,12 do
local button = _G["MultiBarLeftButton"..i]
button:SetAlpha(alpha)
end
end
end
MultiBarLeft:EnableMouse(true)
MultiBarLeft:SetScript("OnEnter", function(self) Fade(1) end)
MultiBarLeft:SetScript("OnLeave", function(self) Fade(0) end)
for i = 1,12 do
local button = _G["MultiBarLeftButton"..i]
button:SetAlpha(0)
button:HookScript("OnEnter", function(self) Fade(1) end)
button:HookScript("OnLeave", function(self) Fade(0) end)
end
end
This same script seems to work fine for MultiBarRight