Thread Tools Display Modes
06-16-11, 02:16 PM   #1
zero_fenix
A Murloc Raider
Join Date: May 2007
Posts: 8
Require assistance, kgPanels + UnitClassification, Tooltips, and Chatframes

Alright, first off here's a ss of my ui might help you get an idea of what i'm talking about http://i.imgur.com/hEXPl.jpg
Also, I'm not great with LUA or very familiar with the WoW api and what not, my background is in C++ and PHP, so I'm learning as I go here.

First off, I have borders around my player and target unit frames (PitBull4) these borders are created with kgPanels and the PitBull4 borders option. The borders on my target in PitBull change color based on the classification of my target, grey for normal, silver(light/grey) for rare, yellow for elite and purple for boss. Well I managed to create a script for kgPanels that changes the borders I've created with kgPanels to match the classification, the only problem is these borders update a lot slower than the player frame and they don't change to purple when switching to a boss.

Queston #1
So for my OnLoad registerevents should I be registering anything else? Is this just a delay in kgPanels, any suggestions?

OnLoad
Code:
self:RegisterEvent("UNIT_TARGET")
OnEvent
Code:
local cl = UnitClassification("target")
if cl == "worldboss" then
  self:SetBackdropBorderColor(0.6, 0.3, 0.6)
elseif cl == "elite" then
  self:SetBackdropBorderColor(1, 1, 0)
elseif (cl == "rare") or (cl == "rareelite") then
  self:SetBackdropBorderColor(0.7, 0.7, 0.7)
else
  self:SetBackdropBorderColor(0.47, 0.47, 0.47)
end
What do I need to add to help this script determine that my target is a boss and effectively change the color to the proper purple of the first condition in the if statement?

Question #2
I was wondering how to make simple tooltips, I have 3 buttons currently, and more to come (you can see them in the upper right just right of the xp/rep bar) and I'd like to give them tool tips, they are also created with kgPanels. any suggestions?

Question #3
I have a kgPanel frame that is the backdrop to my chat frame, I would like it to become invisible when text fades from the currently visible chat frame. I'm not sure if there's any easy way to do this or if it's going to be a big pain in the but using a whole bunch of guessing and a "RegisterEvent("CHAT_MSG") OnLoad. Ideally I'd like the frame to size itself to the number of lines of chat that are currently visible but that could be a lot harder than I'm hoping, so for now a hide when empty script would be fantastic.
  Reply With Quote
06-16-11, 02:22 PM   #2
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Q1: Have a look at the "PLAYER_TARGET_CHANGED"-event.

Q2: http://www.wowpedia.org/Widget_API#GameTooltip
__________________
  Reply With Quote
06-16-11, 02:33 PM   #3
zero_fenix
A Murloc Raider
Join Date: May 2007
Posts: 8
Thank you, that solves my slow transition problem and my Tooltip problem. Guess it's time to learn something.

Any suggestions on the accurate assessment of if the target is a boss problem and the chat hiding?
  Reply With Quote
06-16-11, 07:38 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
A dungeon/raid boss is not the same as a world boss.
http://www.wowpedia.org/World_boss
__________________
"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
06-18-11, 03:13 PM   #5
zero_fenix
A Murloc Raider
Join Date: May 2007
Posts: 8
Originally Posted by Seerah View Post
A dungeon/raid boss is not the same as a world boss.
http://www.wowpedia.org/World_boss
I'm aware of this but those are the only things options that UnitClassification() returns. So my question is what else do I need to be looking at to determine if the target is a raid/instance boss?
  Reply With Quote
06-18-11, 04:17 PM   #6
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
You could go an ugly way and check if you're in a raid-instance...

drycode:

lua Code:
  1. if ( (UnitClassification('target') == 'worldboss') and (select(2, IsInInstance()) == 'raid') ) then
  2.     -- do stuff
  3. end

I said ugly, but in fact, it should be sufficient. I first thought you'll have to hold localisations, but this should work without them.
__________________

Last edited by Mischback : 06-18-11 at 06:08 PM. Reason: omg, what a failure...
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Require assistance, kgPanels + UnitClassification, Tooltips, and Chatframes


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