mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-28 00:44:45 +00:00
unitframes
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
|
||||
@@ -1,4 +1,5 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||||
<Script file="CombatIndicator.lua"/>
|
||||
<Script file="Health.lua"/>
|
||||
<Script file="Name.lua"/>
|
||||
<Script file="Portrait.lua"/>
|
||||
@@ -6,4 +7,5 @@
|
||||
<Script file="InfoPanel.lua"/>
|
||||
<Script file="RaidIcon.lua"/>
|
||||
<Script file="RaidRoleIcons.lua"/>
|
||||
<Script file="RestingIndicator.lua"/>
|
||||
</Ui>
|
||||
@@ -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
|
||||
@@ -23,6 +23,8 @@ function UF:Construct_PlayerFrame(frame)
|
||||
frame.Portrait3D = self:Construct_Portrait(frame, "model")
|
||||
frame.Portrait2D = self:Construct_Portrait(frame, "texture")
|
||||
frame.RaidTargetIndicator = UF:Construct_RaidIcon(frame)
|
||||
frame.RestingIndicator = self:Construct_RestingIndicator(frame)
|
||||
frame.CombatIndicator = self:Construct_CombatIndicator(frame)
|
||||
frame.InfoPanel = self:Construct_InfoPanel(frame)
|
||||
|
||||
frame:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOM", -413, 68)
|
||||
@@ -83,6 +85,10 @@ function UF:Update_PlayerFrame(frame, db)
|
||||
|
||||
UF:Configure_InfoPanel(frame)
|
||||
|
||||
UF:Configure_RestingIndicator(frame)
|
||||
|
||||
UF:Configure_CombatIndicator(frame)
|
||||
|
||||
UF:Configure_HealthBar(frame)
|
||||
|
||||
UF:UpdateNameSettings(frame)
|
||||
|
||||
Reference in New Issue
Block a user