Commit 29c0051c authored by Simpy's avatar Simpy 🐹

12.06

parents e1a2710e 5cd42a91
......@@ -2,15 +2,30 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local LSM = E.Libs.LSM
local _G = _G
local min, max = min, max
local strmatch = strmatch
local function SetFont(obj, font, size, style, sr, sg, sb, sa, sox, soy, r, g, b)
if not obj then return end
obj:SetFont(font, size, style)
if sr and sg and sb then obj:SetShadowColor(sr, sg, sb, sa) end
if sox and soy then obj:SetShadowOffset(sox, soy) end
if r and g and b then obj:SetTextColor(r, g, b)
elseif r then obj:SetAlpha(r) end
if sr and sg and sb then
obj:SetShadowColor(sr, sg, sb, sa)
end
if sox and soy then
obj:SetShadowOffset(sox, soy)
end
if r and g and b then
obj:SetTextColor(r, g, b)
elseif r then
obj:SetAlpha(r)
end
end
local function GetSize(size)
return max(11, min(42, size))
end
local chatFontHeights = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
......@@ -21,9 +36,8 @@ function E:UpdateBlizzardFonts()
local NAMEFONT = LSM:Fetch('font', E.private.general.namefont)
local BUBBLE = LSM:Fetch('font', E.private.general.chatBubbleFont)
local MONOCHROME = strmatch(E.db.general.fontStyle, 'MONOCHROME') and 'MONOCHROME' or ''
_G.CHAT_FONT_HEIGHTS = chatFontHeights
if E.eyefinity then COMBAT = E.Media.Fonts.Invisible end -- set an invisible font for xp, honor kill, etc
if E.private.general.replaceNameFont then _G.UNIT_NAME_FONT = NAMEFONT end
if E.private.general.replaceCombatFont then _G.DAMAGE_TEXT_FONT = COMBAT end
......@@ -31,22 +45,38 @@ function E:UpdateBlizzardFonts()
_G.STANDARD_TEXT_FONT = NORMAL
--_G.NAMEPLATE_FONT = NAMEFONT
SetFont(_G.AchievementFont_Small, NORMAL, E.db.general.fontSize) -- Achiev dates
SetFont(_G.BossEmoteNormalHuge, NORMAL, 24) -- Talent Title
SetFont(_G.ChatBubbleFont, BUBBLE, E.private.general.chatBubbleFontSize, E.private.general.chatBubbleFontOutline)
SetFont(_G.CoreAbilityFont, NORMAL, 26) -- Core abilities(title)
local size = E.db.general.fontSize
local enormous = GetSize(size * 2.00)
local mega = GetSize(size * 1.75)
local huge = GetSize(size * 1.50)
local large = GetSize(size * 1.25)
local medium = GetSize(size * 1.15)
local small = GetSize(size * 0.95)
local tiny = GetSize(size * 0.90)
local mono = strmatch(E.db.general.fontStyle, 'MONOCHROME') and 'MONOCHROME' or ''
local thick = mono..'THICKOUTLINE'
local outline = mono..'OUTLINE'
SetFont(_G.AchievementFont_Small, NORMAL, small) -- 10 -- Achiev dates
SetFont(_G.BossEmoteNormalHuge, NORMAL, 25) -- Talent Title
SetFont(_G.ChatBubbleFont, BUBBLE, E.private.general.chatBubbleFontSize, E.private.general.chatBubbleFontOutline) -- 13
SetFont(_G.CoreAbilityFont, NORMAL, 30) -- 32 -- Core abilities(title)
SetFont(_G.DestinyFontHuge, NORMAL, 32) -- Garrison Mission Report
SetFont(_G.DestinyFontMed, NORMAL, 14) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy12Font, NORMAL, 12) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy14Font, NORMAL, 14) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy22Font, NORMAL, 20) -- Talking frame Title font
SetFont(_G.Fancy24Font, NORMAL, 20) -- Artifact frame - weapon name
SetFont(_G.FriendsFont_Large, NORMAL, E.db.general.fontSize)
SetFont(_G.FriendsFont_Normal, NORMAL, E.db.general.fontSize)
SetFont(_G.FriendsFont_Small, NORMAL, E.db.general.fontSize)
SetFont(_G.FriendsFont_UserText, NORMAL, E.db.general.fontSize)
SetFont(_G.Fancy22Font, NORMAL, 22) -- Talking frame Title font
SetFont(_G.Fancy24Font, NORMAL, 24) -- Artifact frame - weapon name
SetFont(_G.FriendsFont_11, NORMAL, 11)
SetFont(_G.FriendsFont_Large, NORMAL, large) -- 14
SetFont(_G.FriendsFont_Normal, NORMAL, size) -- 12
SetFont(_G.FriendsFont_UserText, NORMAL, size) -- 11
SetFont(_G.FriendsFont_Small, NORMAL, small) -- 10
SetFont(_G.Game10Font_o1, NORMAL, 10, 'OUTLINE')
SetFont(_G.Game120Font, NORMAL, 120)
SetFont(_G.Game12Font, NORMAL, 12) -- PVP Stuff
SetFont(_G.Game13FontShadow, NORMAL, 14) -- InspectPvpFrame
SetFont(_G.Game13FontShadow, NORMAL, 13) -- InspectPvpFrame
SetFont(_G.Game15Font_o1, NORMAL, 15) -- CharacterStatsPane (ItemLevelFrame)
SetFont(_G.Game16Font, NORMAL, 16) -- Added in 7.3.5 used for ?
SetFont(_G.Game18Font, NORMAL, 18) -- MissionUI Bonus Chance
......@@ -59,71 +89,23 @@ function E:UpdateBlizzardFonts()
SetFont(_G.Game48FontShadow, NORMAL, 48)
SetFont(_G.Game60Font, NORMAL, 60)
SetFont(_G.Game72Font, NORMAL, 72)
SetFont(_G.Game120Font, NORMAL, 120)
SetFont(_G.GameFont_Gigantic, NORMAL, 32) -- Used at the install steps
SetFont(_G.GameFontHighlightMedium, NORMAL, 15) -- Fix QuestLog Title mouseover
SetFont(_G.GameFontHighlightSmall2, NORMAL, E.db.general.fontSize) -- Skill or Recipe description on TradeSkill frame
SetFont(_G.GameFontNormalHuge2, NORMAL, 24) -- Mythic weekly best dungeon name
SetFont(_G.GameFontNormalLarge, NORMAL, 16)
SetFont(_G.GameFontNormalLarge2, NORMAL, 15) -- Garrison Follower Names
SetFont(_G.GameFontNormalMed1, NORMAL, 14) -- WoW Token Info
SetFont(_G.GameFontNormalMed2, NORMAL, E.db.general.fontSize*1.1) -- Quest tracker
SetFont(_G.GameFontNormalMed3, NORMAL, 15)
SetFont(_G.GameFontNormalSmall2, NORMAL, 12) -- MissionUI Followers names
SetFont(_G.GameTooltipHeader, NORMAL, E.db.general.fontSize)
SetFont(_G.InvoiceFont_Med, NORMAL, 12) -- Mail
SetFont(_G.InvoiceFont_Small, NORMAL, E.db.general.fontSize) -- Mail
SetFont(_G.GameFontHighlightMedium, NORMAL, medium) -- 14 -- Fix QuestLog Title mouseover
SetFont(_G.GameFontHighlightSmall2, NORMAL, small) -- 11 -- Skill or Recipe description on TradeSkill frame
SetFont(_G.GameFontNormalHuge2, NORMAL, huge) -- 24 -- Mythic weekly best dungeon name
SetFont(_G.GameFontNormalLarge, NORMAL, large) -- 16
SetFont(_G.GameFontNormalLarge2, NORMAL, large) -- 18 -- Garrison Follower Names
SetFont(_G.GameFontNormalMed1, NORMAL, size) -- 13 -- WoW Token Info
SetFont(_G.GameFontNormalMed2, NORMAL, size) -- 14 -- Quest tracker
SetFont(_G.GameFontNormalMed3, NORMAL, size) -- 14
SetFont(_G.GameFontNormalSmall2, NORMAL, small) -- 11 -- MissionUI Followers names
SetFont(_G.GameTooltipHeader, NORMAL, size) -- 14
SetFont(_G.InvoiceFont_Med, NORMAL, size) -- 12 -- Mail
SetFont(_G.InvoiceFont_Small, NORMAL, small) -- 10 -- Mail
SetFont(_G.MailFont_Large, NORMAL, 14) -- Mail
SetFont(_G.NumberFont_Outline_Huge, NUMBER, 28, MONOCHROME..'THICKOUTLINE', 28)
SetFont(_G.NumberFont_Outline_Large, NUMBER, 15, MONOCHROME..'OUTLINE')
SetFont(_G.NumberFont_Outline_Med, NUMBER, E.db.general.fontSize*1.1, 'OUTLINE')
SetFont(_G.NumberFont_OutlineThick_Mono_Small, NUMBER, E.db.general.fontSize, 'OUTLINE')
SetFont(_G.NumberFont_Shadow_Med, NORMAL, E.db.general.fontSize) -- Chat EditBox
SetFont(_G.NumberFont_Shadow_Small, NORMAL, E.db.general.fontSize)
SetFont(_G.NumberFontNormalSmall, NORMAL, 11, 'OUTLINE') -- Calendar, EncounterJournal
SetFont(_G.Number11Font, NORMAL, 11)
SetFont(_G.Number12Font, NORMAL, 12)
SetFont(_G.Number15Font, NORMAL, 15)
SetFont(_G.PriceFont, NORMAL, 13)
SetFont(_G.PVPArenaTextString, NORMAL, 22, MONOCHROME..'OUTLINE')
SetFont(_G.PVPInfoTextString, NORMAL, 22, MONOCHROME..'OUTLINE')
SetFont(_G.QuestFont, NORMAL, E.db.general.fontSize)
SetFont(_G.QuestFont_Enormous, NORMAL, 24) -- Garrison Titles
SetFont(_G.QuestFont_Huge, NORMAL, 15) -- Quest rewards title(Rewards)
SetFont(_G.QuestFont_Large, NORMAL, 14)
SetFont(_G.QuestFont_Shadow_Huge, NORMAL, 15) -- Quest Title
SetFont(_G.QuestFont_Shadow_Small, NORMAL, 14)
SetFont(_G.QuestFont_Super_Huge, NORMAL, 22)
SetFont(_G.ReputationDetailFont, NORMAL, E.db.general.fontSize) -- Rep Desc when clicking a rep
SetFont(_G.SubZoneTextFont, NORMAL, 24, MONOCHROME..'OUTLINE') -- World Map(SubZone)
SetFont(_G.SubZoneTextString, NORMAL, 25, MONOCHROME..'OUTLINE')
SetFont(_G.SystemFont_Huge1, NORMAL, 20) -- Garrison Mission XP
SetFont(_G.SystemFont_Huge1_Outline, NORMAL, 18, MONOCHROME..'OUTLINE') -- Garrison Mission Chance
SetFont(_G.SystemFont_Large, NORMAL, 15)
SetFont(_G.SystemFont_Med1, NORMAL, E.db.general.fontSize)
SetFont(_G.SystemFont_Med3, NORMAL, E.db.general.fontSize*1.1)
SetFont(_G.SystemFont_Outline, NORMAL, 13, MONOCHROME..'OUTLINE') -- Pet level on World map
SetFont(_G.SystemFont_Outline_Small, NUMBER, E.db.general.fontSize, 'OUTLINE')
SetFont(_G.SystemFont_OutlineThick_Huge2, NORMAL, 20, MONOCHROME..'THICKOUTLINE')
SetFont(_G.SystemFont_OutlineThick_WTF, NORMAL, 32, MONOCHROME..'OUTLINE') -- World Map
SetFont(_G.SystemFont_Shadow_Huge1, NORMAL, 20, MONOCHROME..'OUTLINE') -- Raid Warning, Boss emote frame too
SetFont(_G.SystemFont_Shadow_Huge3, NORMAL, 22) -- FlightMap
SetFont(_G.SystemFont_Shadow_Large, NORMAL, 15)
SetFont(_G.SystemFont_Shadow_Large2, NORMAL, 18) -- Auction House ItemDisplay
SetFont(_G.SystemFont_Shadow_Large_Outline, NUMBER, 20, 'OUTLINE')
SetFont(_G.SystemFont_Shadow_Med1, NORMAL, E.db.general.fontSize)
SetFont(_G.SystemFont_Shadow_Med2, NORMAL, 13 * 1.1) -- Shows Order resourses on OrderHallTalentFrame
SetFont(_G.SystemFont_Shadow_Med3, NORMAL, 13 * 1.1)
SetFont(_G.SystemFont_Shadow_Med3, NORMAL, E.db.general.fontSize*1.1)
SetFont(_G.SystemFont_Shadow_Small, NORMAL, E.db.general.fontSize*0.9)
SetFont(_G.SystemFont_Small, NORMAL, E.db.general.fontSize)
SetFont(_G.SystemFont_Tiny, NORMAL, E.db.general.fontSize)
SetFont(_G.Tooltip_Med, NORMAL, E.db.general.fontSize)
SetFont(_G.Tooltip_Small, NORMAL, E.db.general.fontSize)
SetFont(_G.ZoneTextString, NORMAL, 32, MONOCHROME..'OUTLINE')
SetFont(_G.Game10Font_o1, NORMAL, 10, 'OUTLINE')
SetFont(_G.SystemFont_Shadow_Huge4, NORMAL, 27, nil, nil, nil, nil, nil, 1, -1)
SetFont(_G.Number11Font, NUMBER, 11)
SetFont(_G.Number12Font, NORMAL, 12)
SetFont(_G.Number12Font_o1, NUMBER, 12, 'OUTLINE')
SetFont(_G.Number13Font, NUMBER, 13)
SetFont(_G.Number13FontGray, NUMBER, 13)
......@@ -131,10 +113,54 @@ function E:UpdateBlizzardFonts()
SetFont(_G.Number13FontYellow, NUMBER, 13)
SetFont(_G.Number14FontGray, NUMBER, 14)
SetFont(_G.Number14FontWhite, NUMBER, 14)
SetFont(_G.Number15Font, NORMAL, 15)
SetFont(_G.Number18Font, NUMBER, 18)
SetFont(_G.Number18FontWhite, NUMBER, 18)
SetFont(_G.FriendsFont_11, NORMAL, 11)
SetFont(_G.NumberFont_Outline_Huge, NUMBER, huge, thick) -- 30
SetFont(_G.NumberFont_Outline_Large, NUMBER, large, outline) -- 16
SetFont(_G.NumberFont_Outline_Med, NUMBER, medium, 'OUTLINE') -- 14
SetFont(_G.NumberFont_OutlineThick_Mono_Small, NUMBER, size, 'OUTLINE') -- 12
SetFont(_G.NumberFont_Shadow_Med, NORMAL, medium) -- 14 -- Chat EditBox
SetFont(_G.NumberFont_Shadow_Small, NORMAL, small) -- 12
SetFont(_G.NumberFontNormalSmall, NORMAL, small, 'OUTLINE') -- 12 -- Calendar, EncounterJournal
SetFont(_G.PriceFont, NORMAL, 14)
SetFont(_G.PVPArenaTextString, NORMAL, 22, outline)
SetFont(_G.PVPInfoTextString, NORMAL, 22, outline)
SetFont(_G.QuestFont, NORMAL, size) -- 13
SetFont(_G.QuestFont_Enormous, NORMAL, enormous) -- 30 -- Garrison Titles
SetFont(_G.QuestFont_Huge, NORMAL, huge) -- 18 -- Quest rewards title(Rewards)
SetFont(_G.QuestFont_Large, NORMAL, large) -- 14
SetFont(_G.QuestFont_Shadow_Huge, NORMAL, huge) -- 18 -- Quest Title
SetFont(_G.QuestFont_Shadow_Small, NORMAL, small) -- 14
SetFont(_G.QuestFont_Super_Huge, NORMAL, mega) -- 24
SetFont(_G.ReputationDetailFont, NORMAL, size) -- 10 -- Rep Desc when clicking a rep
SetFont(_G.SpellFont_Small, NORMAL, 10)
SetFont(_G.SubSpellFont, NORMAL, 10) -- Spellbook Sub Names
SetFont(_G.SubZoneTextFont, NORMAL, 24, outline) -- 26 -- World Map(SubZone)
SetFont(_G.SubZoneTextString, NORMAL, 25, outline) -- 26
SetFont(_G.SystemFont_Huge1, NORMAL, 20) -- Garrison Mission XP
SetFont(_G.SystemFont_Huge1_Outline, NORMAL, 18, outline) -- 20 -- Garrison Mission Chance
SetFont(_G.SystemFont_Large, NORMAL, 16)
SetFont(_G.SystemFont_Med1, NORMAL, size) -- 12
SetFont(_G.SystemFont_Med3, NORMAL, medium) -- 14
SetFont(_G.SystemFont_Outline, NORMAL, size, outline) -- 13 -- Pet level on World map
SetFont(_G.SystemFont_Outline_Small, NUMBER, small, 'OUTLINE') -- 10
SetFont(_G.SystemFont_OutlineThick_Huge2, NORMAL, huge, thick) -- 22
SetFont(_G.SystemFont_OutlineThick_WTF, NORMAL, enormous, outline) -- 32 -- World Map
SetFont(_G.SystemFont_Shadow_Huge1, NORMAL, 20, outline) -- Raid Warning, Boss emote frame too
SetFont(_G.SystemFont_Shadow_Huge3, NORMAL, 25) -- FlightMap
SetFont(_G.SystemFont_Shadow_Huge4, NORMAL, 27, nil, nil, nil, nil, nil, 1, -1)
SetFont(_G.SystemFont_Shadow_Large, NORMAL, 16)
SetFont(_G.SystemFont_Shadow_Large2, NORMAL, 18) -- Auction House ItemDisplay
SetFont(_G.SystemFont_Shadow_Large_Outline, NUMBER, 16, 'OUTLINE')
SetFont(_G.SystemFont_Shadow_Med1, NORMAL, size) -- 12
SetFont(_G.SystemFont_Shadow_Med2, NORMAL, medium) -- 14 -- Shows Order resourses on OrderHallTalentFrame
SetFont(_G.SystemFont_Shadow_Med3, NORMAL, medium) -- 14
SetFont(_G.SystemFont_Shadow_Small, NORMAL, small) -- 10
SetFont(_G.SystemFont_Small, NORMAL, small) -- 10
SetFont(_G.SystemFont_Tiny, NORMAL, tiny) -- 9
SetFont(_G.Tooltip_Med, NORMAL, size) -- 12
SetFont(_G.Tooltip_Small, NORMAL, small) -- 10
SetFont(_G.ZoneTextString, NORMAL, enormous, outline) -- 32
end
end
......@@ -997,7 +997,7 @@ end
ElvUF.Tags.Events['name:title'] = 'UNIT_NAME_UPDATE INSTANCE_ENCOUNTER_ENGAGE_UNIT'
ElvUF.Tags.Methods['name:title'] = function(unit)
if UnitIsPlayer(unit) then
return UnitPVPName(unit)
return UnitPVPName(unit) or UnitName(unit)
end
end
......
## Interface: 90001
## Author: Elv, Simpy
## Version: 12.05
## Version: 12.06
## Title: |cff1784d1ElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
......@@ -46,19 +46,20 @@ Used to populate the tooltip when the widget is hovered.
local function UpdateTooltip(element)
if GameTooltip:IsForbidden() then return end
local unit = element.__owner.unit
local reason = UnitPhaseReason(unit)
local text = reason and PartyUtil.GetPhasedReasonString(reason, unit) or ''
GameTooltip:SetText(text, nil, nil, nil, nil, true)
GameTooltip:Show()
local text = PartyUtil.GetPhasedReasonString(element.reason, element.__owner.unit)
if(text) then
GameTooltip:SetText(text, nil, nil, nil, nil, true)
GameTooltip:Show()
end
end
local function onEnter(element)
if GameTooltip:IsForbidden() or not element:IsVisible() then return end
GameTooltip:SetOwner(element, 'ANCHOR_BOTTOMRIGHT')
element:UpdateTooltip()
if(element.reason) then
GameTooltip:SetOwner(element, 'ANCHOR_BOTTOMRIGHT')
element:UpdateTooltip()
end
end
local function onLeave()
......@@ -81,21 +82,24 @@ local function Update(self, event, unit)
element:PreUpdate()
end
local isPhased = UnitPhaseReason(unit)
if(isPhased and UnitIsPlayer(unit) and UnitIsConnected(unit)) then
local phaseReason = UnitIsPlayer(unit) and UnitIsConnected(unit) and UnitPhaseReason(unit) or nil
if(phaseReason) then
element:Show()
else
element:Hide()
end
--[[ Callback: PhaseIndicator:PostUpdate(isPhased)
element.reason = phaseReason
--[[ Callback: PhaseIndicator:PostUpdate(isInSamePhase, phaseReason)
Called after the element has been updated.
* self - the PhaseIndicator element
* isPhased - returns enum of what type of phase if not in the same phase as the player (number)
* isInSamePhase - indicates whether the unit is in the same phase as the player (boolean)
* phaseReason - the reason why the unit is in a different phase (number?)
--]]
if(element.PostUpdate) then
return element:PostUpdate(isPhased)
return element:PostUpdate(not phaseReason, phaseReason)
end
end
......
......@@ -74,30 +74,30 @@ local function Update(self, event, unit)
if(event == 'UNIT_SPELLCAST_START' and startTime ~= endTime) then
local costTable = GetSpellPowerCost(spellID)
local requiresAura = isPlayer and #costTable > 1
local checkRequiredAura = isPlayer and #costTable > 1
for _, costInfo in next, costTable do
-- costInfo content:
-- - name: string (powerToken)
-- - type: number (powerType)
-- - cost: number
-- - costPercent: number
-- - costPerSec: number
-- - minCost: number
-- - hasRequiredAura: boolean
-- - requiredAuraID: number
local cost, ctype, cperc = costInfo.cost, costInfo.type, costInfo.costPercent
local checkSpec = not requiresAura or costInfo.hasRequiredAura
local checkSpec = not checkRequiredAura or costInfo.hasRequiredAura
if checkSpec and ctype == mainType then
mainCost = ((isPlayer or cost < mainMax) and cost) or (mainMax * cperc) / 100
element.mainCost = mainCost
break
elseif hasAltManaBar and checkSpec and ctype == ADDITIONAL_POWER_BAR_INDEX then
altCost = cost
element.altCost = altCost
break
end
end
elseif(spellID) then
-- if we try to cast a spell while casting another one we need to avoid
-- resetting the element
mainCost = element.mainCost or 0
altCost = element.altCost or 0
else
element.mainCost = mainCost
element.altCost = altCost
end
if(element.mainBar) then
......
......@@ -218,6 +218,9 @@ local function Enable(self, unit)
MonkStaggerBar:UnregisterEvent('UNIT_EXITED_VEHICLE')
MonkStaggerBar:UnregisterEvent('UPDATE_VEHICLE_ACTIONBAR')
-- do not change this without taking Visibility into account
element:Hide()
return true
end
end
......
......@@ -116,7 +116,8 @@ AddMedia('texture','Mail')
AddMedia('texture','Minus')
AddMedia('texture','MinusButton')
AddMedia('texture','Pause')
AddMedia('texture','PhaseIcons')
AddMedia('texture','PhaseBorder')
AddMedia('texture','PhaseCenter')
AddMedia('texture','Play')
AddMedia('texture','Plus')
AddMedia('texture','PlusButton')
......
......@@ -3,7 +3,7 @@ local A = E:GetModule('Auras')
local LSM = E.Libs.LSM
local _G = _G
local floor, format, tinsert = floor, format, tinsert
local format, tinsert = format, tinsert
local select, unpack, strmatch = select, unpack, strmatch
local GetInventoryItemQuality = GetInventoryItemQuality
local GetInventoryItemTexture = GetInventoryItemTexture
......@@ -91,7 +91,7 @@ end
function A:UpdateStatusBar(button)
button.statusBar:SetValue(button.timeLeft)
local threshold = E.db.auras.fadeThreshold
local threshold = A.db.fadeThreshold
if threshold == -1 then
return
elseif button.timeLeft > threshold then
......@@ -102,29 +102,22 @@ function A:UpdateStatusBar(button)
end
function A:CreateIcon(button)
local font = LSM:Fetch('font', A.db.font)
local header = button:GetParent()
local auraType = header:GetAttribute('filter')
local db = A.db.debuffs
button.auraType = 'debuffs' -- used to update cooldown text
button.filter = auraType
if auraType == 'HELPFUL' then
db = A.db.buffs
button.auraType = 'buffs'
end
-- button:SetFrameLevel(4)
button.texture = button:CreateTexture(nil, 'ARTWORK')
button.texture:SetInside()
button.texture:SetTexCoord(unpack(E.TexCoords))
button.count = button:CreateFontString(nil, 'OVERLAY')
button.count:Point('BOTTOMRIGHT', -1 + A.db.countXOffset, 1 + A.db.countYOffset)
button.count:FontTemplate(font, db.countFontSize, A.db.fontOutline)
button.text = button:CreateFontString(nil, 'OVERLAY')
button.text:Point('TOP', button, 'BOTTOM', 1 + A.db.timeXOffset, 0 + A.db.timeYOffset)
button.highlight = button:CreateTexture(nil, 'HIGHLIGHT')
button.highlight:SetColorTexture(1, 1, 1, .45)
......@@ -133,21 +126,10 @@ function A:CreateIcon(button)
button.statusBar = CreateFrame('StatusBar', nil, button)
button.statusBar:SetFrameLevel(button:GetFrameLevel())
button.statusBar:SetFrameStrata(button:GetFrameStrata())
button.statusBar:SetStatusBarTexture(LSM:Fetch('statusbar', A.db.barTexture))
button.statusBar:CreateBackdrop()
E:SetSmoothing(button.statusBar)
local pos, spacing, iconSize = A.db.barPosition, A.db.barSpacing, db.size - (E.Border * 2)
local isOnTop = pos == 'TOP' and true or false
local isOnBottom = pos == 'BOTTOM' and true or false
local isOnLeft = pos == 'LEFT' and true or false
local isOnRight = pos == 'RIGHT' and true or false
button.statusBar:Width((isOnTop or isOnBottom) and iconSize or (A.db.barWidth + (E.PixelMode and 0 or 2)))
button.statusBar:Height((isOnLeft or isOnRight) and iconSize or (A.db.barHeight + (E.PixelMode and 0 or 2)))
button.statusBar:Point(E.InversePoints[pos], button, pos, (isOnTop or isOnBottom) and 0 or ((isOnLeft and -((E.PixelMode and 1 or 3) + spacing)) or ((E.PixelMode and 1 or 3) + spacing)), (isOnLeft or isOnRight) and 0 or ((isOnTop and ((E.PixelMode and 1 or 3) + spacing) or -((E.PixelMode and 1 or 3) + spacing))))
if isOnLeft or isOnRight then button.statusBar:SetOrientation('VERTICAL') end
A:UpdateIcon(button)
E:SetSmoothing(button.statusBar)
E:SetUpAnimGroup(button)
-- support cooldown override
......@@ -161,8 +143,6 @@ function A:CreateIcon(button)
tinsert(E.RegisteredCooldowns.auras, button)
end
button.text:FontTemplate(font, db.durationFontSize, A.db.fontOutline)
button:SetScript('OnAttributeChanged', A.OnAttributeChanged)
A:Update_CooldownOptions(button)
......@@ -179,6 +159,44 @@ function A:CreateIcon(button)
end
end
function A:UpdateIcon(button)
local font = LSM:Fetch('font', A.db.font)
local db = A.db.debuffs
if button.auraType == 'HELPFUL' then
db = A.db.buffs
end
button.count:ClearAllPoints()
button.count:Point('BOTTOMRIGHT', -1 + A.db.countXOffset, 1 + A.db.countYOffset)
button.count:FontTemplate(font, db.countFontSize, A.db.fontOutline)
button.text:ClearAllPoints()
button.text:Point('TOP', button, 'BOTTOM', 1 + A.db.timeXOffset, 0 + A.db.timeYOffset)
button.text:FontTemplate(font, db.durationFontSize, A.db.fontOutline)
local pos, spacing, iconSize = A.db.barPosition, A.db.barSpacing, db.size - (E.Border * 2)
local isOnTop = pos == 'TOP' and true or false
local isOnBottom = pos == 'BOTTOM' and true or false
local isOnLeft = pos == 'LEFT' and true or false
local isOnRight = pos == 'RIGHT' and true or false
button.statusBar:ClearAllPoints()
button.statusBar:Width((isOnTop or isOnBottom) and iconSize or (A.db.barWidth + (E.PixelMode and 0 or 2)))
button.statusBar:Height((isOnLeft or isOnRight) and iconSize or (A.db.barHeight + (E.PixelMode and 0 or 2)))
button.statusBar:Point(E.InversePoints[pos], button, pos, (isOnTop or isOnBottom) and 0 or ((isOnLeft and -((E.PixelMode and 1 or 3) + spacing)) or ((E.PixelMode and 1 or 3) + spacing)), (isOnLeft or isOnRight) and 0 or ((isOnTop and ((E.PixelMode and 1 or 3) + spacing) or -((E.PixelMode and 1 or 3) + spacing))))
button.statusBar:SetStatusBarTexture(LSM:Fetch('statusbar', A.db.barTexture))
if isOnLeft or isOnRight then
button.statusBar:SetOrientation('VERTICAL')
button.statusBar:SetRotatesTexture(true)
else
button.statusBar:SetOrientation('HORIZONTAL')
button.statusBar:SetRotatesTexture(false)
end
end
function A:SetAuraTime(button, expiration, duration)
button.timeLeft = E:Round(expiration - GetTime(), 3)
......@@ -370,48 +388,20 @@ function A:UpdateHeader(header)
header:SetAttribute('template', format('ElvUIAuraTemplate%d',db.size))
local pos, spacing, iconSize = A.db.barPosition, A.db.barSpacing, db.size - (E.Border * 2)
local isOnTop = pos == 'TOP' and true or false
local isOnBottom = pos == 'BOTTOM' and true or false
local isOnLeft = pos == 'LEFT' and true or false
local isOnRight = pos == 'RIGHT' and true or false
local index = 1
local child = select(index, header:GetChildren())
while child do
if (floor(child:GetWidth() * 100 + 0.5) / 100) ~= db.size then
child:Size(db.size, db.size)
end
child:Size(db.size, db.size)
child.auraType = auraType -- used to update cooldown text
if child.text then
local font = LSM:Fetch('font', A.db.font)
child.text:ClearAllPoints()
child.text:Point('TOP', child, 'BOTTOM', 1 + A.db.timeXOffset, 0 + A.db.timeYOffset)
child.text:FontTemplate(font, db.durationFontSize, A.db.fontOutline)
child.count:ClearAllPoints()
child.count:Point('BOTTOMRIGHT', -1 + A.db.countXOffset, 0 + A.db.countYOffset)
child.count:FontTemplate(font, db.countFontSize, A.db.fontOutline)
end
A:UpdateIcon(child)
--Blizzard bug fix, icons arent being hidden when you reduce the amount of maximum buttons
if index > (db.maxWraps * db.wrapAfter) and child:IsShown() then
child:Hide()
end
child.statusBar:Width((isOnTop or isOnBottom) and iconSize or (A.db.barWidth + (E.PixelMode and 0 or 2)))
child.statusBar:Height((isOnLeft or isOnRight) and iconSize or (A.db.barHeight + (E.PixelMode and 0 or 2)))
child.statusBar:ClearAllPoints()
child.statusBar:Point(E.InversePoints[pos], child, pos, (isOnTop or isOnBottom) and 0 or ((isOnLeft and -((E.PixelMode and 1 or 3) + spacing)) or ((E.PixelMode and 1 or 3) + spacing)), (isOnLeft or isOnRight) and 0 or ((isOnTop and ((E.PixelMode and 1 or 3) + spacing) or -((E.PixelMode and 1 or 3) + spacing))))
child.statusBar:SetStatusBarTexture(LSM:Fetch('statusbar', A.db.barTexture))
if isOnLeft or isOnRight then
child.statusBar:SetOrientation('VERTICAL')
else
child.statusBar:SetOrientation('HORIZONTAL')
end
index = index + 1
child = select(index, header:GetChildren())
end
......
......@@ -326,6 +326,10 @@ do --this can save some main file locals
['Imsopeachy-Cenarius'] = itsSimpy, -- [Horde] DH
['Imsosalty-Cenarius'] = itsSimpy, -- [Horde] Paladin
['Imsospicy-Cenarius'] = itsSimpy, -- [Horde] Mage
['Imsonutty-Cenarius'] = itsSimpy, -- [Horde] Hunter
['Imsotasty-Cenarius'] = itsSimpy, -- [Horde] Monk
['Imsogooey-Cenarius'] = itsSimpy, -- [Horde] Warlock
['Imsodrippy-Cenarius'] = itsSimpy, -- [Horde] Rogue
['Bunne-CenarionCircle'] = itsSimpy, -- [RP] Warrior