mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
remove temp folder structure
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
|
||||
--WoW API / Variables
|
||||
|
||||
function UF:Construct_CombatIndicator(frame)
|
||||
local combat = frame.RaisedElementParent.TextureParent:CreateTexture(nil, "OVERLAY")
|
||||
combat:SetWidth(19)
|
||||
combat:SetHeight(19)
|
||||
combat:SetPoint("CENTER", frame.Health, "CENTER", 0, 6)
|
||||
combat:SetVertexColor(0.69, 0.31, 0.31)
|
||||
|
||||
return combat
|
||||
end
|
||||
|
||||
function UF:Configure_CombatIndicator(frame)
|
||||
if frame.db.combatIcon and not frame:IsElementEnabled('CombatIndicator') then
|
||||
frame:EnableElement("CombatIndicator")
|
||||
elseif not frame.db.combatIcon and frame:IsElementEnabled('CombatIndicator') then
|
||||
frame:DisableElement("CombatIndicator")
|
||||
frame.CombatIndicator:Hide()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,238 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local random = random
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local UnitIsTapped = UnitIsTapped
|
||||
local UnitIsTappedByPlayer = UnitIsTappedByPlayer
|
||||
local UnitReaction = UnitReaction
|
||||
local UnitIsPlayer = UnitIsPlayer
|
||||
local UnitClass = UnitClass
|
||||
local UnitIsDeadOrGhost = UnitIsDeadOrGhost
|
||||
|
||||
local ns = oUF
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
function UF:Construct_HealthBar(frame, bg, text, textPos)
|
||||
local health = CreateFrame("StatusBar", nil, frame)
|
||||
UF["statusbars"][health] = true
|
||||
|
||||
health:SetFrameLevel(10) --Make room for Portrait and Power which should be lower by default
|
||||
health.PostUpdate = self.PostUpdateHealth
|
||||
|
||||
CreateStatusBarTexturePointer(health)
|
||||
|
||||
if bg then
|
||||
health.bg = health:CreateTexture(nil, "BORDER")
|
||||
health.bg:SetAllPoints()
|
||||
health.bg:SetTexture(E["media"].blankTex)
|
||||
health.bg.multiplier = 0.25
|
||||
end
|
||||
|
||||
if text then
|
||||
health.value = frame.RaisedElementParent:CreateFontString(nil, "OVERLAY")
|
||||
UF:Configure_FontString(health.value)
|
||||
|
||||
local x = -2
|
||||
if textPos == "LEFT" then
|
||||
x = 2
|
||||
end
|
||||
|
||||
health.value:SetPoint(textPos, health, textPos, x, 0)
|
||||
end
|
||||
|
||||
health.colorTapping = true
|
||||
health.colorDisconnected = true
|
||||
E:CreateBackdrop(health, "Default", nil, nil, self.thinBorders, true)
|
||||
|
||||
return health
|
||||
end
|
||||
|
||||
function UF:Configure_HealthBar(frame)
|
||||
if not frame.VARIABLES_SET then return end
|
||||
local db = frame.db
|
||||
local health = frame.Health
|
||||
|
||||
health.Smooth = self.db.smoothbars
|
||||
health.SmoothSpeed = self.db.smoothSpeed * 10
|
||||
|
||||
--Text
|
||||
if db.health and health.value then
|
||||
local attachPoint = self:GetObjectAnchorPoint(frame, db.health.attachTextTo)
|
||||
health.value:ClearAllPoints()
|
||||
health.value:SetPoint(db.health.position, attachPoint, db.health.position, db.health.xOffset, db.health.yOffset)
|
||||
frame:Tag(health.value, db.health.text_format)
|
||||
end
|
||||
|
||||
--Colors
|
||||
health.colorSmooth = nil
|
||||
health.colorHealth = nil
|
||||
health.colorClass = nil
|
||||
health.colorReaction = nil
|
||||
|
||||
if db.colorOverride and db.colorOverride == "FORCE_ON" then
|
||||
health.colorClass = true
|
||||
health.colorReaction = true
|
||||
elseif db.colorOverride and db.colorOverride == "FORCE_OFF" then
|
||||
if self.db["colors"].colorhealthbyvalue == true then
|
||||
health.colorSmooth = true
|
||||
else
|
||||
health.colorHealth = true
|
||||
end
|
||||
else
|
||||
if self.db.colors.healthclass ~= true then
|
||||
if self.db.colors.colorhealthbyvalue == true then
|
||||
health.colorSmooth = true
|
||||
else
|
||||
health.colorHealth = true
|
||||
end
|
||||
else
|
||||
health.colorClass = (not self.db.colors.forcehealthreaction)
|
||||
health.colorReaction = true
|
||||
end
|
||||
end
|
||||
|
||||
--Position
|
||||
health:ClearAllPoints()
|
||||
if frame.ORIENTATION == "LEFT" then
|
||||
health:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.BORDER - frame.SPACING, -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
|
||||
|
||||
if frame.USE_POWERBAR_OFFSET then
|
||||
health:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.BORDER - frame.SPACING - frame.POWERBAR_OFFSET, -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET) - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET))
|
||||
elseif frame.POWERBAR_DETACHED or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR then
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET))
|
||||
elseif frame.USE_MINI_POWERBAR then
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.SPACING + (frame.POWERBAR_HEIGHT/2)))
|
||||
else
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET))
|
||||
end
|
||||
elseif frame.ORIENTATION == "RIGHT" then
|
||||
health:SetPoint("TOPLEFT", frame, "TOPLEFT", frame.BORDER + frame.SPACING, -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
|
||||
|
||||
if frame.USE_POWERBAR_OFFSET then
|
||||
health:SetPoint("TOPLEFT", frame, "TOPLEFT", frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET, -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET) - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET))
|
||||
elseif frame.POWERBAR_DETACHED or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR then
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET))
|
||||
elseif frame.USE_MINI_POWERBAR then
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.SPACING + (frame.POWERBAR_HEIGHT/2)))
|
||||
else
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET))
|
||||
end
|
||||
elseif frame.ORIENTATION == "MIDDLE" then
|
||||
health:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.BORDER - frame.SPACING, -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
|
||||
|
||||
if frame.USE_POWERBAR_OFFSET then
|
||||
health:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.BORDER - frame.SPACING - frame.POWERBAR_OFFSET, -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING + (frame.POWERBAR_OFFSET*2)))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET) - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET))
|
||||
elseif frame.POWERBAR_DETACHED or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR then
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET))
|
||||
elseif frame.USE_MINI_POWERBAR then
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.SPACING + (frame.POWERBAR_HEIGHT/2)))
|
||||
else
|
||||
health:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
health:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET) - (frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET))
|
||||
end
|
||||
end
|
||||
|
||||
health.bg:ClearAllPoints()
|
||||
if not frame.USE_PORTRAIT_OVERLAY then
|
||||
health.bg:SetParent(health)
|
||||
health.bg:SetAllPoints()
|
||||
else
|
||||
health.bg:SetPoint("BOTTOMLEFT", health.texturePointer, "BOTTOMRIGHT")
|
||||
health.bg:SetPoint("TOPRIGHT", health)
|
||||
health.bg:SetParent(frame.Portrait.overlay)
|
||||
end
|
||||
|
||||
if db.health then
|
||||
--Party/Raid Frames allow to change statusbar orientation
|
||||
if db.health.orientation then
|
||||
health:SetOrientation(db.health.orientation)
|
||||
end
|
||||
|
||||
--Party/Raid Frames can toggle frequent updates
|
||||
if db.health.frequentUpdates then
|
||||
health.frequentUpdates = db.health.frequentUpdates
|
||||
end
|
||||
end
|
||||
|
||||
--Transparency Settings
|
||||
UF:ToggleTransparentStatusBar(UF.db.colors.transparentHealth, frame.Health, frame.Health.bg, (frame.USE_PORTRAIT and frame.USE_PORTRAIT_OVERLAY) ~= true)
|
||||
|
||||
frame:UpdateElement("Health")
|
||||
end
|
||||
|
||||
function UF:GetHealthBottomOffset(frame)
|
||||
local bottomOffset = 0
|
||||
if frame.USE_POWERBAR and not frame.POWERBAR_DETACHED and not frame.USE_INSET_POWERBAR then
|
||||
bottomOffset = bottomOffset + frame.POWERBAR_HEIGHT - (frame.BORDER-frame.SPACING)
|
||||
end
|
||||
if frame.USE_INFO_PANEL then
|
||||
bottomOffset = bottomOffset + frame.INFO_PANEL_HEIGHT - (frame.BORDER-frame.SPACING)
|
||||
end
|
||||
|
||||
return bottomOffset
|
||||
end
|
||||
|
||||
function UF:PostUpdateHealth(unit, min, max)
|
||||
local parent = self:GetParent()
|
||||
if parent.isForced then
|
||||
min = random(1, max)
|
||||
self:SetValue(min)
|
||||
end
|
||||
|
||||
local r, g, b = self:GetStatusBarColor()
|
||||
local colors = E.db["unitframe"]["colors"]
|
||||
if ((colors.healthclass == true and colors.colorhealthbyvalue == true) or (colors.colorhealthbyvalue and parent.isForced)) and not (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
|
||||
local newr, newg, newb = ElvUF.ColorGradient(min, max, 1, 0, 0, 1, 1, 0, r, g, b)
|
||||
|
||||
self:SetStatusBarColor(newr, newg, newb)
|
||||
if self.bg and self.bg.multiplier then
|
||||
local mu = self.bg.multiplier
|
||||
self.bg:SetVertexColor(newr * mu, newg * mu, newb * mu)
|
||||
end
|
||||
end
|
||||
|
||||
if colors.classbackdrop then
|
||||
local reaction = UnitReaction(unit, "player")
|
||||
local t
|
||||
if UnitIsPlayer(unit) then
|
||||
local _, class = UnitClass(unit)
|
||||
t = parent.colors.class[class]
|
||||
elseif(reaction) then
|
||||
t = parent.colors.reaction[reaction]
|
||||
end
|
||||
|
||||
if t then
|
||||
self.bg:SetVertexColor(t[1], t[2], t[3])
|
||||
end
|
||||
end
|
||||
|
||||
--Backdrop
|
||||
if colors.customhealthbackdrop then
|
||||
local backdrop = colors.health_backdrop
|
||||
self.bg:SetVertexColor(backdrop.r, backdrop.g, backdrop.b)
|
||||
end
|
||||
|
||||
if colors.useDeadBackdrop and UnitIsDeadOrGhost(unit) then
|
||||
local backdrop = colors.health_backdrop_dead
|
||||
self.bg:SetVertexColor(backdrop.r, backdrop.g, backdrop.b)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,49 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
function UF:Construct_InfoPanel(frame)
|
||||
local infoPanel = CreateFrame("Frame", nil, frame)
|
||||
|
||||
infoPanel:SetFrameLevel(7) --Health is 10 and filled power is 5 by default
|
||||
local thinBorders = self.thinBorders
|
||||
E:CreateBackdrop(infoPanel, "Default", true, nil, thinBorders, true)
|
||||
|
||||
return infoPanel
|
||||
end
|
||||
|
||||
function UF:Configure_InfoPanel(frame, noTemplateChange)
|
||||
if not frame.VARIABLES_SET then return end
|
||||
local db = frame.db
|
||||
|
||||
if frame.USE_INFO_PANEL then
|
||||
frame.InfoPanel:Show()
|
||||
frame.InfoPanel:ClearAllPoints()
|
||||
|
||||
if frame.ORIENTATION == "RIGHT" then
|
||||
frame.InfoPanel:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -frame.BORDER - frame.SPACING, frame.BORDER + frame.SPACING)
|
||||
if frame.USE_POWERBAR and not frame.USE_INSET_POWERBAR and not frame.POWERBAR_DETACHED then
|
||||
frame.InfoPanel:SetPoint("TOPLEFT", frame.Power.backdrop, "BOTTOMLEFT", frame.BORDER, -(frame.SPACING*3))
|
||||
else
|
||||
frame.InfoPanel:SetPoint("TOPLEFT", frame.Health.backdrop, "BOTTOMLEFT", frame.BORDER, -(frame.SPACING*3))
|
||||
end
|
||||
else
|
||||
frame.InfoPanel:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.BORDER + frame.SPACING, frame.BORDER + frame.SPACING)
|
||||
if frame.USE_POWERBAR and not frame.USE_INSET_POWERBAR and not frame.POWERBAR_DETACHED then
|
||||
frame.InfoPanel:SetPoint("TOPRIGHT", frame.Power.backdrop, "BOTTOMRIGHT", -frame.BORDER, -(frame.SPACING*3))
|
||||
else
|
||||
frame.InfoPanel:SetPoint("TOPRIGHT", frame.Health.backdrop, "BOTTOMRIGHT", -frame.BORDER, -(frame.SPACING*3))
|
||||
end
|
||||
end
|
||||
|
||||
if not noTemplateChange then
|
||||
local thinBorders = self.thinBorders
|
||||
if db.infoPanel.transparent then
|
||||
E:SetTemplate(frame.InfoPanel.backdrop, "Transparent", nil, nil, thinBorders, true)
|
||||
else
|
||||
E:SetTemplate(frame.InfoPanel.backdrop, "Default", true, nil, thinBorders, true)
|
||||
end
|
||||
end
|
||||
else
|
||||
frame.InfoPanel:Hide()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||||
<Script file="CombatIndicator.lua"/>
|
||||
<Script file="Health.lua"/>
|
||||
<Script file="Name.lua"/>
|
||||
<Script file="Portrait.lua"/>
|
||||
<Script file="Power.lua"/>
|
||||
<Script file="InfoPanel.lua"/>
|
||||
<Script file="RaidIcon.lua"/>
|
||||
<Script file="RaidRoleIcons.lua"/>
|
||||
<Script file="RestingIndicator.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,48 @@
|
||||
local E, L, V, P, G = unpack(ElvUI);
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
local UnitIsPlayer = UnitIsPlayer
|
||||
|
||||
function UF:Construct_NameText(frame)
|
||||
local name = frame.RaisedElementParent:CreateFontString(nil, "OVERLAY")
|
||||
UF:Configure_FontString(name)
|
||||
name:SetPoint("CENTER", frame.Health)
|
||||
|
||||
return name
|
||||
end
|
||||
|
||||
function UF:UpdateNameSettings(frame, childType)
|
||||
local db = frame.db
|
||||
if childType == "pet" then
|
||||
db = frame.db.petsGroup
|
||||
elseif childType == "target" then
|
||||
db = frame.db.targetsGroup
|
||||
end
|
||||
|
||||
local name = frame.Name
|
||||
if not db.power or not db.power.enable or not db.power.hideonnpc then
|
||||
local attachPoint = self:GetObjectAnchorPoint(frame, db.name.attachTextTo)
|
||||
name:ClearAllPoints()
|
||||
name:SetPoint(db.name.position, attachPoint, db.name.position, db.name.xOffset, db.name.yOffset)
|
||||
end
|
||||
|
||||
frame:Tag(name, db.name.text_format)
|
||||
end
|
||||
|
||||
function UF:PostNamePosition(frame, unit)
|
||||
if not frame.Power.value:IsShown() then return end
|
||||
local db = frame.db
|
||||
if UnitIsPlayer(unit) or (db.power and not db.power.enable) then
|
||||
local position = db.name.position
|
||||
local attachPoint = self:GetObjectAnchorPoint(frame, db.name.attachTextTo)
|
||||
frame.Power.value:SetAlpha(1)
|
||||
|
||||
frame.Name:ClearAllPoints()
|
||||
frame.Name:SetPoint(position, attachPoint, position, db.name.xOffset, db.name.yOffset)
|
||||
else
|
||||
frame.Power.value:SetAlpha(db.power.hideonnpc and 0 or 1)
|
||||
|
||||
frame.Name:ClearAllPoints()
|
||||
frame.Name:SetPoint(frame.Power.value:GetPoint())
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,119 @@
|
||||
local E, L, V, P, G = unpack(ElvUI);
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
local CreateFrame = CreateFrame;
|
||||
|
||||
function UF:Construct_Portrait(frame, type)
|
||||
local portrait;
|
||||
if(type == "texture") then
|
||||
local backdrop = CreateFrame("Frame", nil, frame);
|
||||
portrait = frame:CreateTexture(nil, "OVERLAY");
|
||||
portrait:SetTexCoord(0.15, 0.85, 0.15, 0.85);
|
||||
E:SetOutside(backdrop, portrait);
|
||||
backdrop:SetFrameLevel(frame:GetFrameLevel());
|
||||
E:SetTemplate(backdrop, "Default");
|
||||
portrait.backdrop = backdrop;
|
||||
else
|
||||
portrait = CreateFrame("PlayerModel", nil, frame);
|
||||
E:CreateBackdrop(portrait, "Default", nil, nil, self.thinBorders, true)
|
||||
end
|
||||
|
||||
portrait.PostUpdate = self.PortraitUpdate;
|
||||
|
||||
portrait.overlay = CreateFrame("Frame", nil, frame);
|
||||
portrait.overlay:SetFrameLevel(frame.Health:GetFrameLevel() + 5);
|
||||
|
||||
return portrait;
|
||||
end
|
||||
|
||||
function UF:Configure_Portrait(frame, dontHide)
|
||||
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();
|
||||
end
|
||||
frame.Portrait = db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D;
|
||||
|
||||
local portrait = frame.Portrait;
|
||||
if(frame.USE_PORTRAIT) then
|
||||
if(not frame:IsElementEnabled("Portrait")) then
|
||||
frame:EnableElement("Portrait", frame.unit);
|
||||
end
|
||||
|
||||
local color = E.db.unitframe.colors.borderColor
|
||||
portrait.backdrop:SetBackdropBorderColor(color.r, color.g, color.b)
|
||||
|
||||
portrait:ClearAllPoints();
|
||||
portrait.backdrop:ClearAllPoints();
|
||||
if(frame.USE_PORTRAIT_OVERLAY) then
|
||||
if(db.portrait.style == "3D") then
|
||||
portrait:SetFrameLevel(frame.Health:GetFrameLevel() + 1);
|
||||
else
|
||||
portrait:SetParent(frame.Health);
|
||||
end
|
||||
|
||||
portrait:SetAllPoints(frame.Health);
|
||||
|
||||
portrait:SetPoint("TOPLEFT", frame.Health, "TOPLEFT", - frame.BORDER - frame.SPACING, -(frame.BORDER + frame.SPACING))
|
||||
portrait:SetPoint("BOTTOMLEFT", frame.Health, "BOTTOMLEFT", - frame.BORDER - frame.SPACING, -(frame.BORDER + frame.SPACING))
|
||||
|
||||
portrait:SetAlpha(0.35);
|
||||
if(not dontHide) then
|
||||
portrait:Show();
|
||||
end
|
||||
portrait.backdrop:Hide();
|
||||
else
|
||||
portrait:SetAlpha(1);
|
||||
if(not dontHide) then
|
||||
portrait:Show();
|
||||
end
|
||||
portrait.backdrop:Show();
|
||||
if(db.portrait.style == "3D") then
|
||||
portrait:SetFrameLevel(frame.Health:GetFrameLevel() - 4);
|
||||
else
|
||||
portrait:SetParent(frame.Health);
|
||||
end
|
||||
|
||||
if(frame.ORIENTATION == "LEFT") then
|
||||
portrait.backdrop:SetPoint("TOPLEFT", frame, "TOPLEFT", frame.SPACING, frame.USE_MINI_CLASSBAR and -(frame.CLASSBAR_YOFFSET+frame.SPACING) or -frame.SPACING);
|
||||
|
||||
if(frame.USE_MINI_POWERBAR or frame.USE_POWERBAR_OFFSET or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR or frame.POWERBAR_DETACHED) then
|
||||
portrait.backdrop:SetPoint("BOTTOMRIGHT", frame.Health.backdrop, "BOTTOMLEFT", frame.BORDER - frame.SPACING*3, 0);
|
||||
else
|
||||
portrait.backdrop:SetPoint("BOTTOMRIGHT", frame.Power.backdrop, "BOTTOMLEFT", frame.BORDER - frame.SPACING*3, 0);
|
||||
end
|
||||
elseif(frame.ORIENTATION == "RIGHT") then
|
||||
portrait.backdrop:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.SPACING, frame.USE_MINI_CLASSBAR and -(frame.CLASSBAR_YOFFSET+frame.SPACING) or -frame.SPACING);
|
||||
|
||||
if(frame.USE_MINI_POWERBAR or frame.USE_POWERBAR_OFFSET or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR or frame.POWERBAR_DETACHED) then
|
||||
portrait.backdrop:SetPoint("BOTTOMLEFT", frame.Health.backdrop, "BOTTOMRIGHT", -frame.BORDER + frame.SPACING*3, 0);
|
||||
else
|
||||
portrait.backdrop:SetPoint("BOTTOMLEFT", frame.Power.backdrop, "BOTTOMRIGHT", -frame.BORDER + frame.SPACING*3, 0);
|
||||
end
|
||||
end
|
||||
|
||||
E:SetInside(portrait, portrait.backdrop, frame.BORDER);
|
||||
end
|
||||
else
|
||||
if(frame:IsElementEnabled("Portrait")) then
|
||||
frame:DisableElement("Portrait");
|
||||
portrait:Hide();
|
||||
portrait.backdrop:Hide();
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UF:PortraitUpdate()
|
||||
local db = self:GetParent().db;
|
||||
if(not db) then return; end
|
||||
|
||||
local portrait = db.portrait;
|
||||
if(portrait.enable and self:GetParent().USE_PORTRAIT_OVERLAY) then
|
||||
self:SetAlpha(0);
|
||||
self:SetAlpha(0.35);
|
||||
else
|
||||
self:SetAlpha(1)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,244 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local random = random
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
|
||||
local ns = oUF
|
||||
local ElvUF = ns.oUF
|
||||
assert(ElvUF, "ElvUI was unable to locate oUF.")
|
||||
|
||||
function UF:Construct_PowerBar(frame, bg, text, textPos)
|
||||
local power = CreateFrame("StatusBar", nil, frame)
|
||||
UF["statusbars"][power] = true
|
||||
|
||||
power.PostUpdate = self.PostUpdatePower
|
||||
|
||||
CreateStatusBarTexturePointer(power)
|
||||
|
||||
if bg then
|
||||
power.bg = power:CreateTexture(nil, "BORDER")
|
||||
power.bg:SetAllPoints()
|
||||
power.bg:SetTexture(E["media"].blankTex)
|
||||
power.bg.multiplier = 0.2
|
||||
end
|
||||
|
||||
if text then
|
||||
power.value = frame.RaisedElementParent:CreateFontString(nil, "OVERLAY")
|
||||
power.value.frequentUpdates = true
|
||||
|
||||
UF:Configure_FontString(power.value)
|
||||
|
||||
local x = -2
|
||||
if textPos == "LEFT" then
|
||||
x = 2
|
||||
end
|
||||
|
||||
power.value:SetPoint(textPos, frame.Health, textPos, x, 0)
|
||||
end
|
||||
|
||||
power.colorDisconnected = false
|
||||
power.colorTapping = false
|
||||
E:CreateBackdrop(power, "Default", nil, nil, self.thinBorders)
|
||||
|
||||
return power
|
||||
end
|
||||
|
||||
function UF:Configure_Power(frame)
|
||||
if not frame.VARIABLES_SET then return end
|
||||
local db = frame.db
|
||||
local power = frame.Power
|
||||
power.origParent = frame
|
||||
|
||||
if frame.USE_POWERBAR then
|
||||
if not frame:IsElementEnabled("Power") then
|
||||
frame:EnableElement("Power")
|
||||
power:Show()
|
||||
end
|
||||
|
||||
power.Smooth = self.db.smoothbars
|
||||
power.SmoothSpeed = self.db.smoothSpeed * 10
|
||||
|
||||
--Text
|
||||
local attachPoint = self:GetObjectAnchorPoint(frame, db.power.attachTextTo)
|
||||
power.value:ClearAllPoints()
|
||||
power.value:SetPoint(db.power.position, attachPoint, db.power.position, db.power.xOffset, db.power.yOffset)
|
||||
frame:Tag(power.value, db.power.text_format)
|
||||
|
||||
if db.power.attachTextTo == "Power" then
|
||||
power.value:SetParent(power)
|
||||
else
|
||||
power.value:SetParent(frame.RaisedElementParent)
|
||||
end
|
||||
|
||||
--Colors
|
||||
power.colorClass = nil
|
||||
power.colorReaction = nil
|
||||
power.colorPower = nil
|
||||
if self.db["colors"].powerclass then
|
||||
power.colorClass = true
|
||||
power.colorReaction = true
|
||||
else
|
||||
power.colorPower = true
|
||||
end
|
||||
|
||||
--Fix height in case it is lower than the theme allows
|
||||
local heightChanged = false
|
||||
if (not self.thinBorders and not E.PixelMode) and frame.POWERBAR_HEIGHT < 7 then --A height of 7 means 6px for borders and just 1px for the actual power statusbar
|
||||
frame.POWERBAR_HEIGHT = 7
|
||||
if db.power then db.power.height = 7 end
|
||||
heightChanged = true
|
||||
elseif (self.thinBorders or E.PixelMode) and frame.POWERBAR_HEIGHT < 3 then --A height of 3 means 2px for borders and just 1px for the actual power statusbar
|
||||
frame.POWERBAR_HEIGHT = 3
|
||||
if db.power then db.power.height = 3 end
|
||||
heightChanged = true
|
||||
end
|
||||
if heightChanged then
|
||||
--Update health size
|
||||
frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
|
||||
UF:Configure_HealthBar(frame)
|
||||
end
|
||||
|
||||
power:ClearAllPoints()
|
||||
if frame.POWERBAR_DETACHED then
|
||||
power:SetWidth(frame.POWERBAR_WIDTH - ((frame.BORDER + frame.SPACING)*2))
|
||||
power:SetHeight(frame.POWERBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
|
||||
if not power.Holder or (power.Holder and not power.Holder.mover) then
|
||||
power.Holder = CreateFrame("Frame", nil, power)
|
||||
power.Holder:SetWidth(frame.POWERBAR_WIDTH)
|
||||
power.Holder:SetHeight(frame.POWERBAR_HEIGHT)
|
||||
power.Holder:SetPoint("BOTTOM", frame, "BOTTOM", 0, -20)
|
||||
power:ClearAllPoints()
|
||||
power:SetPoint("BOTTOMLEFT", power.Holder, "BOTTOMLEFT", frame.BORDER+frame.SPACING, frame.BORDER+frame.SPACING)
|
||||
|
||||
if(frame.unitframeType and frame.unitframeType == "player") then
|
||||
E:CreateMover(power.Holder, "PlayerPowerBarMover", L["Player Powerbar"], nil, nil, nil, "ALL,SOLO")
|
||||
elseif(frame.unitframeType and frame.unitframeType == "target") then
|
||||
E:CreateMover(power.Holder, "TargetPowerBarMover", L["Target Powerbar"], nil, nil, nil, "ALL,SOLO")
|
||||
end
|
||||
else
|
||||
power.Holder:SetWidth(frame.POWERBAR_WIDTH)
|
||||
power.Holder:SetHeight(frame.POWERBAR_HEIGHT)
|
||||
power:ClearAllPoints()
|
||||
power:SetPoint("BOTTOMLEFT", power.Holder, "BOTTOMLEFT", frame.BORDER+frame.SPACING, frame.BORDER+frame.SPACING)
|
||||
power.Holder.mover:SetScale(1)
|
||||
power.Holder.mover:SetAlpha(1)
|
||||
end
|
||||
|
||||
power:SetFrameLevel(50) --RaisedElementParent uses 100, we want lower value to allow certain icons and texts to appear above power
|
||||
power.backdrop:SetFrameLevel(49)
|
||||
elseif frame.USE_POWERBAR_OFFSET then
|
||||
if frame.ORIENTATION == "LEFT" then
|
||||
power:SetPoint("TOPRIGHT", frame.Health, "TOPRIGHT", frame.POWERBAR_OFFSET, -frame.POWERBAR_OFFSET)
|
||||
power:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET))
|
||||
power:SetHeight(frame.UNIT_HEIGHT - (frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET) - (frame.BORDER + frame.SPACING + frame.CLASSBAR_YOFFSET))
|
||||
elseif frame.ORIENTATION == "MIDDLE" then
|
||||
power:SetWidth(frame.UNIT_WIDTH - frame.PORTRAIT_WIDTH - ((frame.BORDER + frame.SPACING) * 2))
|
||||
power:SetHeight(frame.UNIT_HEIGHT - (frame.POWERBAR_OFFSET + frame.CLASSBAR_YOFFSET) - frame.BORDER)
|
||||
power:SetPoint("TOPLEFT", frame, "TOPLEFT", frame.BORDER + frame.SPACING, -frame.POWERBAR_OFFSET -frame.CLASSBAR_YOFFSET)
|
||||
else
|
||||
power:SetWidth(frame.UNIT_WIDTH - frame.PORTRAIT_WIDTH - frame.POWERBAR_OFFSET)
|
||||
power:SetHeight(frame.UNIT_HEIGHT - frame.POWERBAR_OFFSET)
|
||||
power:SetPoint("TOPLEFT", frame.Health, "TOPLEFT", -frame.POWERBAR_OFFSET, -frame.POWERBAR_OFFSET)
|
||||
end
|
||||
power:SetFrameLevel(frame.Health:GetFrameLevel() -5) --Health uses 10
|
||||
power.backdrop:SetFrameLevel(frame.Health:GetFrameLevel() - 6)
|
||||
elseif frame.USE_INSET_POWERBAR then
|
||||
power:SetWidth(frame.UNIT_WIDTH - frame.PORTRAIT_WIDTH - ((frame.BORDER + (frame.BORDER*2)) * 2) - ((frame.BORDER + frame.SPACING) * 2))
|
||||
power:SetHeight(frame.POWERBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
|
||||
power:SetPoint("BOTTOMLEFT", frame.Health, "BOTTOMLEFT", frame.BORDER + (frame.BORDER*2), frame.BORDER + (frame.BORDER*2))
|
||||
|
||||
power:SetFrameLevel(50)
|
||||
power.backdrop:SetFrameLevel(49)
|
||||
elseif frame.USE_MINI_POWERBAR then
|
||||
power:SetHeight(frame.POWERBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
|
||||
|
||||
if frame.ORIENTATION == "LEFT" then
|
||||
power:SetWidth(frame.POWERBAR_WIDTH - frame.BORDER*2)
|
||||
power:SetPoint("RIGHT", frame, "BOTTOMRIGHT", -(frame.BORDER*2 + 4), ((frame.POWERBAR_HEIGHT-frame.BORDER)/2))
|
||||
elseif frame.ORIENTATION == "RIGHT" then
|
||||
power:SetWidth(frame.POWERBAR_WIDTH - frame.BORDER*2)
|
||||
power:SetPoint("LEFT", frame, "BOTTOMLEFT", (frame.BORDER*2 + 4), ((frame.POWERBAR_HEIGHT-frame.BORDER)/2))
|
||||
else
|
||||
power:SetWidth(frame.UNIT_WIDTH - ((frame.BORDER*2 + 4) * 2))
|
||||
power:SetHeight(frame.POWERBAR_HEIGHT - frame.BORDER*2)
|
||||
power:SetPoint("LEFT", frame, "BOTTOMLEFT", (frame.BORDER*2 + 4), ((frame.POWERBAR_HEIGHT-frame.BORDER)/2))
|
||||
end
|
||||
|
||||
power:SetFrameLevel(50)
|
||||
power.backdrop:SetFrameLevel(49)
|
||||
else
|
||||
power:SetPoint("TOPLEFT", frame.Health.backdrop, "BOTTOMLEFT", frame.BORDER, -frame.SPACING*3)
|
||||
power:SetWidth(frame.UNIT_WIDTH - (frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING) - (frame.BORDER + frame.SPACING))
|
||||
power:SetHeight(frame.POWERBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
|
||||
|
||||
power:SetFrameLevel(frame.Health:GetFrameLevel() - 5)
|
||||
power.backdrop:SetFrameLevel(frame.Health:GetFrameLevel() - 6)
|
||||
end
|
||||
|
||||
--Hide mover until we detach again
|
||||
if not frame.POWERBAR_DETACHED then
|
||||
if power.Holder and power.Holder.mover then
|
||||
power.Holder.mover:SetScale(0.0001)
|
||||
power.Holder.mover:SetAlpha(0)
|
||||
end
|
||||
end
|
||||
|
||||
if db.power.strataAndLevel and db.power.strataAndLevel.useCustomStrata then
|
||||
power:SetFrameStrata(db.power.strataAndLevel.frameStrata)
|
||||
else
|
||||
power:SetFrameStrata("LOW")
|
||||
end
|
||||
if db.power.strataAndLevel and db.power.strataAndLevel.useCustomLevel then
|
||||
power:SetFrameLevel(db.power.strataAndLevel.frameLevel)
|
||||
power.backdrop:SetFrameLevel(power:GetFrameLevel() - 1)
|
||||
end
|
||||
|
||||
if frame.POWERBAR_DETACHED and db.power.parent == "UIPARENT" then
|
||||
power:SetParent(E.UIParent)
|
||||
else
|
||||
power:SetParent(frame)
|
||||
end
|
||||
elseif frame:IsElementEnabled("Power") then
|
||||
frame:DisableElement("Power")
|
||||
power:Hide()
|
||||
frame:Tag(power.value, "")
|
||||
end
|
||||
|
||||
if frame.DruidAltMana then
|
||||
if db.power.druidMana then
|
||||
frame:EnableElement("DruidAltMana")
|
||||
else
|
||||
frame:DisableElement("DruidAltMana")
|
||||
frame.DruidAltMana:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
--Transparency Settings
|
||||
UF:ToggleTransparentStatusBar(UF.db.colors.transparentPower, frame.Power, frame.Power.bg)
|
||||
end
|
||||
|
||||
function UF:PostUpdatePower(unit, cur, max)
|
||||
local parent = self:GetParent()
|
||||
|
||||
if parent.isForced then
|
||||
local pType = random(0, 3)
|
||||
local color = ElvUF["colors"].power[pType]
|
||||
cur = random(1, max)
|
||||
self:SetValue(cur)
|
||||
|
||||
if not self.colorClass then
|
||||
self:SetStatusBarColor(color[1], color[2], color[3])
|
||||
local mu = self.bg.multiplier or 1
|
||||
self.bg:SetVertexColor(color[1] * mu, color[2] * mu, color[3] * mu)
|
||||
end
|
||||
end
|
||||
|
||||
local db = parent.db
|
||||
if db and db.power and db.power.hideonnpc then
|
||||
UF:PostNamePosition(parent, unit)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,32 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
function UF:Construct_RaidIcon(frame)
|
||||
local tex = frame.RaisedElementParent.TextureParent:CreateTexture(nil, "OVERLAY")
|
||||
tex:SetTexture([[Interface\AddOns\ElvUI\media\textures\raidicons]])
|
||||
tex:SetWidth(18)
|
||||
tex:SetHeight(18)
|
||||
tex:SetPoint("CENTER", frame.Health, "TOP", 0, 2)
|
||||
tex.SetTexture = E.noop
|
||||
|
||||
return tex
|
||||
end
|
||||
|
||||
function UF:Configure_RaidIcon(frame)
|
||||
local RI = frame.RaidTargetIndicator
|
||||
local db = frame.db
|
||||
|
||||
if db.raidicon.enable then
|
||||
frame:EnableElement("RaidTargetIndicator")
|
||||
RI:Show()
|
||||
RI:SetWidth(db.raidicon.size)
|
||||
RI:SetHeight(db.raidicon.size)
|
||||
|
||||
local attachPoint = self:GetObjectAnchorPoint(frame, db.raidicon.attachToObject)
|
||||
RI:ClearAllPoints()
|
||||
RI:SetPoint(db.raidicon.attachTo, attachPoint, db.raidicon.attachTo, db.raidicon.xOffset, db.raidicon.yOffset)
|
||||
else
|
||||
frame:DisableElement("RaidTargetIndicator")
|
||||
RI:Hide()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,94 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
|
||||
function UF:Construct_RaidRoleFrames(frame)
|
||||
local anchor = CreateFrame("Frame", nil, frame.RaisedElementParent)
|
||||
frame.LeaderIndicator = anchor:CreateTexture(nil, "OVERLAY")
|
||||
frame.AssistantIndicator = anchor:CreateTexture(nil, "OVERLAY")
|
||||
frame.MasterLooterIndicator = anchor:CreateTexture(nil, "OVERLAY")
|
||||
|
||||
anchor:SetWidth(24)
|
||||
anchor:SetHeight(12)
|
||||
frame.LeaderIndicator:SetWidth(12)
|
||||
frame.LeaderIndicator:SetHeight(12)
|
||||
frame.AssistantIndicator:SetWidth(12)
|
||||
frame.AssistantIndicator:SetHeight(12)
|
||||
frame.MasterLooterIndicator:SetWidth(11)
|
||||
frame.MasterLooterIndicator:SetHeight(11)
|
||||
|
||||
frame.LeaderIndicator.PostUpdate = UF.RaidRoleUpdate
|
||||
frame.AssistantIndicator.PostUpdate = UF.RaidRoleUpdate
|
||||
frame.MasterLooterIndicator.PostUpdate = UF.RaidRoleUpdate
|
||||
|
||||
return anchor
|
||||
end
|
||||
|
||||
function UF:Configure_RaidRoleIcons(frame)
|
||||
local raidRoleFrameAnchor = frame.RaidRoleFramesAnchor
|
||||
|
||||
if frame.db.raidRoleIcons.enable then
|
||||
raidRoleFrameAnchor:Show()
|
||||
if not frame:IsElementEnabled("LeaderIndicator") then
|
||||
frame:EnableElement("LeaderIndicator")
|
||||
frame:EnableElement("MasterLooterIndicator")
|
||||
frame:EnableElement("AssistantIndicator")
|
||||
end
|
||||
|
||||
raidRoleFrameAnchor:ClearAllPoints()
|
||||
if frame.db.raidRoleIcons.position == "TOPLEFT" then
|
||||
raidRoleFrameAnchor:SetPoint("LEFT", frame.Health, "TOPLEFT", 2, 0)
|
||||
else
|
||||
raidRoleFrameAnchor:SetPoint("RIGHT", frame, "TOPRIGHT", -2, 0)
|
||||
end
|
||||
elseif frame:IsElementEnabled("LeaderIndicator") then
|
||||
raidRoleFrameAnchor:Hide()
|
||||
frame:DisableElement("LeaderIndicator")
|
||||
frame:DisableElement("MasterLooterIndicator")
|
||||
frame:DisableElement("AssistantIndicator")
|
||||
end
|
||||
end
|
||||
|
||||
function UF:RaidRoleUpdate()
|
||||
local anchor = self:GetParent()
|
||||
local frame = anchor:GetParent():GetParent()
|
||||
local leader = frame.LeaderIndicator
|
||||
local assistant = frame.AssistantIndicator
|
||||
local masterLooter = frame.MasterLooterIndicator
|
||||
|
||||
if not leader or not masterLooter or not assistant then return; end
|
||||
|
||||
local db = frame.db
|
||||
local isLeader = leader:IsShown()
|
||||
local isMasterLooter = masterLooter:IsShown()
|
||||
local isAssist = assistant:IsShown()
|
||||
|
||||
leader:ClearAllPoints()
|
||||
assistant:ClearAllPoints()
|
||||
masterLooter:ClearAllPoints()
|
||||
|
||||
if db and db.raidRoleIcons then
|
||||
if isLeader and db.raidRoleIcons.position == "TOPLEFT" then
|
||||
leader:SetPoint("LEFT", anchor, "LEFT")
|
||||
masterLooter:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
elseif isLeader and db.raidRoleIcons.position == "TOPRIGHT" then
|
||||
leader:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
masterLooter:SetPoint("LEFT", anchor, "LEFT")
|
||||
elseif isAssist and db.raidRoleIcons.position == "TOPLEFT" then
|
||||
assistant:SetPoint("LEFT", anchor, "LEFT")
|
||||
masterLooter:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
elseif isAssist and db.raidRoleIcons.position == "TOPRIGHT" then
|
||||
assistant:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
masterLooter:SetPoint("LEFT", anchor, "LEFT")
|
||||
elseif isMasterLooter and db.raidRoleIcons.position == "TOPLEFT" then
|
||||
masterLooter:SetPoint("LEFT", anchor, "LEFT")
|
||||
else
|
||||
masterLooter:SetPoint("RIGHT", anchor, "RIGHT")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,40 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
|
||||
--WoW API / Variables
|
||||
|
||||
function UF:Construct_RestingIndicator(frame)
|
||||
local resting = frame.RaisedElementParent.TextureParent:CreateTexture(nil, "OVERLAY")
|
||||
resting:SetWidth(22)
|
||||
resting:SetHeight(22)
|
||||
|
||||
return resting
|
||||
end
|
||||
|
||||
function UF:Configure_RestingIndicator(frame)
|
||||
if not frame.VARIABLES_SET then return end
|
||||
local rIcon = frame.RestingIndicator
|
||||
local db = frame.db
|
||||
if db.restIcon then
|
||||
if not frame:IsElementEnabled("RestingIndicator") then
|
||||
frame:EnableElement("RestingIndicator")
|
||||
end
|
||||
|
||||
rIcon:ClearAllPoints()
|
||||
if frame.ORIENTATION == "RIGHT" then
|
||||
rIcon:SetPoint("CENTER", frame.Health, "TOPLEFT", -3, 6)
|
||||
else
|
||||
if frame.USE_PORTRAIT and not frame.USE_PORTRAIT_OVERLAY then
|
||||
rIcon:SetPoint("CENTER", frame.Portrait, "TOPLEFT", -3, 6)
|
||||
else
|
||||
rIcon:SetPoint("CENTER", frame.Health, "TOPLEFT", -3, 6)
|
||||
end
|
||||
end
|
||||
elseif frame:IsElementEnabled("RestingIndicator") then
|
||||
frame:DisableElement("RestingIndicator")
|
||||
rIcon:Hide()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user