Thread Tools Display Modes
12-11-08, 03:39 PM   #301
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by ObbleYeah View Post
So it would seem. Getting this into a tag is annoying though with my knowledge of code.

Code:
oUF.Tags['[name]']       = function(u) return string.sub(value.unit, -3) end
Is what I have but it's blowing out errors.

Edit: Interface\AddOns\oUF_obbleGrid\layout.lua:25:bad argument #1 to 'sub'(string expected, got nil) is the error
Clearly you are using it wrong

Code:
oUF.Tags['[name]'] = function(u) return strsub(u, 1, 3) end
 
12-11-08, 03:49 PM   #302
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by p3lim View Post
Clearly you are using it wrong

Code:
oUF.Tags['[name]'] = function(u) return strsub(u, 1, 3) end
Thanks p3lim, me and obble have been looking for this for quite some time now
__________________
All I see is strobe lights blinding me in my hindsight.
 
12-11-08, 03:51 PM   #303
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Originally Posted by p3lim View Post
Clearly you are using it wrong

Code:
oUF.Tags['[name]'] = function(u) return strsub(u, 1, 3) end
I know i am, but your code just returns the name of the frame (i.e: tar)
 
12-11-08, 03:53 PM   #304
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
I'm guessing i'm going to have to find the UTF-8 code for UnitName :<
 
12-11-08, 03:55 PM   #305
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by ObbleYeah View Post
I know i am, but your code just returns the name of the frame (i.e: tar)
ow yeah, forgot

Code:
oUF.Tags['[name]'] = function(u) return strsub(UnitName(u), 1, 3) end
 
12-11-08, 04:00 PM   #306
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Originally Posted by p3lim View Post
ow yeah, forgot

Code:
oUF.Tags['[name]'] = function(u) return strsub(UnitName(u), 1, 3) end

Tried that, throws out this error by the bucketful.

Interface\AddOns\oUF\elements\health.lua:37:Usage:UnitHealth("unit")
 
12-11-08, 04:18 PM   #307
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by ObbleYeah View Post
Tried that, throws out this error by the bucketful.

Interface\AddOns\oUF\elements\health.lua:37:Usage:UnitHealth("unit")
Thats some completely other error, has nothing to do with that line.
 
12-12-08, 04:55 AM   #308
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Originally Posted by p3lim View Post
Thats some completely other error, has nothing to do with that line.
It only occurs when i have the name tag uncommented. It seems the name tag is causing the issue. I'l root round a bit more.
 
12-12-08, 05:27 AM   #309
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Just noticed that at the very start of the hundreds of errors i get this:

Interface\AddOns\oUF_obbleGrid\layout.lua:24:bad argument #1 to 'sub' (string expected, got nil)
 
12-12-08, 05:30 AM   #310
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
UnitName() can return nil, so you'll have to account for this.
 
12-12-08, 05:44 AM   #311
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Forgive me, i'm still learning, but how would i turn

Code:
oUF.Tags['[name]']       = function(u) return string.sub(UnitName(u), 1, 8)  end
into a tag that recognizes a nil value? Tried

Code:
oUF.Tags['[name]']       = function(u) return string.sub(UnitName(u), 1, 8) or "" end
But it didn't do much
 
12-12-08, 05:52 AM   #312
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Hello, this is my first shot at an oUF_Layout and i'm using p3lims as a base. (thanks p3lim )

However, i'm having a few problems getting warlock pets to color after the warlock class color, i spoke with Obble on IRC about this but we had no avail... We(He, actually ) came up with this piece of code:
Code:
		elseif UnitClass('player') == 'WARLOCK' then
			self.Health:SetVertexColor(148/255,130/255,201/255)
		end
But that didn't work, i've pastey'd my whole code here.
Anyone mind sheding some light over this? Tried several things now but nothing seems to work

Thanks in advance and sorry for my english.
__________________
All I see is strobe lights blinding me in my hindsight.
 
12-12-08, 06:14 AM   #313
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by ObbleYeah View Post
Forgive me, i'm still learning, but how would i turn

Code:
oUF.Tags['[name]']       = function(u) return string.sub(UnitName(u), 1, 8)  end
into a tag that recognizes a nil value? Tried

Code:
oUF.Tags['[name]']       = function(u) return string.sub(UnitName(u), 1, 8) or "" end
But it didn't do much
Code:
function(u) local name = UnitName(u); if(name) then return name:sub(1, 8) else return '' end end
 
12-12-08, 06:20 AM   #314
Quokka
A Chromatic Dragonspawn
 
Quokka's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 196
is there a way to assing textures to different powers?
and make them animated kinde like the SpartanUI does
 
12-12-08, 06:32 AM   #315
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Everything is possible - if you code it .
 
12-12-08, 07:03 AM   #316
Quokka
A Chromatic Dragonspawn
 
Quokka's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 196
Haste I was hoping to rebuild it kinde like they did only using ouf as a base for the unitframes

Code:
	---------------------------------------------------- Powerbar 
	self.Power = CreateFrame('StatusBar', nil, self)
	self.Power:SetHeight(unit and 8 or 4)
		if(UnitPowerType(unit)==1) then
			self.Power:SetStatusBarTexture(manatex)
		elseif(UnitPowerType(unit)==2) then
			self.Power:SetStatusBarTexture(ragetex)
		elseif(UnitPowerType(unit)==3) then
			self.Power:SetStatusBarTexture(focustex)
		elseif(UnitPowerType(unit)==4) then
			self.Power:SetStatusBarTexture(energytex)
		end
	self.Power:SetPoint('BOTTOMLEFT') 
	self.Power:SetPoint('BOTTOMRIGHT') 
	self.Power.Smooth = true
	self.Power.frequentUpdates = true
	---------------------------------------------------- Powerbar background 
	self.Power.bg = self.Power:CreateTexture(nil, 'BORDER') 
	self.Power.bg:SetAllPoints(self.Power) 
	self.Power.bg:SetTexture(.25,.25,.25)
 
12-12-08, 08:49 AM   #317
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
That will just set a static texture, it won't update if the unit shapeshifts etc.
 
12-12-08, 10:32 AM   #318
Quokka
A Chromatic Dragonspawn
 
Quokka's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 196
How would I do that then, making them now that i have multiple frames in an images & update them on shapeshift?
 
12-12-08, 12:01 PM   #319
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Quokka View Post
How would I do that then, making them now that i have multiple frames in an images & update them on shapeshift?
Use events and make an own handler to update it
 
12-14-08, 11:38 AM   #320
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Wimpface View Post
Hello, this is my first shot at an oUF_Layout and i'm using p3lims as a base. (thanks p3lim )

However, i'm having a few problems getting warlock pets to color after the warlock class color, i spoke with Obble on IRC about this but we had no avail... We(He, actually ) came up with this piece of code:
Code:
		elseif UnitClass('player') == 'WARLOCK' then
			self.Health:SetVertexColor(148/255,130/255,201/255)
		end
But that didn't work, i've pastey'd my whole code here.
Anyone mind sheding some light over this? Tried several things now but nothing seems to work

Thanks in advance and sorry for my english.
You gotta use :SetStatusBarColor(), since self.Health is not a texture, its a StatusBar frame.
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion


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