mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update
This commit is contained in:
@@ -23,18 +23,38 @@ local MICRO_BUTTONS = {
|
|||||||
"HelpMicroButton"
|
"HelpMicroButton"
|
||||||
}
|
}
|
||||||
|
|
||||||
local function onEnter()
|
local function onEnterBar()
|
||||||
if AB.db.microbar.mouseover then
|
if AB.db.microbar.mouseover then
|
||||||
UIFrameFadeIn(ElvUI_MicroBar, 0.2, ElvUI_MicroBar:GetAlpha(), AB.db.microbar.alpha)
|
UIFrameFadeIn(ElvUI_MicroBar, 0.2, ElvUI_MicroBar:GetAlpha(), AB.db.microbar.alpha)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onLeave()
|
local function onLeaveBar()
|
||||||
if AB.db.microbar.mouseover then
|
if AB.db.microbar.mouseover then
|
||||||
UIFrameFadeOut(ElvUI_MicroBar, 0.2, ElvUI_MicroBar:GetAlpha(), 0)
|
UIFrameFadeOut(ElvUI_MicroBar, 0.2, ElvUI_MicroBar:GetAlpha(), 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function onEnterButton(button)
|
||||||
|
if AB.db.microbar.mouseover then
|
||||||
|
UIFrameFadeIn(ElvUI_MicroBar, 0.2, ElvUI_MicroBar:GetAlpha(), AB.db.microbar.alpha)
|
||||||
|
end
|
||||||
|
|
||||||
|
if button.backdrop then
|
||||||
|
button.backdrop:SetBackdropBorderColor(unpack(E.media.rgbvaluecolor))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function onLeaveButton(button)
|
||||||
|
if AB.db.microbar.mouseover then
|
||||||
|
UIFrameFadeOut(ElvUI_MicroBar, 0.2, ElvUI_MicroBar:GetAlpha(), 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
if button.backdrop then
|
||||||
|
button.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function AB:HandleMicroButton(button)
|
function AB:HandleMicroButton(button)
|
||||||
local pushed = button:GetPushedTexture()
|
local pushed = button:GetPushedTexture()
|
||||||
local normal = button:GetNormalTexture()
|
local normal = button:GetNormalTexture()
|
||||||
@@ -48,8 +68,8 @@ function AB:HandleMicroButton(button)
|
|||||||
|
|
||||||
button:SetParent(ElvUI_MicroBar)
|
button:SetParent(ElvUI_MicroBar)
|
||||||
E:Kill(button:GetHighlightTexture())
|
E:Kill(button:GetHighlightTexture())
|
||||||
HookScript(button, "OnEnter", onEnter)
|
HookScript(button, "OnEnter", onEnterButton)
|
||||||
HookScript(button, "OnLeave", onLeave)
|
HookScript(button, "OnLeave", onLeaveButton)
|
||||||
button:SetHitRectInsets(0, 0, 0, 0)
|
button:SetHitRectInsets(0, 0, 0, 0)
|
||||||
button:SetAlpha(self.db.microbar.alpha)
|
button:SetAlpha(self.db.microbar.alpha)
|
||||||
button:Show()
|
button:Show()
|
||||||
@@ -104,12 +124,16 @@ function AB:UpdateMicroPositionDimensions()
|
|||||||
AB.MicroHeight = (((_G["CharacterMicroButton"]:GetHeight() + spacing) * numRows) - spacing) + (offset * 2)
|
AB.MicroHeight = (((_G["CharacterMicroButton"]:GetHeight() + spacing) * numRows) - spacing) + (offset * 2)
|
||||||
E:Size(ElvUI_MicroBar, AB.MicroWidth, AB.MicroHeight)
|
E:Size(ElvUI_MicroBar, AB.MicroWidth, AB.MicroHeight)
|
||||||
|
|
||||||
if ElvUI_MicroBar.mover then
|
|
||||||
if self.db.microbar.enabled then
|
if self.db.microbar.enabled then
|
||||||
ElvUI_MicroBar:Show()
|
ElvUI_MicroBar:Show()
|
||||||
E:EnableMover(ElvUI_MicroBar.mover:GetName())
|
|
||||||
else
|
else
|
||||||
ElvUI_MicroBar:Hide()
|
ElvUI_MicroBar:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
if ElvUI_MicroBar.mover then
|
||||||
|
if self.db.microbar.enabled then
|
||||||
|
E:EnableMover(ElvUI_MicroBar.mover:GetName())
|
||||||
|
else
|
||||||
E:DisableMover(ElvUI_MicroBar.mover:GetName())
|
E:DisableMover(ElvUI_MicroBar.mover:GetName())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -118,8 +142,8 @@ end
|
|||||||
function AB:SetupMicroBar()
|
function AB:SetupMicroBar()
|
||||||
E:Point(ElvUI_MicroBar, "TOPLEFT", E.UIParent, "TOPLEFT", 4, -48)
|
E:Point(ElvUI_MicroBar, "TOPLEFT", E.UIParent, "TOPLEFT", 4, -48)
|
||||||
ElvUI_MicroBar:EnableMouse(true)
|
ElvUI_MicroBar:EnableMouse(true)
|
||||||
ElvUI_MicroBar:SetScript("OnEnter", onEnter)
|
ElvUI_MicroBar:SetScript("OnEnter", onEnterBar)
|
||||||
ElvUI_MicroBar:SetScript("OnLeave", onLeave)
|
ElvUI_MicroBar:SetScript("OnLeave", onLeaveBar)
|
||||||
|
|
||||||
for i = 1, getn(MICRO_BUTTONS) do
|
for i = 1, getn(MICRO_BUTTONS) do
|
||||||
self:HandleMicroButton(_G[MICRO_BUTTONS[i]])
|
self:HandleMicroButton(_G[MICRO_BUTTONS[i]])
|
||||||
|
|||||||
Reference in New Issue
Block a user