WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   new at this/looking for assist (https://www.wowinterface.com/forums/showthread.php?t=57578)

jadiilelz 10-05-19 07:01 AM

new at this/looking for assist
 
The message you have entered is too short. Please lengthen your message to at least 10 characters.

d87 10-05-19 09:18 AM

You can't move unit frames in combat.

And nowadays you can reposition default player and target frames without any addons

aallkkaa 10-05-19 09:23 AM

Well, on your "filthy hack" snippet, you are trying to reset the methods :ClearAllPoints and :SetPoint of protected frames ('PlayerFrame', 'TargetFrame', etc), which is never a good idea, as other addons might need to use those methods as well; actually Blizzard might need to use those methods on their frames as well - and that's why they're protected.

And, as the error message you got implied, even using those methods (let alone modify the methods themselves) on protected frames doesn't go very well with Blizzard, particularly in combat.

There are some things you can do with the standard Blizzard frames, but usually only out of combat (rhis restriction is to prevent automation such as the game casting spell A or B in response to world events, without user interaction, AKA having the game play itself for you).
Not saying this is what you're trying to do (hardly looked at your code). But the above is something to keep in mind.

You can listen to the event PLAYER_REGEN_DISABLED to listen for player entering combat. PLAYER_REGEN_ENABLED lets you listen for player leaving combat. InCombatLockdown() returns true when you are in combat, and thus prevented from messing with protected frames.


All times are GMT -6. The time now is 03:36 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI