 |
07/15/10, 4:04 PM
|
#226
|
|
Glass Joe
Night Elf Hunter
Undermine
|
Text for Raid Frames
So I'm working on some Raid Frames that will essentially replace grid for my non-healers. I need it to show Name (4 letters max), Missing HP (in place of name, if HP is not full), AFK/DC/FD/FI/Dead (in place of name, if unit is AFK or Offline or Feigning Death or Divine Intervention'd or Dead/Ghost).
Here is what I have so far:
local AFK = Afk(unit)
local AFKTIME = AFKDuration(unit)
local DC = Offline(unit)
local DCTIME = OfflineDuration(unit)
local DEAD = Dead(unit)
local DEADTIME = DeadDuration(unit)
local FD = UnitAura(unit,"FEIGN DEATH")
local DI = UnitAura(unit,"DIVINE INTERVENTION")
local cur,max = HP(unit),MaxHP(unit)
local miss = max-cur
if AFK then
return "AFK\n%s",AFKTIME
elseif DC then
return "DC\n%s",DCTIME
elseif DEAD then
return "AFK\n%s",DEADTIME
elseif FD then
return "FD"
elseif DI then
return "DI"
elseif miss ~= 0 then
return "- %s",Short(miss)
else
return Name(unit):sub(1,4)
So far, Name, FD (and I assume DI, since they are functionally identical with different buffs), AFK are confirmed to work. I have not tested DEAD, DC, miss.
My issue is that AFKTIME displays as a massively huge decimal number. I had a fix for this before, but I have no idea what it was.
Anyone know how to fix it?
|
|
|
|
|
07/29/10, 9:27 PM
|
#227
|
|
Glass Joe
poop
Blood Elf Druid
No WoW Account
|
Does anyone know how to view the unit-player's group number when in a raid? The DogTag is pretty simple, however I'm having a really hard time researching the code to display the player's group number (in Pitbull, that is).
|
|
|
|
|
07/30/10, 6:50 AM
|
#228
|
|
Piston Honda
Goblin Priest
Mannoroth (EU)
|
I think this API function should help you with your luatext 
|
There are only 10 types of people... those who understand binary and those who don't.
|
|
|
08/01/10, 9:39 PM
|
#229
|
|
Glass Joe
|
Originally Posted by Antiganon
|
change that into
return "AFK\n%.2f",AFKTIME
That should display the afk time as a 'float' with only 2 decimal places.
|
|
|
|
|
09/23/10, 11:04 PM
|
#230
|
|
Von Kaiser
|
Class Colored Borders + Aggro
Simply trying to get KGPanels to be class colored unless the until has aggro, then red.
I'm using
local _, class = UnitClass("player");
if class == "WARRIOR" then
self:SetBackdropBorderColor(0.95, 0.23, 0.23, 0.50)
elseif class == "PRIEST" then
self:SetBackdropBorderColor(1, 0.96, 0.98, 0.50)
elseif class == "MAGE" then
self:SetBackdropBorderColor(0.00, 1, 1, 0.50)
elseif class == "DRUID" then
self:SetBackdropBorderColor(1, 0.49, 0.04, 0.50)
elseif class == "PALADIN" then
self:SetBackdropBorderColor(0.92, 0.22, 0.46, 0.50)
elseif class == "HUNTER" then
self:SetBackdropBorderColor(0.33, 0.86, 0.00, 0.50)
elseif class == "ROGUE" then
self:SetBackdropBorderColor(1, 0.94, 0.16, 0.50)
elseif class == "SHAMAN" then
self:SetBackdropBorderColor(0.13, 0.42, 1, 0.50)
elseif class == "WARLOCK" then
self:SetBackdropBorderColor(0.36, 0.18, 1, 0.50)
elseif class == "DEATHKNIGHT" then
self:SetBackdropBorderColor(0.77, 0.12, 0.23, 0.50)
end
for the class colored, simply want to add aggro indicator to it.
|
|
|
|
10/10/10, 1:26 PM
|
#231
|
|
Don Flamenco
Dwarf Paladin
Lightbringer
|

Originally Posted by Dankz
Simply trying to get KGPanels to be class colored unless the until has aggro, then red.
I'm using
local _, class = UnitClass("player");
if class == "WARRIOR" then
self:SetBackdropBorderColor(0.95, 0.23, 0.23, 0.50)
elseif class == "PRIEST" then
self:SetBackdropBorderColor(1, 0.96, 0.98, 0.50)
elseif class == "MAGE" then
self:SetBackdropBorderColor(0.00, 1, 1, 0.50)
elseif class == "DRUID" then
self:SetBackdropBorderColor(1, 0.49, 0.04, 0.50)
elseif class == "PALADIN" then
self:SetBackdropBorderColor(0.92, 0.22, 0.46, 0.50)
elseif class == "HUNTER" then
self:SetBackdropBorderColor(0.33, 0.86, 0.00, 0.50)
elseif class == "ROGUE" then
self:SetBackdropBorderColor(1, 0.94, 0.16, 0.50)
elseif class == "SHAMAN" then
self:SetBackdropBorderColor(0.13, 0.42, 1, 0.50)
elseif class == "WARLOCK" then
self:SetBackdropBorderColor(0.36, 0.18, 1, 0.50)
elseif class == "DEATHKNIGHT" then
self:SetBackdropBorderColor(0.77, 0.12, 0.23, 0.50)
end
for the class colored, simply want to add aggro indicator to it.
|
You'll likely want to use UnitThreatSituation ( API UnitThreatSituation - WoWWiki - Your guide to the World of Warcraft) to accomplish this. It should be as easy as adding another IF case before any of the class coloring -- IF the unit has aggro, color it red, ELSE check what class it is.
Skip using the second argument for UnitThreatSituation since you want to check for any aggro, instead of aggro of a specific unit.
|
"The question is not how far we are going to take it... the question is, do you possess the constitution to go as far as needed?" - Il Duce
|
|
|
10/13/10, 1:34 PM
|
#232
|
|
Glass Joe
Blood Elf Paladin
Barthilas
|
Is it possible to just show the level of something.
The same way "[Level: DifficultyColor]" did with dogtags.
|
|
|
|
|
10/17/10, 6:33 PM
|
#233
|
|
Glass Joe
|
delete, figured it out
Last edited by fyritke : 10/18/10 at 6:15 PM.
|
|
|
|
|
10/22/10, 7:18 PM
|
#234
|
|
Glass Joe
|
I am having difficulty trying to print the name of my target's owner (in case my target is a pet). What is the UnitId for it? Right now I have:
if IsPet() then
return '%s',Name(unit)
end
|
Which just prints the pet's name.
|
|
|
|
|
03/16/11, 2:17 AM
|
#235
|
|
Glass Joe
Dwarf Paladin
Stormreaver
|
TextAuras
Hi there. Just before my WoW subscription ended, I put together a very large LuaText to display multiple auras, with animated timer bars, on PitBull4 unit frames. The bottom line of this image shows the default layout of the text for a resto druid, showing Swiftmend, Wild Growth, Rejuvenation, Regrowth, and Lifebloom. (There are defaults for all classes, both healer-oriented and dps-oriented)
The project page (link to curseforge) contains a few animations showing the text in action.
If you give this a try, please post your thoughts at the project page.
The LuaText is so huge that it's inconvenient to edit. If several people express interest, I may be able to resubscribe for a bit and restructure the code as an addon you can call from a short LuaText.
|
|
|
|
|
|