Recover the target of one of Clique's actions
Hello,
I've encountered a little issue with Clique. Well, it's probably more general than just Clique, but you may still be able to help me there. Let's say that I have PoF bound with Clique. I'd like to announce things when about my target when I use PoF, so obviously, the best is to use a custom macro. However, the obvious "%t" for simple macros or "target" unidID for scripts is obviously not the target of the clique action, but my current target, which I do not care about the sightliest. Question is: Do I have an easy way to recover the unitID I need? Or at least the button I cliqued on (which is more or less equivalent)? Thank you for your time (and for Clique ^^), Layrajha |
The mouseover unit is what you want.
|
Wow, I wonder why I didn't think of that :) I expected something a bit complicated, and it's so simple :D
Thank you very much. I didn't realize that it's quite likely that my mouse is over a button when I click it :p:p Though, just out of curiosity, if I used a macro to simulate the click (can't remember the syntax, but I'm pretty sure that there was a macro command to click on a UI button with a specific mouse button), mouseover would probably not work: would there be another option to make it work? |
Nope, it can't just guess your target in that case. You could get the attribute programatically using ButtonName:GetAttribute("unit").
|
Ok. Though, that's assuming that I know what button has been pressed (from the custom macro). I tried (because it was worth trying... maybe ^^) to see what "this" refers to, in a custom macro of Clique, and it is the Macro editbox. The odds for it to refer to the button were slim, but hey! What else ;)
I guess that some ugly modifications to Clique could give ways to do that (but I admit there is absolutely no interest :D). Thank you again for your time. |
It has nothing to do with Clique.. you need the Blizzard API to accomplish this very odd off-thing. Clique can't do anything for you.
|
Quote:
Again, no real interest in doing that, and again, I'm not sure if it's even possible, and if it is, there might be drawbacks that I haven't thought of (is there a size limit for the macrotexts given via SetAttribute, for instance?). |
Quote:
Can you be extremely clear about how you want it to operate in a SPECIFIC case. Please don't tell me how you want to implement it, leave that up to me, but tell me how you want it to behave in a specific case. Then I might be able to give you something. At the moment, I'm completely confused as to what you're hoping to accomplish. |
Ok :)
So, basically, let's say that I want to bind a macro to my "shift+leftclick", via Clique. This macro's text would be: Code:
/cast Power Word: Shield Basically, it could output something like: "I shielded someone by clicking on MyRaidAddon_Group3_Member2, whose parent is MyRaidAddon_Group3." Again, I doubt there's any concrete use of that. But well... :) |
Code:
/cast Power Word: Shield |
Hmm, yes, but, but... it's the same as for "mouseover": it doesn't work if I bind the macro "/click MyRaidAddon_Group3_Member2" to my button "1", and if I press "1". I mean, my mouse could be anywhere on the screen.
Then, a way to know what unit I am casting on would be to know what button has been activated (by a "/click" command), and to use GetAttribute. I really feel like I'm wasting your time with stupid questions though :< Maybe I should just quit ;) |
Quote:
Or am I missing something? |
Well... only that ideally, the macro that should know the name of the button is the one bound in Clique. My "/click" macro could have many conditionals to choose what button to click, after all, and assuming that I also want to trigger my message when I actually click on the button with my mouse (which means that I indeed show this message with a GetMouseFocus() or something), I could have situations where:
- My mouse is over Frame1 - I simulate a click on Frame2 => I get a message about Frame1 and another message about Frame2, while nothing happened to Frame1 |
Quote:
Or I'm missing something, terribly. You keep saying things like "the button is the one bound in Clique".. and I don't know what that means. |
Bah, never mind, really :) There was really no point anyway.
Thanks again for your help and sorry about the digression. |
All times are GMT -6. The time now is 11:27 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI