Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-19-06, 04:43 AM   #1
Miles
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 16
Show/Hide on UnitFrames

** Reposting from EU-Beta forums, since it's totally dead. Hopefully, this forum will provide more feedback **

Andreas and me have been working on converting ag_Unitframes (temp version: http://www.wowinterface.com/download...nitFrames.html, thread at http://www.wowace.com/forums/index.php?topic=2676.0) to BC, and one of the major problems we've encountered is the Target and Target's Target frame.

Normally, when players don't have a target, the target frame is hidden. When a player selects a target, it gets shown. The same thing happens with target's target, if you select a mob while it's incapacitated, it won't have a target -> frame is hidden, and if it's running after you, it's shown.


In the Burning Crusade, using the new secure unitframes, we're not allowed to change visibility of those frames in combat. So if you deselect a mob in combat, the Target frame will get "stuck", and if the mob doesn't have a target when you enter combat (99.9% of the time), the Target's Target frame won't be shown for the whole fight.

There is currently no function in the SecureTemplate (.lua/.xml) that handles this situation, and the default UI's code doesn't hint what we should do at all:

FrameXML\TargetFrame.lua, line 45:
function TargetFrame_Update()
-- This check is here so the frame will hide when the target goes away
-- even if some of the functions below are hooked by addons.
if ( not UnitExists("target") ) then
this:Hide();
else
this:Show();
<snip>

With the secure = 1 in the toc (aka Blizzard UI I-Win Button), they are allowed to do that. The problem is that any other unitframe addon won't be able to follow.


It seems to me that we're missing some code in the SecureUnitButtonTemplate to handle this situation, in pseudocode:

On PLAYER_TARGET_CHANGED do: if GetAttribute("unit") == "target" / "targettarget" then check UnitExists and Show/Hide the frame.
And do the UnitExists check on an interval (0.2 - 0.5 seconds) for targettarget.
  Reply With Quote
 

WoWInterface » AddOns, Compilations, Macros » Alpha/Beta AddOns and Compilations » Show/Hide on UnitFrames


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off