Thread Tools Display Modes
10-21-11, 08:52 PM   #1
shUI
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
shNameplates - Need Advice/Help

I am the author of shNameplates. I have attached my core lua file to this thread. I consider myself to be a good programmer and I have learned lua pretty well over these past months. I can't for the life of me though, even though I have done everything I thought possible, figure out why the following issues occur:
  • Sometimes when the castbar frame appears it is "bloated" having a height that is sometimes 5x more what I set it to be. It happens totally randomly and I can't seem to debug and/or test for it. I have tried many avenues (please see code) to fix this....any advice or help would be greatly appreciated.
  • Whenever I try to anchor the spellicon/overlay of the castbar frame to the left side of the castbar it is pushed down about 15pixels from where it is suppose to be. Like another invisible frame is there not allowing the anchoring I set.

Of course, i wish I can pinpoint parts of the code where I am having problems, but I don't know what is causing these issues. In addition, any suggestions or advice to decrease CPU and/or memory usage would be greatly appreciated. You can also find my addon wowinterface page at: http://www.wowinterface.com/download...ameplates.html
Attached Files
File Type: lua shNameplates.lua (25.7 KB, 685 views)
File Type: lua config.lua (6.3 KB, 713 views)
__________________
shPerformance: Data Broker memory/latency/fps usage display utility
shNameplates: Lightweight, simple, and sexy nameplates
shClock: Lightweight and simple data broker clock
  Reply With Quote
10-22-11, 02:05 PM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I had this aswell.
You can fix most castbar-displays by reseting the castbar points when "OnShow" of the castbar is triggered.

This worked for me for every cast but the ones that are casted by an NPC followed by an immeadiate channel-spell. The OnShow-event does not trigger because the castbar is already visible but the new spell triggers the repositioning.

So the only way to fix it was to reset the castbar position on every value change.

Check: http://code.google.com/p/rothui/sour...2/core.lua#357

On a side note. For my new nameplates I used the default nameplate frame as a base and built a new framestack in the center of it that holds all the stuff. Thus I can even rescale everything.
You may want to check the createArt and createCastbarArt functions. They create all the layers. And I hook some events to fix frame parenting/positioning.

