mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 22:00:49 +00:00
more throttles
more throttle updates, yayyyy
This commit is contained in:
+11
-2
@@ -755,9 +755,14 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local self, button, unlock
|
local self, button, unlock
|
||||||
|
-- Main update loop with throttle for performance optimization
|
||||||
local function BarsUpdate(self)
|
local function BarsUpdate(self)
|
||||||
self = self or this
|
self = self or this
|
||||||
|
|
||||||
|
-- Throttle for performance
|
||||||
|
if (this.tick_main or 0) > GetTime() then return end
|
||||||
|
this.tick_main = GetTime() + 0.025
|
||||||
|
|
||||||
-- update buttons whenever a button drag is assumed
|
-- update buttons whenever a button drag is assumed
|
||||||
AssumeButtonDrag()
|
AssumeButtonDrag()
|
||||||
|
|
||||||
@@ -1695,9 +1700,13 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- limit events to one per second and smoothen action scanning
|
-- Reagent counter update with throttle for performance optimization
|
||||||
reagentcounter:SetScript("OnUpdate", function()
|
reagentcounter:SetScript("OnUpdate", function()
|
||||||
-- scan one action slot per frame
|
-- Throttle entire function to 10 FPS for smooth scanning
|
||||||
|
if (this.tick_update or 0) > GetTime() then return end
|
||||||
|
this.tick_update = GetTime() + 0.1
|
||||||
|
|
||||||
|
-- scan one action slot per update
|
||||||
if this.scan and this.scan <= 120 then
|
if this.scan and this.scan <= 120 then
|
||||||
UpdateSlot(this.scan)
|
UpdateSlot(this.scan)
|
||||||
this.scan = this.scan + 1
|
this.scan = this.scan + 1
|
||||||
|
|||||||
+5
-2
@@ -134,8 +134,11 @@ pfUI:RegisterModule("minimap", "vanilla:tbc", function ()
|
|||||||
-- Create coordinates text frame with location configurable
|
-- Create coordinates text frame with location configurable
|
||||||
pfUI.minimapCoordinates = CreateFrame("Frame", "pfMinimapCoord", pfUI.minimap)
|
pfUI.minimapCoordinates = CreateFrame("Frame", "pfMinimapCoord", pfUI.minimap)
|
||||||
pfUI.minimapCoordinates:SetScript("OnUpdate", function()
|
pfUI.minimapCoordinates:SetScript("OnUpdate", function()
|
||||||
-- update coords every 0.1 seconds
|
-- Throttle to update coords every 0.1 seconds
|
||||||
if C.appearance.minimap.coordstext ~= "off" and ( this.tick or .1) > GetTime() then return else this.tick = GetTime() + .1 end
|
if ( this.tick or 0) > GetTime() then return end
|
||||||
|
this.tick = GetTime() + .1
|
||||||
|
|
||||||
|
if C.appearance.minimap.coordstext == "off" then return end
|
||||||
|
|
||||||
this.posX, this.posY = GetPlayerMapPosition("player")
|
this.posX, this.posY = GetPlayerMapPosition("player")
|
||||||
if this.posX ~= 0 and this.posY ~= 0 then
|
if this.posX ~= 0 and this.posY ~= 0 then
|
||||||
|
|||||||
Reference in New Issue
Block a user