Thread Tools Display Modes
01-06-16, 09:30 AM   #1
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
UnitFramesImproved BossTargetFrame Problem

Hi,

i am currently using this addon but it seems to have an problem with the Boss(2-4)TargetFrame. The problems seems to exist for a long time but it never has been fixed. i don't know what the problem is in the code. Maybe here is some skilled person that can fix this? this bug is very annoying because it hides for example the bossframes of the archimonde adds.

here are the code snippets causing this problem (i think):
Code:
hooksecurefunc("BossTargetFrame_OnLoad", UnitFramesImproved_BossTargetFrame_Style);

UnitFramesImproved_BossTargetFrame_Style(Boss1TargetFrame);
	UnitFramesImproved_BossTargetFrame_Style(Boss2TargetFrame);
	UnitFramesImproved_BossTargetFrame_Style(Boss3TargetFrame);
	UnitFramesImproved_BossTargetFrame_Style(Boss4TargetFrame);

function UnitFramesImproved_BossTargetFrame_Style(self)
	self.borderTexture:SetTexture("Interface\\Addons\\UnitFramesImproved\\Textures\\UI-UnitFrame-Boss");

	UnitFramesImproved_Style_TargetFrame(self);
	if (not (characterSettings["FrameScale"] == nil)) then
		if not InCombatLockdown() then 
			self:SetScale(characterSettings["FrameScale"] * 0.9);
		end
	end
end

function UnitFramesImproved_Style_TargetFrame(self)
	--if not InCombatLockdown() then
		local classification = UnitClassification(self.unit);
		if (classification == "minus") then
			self.healthbar:SetHeight(12);
			self.healthbar:SetPoint("TOPLEFT",7,-41);
			self.healthbar.TextString:SetPoint("CENTER",-50,4);
			self.deadText:SetPoint("CENTER",-50,4);
			self.Background:SetPoint("TOPLEFT",7,-41);
		else
			self.healthbar:SetHeight(29);
			self.healthbar:SetPoint("TOPLEFT",7,-22);
			self.healthbar.TextString:SetPoint("CENTER",-50,6);
			self.deadText:SetPoint("CENTER",-50,6);
			self.nameBackground:Hide();
			self.Background:SetPoint("TOPLEFT",7,-22);
		end
		
		self.healthbar:SetWidth(119);
		self.healthbar.lockColor = true;
	--end
end
thanks in advance

Last edited by pas06 : 01-06-16 at 05:57 PM.
  Reply With Quote
01-12-16, 06:13 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I don't see anything obviously problematic in that code snippet. Can you be more specific about the problem?
  • What do you expect to see, and when/where do you expect to see it?
  • What do you actually see in that situation/place instead?
  • Have you double-checked your expectations against the default UI (eg. does the default UI show what you expect when/where you expect)?
  • Are there any error messages from the addon, either in that situation/place, or when you first log in?
  • Does the problem still occur when you disable all other addons?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
01-12-16, 08:53 AM   #3
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
Thanks for reply

