Originally Posted by Shan
Some action bar addons, like Trinitybars, allow me to set a macro for a certain button. Shouldn't it be possible to make a modification of Trinitybars that only uses that macro if the mouseover=GridPlayerFrame and otherwise just casts a spell normaly?
|
No that all works differently. There are two parts at play here, one is the macro system with its mouseover selector. The other is the UI/Addon system where we can influence stuff but only within certain limits. Since 2.0 there are severe limitations in place to prevent what Blizzard calls automation. It prevents player addons to change targets/spells, etc. while in combat.
Now addons are free to preset certain actions while not in combat. That is what all your addons do that have clickable spells or targets. A unit frame addon for example sets up and draws a unit frame and then tells that frame "your target is player Shan". This works since unit frames must inherit a specific base class which is from Blizzard and provides such an interface. Now as soon as we're in combat, the unit frame becomes "locked", meaning any call to that unit frame to set dynamically another player will fail, because that's not allowed now. Any action happening "on that frame" will happen with that target preset, in this case the player Shan. The unit frame does this by something called attributes; they can be set and manipulated while out of combat and there are several of these. They simply set what they are watching for or what their function should be or their reaction if they are clicked, etc.
Now this all is what we can manipulate as long as we're out of combat. As soon as we enter combat, we can't change them, so they should then be set up well. In your case, you want specific actions happen to specific players (you want to heal the respective party member).
But now comes the macro system with your mouseover macro. How does that tie in ? Macros have other capabilities and limitations than the addon system. They are actually very limited but with a few nice tricks allow yet many things to be made possible. One are the selectors. Since we can't formulate if then else conditions in macros with things like spellcasts or targets, we need another mechanism and the target selectors come into play here. They allow a limited form of a decision to be made what should happen. Now you want to use the mouseover selector to signify that the unit you are hoovering above with the mouse should be the target. Now if your mouse is over a unit frame when you press a button which executes a macro with mouseover, the WoW client is evaluating what it should do. At one point it arrives at mouseover and needs to find a target. So it goes to see where the mouse is. It's over a unit frame, so it goes and reads out the attribute "target" that was set prior to entering combat at one time by the addon. It tells the client "my target is Shah" and now the macro system knows that it should target the spell to the player "Shah" and does so. That's what you want and it does work.
But if you happen to have your mouse lingering over no UI/Frame element but over the 3D world, then you might still be targeting a player there. If that is the case, the WoW client will know who it is and will take him as target, because you told the macro system to give the target you are mousing over. Due to various exploit possibilities, it is completely impossible to manipulate anything in the 3D world display. We can't do anything there. This means that if your mouse cursor is not over a UI Frame, then it is over the 3D world frame and if it happens to be over a targetable thing there, that will be the target and the macro system will use this target even if you want it not to.
There are 2 solutions to this problem, one is, as I wrote above, that you get Blizzard to implement another mouseover targeting selector that will never ever return a target from the 3D world. The other approach is to write an addon that overlays the 3D world with a transparent frame you can see through that catches the mouse. Set this "layer" so that the other UI elements are above it and thus still work with their own mouse targets. The problem with this now is though that you can't switch this on and off in combat as you please. That means it would be always active and prevent you from ever targeting anything in the 3D world when you are in combat. This means it would perhaps prevent you from ever clicking cubes at the Magtheridon encounter and such things as it sucks up mouse events. You can't take a portal from Kalecgos, the mouse clicking doesn't get through, etc.
Furthermore, it would have to be set to return "no one" as target to work and this may cause the macro system to not try to evaluate the next target selector in your macro but to try to cast the spell with an explicitly set target=no one as if the spell would require no target and then the casting fails for targeted spells like heals. There might be a difference between a frame giving back nothing as target to the mouseover selector and the mouse being not over any frame and not over any object in the 3D world. I don't know if that is differentiated by the macro system but it could be.
Anyway, what you would like is just not possible with the limitations in play right now, unless I misunderstood your request or some subtle details in the Addon and Macro systems.
What Clique does by the way is simply set the correct attributes for the selected spells on the unit frames, either on all of them or only those you chose