Thread Tools Display Modes
11-29-10, 11:08 AM   #1
Lyelu
A Cyclonian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 44
Problem when changing targets

I keep bumping up against this issue... When I change targets things wouldn't disappear. So I added this:
Code:
local a = CreateFrame("Frame")
a:SetScript("OnEvent", function(_,event)
	local pguid = UnitGUID("player") or nil
	if pguid then
		oUF_player.Container:Show()
	else
		-- Added If statements here to see if it still crashes on /reload while dead: untested.
		if oUF_player.Container then oUF_player.Container:Hide() end
		if oUF_target.Container then oUF_target.Container:Hide() end
	end
	local guid = UnitGUID("target") or nil
	if guid then
		oUF_target.Container:Show()
	else
		oUF_target.Container:Hide()
	end
end)
a:RegisterEvent("PLAYER_ENTERING_WORLD")
a:RegisterEvent("PLAYER_TARGET_CHANGED")
All of my frames are anchored to the Container. This mostly works well enough for making all the graphics appear and disappear. But now if I go select target Thrall, who's marked pvp, then when I run away to deselect him, and then select myself, I show as flagged target, when I'm not flagged. My file contains a PvpOverride to change the icon, if that matters.

Also I added a left-click to show a frame with Thrall's 103 million hp. This frame is also anchored to the container. Same issue: After selecting and deselecting Thrall, then I select myself and I have 103million hp.

Is there any simple way to fix it so that it resets everything when a target is deselected, or I should make a (very long) list of each element of the layout and try to reset each separately?

Thanks!

Last edited by Lyelu : 11-29-10 at 11:13 AM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Problem when changing targets


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