Thread Tools Display Modes
07-05-10, 06:49 PM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Portraits.

Hello everybody, i want to fix this

1. move the player portrait to the arrow spot.
2. Remove ToT, Pet Focus Partrait.
3. want it to stay put.



my code looks like this:
Code:
local portrait = CreateFrame("PlayerModel", nil, self)
	  portrait:SetBackdrop(backdrop)
		portrait:SetBackdropColor(0, 0, 0, .7)
		portrait:SetScript("OnShow", function(self) self:SetCamera(0) end)
		portrait:SetWidth(height*3)
		portrait:SetHeight(height*2)
		portrait:SetPoint("BOTTOMLEFT", self, "BOTTOMRIGHT", 6, -2)
		portrait.type = "3D"
		self.Portrait = portrait

Last edited by Aftermathhqt : 07-05-10 at 07:17 PM.
  Reply With Quote
07-05-10, 06:53 PM   #2
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
change
Code:
portrait:SetPoint("BOTTOMLEFT", self, "BOTTOMRIGHT", 6, -2)
to

Code:
portrait:SetPoint("BOTTOMRIGHT", self, "BOTTOMLEFT", -6, -2)
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
07-05-10, 06:57 PM   #3
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
dont think you got it, i want the player portrait at the other side and the target and tot to still be at there spot
  Reply With Quote
07-05-10, 07:18 PM   #4
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Ok, fixed it better now, hope you can understand me better.
  Reply With Quote
07-05-10, 07:47 PM   #5
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Don't set one position for all frames. Set it for each unit separately.

Code:
if unit == "player" then
SetPosition ...
elseif unit == "whatever" then
SetPosition ...
...

end
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
07-05-10, 08:00 PM   #6
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
this worked, thanks! but only one problem, how do i remove portraits from ToT pet, and focus?

  Reply With Quote
07-05-10, 08:16 PM   #7
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Just do not set a point or use ClearAllPoints() for those units.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
07-05-10, 11:08 PM   #8
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
Replace the

portrait:SetPoint("BOTTOMLEFT", self, "BOTTOMRIGHT", 6, -2)
with

Code:
 if unit == "player" or unit == "target" then 
        portrait:SetPoint("BOTTOMLEFT", self, "BOTTOMRIGHT", 6, -2)
 else
       portrait:SetPoint(nil)
 end
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"
  Reply With Quote
07-06-10, 07:48 AM   #9
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
He wants his player portrait to the left and target to the right.

Anyway, you don't need to nil out SetPoint, if you set a point for player and target only. That ends up being the same as if you set a point and clear it afterwards. Except for being cleaner code-wise, ofc.

Clean solution would be a function that creates the portrait

Code:
local createPortraits = function(self, unit)
	self.Portrait = CreateFrame("PlayerModel", nil, self.Health)
	self.Portrait:SetWidth(yeahkk)
	self.Portrait:SetHeight(whatever)
end
and than ...

Code:
if unit == "player" then
createPortraits(self)
self.Portrait:SetPoint(.......)
end

if unit == "target" then
createPortraits(self)
self.Portrait:SetPoint(.......)
end

....
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
07-06-10, 10:35 AM   #10
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
fixed it, thanks for the help guys, here is it how it turned out

  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Portraits.


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