From 9e3f7dd79347cc974b9023230d4f2ff559d1289a Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Fri, 19 Jul 2013 05:33:10 +0000 Subject: [PATCH] Fix ticket 264 - update throttling functionality Missed changes in r758 that broke the existing throttling code. This makes the "update interval" option work again, defaulting to 0.1s == 100ms. Expose option to set the update interval to throttle the refresh rate. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@975 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleFrame.lua | 1 + OvaleOptions.lua | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/OvaleFrame.lua b/OvaleFrame.lua index 7b2c9be..287beb3 100644 --- a/OvaleFrame.lua +++ b/OvaleFrame.lua @@ -157,6 +157,7 @@ do local function OnUpdate(self) -- Update current time. Ovale.now = API_GetTime() + local now = Ovale.now local profile = OvaleOptions:GetProfile() local forceRefresh = not self.lastUpdate or (now > self.lastUpdate + profile.apparence.updateInterval) diff --git a/OvaleOptions.lua b/OvaleOptions.lua index 9df1d0f..502264d 100644 --- a/OvaleOptions.lua +++ b/OvaleOptions.lua @@ -202,7 +202,17 @@ local self_options = desc = L["Ce caractère est affiché dans un coin de l'icône pour indiquer si la cible est à portée"], get = function(info) return OvaleOptions.db.profile.apparence.targetText end, set = function(info, value) OvaleOptions.db.profile.apparence.targetText = value; Ovale:UpdateFrame() end - } + }, + updateInterval = + { + order = 100, + type = "range", + name = "Update interval", + desc = "Maximum time to wait (in milliseconds) before refreshing icons.", + min = 0, max = 500, step = 10, + get = function(info) return OvaleOptions.db.profile.apparence.updateInterval * 1000 end, + set = function(info, value) OvaleOptions.db.profile.apparence.updateInterval = value / 1000; Ovale:UpdateFrame() end + }, }, }, iconGroupAppearance = -- 1.7.9.5