View Single Post
06-11-11, 08:00 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
*edit*

IT WORKED...lol on first try.

@haste the "SetCamera 0" settings seems to be deprecated. Try this:

I changed the portrait.lua and male worgen portraits are now fixed.

Seems like: SetPortraitZoom is the new SetCamera.

lua Code:
  1. local Update = function(self, event, unit)
  2.     if(not unit or not UnitIsUnit(self.unit, unit)) then return end
  3.  
  4.     local portrait = self.Portrait
  5.     if(portrait.PreUpdate) then portrait:PreUpdate(unit) end
  6.  
  7.     if(portrait:IsObjectType'Model') then
  8.         local guid = UnitGUID(unit)
  9.         if(not UnitExists(unit) or not UnitIsConnected(unit) or not UnitIsVisible(unit)) then
  10.             portrait:SetModelScale(4.25)
  11.             portrait:SetPosition(0, 0, -1.5)
  12.             portrait:SetModel"Interface\\Buttons\\talktomequestionmark.mdx"
  13.         elseif(portrait.guid ~= guid or event == 'UNIT_MODEL_CHANGED') then
  14.             portrait:SetUnit(unit)
  15.             --portrait:SetCamera(0)
  16.             portrait:SetPortraitZoom(1)
  17.             portrait.guid = guid
  18.         else
  19.             --portrait:SetCamera(0)
  20.             portrait:SetPortraitZoom(1)
  21.         end
  22.     else
  23.         SetPortraitTexture(portrait, unit)
  24.     end
  25.  
  26.     if(portrait.PostUpdate) then
  27.         return portrait:PostUpdate(unit)
  28.     end
  29. end

First worgen male portrait working correctly
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 06-11-11 at 08:08 AM.
  Reply With Quote