Thread Tools Display Modes
09-19-10, 10:40 AM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Error

Why doesnt this work?

Code:
local Portraits = false
Code:
   if(Portraits) then
	   local portrait = CreateFrame('PlayerModel', nil, self)
	   portrait:SetBackdrop(backdrop)
	   portrait:SetBackdropColor(0, 0, 0, .9)
	   portrait:SetScript('OnShow', function(self) self:SetCamera(0) end)
	   portrait:SetWidth(height*3)
	   portrait:SetHeight(height*2)
	   portrait.type = '3D'
	   self.Portrait = portrait

                   CreateBorder(portrait, 12, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)

	if(unit == 'player') then
	 portrait:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', -92, -26)
	elseif(unit == 'target') then
	 portrait:SetPoint('BOTTOMLEFT', self, 'BOTTOMRIGHT', 11, -26)
	elseif(unit == 'focus' or unit == 'pet') then
	 portrait:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', -92, -26)
	end
when i have "local Portraits = false" then my player, target pet, tot.. focus disapre why? then i have = true everything works fine?
  Reply With Quote
09-19-10, 11:29 AM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
You say they "disappear", do you mean just the portraits or the whole unit frame..?

If the whole unit disappears it could be because you forgot to end the if after your portrait section

If you only mean the portrait then that's intended "if (Portrait) then" means if Portrait has a value or is true. When you set Portrait to false or nil the code inside won't run.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
09-20-10, 02:05 AM   #3
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by v6o View Post
You say they "disappear", do you mean just the portraits or the whole unit frame..?

If the whole unit disappears it could be because you forgot to end the if after your portrait section

If you only mean the portrait then that's intended "if (Portrait) then" means if Portrait has a value or is true. When you set Portrait to false or nil the code inside won't run.
Everything "disappear" I only want the portraits to disapper..

when i do local Portraits = false

And it doesnt really mather what you write " if(Portraits) then " or
if(Portrait) then "
  Reply With Quote
09-20-10, 02:36 AM   #4
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Nvm i fixed it.
  Reply With Quote
09-20-10, 02:55 AM   #5
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Glad you fixed it.

Originally Posted by Game92 View Post
And it doesnt really mather what you write " if(Portraits) then " or
if(Portrait) then "
I just missed the s at the end
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Error


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