mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
test range
This commit is contained in:
@@ -8,8 +8,7 @@
|
||||
<Script file="restingindicator.lua"/>
|
||||
<Script file="pvpindicator.lua"/>
|
||||
<Script file="portrait.lua"/>
|
||||
<!--
|
||||
<Script file="range.lua"/>-->
|
||||
<Script file="range.lua"/>
|
||||
<Script file="castbar.lua"/>
|
||||
<Script file="tags.lua"/>
|
||||
<Script file="masterlooterindicator.lua"/>
|
||||
|
||||
@@ -31,7 +31,8 @@ local oUF = ns.oUF
|
||||
local _FRAMES = {}
|
||||
local OnRangeFrame
|
||||
|
||||
local UnitInRange, UnitIsConnected = UnitInRange, UnitIsConnected
|
||||
local getn, tinsert, tremove = table.getn, table.insert, table.remove
|
||||
local CheckInteractDistance, UnitIsConnected = CheckInteractDistance, UnitIsConnected
|
||||
|
||||
local function Update(self, event)
|
||||
local element = self.Range
|
||||
@@ -49,7 +50,7 @@ local function Update(self, event)
|
||||
local inRange
|
||||
local connected = UnitIsConnected(unit)
|
||||
if(connected) then
|
||||
inRange = UnitInRange(unit)
|
||||
inRange = CheckInteractDistance(unit, 4)
|
||||
if(not inRange) then
|
||||
self:SetAlpha(element.outsideAlpha)
|
||||
else
|
||||
@@ -79,13 +80,13 @@ local function Path(self, ...)
|
||||
* self - the parent object
|
||||
* event - the event triggering the update (string)
|
||||
--]]
|
||||
return (self.Range.Override or Update) (self, ...)
|
||||
return (self.Range.Override or Update) (self, unpack(arg))
|
||||
end
|
||||
|
||||
-- Internal updating method
|
||||
local timer = 0
|
||||
local function OnRangeUpdate(_, elapsed)
|
||||
timer = timer + elapsed
|
||||
local function OnRangeUpdate()
|
||||
timer = timer + arg1
|
||||
|
||||
if(timer >= .20) then
|
||||
for _, object in next, _FRAMES do
|
||||
@@ -110,7 +111,7 @@ local function Enable(self)
|
||||
OnRangeFrame:SetScript('OnUpdate', OnRangeUpdate)
|
||||
end
|
||||
|
||||
table.insert(_FRAMES, self)
|
||||
tinsert(_FRAMES, self)
|
||||
OnRangeFrame:Show()
|
||||
|
||||
return true
|
||||
@@ -122,13 +123,13 @@ local function Disable(self)
|
||||
if(element) then
|
||||
for index, frame in next, _FRAMES do
|
||||
if(frame == self) then
|
||||
table.remove(_FRAMES, index)
|
||||
tremove(_FRAMES, index)
|
||||
break
|
||||
end
|
||||
end
|
||||
self:SetAlpha(element.insideAlpha)
|
||||
|
||||
if(#_FRAMES == 0) then
|
||||
if(getn(_FRAMES) == 0) then
|
||||
OnRangeFrame:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<Script file="PvPIndicator.lua"/>
|
||||
<Script file="RaidIcon.lua"/>
|
||||
<Script file="RaidRoleIcons.lua"/>
|
||||
<Script file="Range.lua"/>
|
||||
<Script file="RestingIndicator.lua"/>
|
||||
<Script file="FrameGlow.lua"/>
|
||||
</Ui>
|
||||
@@ -0,0 +1,24 @@
|
||||
local E, L, V, P, G = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
|
||||
function UF:Construct_Range()
|
||||
local Range = {insideAlpha = 1, outsideAlpha = E.db.unitframe.OORAlpha}
|
||||
Range.Override = UF.UpdateRange
|
||||
|
||||
return Range
|
||||
end
|
||||
|
||||
function UF:Configure_Range(frame)
|
||||
local range = frame.Range
|
||||
if frame.db.rangeCheck then
|
||||
if not frame:IsElementEnabled('Range') then
|
||||
frame:EnableElement('Range')
|
||||
end
|
||||
|
||||
range.outsideAlpha = E.db.unitframe.OORAlpha
|
||||
else
|
||||
if frame:IsElementEnabled('Range') then
|
||||
frame:DisableElement('Range')
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -31,6 +31,7 @@ function UF:Construct_PartyFrames()
|
||||
self.RaidTargetIndicator = UF:Construct_RaidIcon(self)
|
||||
|
||||
self.GPS = UF:Construct_GPS(self)
|
||||
self.Range = UF:Construct_Range(self)
|
||||
self.unitframeType = "party"
|
||||
|
||||
UF:Update_StatusBars()
|
||||
@@ -116,6 +117,8 @@ function UF:Update_PartyFrames(frame, db)
|
||||
|
||||
UF:Configure_RaidRoleIcons(frame)
|
||||
|
||||
UF:Configure_Range(frame)
|
||||
|
||||
frame:UpdateAllElements("ElvUI_UpdateAllElements")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user