WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Stuf Unit Frames Anchoring (https://www.wowinterface.com/forums/showthread.php?t=39201)

Fhorau 03-08-11 07:12 AM

Stuf Unit Frames Anchoring
 
I made an UI compilation and I want it to work with all resolutions. Everything is anchored to "BOTTOM" and placed in the lower half of the screen, so the aspect ratio doesn't matter. Just Stuf is still anchoring the default way and doesn't fit with diverse ratios. It has no in-game anchor settings.
How can I change it? Do I need to rewrite anything in the LUA code? If so, what?

gfxamk 03-11-11 04:18 AM

look at the core.lua of the stuf addon.do a search for
Code:

uf:SetPoint
and you should find
Code:

uf:SetPoint("TOPLEFT", UIParent, "TOPLEFT", dbuf.x, dbuf.y)
change that to something like
Code:

uf:SetPoint("TOPLEFT", UIParent, "BOTTOM", dbuf.x, dbuf.y)
or better make an anchorframe perhaps 1x1 pixel and then move the unitframes with your anchor.
Code:

uf:SetPoint("CENTER", YourAnchorFrameName, "CENTER", dbuf.x, dbuf.y)
perhaps you need to adjust the x/y postioning, depends on how you do it

Lordyfrb 03-17-11 01:09 PM

Quote:

Originally Posted by gfxamk (Post 231473)
look at the core.lua of the stuf addon.do a search for
Code:

uf:SetPoint
and you should find
Code:

uf:SetPoint("TOPLEFT", UIParent, "TOPLEFT", dbuf.x, dbuf.y)
change that to something like
Code:

uf:SetPoint("TOPLEFT", UIParent, "BOTTOM", dbuf.x, dbuf.y)
or it

Theres a slight problem with your coding, altoough it looks like it would work, the way Stuf positions its frames, you would only be able to move the frames to the right and down from the bottom center of your screen.

The way I accomplished this was to edit 2 files, the first been the same file mentioned in your post (Stuf\core.lua) , but to change the line to read:
Code:

uf:SetPoint("BOTTOM", UIParent, "BOTTOM", dbuf.x, dbuf.y)
Then you need to change Stuf's options file which is Stuf_Options\options.lua

Find line 1192 or do a search for
Code:

x.max, y.min
and replace that line with the following
Code:

x.max, y.min = floor(sw / s)/2, 0
x.min, y.max = -floor(sw / s)/2, floor(sh /s)

Both these changes will have the effect of anchoring all the unit frames to the bottom center of the screen, so on a fresh install some frames will appear on top of each other.

Nhuwaen 04-08-11 06:47 AM

Is there any way to anchor every unit frame individually? For example I need to anchor everything to bottom, except for party unit frames, I need to anchor them to topleft.


All times are GMT -6. The time now is 10:44 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI