mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
unitframes
This commit is contained in:
@@ -42,7 +42,7 @@ local function Update(self, event)
|
||||
end
|
||||
|
||||
local unit = self.unit
|
||||
local isAssistant = UnitInRaid(unit) and UnitIsRaidOfficer(unit) and not UnitIsPartyLeader(unit)
|
||||
local isAssistant = UnitInRaid(unit) and not UnitIsPartyLeader(unit)
|
||||
if(isAssistant) then
|
||||
element:Show()
|
||||
else
|
||||
@@ -68,7 +68,7 @@ local function Path(self, ...)
|
||||
* event - the event triggering the update (string)
|
||||
* ... - the arguments accompanying the event (string)
|
||||
--]]
|
||||
return (self.AssistantIndicator.Override or Update) (self, ...)
|
||||
return (self.AssistantIndicator.Override or Update) (self, unpack(arg))
|
||||
end
|
||||
|
||||
local function ForceUpdate(element)
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<Script file="power.lua"/>
|
||||
<!--<Script file="auras.lua"/>-->
|
||||
<Script file="health.lua"/>
|
||||
<!--<Script file="raidtargetindicator.lua"/>
|
||||
<Script file="raidtargetindicator.lua"/>
|
||||
<Script file="leaderindicator.lua"/>
|
||||
<Script file="combatindicator.lua"/>
|
||||
<!--<Script file="combatindicator.lua"/>
|
||||
<Script file="restingindicator.lua"/>
|
||||
<Script file="pvpindicator.lua"/>-->
|
||||
<Script file="portrait.lua"/>
|
||||
@@ -12,9 +12,9 @@
|
||||
<Script file="range.lua"/>
|
||||
<Script file="castbar.lua"/>-->
|
||||
<Script file="tags.lua"/>
|
||||
<!-- <Script file="masterlooterindicator.lua"/>
|
||||
<Script file="masterlooterindicator.lua"/>
|
||||
<Script file="assistantindicator.lua"/>
|
||||
<Script file="readycheckindicator.lua"/>
|
||||
<!--<Script file="readycheckindicator.lua"/>
|
||||
<Script file="combopoints.lua"/>
|
||||
<Script file="raidroleindicator.lua"/>
|
||||
<Script file="happinessindicator.lua"/>
|
||||
|
||||
@@ -68,7 +68,7 @@ local function Path(self, ...)
|
||||
* event - the event triggering the update (string)
|
||||
* ... - the arguments accompanying the event
|
||||
--]]
|
||||
return (self.LeaderIndicator.Override or Update) (self, ...)
|
||||
return (self.LeaderIndicator.Override or Update) (self, unpack(arg))
|
||||
end
|
||||
|
||||
local function ForceUpdate(element)
|
||||
|
||||
@@ -89,7 +89,7 @@ local function Path(self, ...)
|
||||
* event - the event triggering the update (string)
|
||||
* ... - the arguments accompanying the event
|
||||
--]]
|
||||
return (self.MasterLooterIndicator.Override or Update) (self, ...)
|
||||
return (self.MasterLooterIndicator.Override or Update) (self, unpack(arg))
|
||||
end
|
||||
|
||||
local function ForceUpdate(element)
|
||||
|
||||
@@ -66,7 +66,7 @@ local function Path(self, ...)
|
||||
* self - the parent object
|
||||
* event - the event triggering the update (string)
|
||||
--]]
|
||||
return (self.RaidTargetIndicator.Override or Update) (self, ...)
|
||||
return (self.RaidTargetIndicator.Override or Update) (self, unpack(arg))
|
||||
end
|
||||
|
||||
local function ForceUpdate(element)
|
||||
|
||||
@@ -104,6 +104,9 @@ for k, v in next, {
|
||||
* unit - unit to be passed to the element's Enable function. Defaults to the frame's unit (string?)
|
||||
--]]
|
||||
EnableElement = function(self, name, unit)
|
||||
local unit = unit or self.unit
|
||||
if not unit then return end
|
||||
|
||||
argcheck(name, 2, 'string')
|
||||
argcheck(unit or self.unit, 3, 'string', 'nil')
|
||||
|
||||
@@ -312,9 +315,11 @@ local function initObject(unit, style, styleFunc, header, ...)
|
||||
else
|
||||
-- Used to update frames when they change position in a group.
|
||||
object:RegisterEvent('RAID_ROSTER_UPDATE', object.UpdateAllElements)
|
||||
|
||||
object:SetScript("OnClick", function()
|
||||
TargetUnit(object.unit)
|
||||
end)
|
||||
|
||||
if(num > 1) then
|
||||
if(object:GetParent() == header) then
|
||||
object.hasChildren = true
|
||||
|
||||
@@ -92,15 +92,13 @@ function SecureGroupHeader_OnEvent()
|
||||
end
|
||||
end
|
||||
|
||||
-- relativePoint, xMultiplier, yMultiplier = getRelativePointAnchor( point )
|
||||
-- relativePoint, xMultiplier, yMultiplier = getRelativePointAnchor(point)
|
||||
-- Given a point return the opposite point and which axes the point
|
||||
-- depends on.
|
||||
local function getRelativePointAnchor( point )
|
||||
if not point then return end
|
||||
|
||||
local function getRelativePointAnchor(point)
|
||||
point = strupper(point)
|
||||
if point == "TOP" then
|
||||
return "BOTTOM", 0, -1;
|
||||
return "BOTTOM", 0, -1
|
||||
elseif point == "BOTTOM" then
|
||||
return "TOP", 0, 1
|
||||
elseif point == "LEFT" then
|
||||
@@ -120,21 +118,8 @@ local function getRelativePointAnchor( point )
|
||||
end
|
||||
end
|
||||
|
||||
function ApplyUnitButtonConfiguration( frame )
|
||||
-- for i = 1, getn(arg), 1 do
|
||||
-- local frame = arg[i];
|
||||
|
||||
--if ( unitWatch ) then
|
||||
-- if ( unitWatch == "state" ) then
|
||||
-- RegisterUnitWatch(frame, true);
|
||||
-- else
|
||||
RegisterUnitWatch(frame);
|
||||
-- end
|
||||
--end
|
||||
|
||||
-- call this function recursively for the current frame's children
|
||||
-- ApplyUnitButtonConfiguration(frame:GetChildren());
|
||||
-- end
|
||||
function ApplyUnitButtonConfiguration(frame)
|
||||
RegisterUnitWatch(frame)
|
||||
end
|
||||
|
||||
local function ApplyConfig(header, newChild, defaultConfigFunction)
|
||||
@@ -185,7 +170,7 @@ local function configureChildren(self)
|
||||
local xMultiplier, yMultiplier = abs(xOffsetMult), abs(yOffsetMult)
|
||||
local xOffset = self:GetAttribute("xOffset") or 0 --default of 0
|
||||
local yOffset = self:GetAttribute("yOffset") or 0 --default of 0
|
||||
local sortDir = self:GetAttribute("sortDir") or "ASC"; --sort ascending by default
|
||||
local sortDir = self:GetAttribute("sortDir") or "ASC" --sort ascending by default
|
||||
local columnSpacing = self:GetAttribute("columnSpacing") or 0
|
||||
local startingIndex = self:GetAttribute("startingIndex") or 1
|
||||
|
||||
@@ -248,7 +233,7 @@ local function configureChildren(self)
|
||||
columnNum = columnNum + 1
|
||||
end
|
||||
|
||||
local unitButton = self:GetAttribute("child"..buttonNum);
|
||||
local unitButton = self:GetAttribute("child"..buttonNum)
|
||||
unitButton:Hide()
|
||||
unitButton:ClearAllPoints()
|
||||
if buttonNum == 1 then
|
||||
@@ -304,7 +289,7 @@ local function GetGroupHeaderType(self)
|
||||
local nRaid = GetNumRaidMembers()
|
||||
local nParty = GetNumPartyMembers()
|
||||
if nRaid > 0 and self:GetAttribute("showRaid") then
|
||||
type = "RAID";
|
||||
type = "RAID"
|
||||
elseif (nRaid > 0 or nParty > 0) and self:GetAttribute("showParty") then
|
||||
type = "PARTY"
|
||||
elseif self:GetAttribute("showSolo") then
|
||||
@@ -366,13 +351,13 @@ function SecureGroupHeader_Update(self)
|
||||
end
|
||||
|
||||
if not groupFilter and not nameList then
|
||||
groupFilter = "1,2,3,4,5,6,7,8";
|
||||
groupFilter = "1,2,3,4,5,6,7,8"
|
||||
end
|
||||
|
||||
if groupFilter then
|
||||
-- filtering by a list of group numbers and/or classes
|
||||
fillTable(tokenTable, strsplit(",", groupFilter));
|
||||
local strictFiltering = self:GetAttribute("strictFiltering"); -- non-strict by default
|
||||
fillTable(tokenTable, strsplit(",", groupFilter))
|
||||
local strictFiltering = self:GetAttribute("strictFiltering") -- non-strict by default
|
||||
for i = start, stop, 1 do
|
||||
local unit, name, subgroup, className = GetGroupRosterInfo(type, i)
|
||||
if name and ((not strictFiltering) and (tokenTable[subgroup] or tokenTable[className])) or (tokenTable[subgroup] and tokenTable[className]) then
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local B = E:GetModule("Bags");
|
||||
local Search = LibStub("LibItemSearch-1.2");
|
||||
local Search = LibStub("LibItemSearch-1.2", true);
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local ipairs, pairs, tonumber, select, unpack = ipairs, pairs, tonumber, select, unpack
|
||||
local tinsert, tremove, tsort, twipe = table.insert, table.remove, table.sort, table.wipe
|
||||
local floor = math.floor
|
||||
local floor, mod = math.floor, math.mod
|
||||
local band = bit.band
|
||||
local match, gmatch, find = string.match, string.gmatch, string.find
|
||||
--WoW API / Variables
|
||||
@@ -371,7 +371,7 @@ function B:Encode_BagSlot(bag, slot)
|
||||
end
|
||||
|
||||
function B:Decode_BagSlot(int)
|
||||
return floor(int/100), int % 100
|
||||
return floor(int/100), mod(int, 100)
|
||||
end
|
||||
|
||||
function B:IsPartial(bag, slot)
|
||||
@@ -385,7 +385,7 @@ end
|
||||
|
||||
function B:DecodeMove(move)
|
||||
local s = floor(move/10000)
|
||||
local t = move%10000
|
||||
local t = mod(move,10000)
|
||||
s = (t>9000) and (s+1) or s
|
||||
t = (t>9000) and (t-10000) or t
|
||||
return s, t
|
||||
@@ -444,8 +444,8 @@ function B:CanItemGoInBag(bag, slot, targetBag)
|
||||
end
|
||||
|
||||
function B.Compress(...)
|
||||
for i=1, select("#", ...) do
|
||||
local bags = select(i, ...)
|
||||
for i=1, getn(arg) do
|
||||
local bags = arg[i]
|
||||
B.Stack(bags, bags, B.IsPartial)
|
||||
end
|
||||
end
|
||||
@@ -495,7 +495,7 @@ local blackList = {}
|
||||
local blackListQueries = {}
|
||||
|
||||
local function buildBlacklist(...)
|
||||
for entry in pairs(...) do
|
||||
for entry in pairs(arg) do
|
||||
local itemName = GetItemInfo(entry)
|
||||
if(itemName) then
|
||||
blackList[itemName] = true
|
||||
@@ -625,8 +625,8 @@ function B.Fill(sourceBags, targetBags, reverse, canMove)
|
||||
end
|
||||
|
||||
function B.SortBags(...)
|
||||
for i=1, select("#", ...) do
|
||||
local bags = select(i, ...)
|
||||
for i=1, getn(arg) do
|
||||
local bags = arg[i]
|
||||
for _, slotNum in ipairs(bags) do
|
||||
local bagType = B:IsSpecialtyBag(slotNum)
|
||||
if bagType == false then bagType = "Normal" end
|
||||
|
||||
@@ -4,4 +4,6 @@
|
||||
<Script file="Portrait.lua"/>
|
||||
<Script file="Power.lua"/>
|
||||
<Script file="InfoPanel.lua"/>
|
||||
<Script file="RaidIcon.lua"/>
|
||||
<Script file="RaidRoleIcons.lua"/>
|
||||
</Ui>
|
||||
@@ -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\TargetingFrame\UI-RaidTargetingIcons]])
|
||||
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
|
||||
@@ -4,11 +4,11 @@ local UF = E:GetModule("UnitFrames")
|
||||
local _G = _G
|
||||
local tinsert = table.insert
|
||||
|
||||
local CreateFrame = CreateFrame;
|
||||
local InCombatLockdown = InCombatLockdown;
|
||||
local UnregisterStateDriver = UnregisterStateDriver;
|
||||
local RegisterStateDriver = RegisterStateDriver;
|
||||
local IsInInstance = IsInInstance;
|
||||
local CreateFrame = CreateFrame
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
local UnregisterStateDriver = UnregisterStateDriver
|
||||
local RegisterStateDriver = RegisterStateDriver
|
||||
local IsInInstance = IsInInstance
|
||||
|
||||
local ns = oUF
|
||||
local ElvUF = ns.oUF
|
||||
@@ -21,17 +21,16 @@ function UF:Construct_PartyFrames()
|
||||
self.RaisedElementParent = CreateFrame("Frame", nil, self)
|
||||
self.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, self.RaisedElementParent)
|
||||
self.RaisedElementParent:SetFrameLevel(self:GetFrameLevel() + 100)
|
||||
self.BORDER = E.Border
|
||||
self.SPACING = E.Spacing
|
||||
self.SHADOW_SPACING = 3
|
||||
|
||||
self.Health = UF:Construct_HealthBar(self, true, true, "RIGHT");
|
||||
self.Power = UF:Construct_PowerBar(self, true, true, "LEFT");
|
||||
self.Power.frequentUpdates = false;
|
||||
self.Portrait3D = UF:Construct_Portrait(self, "model");
|
||||
self.Portrait2D = UF:Construct_Portrait(self, "texture");
|
||||
self.InfoPanel = UF:Construct_InfoPanel(self);
|
||||
self.Name = UF:Construct_NameText(self);
|
||||
self.Health = UF:Construct_HealthBar(self, true, true, "RIGHT")
|
||||
self.Power = UF:Construct_PowerBar(self, true, true, "LEFT")
|
||||
self.Power.frequentUpdates = false
|
||||
self.Portrait3D = UF:Construct_Portrait(self, "model")
|
||||
self.Portrait2D = UF:Construct_Portrait(self, "texture")
|
||||
self.InfoPanel = UF:Construct_InfoPanel(self)
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.RaidRoleFramesAnchor = UF:Construct_RaidRoleFrames(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
|
||||
self.unitframeType = "party"
|
||||
|
||||
@@ -52,37 +51,9 @@ function UF:Update_PartyHeader(header, db)
|
||||
|
||||
E:CreateMover(header, header:GetName().."Mover", L["Party Frames"], nil, nil, nil, "ALL,PARTY,ARENA")
|
||||
header.positioned = true
|
||||
|
||||
header:RegisterEvent("PLAYER_LOGIN")
|
||||
header:RegisterEvent("ZONE_CHANGED_NEW_AREA")
|
||||
header:SetScript("OnEvent", UF["PartySmartVisibility"])
|
||||
end
|
||||
|
||||
UF.PartySmartVisibility(header)
|
||||
end
|
||||
|
||||
function UF:PartySmartVisibility(event)
|
||||
--if(not self.db or (self.db and not self.db.enable) or (UF.db and not UF.db.smartRaidFilter) or self.isForced) then
|
||||
-- self.blockVisibilityChanges = false;
|
||||
-- return;
|
||||
--end
|
||||
|
||||
--if(event == "PLAYER_REGEN_ENABLED") then self:UnregisterEvent("PLAYER_REGEN_ENABLED"); end
|
||||
--self.blockVisibilityChanges = true;
|
||||
--if(not InCombatLockdown()) then
|
||||
-- local inInstance, instanceType = IsInInstance();
|
||||
-- if(inInstance and (instanceType == "raid" or instanceType == "pvp")) then
|
||||
-- UnregisterStateDriver(self, "visibility");
|
||||
-- self:Hide();
|
||||
-- self.blockVisibilityChanges = true;
|
||||
-- elseif(self.db.visibility) then
|
||||
-- RegisterStateDriver(self, "visibility", self.db.visibility);
|
||||
-- self.blockVisibilityChanges = false;
|
||||
-- end
|
||||
--else
|
||||
-- self:RegisterEvent("PLAYER_REGEN_ENABLED");
|
||||
--end
|
||||
end
|
||||
|
||||
function UF:Update_PartyFrames(frame, db)
|
||||
frame.db = db
|
||||
@@ -142,8 +113,11 @@ function UF:Update_PartyFrames(frame, db)
|
||||
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
frame:UpdateAllElements("ElvUI_UpdateAllElements");
|
||||
UF:Configure_RaidRoleIcons(frame)
|
||||
|
||||
frame:UpdateAllElements("ElvUI_UpdateAllElements")
|
||||
end
|
||||
|
||||
UF["headerstoload"]["party"] = true
|
||||
@@ -1,7 +1,7 @@
|
||||
local E, L, V, P, G = unpack(ElvUI)
|
||||
local UF = E:GetModule("UnitFrames")
|
||||
|
||||
local tinsert = table.insert;
|
||||
local tinsert = table.insert
|
||||
|
||||
local CreateFrame = CreateFrame
|
||||
local InCombatLockdown = InCombatLockdown
|
||||
@@ -22,83 +22,36 @@ function UF:Construct_RaidFrames()
|
||||
self.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, self.RaisedElementParent)
|
||||
self.RaisedElementParent:SetFrameLevel(self:GetFrameLevel() + 100)
|
||||
|
||||
self.Health = UF:Construct_HealthBar(self, true, true, "RIGHT");
|
||||
self.Power = UF:Construct_PowerBar(self, true, true, "LEFT");
|
||||
self.Power.frequentUpdates = false;
|
||||
self.Portrait3D = UF:Construct_Portrait(self, "model");
|
||||
self.Portrait2D = UF:Construct_Portrait(self, "texture");
|
||||
self.Name = UF:Construct_NameText(self);
|
||||
self.Health = UF:Construct_HealthBar(self, true, true, "RIGHT")
|
||||
self.Power = UF:Construct_PowerBar(self, true, true, "LEFT")
|
||||
self.Power.frequentUpdates = false
|
||||
self.Portrait3D = UF:Construct_Portrait(self, "model")
|
||||
self.Portrait2D = UF:Construct_Portrait(self, "texture")
|
||||
self.Name = UF:Construct_NameText(self)
|
||||
self.RaidRoleFramesAnchor = UF:Construct_RaidRoleFrames(self)
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self);
|
||||
|
||||
self.InfoPanel = UF:Construct_InfoPanel(self);
|
||||
UF:Update_StatusBars();
|
||||
UF:Update_FontStrings();
|
||||
self.unitframeType = "raid";
|
||||
self.InfoPanel = UF:Construct_InfoPanel(self)
|
||||
UF:Update_StatusBars()
|
||||
UF:Update_FontStrings()
|
||||
self.unitframeType = "raid"
|
||||
|
||||
UF:Update_RaidFrames(self, UF.db["units"]["raid"]);
|
||||
UF:Update_RaidFrames(self, UF.db["units"]["raid"])
|
||||
|
||||
return self;
|
||||
end
|
||||
|
||||
function UF:RaidSmartVisibility(event)
|
||||
--[[if(not self.db or (self.db and not self.db.enable) or (UF.db and not UF.db.smartRaidFilter) or self.isForced) then
|
||||
self.blockVisibilityChanges = false;
|
||||
return;
|
||||
end
|
||||
|
||||
if(event == "PLAYER_REGEN_ENABLED") then self:UnregisterEvent("PLAYER_REGEN_ENABLED"); end
|
||||
|
||||
if(not InCombatLockdown()) then
|
||||
self.isInstanceForced = nil;
|
||||
local inInstance, instanceType = IsInInstance();
|
||||
if(inInstance and (instanceType == "raid" or instanceType == "pvp")) then
|
||||
local _, _, _, _, maxPlayers = GetInstanceInfo();
|
||||
local mapID = GetCurrentMapAreaID();
|
||||
if(UF.mapIDs[mapID]) then
|
||||
maxPlayers = UF.mapIDs[mapID];
|
||||
end
|
||||
|
||||
UnregisterStateDriver(self, "visibility");
|
||||
|
||||
if(maxPlayers < 40) then
|
||||
self:Show();
|
||||
self.isInstanceForced = true;
|
||||
self.blockVisibilityChanges = false;
|
||||
if(ElvUF_Raid.numGroups ~= E:Round(maxPlayers/5) and event) then
|
||||
UF:CreateAndUpdateHeaderGroup("raid");
|
||||
end
|
||||
else
|
||||
self:Hide();
|
||||
self.blockVisibilityChanges = true;
|
||||
end
|
||||
elseif(self.db.visibility) then
|
||||
RegisterStateDriver(self, "visibility", self.db.visibility);
|
||||
self.blockVisibilityChanges = false;
|
||||
if(ElvUF_Raid.numGroups ~= self.db.numGroups) then
|
||||
UF:CreateAndUpdateHeaderGroup("raid");
|
||||
end
|
||||
end
|
||||
else
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED");
|
||||
return;
|
||||
end]]
|
||||
return self
|
||||
end
|
||||
|
||||
function UF:Update_RaidHeader(header, db)
|
||||
header.db = db;
|
||||
header.db = db
|
||||
|
||||
if not header.positioned then
|
||||
header:ClearAllPoints()
|
||||
header:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 4, 195)
|
||||
|
||||
E:CreateMover(header, header:GetName().."Mover", L["Raid Frames"], nil, nil, nil, "ALL,RAID")
|
||||
|
||||
-- header:RegisterEvent("PLAYER_LOGIN")
|
||||
-- header:RegisterEvent("ZONE_CHANGED_NEW_AREA")
|
||||
-- header:SetScript("OnEvent", UF["RaidSmartVisibility"])
|
||||
header.positioned = true
|
||||
end
|
||||
|
||||
--UF.RaidSmartVisibility(header)
|
||||
end
|
||||
|
||||
function UF:Update_RaidFrames(frame, db)
|
||||
@@ -161,6 +114,10 @@ function UF:Update_RaidFrames(frame, db)
|
||||
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
UF:Configure_RaidRoleIcons(frame)
|
||||
|
||||
frame:UpdateAllElements("ElvUI_UpdateAllElements")
|
||||
end
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ 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.InfoPanel = self:Construct_InfoPanel(frame)
|
||||
|
||||
frame:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOM", -413, 68)
|
||||
@@ -91,6 +91,8 @@ function UF:Update_PlayerFrame(frame, db)
|
||||
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
E:SetMoverSnapOffset(frame:GetName().."Mover", -(12 + db.castbar.height))
|
||||
frame:UpdateAllElements("ElvUI_UpdateAllElements")
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ function UF:Construct_TargetFrame(frame)
|
||||
|
||||
frame.Portrait3D = self:Construct_Portrait(frame, "model")
|
||||
frame.Portrait2D = self:Construct_Portrait(frame, "texture")
|
||||
|
||||
frame.RaidTargetIndicator = UF:Construct_RaidIcon(frame)
|
||||
frame.InfoPanel = self:Construct_InfoPanel(frame)
|
||||
|
||||
frame:SetPoint("BOTTOMRIGHT", E.UIParent, "BOTTOM", 413, 68)
|
||||
@@ -87,6 +87,8 @@ function UF:Update_TargetFrame(frame, db)
|
||||
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
E:SetMoverSnapOffset(frame:GetName().."Mover", -(12 + db.castbar.height))
|
||||
frame:UpdateAllElements("ElvUI_UpdateAllElements")
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ function UF:Construct_TargetTargetFrame(frame)
|
||||
frame.Name = self:Construct_NameText(frame)
|
||||
frame.Portrait3D = self:Construct_Portrait(frame, "model")
|
||||
frame.Portrait2D = self:Construct_Portrait(frame, "texture")
|
||||
|
||||
frame.RaidTargetIndicator = UF:Construct_RaidIcon(frame)
|
||||
frame.InfoPanel = self:Construct_InfoPanel(frame)
|
||||
|
||||
frame:SetPoint("BOTTOM", E.UIParent, "BOTTOM", 0, 75)
|
||||
@@ -72,6 +72,8 @@ function UF:Update_TargetTargetFrame(frame, db)
|
||||
|
||||
UF:Configure_Portrait(frame)
|
||||
|
||||
UF:Configure_RaidIcon(frame)
|
||||
|
||||
E:SetMoverSnapOffset(frame:GetName().."Mover", -(12 + self.db["units"].player.castbar.height))
|
||||
frame:UpdateAllElements("ElvUI_UpdateAllElements")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user