mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-28 08:54:43 +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
|
||||
|
||||
Reference in New Issue
Block a user