Skip to content

Commit

Permalink
update cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunny67 committed Feb 23, 2017
1 parent be3be5b commit cee435f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ElvUI/modules/nameplates/nameplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local SetCVar = SetCVar;
local IsAddOnLoaded = IsAddOnLoaded;
local GetSpellInfo = GetSpellInfo;
local WorldFrame = WorldFrame;
local WorldGetNumChildren, WorldGetChildren = WorldFrame.GetNumChildren, WorldFrame.GetChildren;
local RAID_CLASS_COLORS = RAID_CLASS_COLORS;
local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS;
local COMBATLOG_OBJECT_CONTROL_PLAYER = COMBATLOG_OBJECT_CONTROL_PLAYER;
Expand Down Expand Up @@ -170,10 +171,10 @@ function mod:SetTargetIndicator()
end

function mod:OnUpdate(elapsed)
local count = WorldFrame:GetNumChildren();
local count = WorldGetNumChildren(WorldFrame);
if(count ~= numChildren) then
for i = numChildren + 1, count do
local frame = select(i, WorldFrame:GetChildren())
local frame = select(i, WorldGetChildren(WorldFrame))
local region = frame:GetRegions();

if(not mod.CreatedPlates[frame] and region and region:GetObjectType() == "Texture" and region:GetTexture() == OVERLAY) then
Expand Down Expand Up @@ -1067,9 +1068,7 @@ function mod:Initialize()
if(E.private["nameplate"].enable ~= true) then return; end

self.PlateParent = CreateFrame("Frame", nil, WorldFrame);
self.PlateParent:SetFrameStrata("BACKGROUND");
self.PlateParent:SetFrameLevel(0);
WorldFrame:HookScript("OnUpdate", self.OnUpdate);
self.PlateParent:SetScript("OnUpdate", self.OnUpdate);
self:RegisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
self:RegisterEvent("PLAYER_REGEN_ENABLED");
Expand Down

0 comments on commit cee435f

Please sign in to comment.