Race & class
Hi there all.
I just wanted to ask. if there is a Layout already made. or where i could start. what it is. i was thinknig alot of the layouts i find use UnitClass & UnitRace but end up with the full race and class name. i wanted to make a plugin that shortens this. ie. Like Draenei - Death Knight Class - Death Knight TO 'DK' Race - Draenei to 'D' this i guess moght have a floor. but i think you see like shorted down vers of partys and so on. race and class. thanks for you time. |
What about
"a class colored name or bar or whatever"? and "a DK is a DK is a DK" so forget about the freaking race? :rolleyes: Just some thoughts on information that you shouldn't care about. |
Quote:
so say your a mage. you mana bar looks like this Code:
80 Human Mage 100% and try to add Class icons. i think i remember cogumel0 doing somthing like this. but then do i add them into the mana bar. :) but i still would like to add a text format. im not big into icons. other then lfd leader ect. lol |
If class colors are insufficient for you, try something like this:
Code:
local classabbrev = { Code:
self.Class:SetText(classabbrev[UnitClass(unit)]) |
Quote:
thanks again |
well this is what i did
Code:
local classabbrev = { the in the self part. i put Code:
self.Class:SetText(classabbrev[UnitClass(unit)]) Code:
Interface\AddOns\oUF_Test\oUF_Test.lua:634: attempt to index field 'Class' (a nil value) |
check if self.Class exists first
|
Quick walkthrough
Code:
-- this needs to be defined before the function you use to update the font string (see below) Code:
local updateHealth = function(self, event, unit, bar, min, max) Code:
-- create the font string Code:
if (unit == "target") or (unit == "focus") then -- define the frames on which the font string should be shown |
thank you for your time Dawn., i will look into this tomorrow. thanks.
|
You should change the table keys to match the second return from UnitClass so that it's locale independent. The format is the English name is all capital letters with spacing removed. MAGE, HUNTER, DEATHKNIGHT etc.
|
Quote:
|
thanks again so much for the iput. i need to 1st remove the comment that my code has that show the race and class.
as im testing out on oUF Classic. as i found on the fourm that is the best place to learn. so ive been adding LFG and other things i like in a ui. there are lots out there that tick alot of boxs. |
ok well it all seems to be ok. by one bit.
Code:
local PostUpdatePower = function(self, event, unit, bar, min, max) now looking over it. the template im usen. i see this Code:
-- Info string and with the help from you guys. i think maybe what we have can be added into this. as that self tag is set up for level then class. i was thinking to add all the code ive had help make and just add classabbrev from the local updateHealth part. but it didnt work. i guess i dont know that code. at this point i did have the local classabbrev = { and the font string added./ so that way i was thinking not like 'L[level][shortclassification] [raidcolor][classabbrev]' but 'L[level][shortclassification] [raidcolor][classabbrev[UnitClass(unit)]' well again guys thanks for your time and help. |
you need to create a new tag
Code:
oUF.Tags['shortclass'] = function(unit) |
Quote:
'L[level][shortclassification] [raidcolor][classabbrev[UnitClass(unit)]' that didnt work. and this did not work also. self.Class:SetText((classabbrev[UnitClass(unit)]) or (UnitCreatureType(unit))) under the PostUpdatePower i just get Test.lua:103: '<eof>' expected near 'end' Count: 1 Call Stack: [C]: ? thanks |
There's at least one "end" to much or to less. Leaving a function open or closing it to early.
|
Quote:
Code:
local PostUpdatePower = function(self, event, unit, bar, min, max) self.Class:SetText((classabbrev[UnitClass(unit)]) or (UnitCreatureType(unit))) if(min == 0) then i get the error attempt to index field 'class' (a nil value) |
You are still trying to use the "self.Class" FontString from my example, without having it defined. Thus the error. You are using "info", replace self.Class with "self.info". :)
|
Quote:
local class = pp:CreateFontString(nil, "OVERLAY", "GameFontNormal") class = self.Health:CreateFontString(nil, "ARTWORK") class:SetPoint("LEFT", 2, -1) class:SetPoint("RIGHT", -2, 0) class:SetJustifyH"LEFT" class:SetFont(GameFontNormal:GetFont(), 11) class:SetTextColor(1, 1, 1) i made a fontstring. for the call to be handled. well that is what i was thinking |
add at the end of your fontstring declaration :
self.Class = class That should do it (but remember self.Class and class are different till you say they're not). |
All times are GMT -6. The time now is 06:42 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI