Commit bc6ae253 authored by Blazeflack's avatar Blazeflack

Merge branch 'development'

parents 75699fad 124f1568
**Description**
<!--- Please give a short description of the issue here -->
**Version Number**
<!--- Provide the version number here (the actual number, do not say "latest") -->
**Steps to Reproduce**
<!--- Provide all the steps necessary to reproduce the problem -->
1. Step 1
2. Step 2
3. Step 3
4. Step 4
**Expected Behavior**
<!--- Tell us what should happen -->
**Actual Behavior**
<!--- Tell us what happens instead -->
**Only ElvUI Enabled**
<!--- Please provide information about whether or not you can reproduce it -->
<!--- when ElvUI is the only addon enabled -->
**Blizzard Issue?**
<!--- Please test if you can reproduce the issue with 0 addons enabled -->
<!--- Include screenshot of how it looks if possible -->
**Additional Information**
<!--- Please provide any additional information here -->
**Error Log**
<!--- If you received an error then please post it in the empty space below, -->
<!--- so that the error is wrapped in the 3 backquotes (before and after) -->
```
```
\ No newline at end of file
**Description**
<!--- Please describe the request here. What part of the UI do you want changed? -->
<!--- How do you want it to look/work in comparison to how it is now? -->
\ No newline at end of file
This diff is collapsed.
## Interface: 80100 ## Interface: 80100
## Author: Elv ## Author: Elv
## Version: 10.87 ## Version: 10.88
## Title: |cfffe7b2cElvUI|r ## Title: |cfffe7b2cElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft. ## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB ## SavedVariables: ElvDB, ElvPrivateDB
......
...@@ -2,7 +2,6 @@ local MAJOR, MINOR = 'LibElvUIPlugin-1.0', 22 ...@@ -2,7 +2,6 @@ local MAJOR, MINOR = 'LibElvUIPlugin-1.0', 22
local lib, oldminor = LibStub:NewLibrary(MAJOR, MINOR) local lib, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not lib then return end if not lib then return end
--Cache global variables
--Lua functions --Lua functions
local pairs, tonumber, strmatch, strsub = pairs, tonumber, strmatch, strsub local pairs, tonumber, strmatch, strsub = pairs, tonumber, strmatch, strsub
local format, strsplit, strlen, gsub, ceil = format, strsplit, strlen, gsub, ceil local format, strsplit, strlen, gsub, ceil = format, strsplit, strlen, gsub, ceil
......
This diff is collapsed.
--------------------------------- -- LibItemLevel Author: M --------------------------------- local MAJOR, MINOR = "LibItemLevel-ElvUI", 1 local lib = LibStub:NewLibrary(MAJOR, MINOR) if not lib then return end local ItemLevelPattern = gsub(ITEM_LEVEL, "%%d", "(%%d+)") --Toolip local tooltip = CreateFrame("GameTooltip", "LibItemLevelTooltip1", UIParent, "GameTooltipTemplate") local unittip = CreateFrame("GameTooltip", "LibItemLevelTooltip2", UIParent, "GameTooltipTemplate") function lib:hasLocally(ItemID) if (not ItemID or ItemID == "" or ItemID == "0") then return true end return select(10, GetItemInfo(tonumber(ItemID))) end function lib:itemLocally(ItemLink) local id, gem1, gem2, gem3 = string.match(ItemLink, "item:(%d+):[^:]*:(%d-):(%d-):(%d-):") return (self:hasLocally(id) and self:hasLocally(gem1) and self:hasLocally(gem2) and self:hasLocally(gem3)) end function lib:GetStatsViaTooltip(tip, stats) if (type(stats) == "table") then local line, text, r, g, b, statValue, statName for i = 2, tip:NumLines() do line = _G[tip:GetName().."TextLeft" .. i] text = line:GetText() or "" r, g, b = line:GetTextColor() for statValue, statName in string.gmatch(text, "%+([0-9,]+)([^%+%|]+)") do statName = strtrim(statName) statName = statName:gsub("與$", "") --zhTW statName = statName:gsub(",", "") --zhCN statName = statName:gsub("%s*&$", "") --enUS statValue = statValue:gsub(",","") statValue = tonumber(statValue) or 0 if (not stats[statName]) then stats[statName] = { value = statValue, r = r, g = g, b = b } else stats[statName].value = stats[statName].value + statValue if (g > stats[statName].g) then stats[statName].r = r stats[statName].g = g stats[statName].b = b end end end end end return stats end function lib:GetItemInfo(ItemLink, stats) if (not ItemLink or ItemLink == "") then return 0, 0 end if (not string.match(ItemLink, "item:%d+:")) then return -1, 0 end if (not self:itemLocally(ItemLink)) then return 1, 0 end tooltip:SetOwner(UIParent, "ANCHOR_NONE") tooltip:SetHyperlink(ItemLink) local text, level for i = 2, 5 do text = _G[tooltip:GetName().."TextLeft" .. i]:GetText() or "" level = string.match(text, ItemLevelPattern) if (level) then break end end self:GetStatsViaTooltip(tooltip, stats) return 0, tonumber(level) or 0, GetItemInfo(ItemLink) end function lib:GetUnitItemInfo(unit, index, stats) if (not UnitExists(unit)) then return 1, 0 end unittip:SetOwner(UIParent, "ANCHOR_NONE") unittip:SetInventoryItem(unit, index) local ItemLink = GetInventoryItemLink(unit, index) or select(2, unittip:GetItem()) if (not ItemLink or ItemLink == "") then return 0, 0 end if (not self:itemLocally(ItemLink)) then return 1, 0 end local text, level for i = 2, 5 do text = _G[unittip:GetName().."TextLeft" .. i]:GetText() or "" level = string.match(text, ItemLevelPattern) if (level) then break end end self:GetStatsViaTooltip(unittip, stats) if (string.match(ItemLink, "item:(%d+):")) then return 0, tonumber(level) or 0, GetItemInfo(ItemLink) else local line = _G[unittip:GetName().."TextLeft1"] local r, g, b = line:GetTextColor() local name = WrapTextInColorCode(line:GetText() or "", ("ff%.2x%.2x%.2x"):format((r or 1)*255, (g or 1)*255, (b or 1)*255)) return 0, tonumber(level) or 0, name end end function lib:GetUnitItemLevel(unit, stats) local total, counts = 0, 0 local _, count, level for i = 1, 15 do if (i ~= 4) then count, level = self:GetUnitItemInfo(unit, i, stats) total = total + level counts = counts + count end end local mcount, mlevel, mquality, mslot, ocount, olevel, oquality, oslot mcount, mlevel, _, _, mquality, _, _, _, _, _, mslot = self:GetUnitItemInfo(unit, 16, stats) ocount, olevel, _, _, oquality, _, _, _, _, _, oslot = self:GetUnitItemInfo(unit, 17, stats) counts = counts + mcount + ocount if (mquality == 6 or oquality == 6) then total = total + max(mlevel, olevel) * 2 else total = total + mlevel + olevel end return counts, total/max(16-counts,1), total end
\ No newline at end of file
...@@ -26,6 +26,4 @@ ...@@ -26,6 +26,4 @@
<Include file="LibCompress\lib.xml"/> <Include file="LibCompress\lib.xml"/>
<Include file="LibBase64-1.0\lib.xml"/> <Include file="LibBase64-1.0\lib.xml"/>
<Script file="LibAnim\LibAnim.lua"/> <Script file="LibAnim\LibAnim.lua"/>
<Script file="LibItemLevel\LibItemLevel.lua"/>
<Script file="LibInspect\LibInspect.lua"/>
</Ui> </Ui>
This diff is collapsed.
...@@ -188,9 +188,11 @@ local function SetFrequentUpdates(element, state) ...@@ -188,9 +188,11 @@ local function SetFrequentUpdates(element, state)
if(element.frequentUpdates ~= state) then if(element.frequentUpdates ~= state) then
element.frequentUpdates = state element.frequentUpdates = state
if(element.frequentUpdates) then if(element.frequentUpdates) then
element.__owner:UnregisterEvent('UNIT_HEALTH', Path)
element.__owner:RegisterEvent('UNIT_HEALTH_FREQUENT', Path) element.__owner:RegisterEvent('UNIT_HEALTH_FREQUENT', Path)
else else
element.__owner:UnregisterEvent('UNIT_HEALTH_FREQUENT', Path) element.__owner:UnregisterEvent('UNIT_HEALTH_FREQUENT', Path)
element.__owner:RegisterEvent('UNIT_HEALTH', Path)
end end
end end
end end
...@@ -204,13 +206,13 @@ local function Enable(self, unit) ...@@ -204,13 +206,13 @@ local function Enable(self, unit)
if(element.frequentUpdates) then if(element.frequentUpdates) then
self:RegisterEvent('UNIT_HEALTH_FREQUENT', Path) self:RegisterEvent('UNIT_HEALTH_FREQUENT', Path)
else
self:RegisterEvent('UNIT_HEALTH', Path)
end end
self:RegisterEvent('UNIT_HEALTH', Path)
self:RegisterEvent('UNIT_MAXHEALTH', Path) self:RegisterEvent('UNIT_MAXHEALTH', Path)
self:RegisterEvent('UNIT_CONNECTION', Path) self:RegisterEvent('UNIT_CONNECTION', Path)
self:RegisterEvent('UNIT_FACTION', Path) -- For tapping self:RegisterEvent('UNIT_FACTION', Path) -- For tapping
self:RegisterEvent('UNIT_AURA', Path) -- This is the bullshit fix.. Still Blizzard's Fault
if(element:IsObjectType('StatusBar') and not element:GetStatusBarTexture()) then if(element:IsObjectType('StatusBar') and not element:GetStatusBarTexture()) then
element:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) element:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]])
...@@ -236,7 +238,6 @@ local function Disable(self) ...@@ -236,7 +238,6 @@ local function Disable(self)
self:UnregisterEvent('UNIT_MAXHEALTH', Path) self:UnregisterEvent('UNIT_MAXHEALTH', Path)
self:UnregisterEvent('UNIT_CONNECTION', Path) self:UnregisterEvent('UNIT_CONNECTION', Path)
self:UnregisterEvent('UNIT_FACTION', Path) self:UnregisterEvent('UNIT_FACTION', Path)
self:UnregisterEvent('UNIT_AURA', Path) -- This is the bullshit fix.. Still Blizzard's Fault
end end
end end
......
...@@ -13,30 +13,58 @@ local registerUnitEvent = frame_metatable.__index.RegisterUnitEvent ...@@ -13,30 +13,58 @@ local registerUnitEvent = frame_metatable.__index.RegisterUnitEvent
local unregisterEvent = frame_metatable.__index.UnregisterEvent local unregisterEvent = frame_metatable.__index.UnregisterEvent
local isEventRegistered = frame_metatable.__index.IsEventRegistered local isEventRegistered = frame_metatable.__index.IsEventRegistered
-- to update unit frames correctly, some events need to be registered for
-- a specific combination of primary and secondary units
local secondaryUnits = {
UNIT_ENTERED_VEHICLE = {
pet = 'player',
},
UNIT_EXITED_VEHICLE = {
pet = 'player',
},
UNIT_PET = {
pet = 'player',
},
}
function Private.UpdateUnits(frame, unit, realUnit) function Private.UpdateUnits(frame, unit, realUnit)
if(unit == realUnit) then if(unit == realUnit) then
realUnit = nil realUnit = nil
end end
if(frame.unit ~= unit or frame.realUnit ~= realUnit) then if(frame.unit ~= unit or frame.realUnit ~= realUnit) then
if(frame.unitEvents) then -- don't let invalid units in, otherwise unit events will end up being
-- registered as unitless
if(frame.unitEvents and validateUnit(unit)) then
local resetRealUnit = false
for event in next, frame.unitEvents do for event in next, frame.unitEvents do
local registered, unit1 = isEventRegistered(frame, event) if(not realUnit and secondaryUnits[event]) then
-- unit event registration for header units is postponed until realUnit = secondaryUnits[event][unit]
-- the frame units are known resetRealUnit = true
end
local registered, unit1, unit2 = isEventRegistered(frame, event)
-- we don't want to re-register unitless/shared events in case -- we don't want to re-register unitless/shared events in case
-- someone added them by hand to the unitEvents table -- someone added them by hand to the unitEvents table
if(registered and unit1 and unit1 ~= unit or not registered) then if(not registered or unit1 and (unit1 ~= unit or unit2 ~= realUnit)) then
-- BUG: passing explicit nil units to RegisterUnitEvent -- BUG: passing explicit nil units to RegisterUnitEvent
-- makes it silently fall back to RegisterEvent -- makes it silently fall back to RegisterEvent, using ''
-- instead of explicit nils doesn't cause this behaviour
registerUnitEvent(frame, event, unit, realUnit or '') registerUnitEvent(frame, event, unit, realUnit or '')
end end
if(resetRealUnit) then
realUnit = nil
resetRealUnit = false
end
end end
end end
frame.unit = unit frame.unit = unit
frame.realUnit = realUnit frame.realUnit = realUnit
frame.id = unit:match('^.-(%d+)') frame.id = unit:match('^.-(%d+)')
return true return true
end end
end end
...@@ -109,9 +137,13 @@ function frame_metatable.__index:RegisterEvent(event, func, unitless) ...@@ -109,9 +137,13 @@ function frame_metatable.__index:RegisterEvent(event, func, unitless)
self.unitEvents[event] = true self.unitEvents[event] = true
-- UpdateUnits will take care of unit event registration for header -- UpdateUnits will take care of unit event registration for header
-- units in case we don't have a valid unit yet -- units in case we don't have a valid unit yet
local unit = self.unit local unit1, unit2 = self.unit
if(unit and validateUnit(unit)) then if(unit1 and validateUnit(unit1)) then
registerUnitEvent(self, event, unit) if(secondaryUnits[event]) then
unit2 = secondaryUnits[event][unit1]
end
registerUnitEvent(self, event, unit1, unit2 or '')
end end
end end
end end
...@@ -134,6 +166,7 @@ function frame_metatable.__index:UnregisterEvent(event, func) ...@@ -134,6 +166,7 @@ function frame_metatable.__index:UnregisterEvent(event, func)
for k, infunc in next, curev do for k, infunc in next, curev do
if(infunc == func) then if(infunc == func) then
curev[k] = nil curev[k] = nil
break break
end end
end end
...@@ -148,6 +181,7 @@ function frame_metatable.__index:UnregisterEvent(event, func) ...@@ -148,6 +181,7 @@ function frame_metatable.__index:UnregisterEvent(event, func)
if(self.unitEvents) then if(self.unitEvents) then
self.unitEvents[event] = nil self.unitEvents[event] = nil
end end
unregisterEvent(self, event) unregisterEvent(self, event)
end end
end end
...@@ -61,7 +61,7 @@ local function updateActiveUnit(self, event, unit) ...@@ -61,7 +61,7 @@ local function updateActiveUnit(self, event, unit)
if(not UnitExists(modUnit)) then return end if(not UnitExists(modUnit)) then return end
-- Change the active unit and run a full update. -- Change the active unit and run a full update.
if Private.UpdateUnits(self, modUnit, realUnit) then if(Private.UpdateUnits(self, modUnit, realUnit)) then
self:UpdateAllElements('RefreshUnit') self:UpdateAllElements('RefreshUnit')
return true return true
...@@ -248,6 +248,15 @@ local function updatePet(self, event, unit) ...@@ -248,6 +248,15 @@ local function updatePet(self, event, unit)
end end
end end
local function updateRaid(self, event)
local unitGUID = UnitGUID(self.unit)
if unitGUID and unitGUID ~= self.unitGUID then
self.unitGUID = unitGUID
self:UpdateAllElements(event)
end
end
local function initObject(unit, style, styleFunc, header, ...) local function initObject(unit, style, styleFunc, header, ...)
local num = select('#', ...) local num = select('#', ...)
for i = 1, num do for i = 1, num do
...@@ -274,7 +283,6 @@ local function initObject(unit, style, styleFunc, header, ...) ...@@ -274,7 +283,6 @@ local function initObject(unit, style, styleFunc, header, ...)
if(not (suffix == 'target' or objectUnit and objectUnit:match('target'))) then if(not (suffix == 'target' or objectUnit and objectUnit:match('target'))) then
object:RegisterEvent('UNIT_ENTERED_VEHICLE', updateActiveUnit) object:RegisterEvent('UNIT_ENTERED_VEHICLE', updateActiveUnit)
object:RegisterEvent('UNIT_EXITED_VEHICLE', updateActiveUnit) object:RegisterEvent('UNIT_EXITED_VEHICLE', updateActiveUnit)
object:RegisterEvent('UNIT_EXITING_VEHICLE', updateActiveUnit)
-- We don't need to register UNIT_PET for the player unit. We register it -- We don't need to register UNIT_PET for the player unit. We register it
-- mainly because UNIT_EXITED_VEHICLE and UNIT_ENTERED_VEHICLE doesn't always -- mainly because UNIT_EXITED_VEHICLE and UNIT_ENTERED_VEHICLE doesn't always
...@@ -301,8 +309,9 @@ local function initObject(unit, style, styleFunc, header, ...) ...@@ -301,8 +309,9 @@ local function initObject(unit, style, styleFunc, header, ...)
oUF:HandleUnit(object) oUF:HandleUnit(object)
end end
else else
-- Used to update frames when they change position in a group. -- update the frame when its prev unit is replaced with a new one
object:RegisterEvent('GROUP_ROSTER_UPDATE', object.UpdateAllElements, true) -- updateRaid relies on UnitGUID to detect the unit change
object:RegisterEvent('GROUP_ROSTER_UPDATE', updateRaid, true)
if(num > 1) then if(num > 1) then
if(object:GetParent() == header) then if(object:GetParent() == header) then
......
This diff is collapsed.
...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private ...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local mod = E:GetModule('DataBars'); local mod = E:GetModule('DataBars');
local LSM = E.Libs.LSM local LSM = E.Libs.LSM
--Cache global variables
--Lua functions --Lua functions
local floor = floor local floor = floor
local format = string.format local format = string.format
......
...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private ...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local mod = E:NewModule("DataBars", 'AceEvent-3.0') local mod = E:NewModule("DataBars", 'AceEvent-3.0')
E.DataBars = mod E.DataBars = mod
--Cache global variables
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetExpansionLevel = GetExpansionLevel local GetExpansionLevel = GetExpansionLevel
......
...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private ...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local mod = E:GetModule('DataBars'); local mod = E:GetModule('DataBars');
local LSM = E.Libs.LSM local LSM = E.Libs.LSM
--Cache global variables
--Lua functions --Lua functions
local format = format local format = format
local min = min local min = min
......
...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private ...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local mod = E:GetModule('DataBars'); local mod = E:GetModule('DataBars');
local LSM = E.Libs.LSM local LSM = E.Libs.LSM
--Cache global variables
--Lua functions --Lua functions
local format = format local format = format
--WoW API / Variables --WoW API / Variables
......
...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private ...@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local mod = E:GetModule('DataBars'); local mod = E:GetModule('DataBars');
local LSM = E.Libs.LSM local LSM = E.Libs.LSM
--Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local format = format local format = format
......
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local AB = E:GetModule('ActionBars'); local AB = E:GetModule('ActionBars');
--Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local select, tonumber, pairs = select, tonumber, pairs local select, tonumber, pairs = select, tonumber, pairs
......
This diff is collapsed.
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local AB = E:GetModule('ActionBars'); local AB = E:GetModule('ActionBars');
--Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
......
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local AB = E:GetModule('ActionBars'); local AB = E:GetModule('ActionBars');
--Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local pairs = pairs local pairs = pairs
...@@ -14,10 +13,11 @@ local UpdateMicroButtonsParent = UpdateMicroButtonsParent ...@@ -14,10 +13,11 @@ local UpdateMicroButtonsParent = UpdateMicroButtonsParent
local GetCurrentRegionName = GetCurrentRegionName local GetCurrentRegionName = GetCurrentRegionName
local RegisterStateDriver = RegisterStateDriver local RegisterStateDriver = RegisterStateDriver
local InCombatLockdown = InCombatLockdown local InCombatLockdown = InCombatLockdown
-- GLOBALS: ElvUI_MicroBar
local function onLeaveBar() local function onLeaveBar()
if AB.db.microbar.mouseover then if AB.db.microbar.mouseover then
E:UIFrameFadeOut(_G.ElvUI_MicroBar, 0.2, _G.ElvUI_MicroBar:GetAlpha(), 0) E:UIFrameFadeOut(ElvUI_MicroBar, 0.2, ElvUI_MicroBar:GetAlpha(), 0)
end end
end end
...@@ -36,10 +36,10 @@ local function onUpdate(self, elapsed) ...@@ -36,10 +36,10 @@ local function onUpdate(self, elapsed)
end end
local function onEnter(button) local function onEnter(button)
if AB.db.microbar.mouseover and not _G.ElvUI_MicroBar.IsMouseOvered then if AB.db.microbar.mouseover and not ElvUI_MicroBar.IsMouseOvered then
_G.ElvUI_MicroBar.IsMouseOvered = true ElvUI_MicroBar.IsMouseOvered = true
_G.ElvUI_MicroBar:SetScript("OnUpdate", onUpdate) ElvUI_MicroBar:SetScript("OnUpdate", onUpdate)
E:UIFrameFadeIn(_G.ElvUI_MicroBar, 0.2, _G.ElvUI_MicroBar:GetAlpha(), AB.db.microbar.alpha) E:UIFrameFadeIn(ElvUI_MicroBar, 0.2, ElvUI_MicroBar:GetAlpha(), AB.db.microbar.alpha)
end end
if button.backdrop then if button.backdrop then
...@@ -67,7 +67,7 @@ function AB:HandleMicroButton(button) ...@@ -67,7 +67,7 @@ function AB:HandleMicroButton(button)
f:SetOutside(button) f:SetOutside(button)
button.backdrop = f button.backdrop = f
button:SetParent(_G.ElvUI_MicroBar) button:SetParent(ElvUI_MicroBar)
button:GetHighlightTexture():Kill() button:GetHighlightTexture():Kill()
button:HookScript('OnEnter', onEnter) button:HookScript('OnEnter', onEnter)
button:HookScript('OnLeave', onLeave) button:HookScript('OnLeave', onLeave)
...@@ -75,7 +75,7 @@ function AB:HandleMicroButton(button) ...@@ -75,7 +75,7 @@ function AB:HandleMicroButton(button)
if button.Flash then if button.Flash then
button.Flash:SetInside() button.Flash:SetInside()
button.Flash:SetTexture(nil) button.Flash:SetTexture()
end end
pushed:SetTexCoord(0.22, 0.81, 0.26, 0.82) pushed:SetTexCoord(0.22, 0.81, 0.26, 0.82)
...@@ -100,7 +100,7 @@ end ...@@ -100,7 +100,7 @@ end
function AB:UpdateMicroButtonsParent() function AB:UpdateMicroButtonsParent()
for _, x in pairs(_G.MICRO_BUTTONS) do for _, x in pairs(_G.MICRO_BUTTONS) do
_G[x]:SetParent(_G.ElvUI_MicroBar) _G[x]:SetParent(ElvUI_MicroBar)
end end
end end
...@@ -124,14 +124,14 @@ function AB:UpdateMicroBarVisibility() ...@@ -124,14 +124,14 @@ function AB:UpdateMicroBarVisibility()
visibility = visibility:gsub('[\n\r]','') visibility = visibility:gsub('[\n\r]','')
end end
RegisterStateDriver(_G.ElvUI_MicroBar.visibility, "visibility", (self.db.microbar.enabled and visibility) or "hide"); RegisterStateDriver(ElvUI_MicroBar.visibility, "visibility", (self.db.microbar.enabled and visibility) or "hide");
end end
function AB:UpdateMicroPositionDimensions() function AB:UpdateMicroPositionDimensions()
if not _G.ElvUI_MicroBar then return end if not ElvUI_MicroBar then return end
local numRows = 1 local numRows = 1
local prevButton = _G.ElvUI_MicroBar local prevButton = ElvUI_MicroBar
local offset = E:Scale(E.PixelMode and 1 or 3) local offset = E:Scale(E.PixelMode and 1 or 3)
local spacing = E:Scale(offset + self.db.microbar.buttonSpacing) local spacing = E:Scale(offset + self.db.microbar.buttonSpacing)
...@@ -143,7 +143,7 @@ function AB:UpdateMicroPositionDimensions() ...@@ -143,7 +143,7 @@ function AB:UpdateMicroPositionDimensions()
button:Size(self.db.microbar.buttonSize, self.db.microbar.buttonSize * 1.4); button:Size(self.db.microbar.buttonSize, self.db.microbar.buttonSize * 1.4);
button:ClearAllPoints(); button:ClearAllPoints();
if prevButton == _G.ElvUI_MicroBar then if prevButton == ElvUI_MicroBar then
button:Point('TOPLEFT', prevButton, 'TOPLEFT', offset, -offset) button:Point('TOPLEFT', prevButton, 'TOPLEFT', offset, -offset)
elseif (i - 1) % self.db.microbar.buttonsPerRow == 0 then elseif (i - 1) % self.db.microbar.buttonsPerRow == 0 then
button:Point('TOP', lastColumnButton, 'BOTTOM', 0, -spacing); button:Point('TOP', lastColumnButton, 'BOTTOM', 0, -spacing);
...@@ -155,21 +155,21 @@ function AB:UpdateMicroPositionDimensions() ...@@ -155,21 +155,21 @@ function AB:UpdateMicroPositionDimensions()
prevButton = button prevButton = button
end end
if AB.db.microbar.mouseover and not _G.ElvUI_MicroBar:IsMouseOver() then if AB.db.microbar.mouseover and not ElvUI_MicroBar:IsMouseOver() then
_G.ElvUI_MicroBar:SetAlpha(0) ElvUI_MicroBar:SetAlpha(0)
else else
_G.ElvUI_MicroBar:SetAlpha(self.db.microbar.alpha) ElvUI_MicroBar:SetAlpha(self.db.microbar.alpha)
end end
AB.MicroWidth = (((_G["CharacterMicroButton"]:GetWidth() + spacing) * self.db.microbar.buttonsPerRow) - spacing) + (offset * 2) AB.MicroWidth = (((_G["CharacterMicroButton"]:GetWidth() + spacing) * self.db.microbar.buttonsPerRow) - spacing) + (offset * 2)
AB.MicroHeight = (((_G["CharacterMicroButton"]:GetHeight() + spacing) * numRows) - spacing) + (offset * 2)