diff --git a/Omen.lua b/Omen.lua index 071fccd..5679321 100644 --- a/Omen.lua +++ b/Omen.lua @@ -1313,8 +1313,19 @@ function Omen:FindThreatMob() self.unitID = nil end -local queried = false +-- Frame for throtling updates +local OmenUpdateBarsThrotleFrame = CreateFrame("Frame") +OmenUpdateBarsThrotleFrame:Hide() +OmenUpdateBarsThrotleFrame:SetScript("OnUpdate", function(self, elapsed) + self:Hide() + Omen:UpdateBarsReal() +end) function Omen:UpdateBars() + OmenUpdateBarsThrotleFrame:Show() +end + +local queried = false +function Omen:UpdateBarsReal() if db.Autocollapse and db.CollapseHide then -- Update the visibility because it could have been hidden on 0 bars self.BarList.barsShown = 1 -- Dummy value @@ -1325,8 +1336,6 @@ function Omen:UpdateBars() return end - -- TODO: Put a update throtle on this function - local myGUID = UnitGUID("player") local dbBar = db.Bar local mob, mobGUID, mobTargetGUID