Commit 86cc61da authored by Simpy's avatar Simpy 🐹

11.37

parents 7b03590b 9e693812
......@@ -52,7 +52,7 @@ local LSM = E.Libs.LSM
--Constants
E.noop = function() end
E.title = format('|cfffe7b2c%s |r', 'ElvUI')
E.version = GetAddOnMetadata('ElvUI', 'Version')
E.version = tonumber(GetAddOnMetadata('ElvUI', 'Version'))
E.myfaction, E.myLocalizedFaction = UnitFactionGroup('player')
E.mylevel = UnitLevel('player')
E.myLocalizedClass, E.myclass, E.myClassID = UnitClass('player')
......@@ -69,6 +69,7 @@ E.resolution = format('%dx%d', E.screenwidth, E.screenheight)
E.NewSign = '|TInterface\\OptionsFrame\\UI-OptionsFrame-NewFeatureIcon:14:14|t' -- not used by ElvUI yet, but plugins like BenikUI and MerathilisUI use it.
E.TexturePath = 'Interface\\AddOns\\ElvUI\\Media\\Textures\\' -- for plugins?
E.InfoColor = '|cfffe7b2c'
E.UserList = {}
-- oUF Defines
E.oUF.Tags.Vars.E = E
......@@ -780,9 +781,10 @@ do
if event == 'CHAT_MSG_ADDON' then
if sender == myName then return end
if prefix == 'ELVUI_VERSIONCHK' then
local msg, ver = tonumber(message), tonumber(E.version)
local msg, ver = tonumber(message), E.version
local inCombat = InCombatLockdown()
E.UserList[gsub(sender, '%-'..myRealm,'')] = msg
if ver ~= G.general.version then
if not E.shownUpdatedWhileRunningPopup and not inCombat then
E:StaticPopup_Show('ELVUI_UPDATED_WHILE_RUNNING', nil, nil, {mismatch = ver > G.general.version})
......@@ -1011,7 +1013,8 @@ function E:UpdateEnd()
E:SetMoversClampedToScreen(true) -- Go back to using clamp after resizing has taken place.
if (E.installSetup ~= true) and (E.private.install_complete == nil or (E.private.install_complete and type(E.private.install_complete) == 'boolean') or (E.private.install_complete and type(tonumber(E.private.install_complete)) == 'number' and tonumber(E.private.install_complete) <= 3.83)) then
local iver = E.private.install_complete
if (E.installSetup ~= true) and (not iver or ((type(iver) == 'boolean') or (type(tonumber(iver)) == 'number' and tonumber(iver) <= 3.83))) then
E.installSetup = nil
E:Install()
end
......@@ -1528,6 +1531,8 @@ function E:DBConversions()
end
end
end
if E.db.unitframe.debuffHighlight.blendMode == 'MOD' then E.db.unitframe.debuffHighlight.blendMode = P.unitframe.debuffHighlight.blendMode end
end
function E:RefreshModulesDB()
......
......@@ -1220,7 +1220,6 @@ E.TagInfo = {
['speed:percent'] = { category = 'Speed', description = "" },
['speed:percent-raw'] = { category = 'Speed', description = "" },
['speed:yardspersec'] = { category = 'Speed', description = "" },
['speed:percent'] = { category = 'Speed', description = "" },
['speed:percent-moving'] = { category = 'Speed', description = "" },
['speed:yardspersec-moving'] = { category = 'Speed', description = "" },
['speed:percent-moving-raw'] = { category = 'Speed', description = "" },
......
## Interface: 80300
## Author: Elv, Simpy
## Version: 11.36
## Version: 11.37
## Title: |cfffe7b2cElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
......@@ -103,7 +103,7 @@ local function UpdateColor(self, event, unit, powertype)
local element = self.AdditionalPower
local r, g, b, t
if(element.colorDisconnected and element.disconnected) then
if(element.colorDisconnected and not UnitIsConnected(unit)) then
t = self.colors.disconnected
elseif(element.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapDenied(unit)) then
t = self.colors.tapped
......@@ -171,11 +171,10 @@ local function Update(self, event, unit, powertype)
local cur = UnitPower('player', ADDITIONAL_POWER_BAR_INDEX)
local max = UnitPowerMax('player', ADDITIONAL_POWER_BAR_INDEX)
local disconnected = not UnitIsConnected(unit)
element:SetMinMaxValues(0, max)
if(disconnected) then
if not UnitIsConnected(unit) then
element:SetValue(max)
else
element:SetValue(cur)
......@@ -183,7 +182,6 @@ local function Update(self, event, unit, powertype)
element.cur = cur
element.max = max
element.disconnected = disconnected
--[[ Callback: AdditionalPower:PostUpdate(unit, cur, max)
Called after the element has been updated.
......
......@@ -47,10 +47,6 @@ The following options are listed by priority. The first check that returns true
.multiplier - Used to tint the background based on the main widgets R, G and B values. Defaults to 1 (number)[0-1]
## Attributes
.disconnected - Indicates whether the unit is disconnected (boolean)
## Examples
-- Position and size
......@@ -91,7 +87,7 @@ local function UpdateColor(self, event, unit)
local element = self.Health
local r, g, b, t
if(element.colorDisconnected and element.disconnected) then
if(element.colorDisconnected and not UnitIsConnected(unit)) then
t = self.colors.disconnected
elseif(element.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapDenied(unit)) then
t = self.colors.tapped
......@@ -169,7 +165,6 @@ local function Update(self, event, unit)
element.cur = cur
element.max = max
element.disconnected = disconnected
--[[ Callback: Health:PostUpdate(unit, cur, max)
Called after the element has been updated.
......@@ -214,8 +209,12 @@ local function SetColorDisconnected(element, state)
element.colorDisconnected = state
if(element.colorDisconnected) then
element.__owner:RegisterEvent('UNIT_CONNECTION', ColorPath)
element.__owner:RegisterEvent('PARTY_MEMBER_ENABLE', ColorPath)
element.__owner:RegisterEvent('PARTY_MEMBER_DISABLE', ColorPath)
else
element.__owner:UnregisterEvent('UNIT_CONNECTION', ColorPath)
element.__owner:UnregisterEvent('PARTY_MEMBER_ENABLE', ColorPath)
element.__owner:UnregisterEvent('PARTY_MEMBER_DISABLE', ColorPath)
end
end
end
......@@ -324,6 +323,8 @@ local function Enable(self, unit)
if(element.colorDisconnected) then
self:RegisterEvent('UNIT_CONNECTION', ColorPath)
self:RegisterEvent('PARTY_MEMBER_ENABLE', ColorPath)
self:RegisterEvent('PARTY_MEMBER_DISABLE', ColorPath)
end
if(element.colorSelection) then
......@@ -361,6 +362,8 @@ local function Disable(self)
self:UnregisterEvent('UNIT_CONNECTION', ColorPath)
self:UnregisterEvent('UNIT_FACTION', ColorPath)
self:UnregisterEvent('UNIT_FLAGS', ColorPath)
self:UnregisterEvent('PARTY_MEMBER_ENABLE', ColorPath)
self:UnregisterEvent('PARTY_MEMBER_DISABLE', ColorPath)
self:UnregisterEvent('UNIT_THREAT_LIST_UPDATE', ColorPath)
end
end
......
......@@ -46,14 +46,14 @@ local SetPortraitTexture = SetPortraitTexture
local function Update(self, event, unit)
if(not unit or not UnitIsUnit(self.unit, unit)) then return end
local element = self.Portrait
--[[ Callback: Portrait:PreUpdate(unit)
Called before the element has been updated.
* self - the Portrait element
* unit - the unit for which the update has been triggered (string)
--]]
local element = self.Portrait
if(element.PreUpdate) then element:PreUpdate(unit) end
local guid = UnitGUID(unit)
......@@ -78,7 +78,7 @@ local function Update(self, event, unit)
element:ClearModel()
element:SetUnit(unit)
end
else
elseif not element.customTexture then -- ElvUI changed
SetPortraitTexture(element, unit)
end
end
......
......@@ -57,10 +57,6 @@ The following options are listed by priority. The first check that returns true
.multiplier - A multiplier used to tint the background based on the main widgets R, G and B values. Defaults to 1
(number)[0-1]
## Attributes
.disconnected - Indicates whether the unit is disconnected (boolean)
## Examples
-- Position and size
......@@ -114,7 +110,7 @@ local function UpdateColor(self, event, unit)
local ptype, ptoken, altR, altG, altB = UnitPowerType(unit)
local r, g, b, t, atlas
if(element.colorDisconnected and element.disconnected) then
if(element.colorDisconnected and not UnitIsConnected(unit)) then
t = self.colors.disconnected
elseif(element.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapDenied(unit)) then
t = self.colors.tapped
......@@ -212,11 +208,10 @@ local function Update(self, event, unit)
end
local cur, max = UnitPower(unit, displayType), UnitPowerMax(unit, displayType)
local disconnected = not UnitIsConnected(unit)
element:SetMinMaxValues(min or 0, max)
if(disconnected) then
if not UnitIsConnected(unit) then
element:SetValue(max)
else
element:SetValue(cur)
......@@ -226,7 +221,6 @@ local function Update(self, event, unit)
element.min = min
element.max = max
element.displayType = displayType
element.disconnected = disconnected
--[[ Callback: Power:PostUpdate(unit, cur, min, max)
Called after the element has been updated.
......
......@@ -329,7 +329,6 @@ L["Type /hellokitty to revert to old settings."] = "Tippe /hellokitty um die alt
L["UIWidgetBelowMinimapContainer"] = true --No need to translate
L["UIWidgetTopContainer"] = true --No need to translate
L["Unhittable:"] = "Unschlagbar:"
L["Use CVar Value"] = "Benutze CVar Wert"
L["Vehicle Seat Frame"] = "Fahrzeugfenster"
L["Vendor / Delete Grays"] = "Verkaufe / Lösche graue Gegenstände"
L["Vendor Grays"] = "Graue Gegenstände verkaufen"
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = true
L["UIWidgetBelowMinimapContainer"] = true
L["UIWidgetTopContainer"] = true
L["Unhittable:"] = true
L["Use CVar Value"] = true
L["Vehicle Seat Frame"] = true
L["Vendor / Delete Grays"] = true
L["Vendor Grays"] = true
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = "Escribe /hellokitty para rev
L["UIWidgetBelowMinimapContainer"] = true
L["UIWidgetTopContainer"] = true
L["Unhittable:"] = "Imbatible:"
L["Use CVar Value"] = "Usar valor CVar"
L["Vehicle Seat Frame"] = "Marco del Asiento del Vehículo"
L["Vendor / Delete Grays"] = "Vender / Eliminar Grises"
L["Vendor Grays"] = "Vender Objetos Grises"
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = "Tapez /hellokitty pour recha
L["UIWidgetBelowMinimapContainer"] = true
L["UIWidgetTopContainer"] = true
L["Unhittable:"] = "Intouchable :"
L["Use CVar Value"] = true
L["Vehicle Seat Frame"] = "Cadre de siège du véhicule"
L["Vendor / Delete Grays"] = true
L["Vendor Grays"] = "Vendre les objets gris"
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = true
L["UIWidgetBelowMinimapContainer"] = true
L["UIWidgetTopContainer"] = true
L["Unhittable:"] = true
L["Use CVar Value"] = true
L["Vehicle Seat Frame"] = true
L["Vendor / Delete Grays"] = true
L["Vendor Grays"] = true
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = "/hellokitty 를 입력해서
L["UIWidgetBelowMinimapContainer"] = true
L["UIWidgetTopContainer"] = true
L["Unhittable:"] = "100% 방어행동까지"
L["Use CVar Value"] = true
L["Vehicle Seat Frame"] = "차량 좌석 프레임"
L["Vendor / Delete Grays"] = "잡템 자동판매/삭제"
L["Vendor Grays"] = "잡동사니 자동판매"
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = true
L["UIWidgetBelowMinimapContainer"] = true
L["UIWidgetTopContainer"] = true
L["Unhittable:"] = "Inacertável"
L["Use CVar Value"] = true
L["Vehicle Seat Frame"] = "Quadro de Assento de Veículo"
L["Vendor / Delete Grays"] = true
L["Vendor Grays"] = "Vender Itens Cinzentos"
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = "Напишите /hellokitty
L["UIWidgetBelowMinimapContainer"] = "Виджет миникарты"
L["UIWidgetTopContainer"] = "Верхний виджет"
L["Unhittable:"] = "Полная защита от ударов"
L["Use CVar Value"] = "Использовать значение CVar"
L["Vehicle Seat Frame"] = "Техника"
L["Vendor / Delete Grays"] = "Продать/удалить серые предметы"
L["Vendor Grays"] = "Продавать серые предметы"
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = "输入/hellokitty以撤销
L["UIWidgetBelowMinimapContainer"] = "小地图下方部件容器"
L["UIWidgetTopContainer"] = "顶部部件容器"
L["Unhittable:"] = "未命中:"
L["Use CVar Value"] = "使用CVar数值"
L["Vehicle Seat Frame"] = "载具座位框"
L["Vendor / Delete Grays"] = "出售/删除灰色物品"
L["Vendor Grays"] = "出售灰色物品"
......
......@@ -327,7 +327,6 @@ L["Type /hellokitty to revert to old settings."] = "輸入 /hellokitty 來回復
L["UIWidgetBelowMinimapContainer"] = "小地圖下方容器"
L["UIWidgetTopContainer"] = "頂部容器"
L["Unhittable:"] = "未命中:"
L["Use CVar Value"] = "使用 CVar 設定值"
L["Vehicle Seat Frame"] = "載具座位框"
L["Vendor / Delete Grays"] = "出售/摧毁灰色物品"
L["Vendor Grays"] = "出售灰色物品"
......
......@@ -351,7 +351,7 @@ function AB:CreateBar(id)
]])
self.handledBars['bar'..id] = bar
E:CreateMover(bar, 'ElvAB_'..id, L["Bar "]..id, nil, nil, nil,'ALL,ACTIONBARS',nil,'actionbar,bar'..id)
E:CreateMover(bar, 'ElvAB_'..id, L["Bar "]..id, nil, nil, nil,'ALL,ACTIONBARS',nil,'actionbar,playerBars,bar'..id)
self:PositionAndSizeBar('bar'..id)
return bar
end
......@@ -379,7 +379,7 @@ function AB:CreateVehicleLeave()
local holder = CreateFrame('Frame', 'VehicleLeaveButtonHolder', E.UIParent)
holder:Point('BOTTOM', E.UIParent, 'BOTTOM', 0, 300)
holder:Size(_G.MainMenuBarVehicleLeaveButton:GetSize())
E:CreateMover(holder, 'VehicleLeaveButton', L["VehicleLeaveButton"], nil, nil, nil, nil, nil, 'all,general')
E:CreateMover(holder, 'VehicleLeaveButton', L["VehicleLeaveButton"], nil, nil, nil, 'ALL,ACTIONBARS', nil, 'actionbar,vehicleExitButton')
local Button = _G.MainMenuBarVehicleLeaveButton
Button:ClearAllPoints()
......
......@@ -121,18 +121,6 @@ function A:CreateIcon(button)
button.texture:SetInside()
button.texture:SetTexCoord(unpack(E.TexCoords))
button:HookScript("OnShow", function(btn)
if btn.filter == 'HARMFUL' then
local color = _G.DebuffTypeColor[btn.dtype or 'none']
btn:SetBackdropBorderColor(color.r, color.g, color.b)
btn.statusBar.backdrop:SetBackdropBorderColor(color.r, color.g, color.b)
else
local cr, cg, cb = unpack(E.media.bordercolor)
btn:SetBackdropBorderColor(cr, cg, cb)
btn.statusBar.backdrop:SetBackdropBorderColor(cr, cg, cb)
end
end)
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)
......@@ -229,6 +217,7 @@ function A:UpdateAura(button, index)
local unit = button:GetParent():GetAttribute('unit')
local name, texture, count, dtype, duration, expiration = UnitAura(unit, index, button.filter)
local DebuffType = dtype or 'none'
if name then
if duration > 0 and expiration then
A:SetAuraTime(button, expiration, duration)
......@@ -236,8 +225,6 @@ function A:UpdateAura(button, index)
A:ClearAuraTime(button)
end
button.dtype = dtype
local r, g, b
if button.timeLeft and A.db.barColorGradient then
r, g, b = E.oUF:ColorGradient(button.timeLeft, duration or 0, .8, 0, 0, .8, .8, 0, 0, .8, 0)
......@@ -265,8 +252,22 @@ function A:UpdateAura(button, index)
button.statusBar:Hide()
end
if button.debuffType ~= DebuffType then
if button.filter == 'HARMFUL' then
local color = _G.DebuffTypeColor[DebuffType]
button:SetBackdropBorderColor(color.r, color.g, color.b)
button.statusBar.backdrop:SetBackdropBorderColor(color.r, color.g, color.b)
else
local cr, cg, cb = unpack(E.media.bordercolor)
button:SetBackdropBorderColor(cr, cg, cb)
button.statusBar.backdrop:SetBackdropBorderColor(cr, cg, cb)
end
end
button.texture:SetTexture(texture)
end
button.debuffType = DebuffType
end
function A:UpdateTempEnchant(button, index)
......
......@@ -267,18 +267,18 @@ do --this can save some main file locals
["Misdecay-Spirestone"] = itsMis,
["Mislust-Spirestone"] = itsMis,
-- Luckyone
["Luckyone-Gorgonnash"] = Clover,
["Luckypriest-Gorgonnash"] = Clover,
["Luckymonkas-Blackrock"] = Clover,
["Luckysabers-Blackrock"] = Clover,
["Luckydemon-Blackrock"] = Clover,
["Luckymage-Blackrock"] = Clover,
["Luckyshaman-Blackrock"] = Clover,
["Luckylockx-Blackrock"] = Clover,
["Luckybow-Blackrock"] = Clover,
["Luckypepega-Blackrock"] = Clover,
["Luckypoggers-Blackrock"] = Clover,
["Luckyclap-Blackrock"] = Clover,
["Luckyone-LaughingSkull"] = Clover,
["Luckypriest-LaughingSkull"] = Clover,
["Luckymonkas-Blackrock"] = Clover,
["Luckysabers-Blackrock"] = Clover,
["Luckydemon-Blackrock"] = Clover,
["Luckymage-Blackrock"] = Clover,
["Luckyshaman-Blackrock"] = Clover,
["Luckylockx-Blackrock"] = Clover,
["Luckybow-Blackrock"] = Clover,
["Luckypepega-Blackrock"] = Clover,
["Luckypoggers-Blackrock"] = Clover,
["Luckyclap-Blackrock"] = Clover,
-- NihilisticPandemonium
["Dirishia-WyrmrestAccord"] = itsTheFlyestNihilist("Warlock"),
["Xanikani-WyrmrestAccord"] = itsTheFlyestNihilist("Mage"),
......
......@@ -20,9 +20,7 @@ function NP:Health_UpdateColor(event, unit)
local Selection = element.colorSelection and NP:UnitSelectionType(unit, element.considerSelectionInCombatHostile)
local r, g, b, t
if(element.colorDead and element.dead) then
t = self.colors.dead
elseif(element.colorDisconnected and element.disconnected) then
if(element.colorDisconnected and not UnitIsConnected(unit)) then
t = self.colors.disconnected
elseif(element.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapDenied(unit)) then
t = NP.db.colors.tapped
......
......@@ -26,9 +26,7 @@ function NP:Power_UpdateColor(event, unit)
local Selection = element.colorSelection and NP:UnitSelectionType(unit, element.considerSelectionInCombatHostile)
local r, g, b, t, atlas
if(element.colorDead and element.dead) then
t = self.colors.dead
elseif(element.colorDisconnected and element.disconnected) then
if(element.colorDisconnected and not UnitIsConnected(unit)) then
t = self.colors.disconnected
elseif(element.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapDenied(unit)) then
t = self.colors.tapped
......
local E, L, V, P, G = unpack(select(2, ...)) --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local oUF = E.oUF
local UnitPlayerControlled = UnitPlayerControlled
local UnitIsOwnerOrControllerOfUnit = UnitIsOwnerOrControllerOfUnit
local function Hide(element)
if element.Rank then element.Rank:Hide() end
if element.ProgressText then element.ProgressText:Hide() end
......@@ -14,6 +17,9 @@ local function Update(self)
local widget = self.widget
if not widget then Hide(element) return end
local unit = self.unit
if unit and UnitPlayerControlled(unit) and not UnitIsOwnerOrControllerOfUnit('player', unit) then Hide(element) return end
if element.PreUpdate then
element:PreUpdate()
end
......@@ -39,7 +45,7 @@ local function Update(self)
end
if element.ProgressText then
element.ProgressText:SetText((maxRank and L["Max Rank"]) or ("%d / %d"):format(cur, toNext))
element.ProgressText:SetFormattedText(maxRank and L["Max Rank"] or "%d / %d", cur, toNext)
element.ProgressText:Show()
end
......
......@@ -3,12 +3,9 @@ local S = E:GetModule('Skins')
--Lua functions
local _G = _G
local pairs, select, unpack = pairs, select, unpack
local GetItemInfo = GetItemInfo
local GetItemQualityColor = GetItemQualityColor
local pairs, select = pairs, select
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local FRIENDS_BNET_NAME_COLOR = FRIENDS_BNET_NAME_COLOR
--[[
TO DO:
......
......@@ -10,7 +10,6 @@ local floor, tonumber, strlower = floor, tonumber, strlower
local strfind, format, strsub = strfind, format, strsub
local strmatch, gmatch, gsub = strmatch, gmatch, gsub
--WoW API / Variables
local C_ToyBox_GetToyInfo = C_ToyBox.GetToyInfo
local CanInspect = CanInspect
local CreateFrame = CreateFrame
local GameTooltip_ClearMoney = GameTooltip_ClearMoney
......@@ -204,6 +203,7 @@ function TT:SetUnitText(tt, unit, level, isShiftKeyDown)
if not localeClass or not class then return end
local name, realm = UnitName(unit)
local nameRealm = (realm and realm ~= "" and format("%s-%s", name, realm)) or name
local guildName, guildRankName, _, guildRealm = GetGuildInfo(unit)
local pvpName = UnitPVPName(unit)
local relationship = UnitRealmRelationship(unit)
......@@ -270,6 +270,14 @@ function TT:SetUnitText(tt, unit, level, isShiftKeyDown)
GameTooltip:AddDoubleLine(format("%s:", _G.ROLE), role, nil, nil, nil, r, g, b)
end
end
if E.db.tooltip.showElvUIUsers then
local addonUser = E.UserList[nameRealm]
if addonUser then
local v,r,g,b = addonUser == E.version, unpack(E.media.rgbvaluecolor)
GameTooltip:AddDoubleLine(L["ElvUI Version:"], addonUser, r,g,b, v and 0 or 1, v and 1 or 0, 0)
end
end
else
if UnitIsTapDenied(unit) then
color = TAPPED_COLOR
......@@ -449,7 +457,6 @@ function TT:GameTooltip_OnTooltipSetUnit(tt)
self:RemoveTrashLines(tt) --keep an eye on this may be buggy
local color = self:SetUnitText(tt, unit, UnitLevel(unit), isShiftKeyDown)
if self.db.showMount and not isShiftKeyDown and unit ~= "player" and isPlayerUnit then
for i = 1, 40 do
local name, _, _, _, _, _, _, _, _, id = UnitBuff(unit, i)
......
......@@ -3,7 +3,6 @@ local UF = E:GetModule('UnitFrames');
--Lua functions
local _G = _G
local tostring = tostring
local format = format
local unpack = unpack
--WoW API / Variables
......
......@@ -292,7 +292,7 @@ local function ToggleResourceBar(bars, overrideVisibility)
if not frame.CLASSBAR_DETACHED then --Only update when necessary
UF:Configure_HealthBar(frame)
UF:Configure_Portrait(frame, true) --running :Hide on portrait makes the frame all funky
UF:Configure_Portrait(frame)
UF:Configure_Threat(frame)
end
end
......
......@@ -7,6 +7,7 @@ local select = select
local UnitClass = UnitClass
local CreateFrame = CreateFrame
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
local classIcon = 'Interface\\WorldStateFrame\\Icons-Classes'
function UF:Construct_Portrait(frame, type)
local portrait
......@@ -29,40 +30,48 @@ function UF:Construct_Portrait(frame, type)
return portrait
end
function UF:Configure_Portrait(frame, dontHide)
function UF:Configure_Portrait(frame)
if not frame.VARIABLES_SET then return end
local db = frame.db
if frame.Portrait and not dontHide then
frame.Portrait:Hide()
frame.Portrait:ClearAllPoints()
frame.Portrait.backdrop:Hide()
local last = frame.Portrait
if last then
last:Hide()
last.backdrop:Hide()
end
frame.Portrait = (db.portrait.style == '3D' and frame.Portrait3D) or frame.Portrait2D
local db = frame.db
local portrait = (db.portrait.style == '3D' and frame.Portrait3D) or frame.Portrait2D
portrait.db = db.portrait
frame.Portrait = portrait
if portrait.db.style == 'Class' then
portrait:SetTexture(classIcon)
portrait.customTexture = classIcon
elseif portrait.db.style == '2D' then
portrait:SetTexCoord(0.15, 0.85, 0.15, 0.85)
portrait.customTexture = nil
end
local portrait = frame.Portrait
if frame.USE_PORTRAIT then
if not frame:IsElementEnabled('Portrait') then
frame:EnableElement('Portrait')
end
portrait:Show()
portrait:ClearAllPoints()
portrait.backdrop:ClearAllPoints()
if frame.USE_PORTRAIT_OVERLAY then
if db.portrait.style == '3D' then
portrait:SetFrameLevel(frame.Health:GetFrameLevel())
else
portrait:SetParent(frame.Health)
end
portrait:SetAlpha(db.portrait.overlayAlpha)
if not dontHide then
portrait:Show()
end
if portrait.db.style == '3D' then
portrait:SetFrameLevel(frame.Health:GetFrameLevel())
else
portrait:SetParent(frame.USE_PORTRAIT_OVERLAY and frame.Health or frame)
end
if frame.USE_PORTRAIT_OVERLAY then
portrait:SetAlpha(portrait.db.overlayAlpha)
portrait.backdrop:Hide()
portrait:ClearAllPoints()
if db.portrait.fullOverlay then
if portrait.db.fullOverlay then
portrait:SetAllPoints(frame.Health)
else
local healthTex = frame.Health:GetStatusBarTexture()
......@@ -77,20 +86,9 @@ function UF:Configure_Portrait(frame, dontHide)
end
end
else