What do you expect to see, and when/where do you expect to see it?
- the other Bossframes of for example doomfire or Death Brand are not shown. if i disable the addon they are shown.
What do you actually see in that situation/place instead?
- i see only the bossframe of the Boss itself
Are there any error messages from the addon, either in that situation/place, or when you first log in?
- no message at login only when the frist bossframe is shown:
The error message, that appears when the first Bossframe is shown:
7x [ADDON_ACTION_BLOCKED] AddOn 'UnitFramesImproved' tried to call the protected function 'Boss2TargetFrame:Hide()'
!BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
[C]: in function `Hide'
FrameXML\TargetFrame.lua:108: in function <FrameXML\TargetFrame.lua:104>
[C]: ?
[C]: in function `TargetFrame_Update'
FrameXML\TargetFrame.lua:174: in function `OnEvent'
FrameXML\UnitFrame.lua:676: in function <FrameXML\UnitFrame.lua:674>
Does the problem still occur when you disable all other addons?
- haven't tried it yet but the error is gone if i disable it and use the default ui instead all bossframes are shown

This is the addon i am talking about: http://www.curse.com/addons/wow/unitframesimproved
there are other posts that are about the same topic and a ticket on curseforge also exists about this problem. The author replied regarding this problem:
"Can't do much about this unfortunately. The hooks used don't jive well with the Blizz code at all times. Unless Blizz cleans up theri code to make it easier to hook into, there's not much I can do."

is this really the case? other unitframe addons don't have a problem with this.
  Reply With Quote
01-12-16, 10:27 AM   #4
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by pas06 View Post
Thanks for reply

What do you expect to see, and when/where do you expect to see it?
- the other Bossframes of for example doomfire or Death Brand are not shown. if i disable the addon they are shown.
What do you actually see in that situation/place instead?
- i see only the bossframe of the Boss itself
Are there any error messages from the addon, either in that situation/place, or when you first log in?
- no message at login only when the frist bossframe is shown:
The error message, that appears when the first Bossframe is shown:
7x [ADDON_ACTION_BLOCKED] AddOn 'UnitFramesImproved' tried to call the protected function 'Boss2TargetFrame:Hide()'
!BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
[C]: in function `Hide'
FrameXML\TargetFrame.lua:108: in function <FrameXML\TargetFrame.lua:104>
[C]: ?
[C]: in function `TargetFrame_Update'
FrameXML\TargetFrame.lua:174: in function `OnEvent'
FrameXML\UnitFrame.lua:676: in function <FrameXML\UnitFrame.lua:674>
Does the problem still occur when you disable all other addons?
- haven't tried it yet but the error is gone if i disable it and use the default ui instead all bossframes are shown

This is the addon i am talking about: http://www.curse.com/addons/wow/unitframesimproved
there are other posts that are about the same topic and a ticket on curseforge also exists about this problem. The author replied regarding this problem:
"Can't do much about this unfortunately. The hooks used don't jive well with the Blizz code at all times. Unless Blizz cleans up theri code to make it easier to hook into, there's not much I can do."

is this really the case? other unitframe addons don't have a problem with this.
Other unitframe usually builds their own frames instead of restyling the blizzard ones.
  Reply With Quote
01-12-16, 11:10 AM   #5
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
So its actually not possible to make it work in the way it is modifying the frame right now?
Or is there a way to fix this problem?
  Reply With Quote
01-12-16, 11:24 AM   #6
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by pas06 View Post
So its actually not possible to make it work in the way it is modifying the frame right now?
Or is there a way to fix this problem?
What happens if you remove the InCombatLockdown() comment?

Lua Code:
  1. function UnitFramesImproved_Style_TargetFrame(self)
  2.     if not InCombatLockdown() then
  3.         local classification = UnitClassification(self.unit);
  4.         if (classification == "minus") then
  5.             self.healthbar:SetHeight(12);
  6.             self.healthbar:SetPoint("TOPLEFT",7,-41);
  7.             self.healthbar.TextString:SetPoint("CENTER",-50,4);
  8.             self.deadText:SetPoint("CENTER",-50,4);
  9.             self.Background:SetPoint("TOPLEFT",7,-41);
  10.         else
  11.             self.healthbar:SetHeight(29);
  12.             self.healthbar:SetPoint("TOPLEFT",7,-22);
  13.             self.healthbar.TextString:SetPoint("CENTER",-50,6);
  14.             self.deadText:SetPoint("CENTER",-50,6);
  15.             self.nameBackground:Hide();
  16.             self.Background:SetPoint("TOPLEFT",7,-22);
  17.         end
  18.        
  19.         self.healthbar:SetWidth(119);
  20.         self.healthbar.lockColor = true;
  21.     end
  22. end
  Reply With Quote
01-12-16, 12:21 PM   #7
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
exactly the same
  Reply With Quote
01-12-16, 12:39 PM   #8
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by pas06 View Post
exactly the same
The taint should be somewhere else then, maybe not even in the addon.
  Reply With Quote
01-12-16, 12:46 PM   #9
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
how can i find this out? Just by disabling anything else than this addon?
  Reply With Quote
