Poster: Mozz at 6/1/2005 4:19:04 PM PDT Subject: Slouken: request for TargetLastTarget() func |
| |
Could we please please have a TargetLastTarget() function?
If so, maybe we could also have a "query" unit ID with SetQueryUnit() and SetQueryByName() functions?
I ask because there appear to be plenty of AddOns that switch targets for you for various purposes, with the intent of switching back. Which they can only do reliably under certain circumstances. See for example, this thread:
http://forums.worldofwarcraft.com/thread.aspx?ForumName=wow-interface-customization&ThreadID=148596
TargetLastTarget() would make it possible for addon authors to target a given unit, get some information about it (e.g. UnitClass("target")) and then reliably restore the player's original target. The "query" unit might be even better, because you would not have to change the target (and so the related events would not get sent, and we would not have to hook and suppress them in our addons). However, when you actually need to do something to the newly-selected target, the "query" unit would not be helpful--we need TargetLastTarget() for those cases.
In MozzSmartCast, for example, I use TargetLastEnemy() for hostile units and TargetByName() for friendly units. If you happened to have a friendly NPC guard targeted when you self-cast a heal or buff, it will probably restore the target to the wrong NPC (since they all have the same name). With TargetLastTarget(), I could make that 100% reliable.[ post edited by Mozz ]
|
| | http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=148610&p=#post148610 |
| |
Poster: slouken at 6/1/2005 8:36:59 PM PDT Subject: Re: Slouken: request for TargetLastTarget() f |
| |
The UI is designed to know about you, your party, their pets, and targets. It's really not designed to have a complete picture of the play field - that's what the rest of the game is for. :)
I don't really have the authority to extend the API to make more information available, although if there is specific functionality that you would like to have available, I am happy to pass it on to designers. If you have a specific request for the designers, please be as clear as possible and phrase it in terms of UI functionality rather than API functions (though you can include that too, if you like)
|
| | http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=148610&p=#post148776 |
Poster: slouken at 6/1/2005 9:18:33 PM PDT Subject: Re: Slouken: request for TargetLastTarget() f |
| |
I'm passing your request on to the designers, thanks.
|
| | http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=148610&p=#post148806 |
Poster: slouken at 6/2/2005 9:30:34 AM PDT Subject: Re: Slouken: request for TargetLastTarget() func |
| |
By the way, you can already pretty much do TargetLastTarget() already:
local hadTarget, targetName;
hadTarget = UnitExists("target");
if ( hadTarget ) then
if ( UnitCanAssist("player", "target") then
targetName= UnitName("target");
else
targetName= nil;
end
end
-- switch targets and do something fancy
if ( hadTarget ) then
if ( targetName ) then
TargetByName(targetName);
else
TargetLastEnemy();
end
else
ClearTarget();
end
(Note: completely untested!)
This is almost right, and should cover every case you're trying to handle.
|
| | http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=148610&p=#post149058 |
Poster: slouken at 6/2/2005 11:51:49 AM PDT Subject: Re: Slouken: request for TargetLastTarget() f |
| |
Q u o t e: Unfortunately it fails for annoyingly named pets (pet-like entities).
Hopefully those are rare.
True, true.
|
| | http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=148610&p=#post149165 |
Poster: slouken at 6/3/2005 10:40:20 AM PDT Subject: Re: Slouken: request for TargetLastTarget() f |
| |
Q u o t e: Could we please please have a TargetLastTarget() function?
Thanks for the great examples. The designers have approved it, and I've implemented it for 1.6.
|
| | http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=148610&p=#post149699 |
Poster: slouken at 6/4/2005 9:21:06 AM PDT Subject: Re: Slouken: request for TargetLastTarget() f |
| |
Probably not, although it's possible that we'll change how targeting affects tab order. I'll look into it. [ post edited by slouken ]
|
| | http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=148610&p=#post150309 |
Poster: slouken at 6/4/2005 12:01:57 PM PDT Subject: Re: Slouken: request for TargetLastTarget() f |
| |
Okay, so here is how tab target selection will be improved in 1.6:
If you are cycling through tab targets and then select a different target, and then quickly hit tab again, your last tab-selected target will be re-selected and you can continue tab selecting where you left off. If you select another target and then reselect the last tabbed target, then tab selection will continue unhindered. Clearing your target or staying on the same target for 3 seconds will restart the tab selection process.
Keep in mind that until a patch is actually live, anything can change, so this is not an official statement. :)
|
| | http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=148610&p=#post150366 |