Thread Tools Display Modes
02-07-10, 07:03 PM   #1
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
change initial frame scale on event

I'm trying to change my raids scale based on the number of raid members. I tried to use a function and update it on some events. There's no error popping up, but it is not working so far (no resize going on).

The function
Code:
local function raidReSize(self, event, unit)
	if(self:GetParent():GetName():match"oUF_Raid") then 
		local numMemb = GetNumRaidMembers()
				if numMemb > 10 then
					self:SetAttribute('initial-scale', RaidScale*0.6) -- 60% of initial raid scale
				else
					self:SetAttribute('initial-scale', RaidScale)
				end
	end	
end
what I put into the raid part of the layout
Code:
		self:RegisterEvent("PLAYER_LOGIN", raidReSize)
		self:RegisterEvent("RAID_ROSTER_UPDATE", raidReSize)
		self:RegisterEvent("PARTY_LEADER_CHANGED", raidReSize)
		self:RegisterEvent("PARTY_MEMBERS_CHANGED", raidReSize)

Any ideas what's wrong? Or how to achieve changing raids scale/size based on the number of raid members, at all?
__________________
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
02-07-10, 09:28 PM   #2
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
The "initial-scale" part only works for the initial spawn. After that, use SetScale while out of combat.
  Reply With Quote
02-08-10, 04:06 AM   #3
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
I changed the code to use SetHeight instead which works like a charm, thanks for the hint with initial scale not working at all times.
__________________
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
02-08-10, 08:23 AM   #4
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by Dawn View Post
I changed the code to use SetHeight instead which works like a charm, thanks for the hint with initial scale not working at all times.
I thought INITIAL said enough :P
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
02-08-10, 02:46 PM   #5
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
I use initialscale instead of setscale on my frames, because it works if the unit is spawned in combat (and wasn't spawned before). It's not that obvious, imho.
__________________
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) » change initial frame scale on event


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