mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-09-11 09:50:21 +00:00
Hotfix: implement fast-path update pipeline to optimize mana tracking performance, skipping unnecessary ui re-draws
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
-- Manages WoW Frame events and periodic updates, routing to respective services
|
||||
|
||||
HealBot_View_DirtyUnits = {}
|
||||
HealBot_View_DirtyPower = {}
|
||||
local HealBot_Timer1, HealsIn_Timer = 0, 0;
|
||||
HealBot_LastModState = ""
|
||||
|
||||
@@ -20,7 +21,7 @@ function HealBot_OnLoad(this)
|
||||
HealBot_View_DirtyUnits[unitID] = true
|
||||
end)
|
||||
HealBot_Model:RegisterObserver("UNIT_POWER_CHANGED", function(unitID)
|
||||
HealBot_View_DirtyUnits[unitID] = true
|
||||
HealBot_View_DirtyPower[unitID] = true
|
||||
end)
|
||||
HealBot_Model:RegisterObserver("UNIT_AURA_CHANGED", function(unitID)
|
||||
HealBot_View_DirtyUnits[unitID] = true
|
||||
@@ -78,9 +79,17 @@ function HealBot_OnUpdate(this, arg1)
|
||||
while unitID do
|
||||
HealBot_Action_RefreshButtons(unitID)
|
||||
HealBot_View_DirtyUnits[unitID] = nil
|
||||
HealBot_View_DirtyPower[unitID] = nil -- Skip fast path if doing full refresh
|
||||
unitID, _ = next(HealBot_View_DirtyUnits)
|
||||
end
|
||||
|
||||
local powerID, _ = next(HealBot_View_DirtyPower)
|
||||
while powerID do
|
||||
HealBot_Action_RefreshPower(powerID)
|
||||
HealBot_View_DirtyPower[powerID] = nil
|
||||
powerID, _ = next(HealBot_View_DirtyPower)
|
||||
end
|
||||
|
||||
if HealBot_EquipChangeTimer > 0 then
|
||||
HealBot_EquipChangeTimer = HealBot_EquipChangeTimer - arg1
|
||||
if HealBot_EquipChangeTimer <= 0 then
|
||||
|
||||
Reference in New Issue
Block a user