Mouseover functionality for unit frames
Hello everyone!
I'm trying to create mouseover cast functionality to my unit frames, working essentially the same way VuhDo works for party and raid frames. An example of desired functionality: when hovering over my Boss1 frame, I would like to be able to cast dots on boss1 unit by simply pressing an assigned hotkey, not needing to click the unit and switch targets. [EDIT]: This is specifically for keybinds, not mouse clicks. Regular mouseover macros don't quite cut it in my case, and I would really like to learn how to implement this kind of functionality properly. I've gotten to the point where I think I'm quite close to my goal, but the implementation is very clunky and has a few problems. My code so far: Code:
-- a is helper table However, I don't know if this is the best solution by any means, and I have a few problems and questions: 1) To be able to assign macros to SetBindingMacro, those macros have to exist in my macros. Is there a way to create them locally within the frame, maybe using macrotext attributes or something? Otherwise this will be a pain with multiple characters and different frames. I know Vuhdo is able to do it, I just don't understand how. 2) How should I handle GameTooltip? AFAIK I can't do anything to it in restricted environment, and using SetScript overrides my state handlers. Should I have two separate frames for that? 3) Would there be some other, entirely different solution to achieving my goal? E.g. some other handlers or using virtual button clicks etc. Overall I feel like I'm close, but at the moment stuck and I just can't seem to figure out a way to get forward. I've spent hours trying to get hints reading the source of Vuhdo, Clique, Healbots and FrameXML, but honestly I couldn't get much out of any of those :/ Any help would be hugely appreciated! |
Why not use macros with conditionals on your action bar?
Code:
/cast [mod,@boss1,harm][@mouseover,harm][]Corruption |
Thanks for the reply!
The macro solution is what I'm actually doing right now, but it has its problems as well. It leads to a near endless elseif chain of mouseover conditions for all and any unitIds I would like mouseover functionality to cover. Even still, it doesn't fix the annoyance of sometimes hovering over those units' character models and accidentally applying whatever spell that way. It gets even worse with multiple [harm]ii;[help]jj macros. Alternatively, I could use different keybinds for different units for the same spell, but that is just a no-no. Surely I could just create a bunch of override keybinds for different scenarios (raids, BGs, arenas etc), but it is a messy solution at best. What I would fancy is a [@unitFrame] conditional, which would solve all of my problems, but since it doesn't exist, I'm trying to create it kind of artificially. I know what I'm trying to do isn't an easy or class wide universal solution either, but I feel like this is as close to the root problem (=not having a @unitFrame condition) that I can get. Evidently it isn't that simple to achieve, and I understand it may seem excessive, but I'm willing to put in the hours to make it work. And after all, I would like to learn new stuff ^^ |
Isn't this what Clique does?
|
Quote:
|
Quote:
Quote:
Also, thank you for the well-structured and commented code -- the @unitModel implementation especially was interesting to learn. |
All times are GMT -6. The time now is 02:44 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI