initial commit
This commit is contained in:
32
Modules/UnitFrames/Elements/PVPIcon.lua
Normal file
32
Modules/UnitFrames/Elements/PVPIcon.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule('UnitFrames');
|
||||
|
||||
function UF:Construct_PvPIcon(frame)
|
||||
local PvPIndicator = frame.RaisedElementParent.TextureParent:CreateTexture(nil, 'ARTWORK', nil, 1)
|
||||
PvPIndicator:Size(30, 30)
|
||||
PvPIndicator:Point('CENTER', frame, 'CENTER')
|
||||
|
||||
local Badge = frame.RaisedElementParent.TextureParent:CreateTexture(nil, 'ARTWORK')
|
||||
Badge:Size(50, 52)
|
||||
Badge:Point('CENTER', PvPIndicator, 'CENTER')
|
||||
|
||||
PvPIndicator.Badge = Badge
|
||||
|
||||
return PvPIndicator
|
||||
end
|
||||
|
||||
function UF:Configure_PVPIcon(frame)
|
||||
local PvPIndicator = frame.PvPIndicator
|
||||
PvPIndicator:ClearAllPoints()
|
||||
PvPIndicator:Point(frame.db.pvpIcon.anchorPoint, frame.Health, frame.db.pvpIcon.anchorPoint, frame.db.pvpIcon.xOffset, frame.db.pvpIcon.yOffset)
|
||||
|
||||
local scale = frame.db.pvpIcon.scale or 1
|
||||
PvPIndicator:Size(30 * scale)
|
||||
PvPIndicator.Badge:Size(50 * scale, 52 * scale)
|
||||
|
||||
if frame.db.pvpIcon.enable and not frame:IsElementEnabled('PvPIndicator') then
|
||||
frame:EnableElement('PvPIndicator')
|
||||
elseif not frame.db.pvpIcon.enable and frame:IsElementEnabled('PvPIndicator') then
|
||||
frame:DisableElement('PvPIndicator')
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user