Thread Tools Display Modes
12-09-09, 11:04 AM   #1
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
*portraits, patch 3.3, oUF 1.3.24 and you*

Since 3.3 my portrait code no longer accepts any SetAlpha changes. No matter what I change it stays at 1.0.

Code:
	if unit=="player" or unit=="target" or unit=="focus" or (self:GetParent():GetName():match"oUF_Party") then	
		local portrait = CreateFrame("PlayerModel", nil, self)
		portrait:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 1, -1)
		portrait:SetPoint("BOTTOMRIGHT", self.Health, "BOTTOMRIGHT", -1, 1)
		self.Portrait = portrait
		portrait:SetFrameStrata("LOW")		
		portrait:SetFrameLevel(11)
			if useportraits == true then		
				portrait:SetAlpha(0.2)
			else
				portrait:SetAlpha(0)
			end		
	end

	local HidePortrait = function(self, unit) -- attempt to hide portraits when not available
		if (not UnitExists(self.unit) or not UnitIsConnected(self.unit) or not UnitIsVisible(self.unit)) then
			self.Portrait:SetAlpha(0)
		elseif (UnitExists(self.unit) or UnitIsConnected(self.unit) or UnitIsVisible(self.unit)) and useportraits==true then
			self.Portrait:SetAlpha(0.2)
		end
	end
I also tried it without the HidePortrait function, like this

Code:
		local portrait = CreateFrame("PlayerModel", nil, self)
		portrait:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 1, -1)
		portrait:SetPoint("BOTTOMRIGHT", self.Health, "BOTTOMRIGHT", -1, 1)
		self.Portrait = portrait
		portrait:SetFrameStrata("LOW")		
		portrait:SetFrameLevel(11)
				portrait:SetAlpha(0.2)

Thing is, I haven't changed portrait code for ages and I used oUF 1.3.24 before patch day, too. Without such a behaviour, SetAlpha worked just fine. But since 3.3 it won't accept alpha changes anymore. Any ideas? Bug?
__________________
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
12-09-09, 11:36 AM   #2
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
I was able to repro what you're seeing, but also found something fun. If you set the alpha after the frame has been created, it'll stick. For example, with oUF_Banthis I just ran this while in game:

/script bouf_player.Portrait:SetAlpha(0.2)

And it had the expected effect.

Not sure what that really tells you, as I can't find something else that's preventing it, but maybe it'll help.

Edit: Further testing with making the call within the layout to set the alpha after the frames have spawned does nothing. It seems that only after the UI has actually loaded can the call stick. I'm guessing it's something on Blizz's side that did it.

Last edited by wurmfood : 12-09-09 at 12:19 PM.
  Reply With Quote
12-09-09, 12:16 PM   #3
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Mhm, strange.

Question is if this an "issue" with oUF or is something wrong on blizzards 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
12-09-09, 02:50 PM   #4
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
Originally Posted by Dawn View Post
Mhm, strange.

Question is if this an "issue" with oUF or is something wrong on blizzards end.
I'm having the same issue >.>
  Reply With Quote
12-09-09, 08:08 PM   #5
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
I seen what Wurmfood wrote and was curious if you could put something into the oUF layout like this:

Code:
OnLoad = function(self, event, unit)
	if PLAYER_ENTERING_WORLD then
	
	oUF_Player.Portrait:SetAlpha(0.2);
	oUF_Target.Portrait:SetAlpha(0.2);
	
	end
	
end
Clearly, i am doing something wrong because i get no errors but it doesn't do the script ingame...

But I tried the script and it works, now how would you go about calling this script everytime the player entered the world? Just a thought maybe until there is a fix?
  Reply With Quote
12-09-09, 08:15 PM   #6
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
Tested it some more with a simple addition to my layout at the end of the file:

Code:
local testFrame = CreateFrame("PlayerModel", portraitTestFrame, UIParent)
testFrame:SetScript('OnEvent', function(self, event, ...) self[event](self, event, ...) end)
testFrame:RegisterEvent('ADDON_LOADED')

function testFrame:ADDON_LOADED(event, name)
	if( name == 'oUF_Banthis') then
		testFrame:SetHeight(300)
		testFrame:SetWidth(300)
		testFrame:SetPoint("CENTER", UIParent, "CENTER")
		testFrame:SetUnit("player")
		testFrame:SetAlpha(0.2)
		testFrame:Show()
	end
end
(I set it up this way to reflect better how the rest of my layout is set up.)

Using this, it's showing properly... so I think it's something in oUF. I've been digging through the commits since about the end of November and I don't see anything that strikes me as a likely culprit.
  Reply With Quote
12-09-09, 11:32 PM   #7
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
haste added 2 functions to update the portrait : Pre/PostUpdatePortrait.
Maybe you should take a look :
http://github.com/haste/oUF/commit/3...8f87fc1a77491c
  Reply With Quote
12-10-09, 12:36 AM   #8
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
I saw those, but the inclusion of those to the base code nor the exclusion of the functions in a layout shouldn't cause an issue. This isn't something that needs to be updated when the portrait is (or shouldn't need to be). Once it's set, it should stay that way. A workaround would be to set up the post update function to do this, but that seems overkill.
  Reply With Quote
12-10-09, 05:30 AM   #9
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Omicron posted something that works, but you have to edit oUF\portrait.lua directly ... not a nice way.

Code:
local Update = function(self, event, unit)
	if(not UnitIsUnit(self.unit, unit)) then return end
	if(self.PreUpdatePortrait) then self:PreUpdatePortrait(event, unit) end

	local portrait = self.Portrait
	if(portrait:IsObjectType'Model') then
		local name = UnitName(unit)
		if(not UnitExists(unit) or not UnitIsConnected(unit) or not UnitIsVisible(unit)) then
			portrait:SetModelScale(4.25)
			portrait:SetPosition(0, 0, -1.5)
			portrait:SetModel"Interface\\Buttons\\talktomequestionmark.mdx"
-->			portrait:SetAlpha(0.25)
		elseif(portrait.name ~= name or event == 'UNIT_MODEL_CHANGED') then
			portrait:SetUnit(unit)
			portrait:SetCamera(0)

			portrait.name = name
-->			portrait:SetAlpha(0.25)
		else
			portrait:SetCamera(0)
-->			portrait:SetAlpha(0.25)
		end
	else
		SetPortraitTexture(portrait, unit)
	end

	if(self.PostUpdatePortrait) then
		return self:PostUpdatePortrait(event, unit)
	end
end

I removed portraits from my layout, for now. Until there is a workaround to this.
__________________
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

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » *portraits, patch 3.3, oUF 1.3.24 and you*


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