Hooking into OnUpdate for moving unitframes
I've been fiddling with a very basic UI modification where I need to scale and move the default unitframes.
I initially just made a macro for re-scaling and re-positioning the unitframes, but wanted something more permanent to avoid having to run the macro after each loading screen. I tried using a wide variety of "move anything"-addons out there, but they all had issues with vehicle unitframes. I tried to come up with my own solution, and ended up with the following bit of code, which actually works even with vehicle unitframes: Code:
local timer = 2 |
You might try using one of the events related to entering the world or addons being loaded. Trying to do it on-update will try to do it every frame, and throw errors when it fires in combat for frames that can't be moved then.
|
Quote:
Code:
local f = CreateFrame("Frame") |
OnUpdate is the very last spot you should do stuff like this, because it is run way too often.
As mentioned: Use PLAYER_ENTERING_WORLD and perhaps disable the SetPoint-functions for the frames in question by setting lua Code:
|
All times are GMT -6. The time now is 12:12 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI