mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-30 11:10:00 +00:00
replace poll-until-cancel OnUpdate frames with C_Timer / RunNextFrame
Seven ad-hoc OnUpdate handlers were only spinning long enough to reach a known deadline or a next-frame defer, then unhooking themselves. Convert them to their proper primitives: - autovendor: 0.3s wait after junk sell → C_Timer.After(0.3, ...) - innervatecall: cooldown-expiry ready ping → C_Timer.After(cd, ...) - focus: re-arm UI_ERROR_MESSAGE next tick → RunNextFrame - macrotweak: conflict scan after addons load → RunNextFrame - ui-widgets (CreateQuestionDialog): font-measure resize → RunNextFrame - libdebuff: post-PEW Nampower init → RunNextFrame - bubbles: WorldFrame scan after chat event → RunNextFrame Net -18 lines and no more throwaway frames sitting on the OnUpdate list.
This commit is contained in:
+2
-3
@@ -1172,10 +1172,9 @@ function pfUI.api.CreateQuestionDialog(text, yes, no, editbox, onclose)
|
||||
local width = 200
|
||||
|
||||
-- delay the auto sizing, to make sure the font rendering happened
|
||||
question:SetScript("OnUpdate", function()
|
||||
RunNextFrame(function()
|
||||
if question.text:GetStringWidth() > width then width = question.text:GetStringWidth() end
|
||||
question:SetWidth( width + 2*padding)
|
||||
this:SetScript("OnUpdate", nil)
|
||||
question:SetWidth(width + 2*padding)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user