*edit* Hey maybe I can hook the change of the minmaxvalues...need to test that later (http://wowprogramming.com/docs/widgets/StatusBar)
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-22-11 at 02:10 PM.
  Reply With Quote
10-22-11, 05:56 PM   #3
shUI
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
Interesting...wow, I actually used your rNameplates as inspiration. I am gonna study this and try to fix my addon. Thank you very much!

Also, if anyone else has any advice/suggestions, please let me know!
__________________
shPerformance: Data Broker memory/latency/fps usage display utility
shNameplates: Lightweight, simple, and sexy nameplates
shClock: Lightweight and simple data broker clock
  Reply With Quote
10-23-11, 12:01 AM   #4
shUI
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
I fixed my FixCastbar function to look like this:
Code:
local function FixCastbar(self)
	print("Fixcastbar FIRED")
	self:ClearAllPoints()
	self:SetParent(self.healthBar)
	--self.castbarOverlay:Hide()	
	self:SetSize(cfg.castbar.width, cfg.castbar.height)
	self:SetPoint(cfg.castbar.anchor, self.healthBar, cfg.castbar.anchor2, cfg.castbar.xoffset, cfg.castbar.yoffset)

	if cfg.powerbar and self.powerBar:IsShown() == 1 then
		self:SetPoint(cfg.castbar.anchor, self.powerBar, cfg.castbar.anchor2, cfg.castbar.xoffset, cfg.castbar.yoffset)
	end
end
And I added this to the OnSizeChanged script call:

Code:
local function OnSizeChanged(self, width, height)
	if self:IsShown() ~= 1 then return end
	
	if height > cfg.castbar.height then
		FixCastbar(self)
	end
end
Do you think this is sufficient?
__________________
shPerformance: Data Broker memory/latency/fps usage display utility
shNameplates: Lightweight, simple, and sexy nameplates
shClock: Lightweight and simple data broker clock
  Reply With Quote
10-23-11, 03:23 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
OnSizeChanged sounds good. The castbar frame is resizing when it looks ugly thus the event should fire. Gonna try this aswell.

Tested it: Seems to work.
The print is inside the fix function. It first fires when the ugly and a second time after fixing it.
http://www.abload.de/img/wowscrnshot_102311_114oucz.jpg
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-23-11 at 03:45 AM.
  Reply With Quote
10-23-11, 12:55 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
No, you're going to set yourself up for an infinite loop there.

Your OnSizeChanged script calls FixCastbar. In your FixCastbar funtion, you change the size. This fires the OnSizeChanged script. Which calls FixCastbar. Which changes the size. Which fires the OnSizeChanged script. Which.......
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
10-23-11, 04:33 PM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
No we are not. That is why I used the print. The OnSizeChanged is not fired again if the size is changed to the already given size.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
10-23-11, 07:03 PM   #8
shUI
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
Exactly, it only fires a couple of times. But I also did this and it seems to be working perfectly...so far. Does this look good/right?

Code:
local function OnValueChanged(self, curValue)
	if self:IsShown() ~= 1 then return end
	UpdateTime(self, curValue) 
	
	-->fix castbar from bloating - as a back up to onshow fixcastbar call
	if self:GetHeight() > cfg.castbar.height then
		FixCastbar(self) 
	end
end
Mind you, I have a separate config file with static given variables.
__________________
shPerformance: Data Broker memory/latency/fps usage display utility
shNameplates: Lightweight, simple, and sexy nameplates
shClock: Lightweight and simple data broker clock
  Reply With Quote
10-23-11, 07:51 PM   #9
MickeTun
A Murloc Raider
 
MickeTun's Avatar
Join Date: Jun 2008
Posts: 8
Help! My bar doesn't show!

Hi, I'm on the brink of insanity. The bar with my name and castbar is gone. I have done a great deal of work to get left and right sidebars and bar 1 & 2 to be identical so I know where things are when I change char with different classes. So I'm not to keen on reinstall everything. Is that the only way?

Please say no and tell me how to get my bar back. If I target a char, that bar works fine with name etc. But not the one showing my health and castbar.

Kindly and humble

MickeT
__________________
Happy Hunting
MickeTun
  Reply With Quote
10-23-11, 08:00 PM   #10
shUI
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
Forgive me, but I am not sure what you are describing?
__________________
shPerformance: Data Broker memory/latency/fps usage display utility
shNameplates: Lightweight, simple, and sexy nameplates
shClock: Lightweight and simple data broker clock
  Reply With Quote
10-24-11, 01:13 AM   #11
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Maybe he is lost?

@shui
Sounds OK to me. I use no size, I set the frame via SetPoint.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-24-11 at 01:16 AM.
  Reply With Quote
10-24-11, 12:27 PM   #12
MickeTun
A Murloc Raider
 
MickeTun's Avatar
Join Date: Jun 2008
Posts: 8
Hi again!

Hi again!

Sorry if I was rather unprecise in describing my problem. I wrote too quick and the result was not good.

But the problem is that I don't seem to have any playerframe anymore. If I fiddle around I can get the original Blizzard framme with health with my name, level and mana etc. But only for that session. Next time I login there is no frame visible. If I mark a char I get their name, level,Rare if it is rare monster and that works perfect. But I can't see anything about my health-status (except for Ice-hud) name or level.

I hope I didn't confuse You anymore than I already have. Thanks for answering.

MickeT
__________________
Happy Hunting
MickeTun
  Reply With Quote
10-24-11, 03:18 PM   #13
shUI
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
I'm sorry bud, but I am still a bit confused. You are having an issue with your OWN unit frames when my nameplates are enabled?
__________________
shPerformance: Data Broker memory/latency/fps usage display utility
shNameplates: Lightweight, simple, and sexy nameplates
shClock: Lightweight and simple data broker clock
  Reply With Quote
10-24-11, 03:23 PM   #14
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Originally Posted by MickeTun View Post
Hi again!

Sorry if I was rather unprecise in describing my problem. I wrote too quick and the result was not good.

But the problem is that I don't seem to have any playerframe anymore. If I fiddle around I can get the original Blizzard framme with health with my name, level and mana etc. But only for that session. Next time I login there is no frame visible. If I mark a char I get their name, level,Rare if it is rare monster and that works perfect. But I can't see anything about my health-status (except for Ice-hud) name or level.

I hope I didn't confuse You anymore than I already have. Thanks for answering.

MickeT
Problem is you're posting in an shNameplates related thread.
Is your problem in any way related to shNameplates?
  Reply With Quote
10-25-11, 11:14 AM   #15
MickeTun
A Murloc Raider
 
MickeTun's Avatar
Join Date: Jun 2008
Posts: 8
I'm sorry

Originally Posted by Dridzt View Post
Problem is you're posting in an shNameplates related thread.
Is your problem in any way related to shNameplates?
Hi again, thanks for answering! When I begun searching for an answer I was pointed in this direction. Apologise but I think You are right. I use LUI userinterface and that comes with a bundle of "programs" or parts if You will. So I don't know for sure 100% that I'm at the right place. If someone could point me in the right direction I'll be more than happy! I think my missing frame ( I got the name from target frame) is ouf_OUF-player.

And thanks all of You that has bothered You with my problem. The least anyone can say is that Your community really cares about eachother.

Kind regard

MickeT

Valhalla Warriors
__________________
Happy Hunting
MickeTun
  Reply With Quote
10-25-11, 11:54 AM   #16
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
The LUI v3 page on this site or perhaps their own forum might be better.
  Reply With Quote
10-25-11, 12:50 PM   #17
MickeTun
A Murloc Raider
 
MickeTun's Avatar
Join Date: Jun 2008
Posts: 8
Hi again!

Thanks a lot, sorry to bother You!

Kind regards
MickeT
__________________
Happy Hunting
MickeTun
  Reply With Quote
10-26-11, 05:10 AM   #18
MickeTun
A Murloc Raider
 
MickeTun's Avatar
Join Date: Jun 2008
Posts: 8
Hi

I succeeded to solve my problem so I thought I owed You my solution.

What I did was to copy everything and then deleted oUFUF and oUF folders. And then all worked again. Hope we live happily for ever after.

Thanks for Your help again.

Kind regards

MickeT
__________________
Happy Hunting
MickeTun
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » shNameplates - Need Advice/Help


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