Quantcast SecureGroupHeader InitialConfig scale does not affect header - WoWInterface
 
Thread Tools Display Modes
11-15-16, 12:46 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
SecureGroupHeader InitialConfig scale does not affect header

When a scale is set in the initialconfiguration of a secure groupheader unit button it affects the button, but not the header.

Lua Code:
  1. "oUF-initialConfigFunction", ([[
  2.         self:SetWidth(%d)
  3.         self:SetHeight(%d)
  4.         self:SetScale(%f)
  5.       ]]):format(110,26,0.5)

The result is sth like this:

0.5 scale:
http://imgur.com/a/OWWvn

0.8 scale:
http://imgur.com/a/ifeUa

1 scale:
http://imgur.com/a/PrqBh

1.25 scale: (header does not even fit all the unit buttons!)
http://imgur.com/a/1mdHn

The header resize calculation works of the unit button width/height (https://github.com/tomrus88/Blizzard...aders.lua#L231), but for whatever reason it is ignoring the scale of the button resulting in a way to large unit header on low scale values and to low size if the scale is > 1.

This destroys all offsets since it only works for scale 1 properly.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

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

Last edited by zork : 11-15-16 at 01:11 PM.
 
11-15-16, 01:14 PM   #2
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
I see what are you saying now, what happens if you create your unitbutton like this then?

Lua Code:
  1. self.headers[i]:SetAttribute("style-width", 68)
  2. self.headers[i]:SetAttribute("style-height", 41)
  3. self.headers[i]:SetAttribute("style-scale", 1)
  4.  
  5. self.headers[i]:SetAttribute("initialConfigFunction", [[
  6.     local header = self:GetParent()
  7.  
  8.     self:SetHeight(header:GetAttribute("style-height") * header:GetAttribute("style-scale"))
  9.     self:SetWidth(header:GetAttribute("style-width") * header:GetAttribute("style-scale"))
  10.     --self:SetScale(header:GetAttribute("style-scale"))
  11.  
  12.     header:CallMethod("initialConfigFunction", self:GetName())
  13. ]])

No scale attribute or 1, just setting the width/height multiplied with the scale itself.

Edit:
I think the style-scale attribute is broken too, if you use a simple SetScale on the header that should also get applied on every unit child which will also scale up the unit button's width/height and the offsets will work properly too:

self.headers[i]:SetScale(1)

Last edited by Resike : 11-17-16 at 07:08 PM.
 
11-15-16, 02:53 PM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
I tried any variant of applying init-scale. None of them had an effect.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
11-15-16, 05:52 PM   #4
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Originally Posted by zork View Post
I tried any variant of applying init-scale. None of them had an effect.
You do this outside of the init function, where you've created your header frame. Might not be possible to do with oUF tho.

You could try to do this too:

Lua Code:
  1. self.header:SetAttribute("initialConfigFunction", [[
  2.     local header = self:GetParent()
  3.     header:SetScale(1.2)
  4.  
  5.     header:CallMethod("initialConfigFunction", self:GetName())
  6. ]])

Last edited by Resike : 11-15-16 at 05:56 PM.
 
11-17-16, 08:19 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
I will try your last idea later. The implementation has to be secure. Otherwise it is of no use since raid headers can be spawned in combat.

Maybe I can do this:
Lua Code:
  1. "oUF-initialConfigFunction", ([[
  2.   self:SetWidth(%d)
  3.   self:SetHeight(%d)
  4.   self:GetParent():SetScale(%f)
  5. ]]):format(110,26,0.5)

*edit*

Tested it. The above is the solution!

It works if you set the header scale instead of the unit button scale inside the initialConfiguration.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

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

Last edited by zork : 11-17-16 at 11:11 AM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » SecureGroupHeader InitialConfig scale does not affect header

Thread Tools
Display Modes

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