01-12-16, 01:07 PM   #10
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
with everything disabled and only !Buggrabber, Bugsack and UnitFramesImproved enabled and the change you posted above i got this(and the same problem still exists):
6x [ADDON_ACTION_BLOCKED] AddOn 'UnitFramesImproved' tried to call the protected function 'Boss2TargetFrame:Show()'.
!BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
[C]: in function `Show'
FrameXML\TargetFrame.lua:110: in function <FrameXML\TargetFrame.lua:104>
[C]: ?
[C]: ?
[C]: in function `TargetFrame_Update'
FrameXML\TargetFrame.lua:174: in function `OnEvent'
FrameXML\UnitFrame.lua:676: in function <FrameXML\UnitFrame.lua:674>

Locals:

this means that the problem is in the addon right?
  Reply With Quote
01-12-16, 01:44 PM   #11
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by pas06 View Post
with everything disabled and only !Buggrabber, Bugsack and UnitFramesImproved enabled and the change you posted above i got this(and the same problem still exists):
6x [ADDON_ACTION_BLOCKED] AddOn 'UnitFramesImproved' tried to call the protected function 'Boss2TargetFrame:Show()'.
!BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
[C]: in function `Show'
FrameXML\TargetFrame.lua:110: in function <FrameXML\TargetFrame.lua:104>
[C]: ?
[C]: ?
[C]: in function `TargetFrame_Update'
FrameXML\TargetFrame.lua:174: in function `OnEvent'
FrameXML\UnitFrame.lua:676: in function <FrameXML\UnitFrame.lua:674>

Locals:

this means that the problem is in the addon right?
How can you actually trigger the problem? I'll look into it.
  Reply With Quote
01-12-16, 01:49 PM   #12
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
installing the addon and encounter a boss where the bossframes get toggled
I really appreciate your help

Last edited by pas06 : 01-12-16 at 01:56 PM.
  Reply With Quote
01-12-16, 02:05 PM   #13
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by pas06 View Post
installing the addon and encounter a boss where the bossframes get toggled
I really appreciate your help
Comment this line around line 83:

Lua Code:
  1. --hooksecurefunc("TargetFrame_Update", UnitFramesImproved_TargetFrame_Update);

Then it should be fixed. The function itself is not even needed.
On the other side, the addon using a lot of global functions which could potentionally cause some other errors.
  Reply With Quote
01-12-16, 02:13 PM   #14
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
commenting out this line didn't fix it
  Reply With Quote
01-12-16, 03:27 PM   #15
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by pas06 View Post
commenting out this line didn't fix it
My bad, to be honest i was fixing some other stuff while i was parsing through the code, so it might be a combination with those fixes.

There is the fully modified addon, try this one:
https://github.com/Resike/UnitFrames...ive/master.zip
  Reply With Quote
01-12-16, 03:55 PM   #16
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
i tried it but it didn't make any difference still exactly the same. if i make an ui reload infight all bossframes are there, first with green healtbar and if i damage the unit it turns red.
  Reply With Quote
01-12-16, 04:19 PM   #17
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by pas06 View Post
i tried it but it didn't make any difference still exactly the same. if i make an ui reload infight all bossframes are there, first with green healtbar and if i damage the unit it turns red.
I donno i tested it on the first boss in Blackrock Caverns and the error is gone for me.
  Reply With Quote
01-12-16, 04:38 PM   #18
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
i tried this boss it works on this boss. i think thats because there are not more bossframes. The error only occurs if the encounter has more than one bossframe - try the second boss (the error still occurs for me there)
i am sorry i haven't noticed that this only occurs if there are more than one bossframe
Thanks in advance

Last edited by pas06 : 01-12-16 at 04:42 PM.
  Reply With Quote
01-12-16, 06:49 PM   #19
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by pas06 View Post
i tried this boss it works on this boss. i think thats because there are not more bossframes. The error only occurs if the encounter has more than one bossframe - try the second boss (the error still occurs for me there)
i am sorry i haven't noticed that this only occurs if there are more than one bossframe
Thanks in advance
Hmm, i'll look into it. I'm pretty sure there is a solution for the other bosses too.
  Reply With Quote
01-26-16, 11:33 AM   #20
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
Have you tried it out yet?
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » UnitFramesImproved BossTargetFrame Problem


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