Download
(23Kb)
Download
Updated: 05-12-11 02:49 AM
Pictures
File Info
Updated:05-12-11 02:49 AM
Created:04-14-11 10:33 AM
Downloads:11,132
Favorites:74
MD5:

!Beautycase  Popular! (More than 5000 hits)

Version: 1.1.0
by: Neal [More]

This is a small addon for add fast and efficiently smooth borders to your frames!
You dont need to create a texture for all of your frames annymore. Just this little addon and some code below.
The benefit? The border remains the same, even if the window's size changes. It always looks like it should be.

It's a LUA bases addon. So there are no ingame configurations.

So ok, and how can you use it?

It's quite simple!
!Beautycase has some simple functions.


Create a border

Code:
CreateBorder(myFrame, borderSize, R, G, B, uL1, uL2, uR1, uR2, bL1, bL2, bR1, bR2)
myFrame
-> The name of your frame, It must be a frame not a texture
borderSize
-> The size of the simple square Border. 10-12 looks amazing with the default beautycase texture
R, G, B -> The colors of the Border. r = Red, g = Green, b = Blue
uL1, uL2 -> top left x, top left y
uR1, uR2 -> top right x, top right y
bL1, bL2 -> bottom left x, bottom left y
bR1, bR2 -> bottom right x, bottom right y
Shorter method to add a border with no spacing
Code:
CreateBorder(myFrame, borderSize, r, g, b)
Or simple just one number (x) for the same distance on all corners
Code:
CreateBorder(myFrame, borderSize, r, g, b, x)
Change the border/shadow color

"a" is the alpha, its is an alternative possibility and is not needed
Code:
ColorBorder(self, r, g, b, a)
Code:
ColorBorderShadow(self, r, g, b, a)

Change the border/shadow texture

Why? So when you want to use different textures like a "normal" texture
and a white texture for debuff highlight or as indicator for something
Code:
SetBorderTexture(myFrame, texture.tga)
SetBorderShadowTexture(myFrame, texture.tga)

Get infos about the beautycase border on a frame

Code:
local size, texture, r, g, b, alpha = GetBorderInfo(myFrame)

Try it out und you will see how easy you can add a cool border to your frames!

NEW FEATURES!

Code:
  
    myFrame:CreateBorder(borderSize)
    myFrame:SetBorderSize(borderSize)
    
    myFrame:SetBorderPadding(number or [uL1, uL2, uR1, uR2, bL1, bL2, bR1, bR2])
    
    myFrame:SetBorderTexture(texture)
    myFrame:SetBorderShadowTexture(texture)
    
    myFrame:SetBorderColor(r, g, b)
    myFrame:SetBorderShadowColor(r, g, b)
    
    myFrame:HideBorder()
    myFrame:ShowBorder()
    
    myFrame:GetBorder() - true if has a beautycase border, otherwise false
    
    local borderSize, texture, r, g, b, alpha = myFrame:GetBorderInfo()
Change the texture

You dont like the texture included in !Beautycase? Want your own?
So go into the !Beautycase/media folder and change the textureNormal.tga
file with a file of your choice.

Problems
How or where can i put these code snippets into a file or get to work?

First: DONT'T put the code snippets into the beautycase file.
Create a little addons and put the code in its .lua file.

------------------------------------------------------------

You want to skin the frames of an addon.
For example Pitbull or Omen but you get an error message?
So watch out.

WoW initalize all addon alphabetically.
So when you created a addon like "myAddon" and want
to "CreateBorder(aPitbullFrame, ...)" you can only get an error message because
you want to create a border on a frame which at that time does not exist.

Loading ... !Beautycase
Loading ... aAddon
Loading ... bAddon
Loading ... cAddon
Loading ... myAddon > CreateBorder(aPitbullFrame, ...) > Error. This frame does not exist
Loading ... Omen
Loading ... Pitbull > CreatePitbullUnitFrames
So thats one of the most mistake.
You cannot create a border on a frame that does not exist.

In the example below you must create a addon whose first character must be greater than "p"
The some for Omen and other addons. (z is a good character)

Thats the point why this addon is called !Beautycase and not Beautycase.
Its loaded as one of the first addons so that you can use the !Beautycase functions very early in a addon

------------------------------------------------------------

How can i find out the name of an frame?
Create a macro
/print GetMouseFocus():GetName()
Go over the frame you want to give a border and use this macro

Your frame has no name? Than the only solution is to insert the beautycase
code directly into the source data/function of these addon.

If you have no idea how to do this. Ask other people on the wowi/other ui forums.
There are to many wow addons, so I can't give some help with this problems.
If they have no ideas, you can even try it on the comment function of these addon.

v. 1.1.0

- huge update
- border is now names "self.beautyBorder[i]" to prevent issues with other addons
- do NOT update if you dont need the "new" features!

v. 1.0.3

- new functions
- alpha can now be change
- some non-essential changes

v. 1.0.2

- fix how variables should be handled
Optional Files (0)


Post A Reply Comment Options
Unread 04-18-11, 01:30 AM  
Neal
A Defias Bandit
 
Neal's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 300
Uploads: 10
Ok I've tested it with kgPanels now.

When you have active the config mode, your frame cannot have a name because there is a frame over your frame (these turquoise frame for resizeing, moving etc).

So to get the panel name lock your panel (enable mouseclicks) and try the FrameName macro.

As result you should get "kgPanel1", "kgPanel2" ... etc.

I've tried this
Code:
/run CreateBorder(kgPanel1, 11, 1, 1, 1)
And it work fine for me

----------------------------------

Haha lol, possibility 2, to easy ^^

/kgpanels config > active panels > yourpanel > scripts > Scripts Dependency > "!Beautycase"

AND THEN

/kgpanels config > active panels > yourpanel > scripts > onload > CreateBorder(self, 11, 1, 1, 1)
Have fun !

btw. screenshot of your result?
Last edited by Neal : 04-18-11 at 01:52 AM.
Report comment to moderator  
Reply With Quote
Unread 04-18-11, 02:28 AM  
Neal
A Defias Bandit
 
Neal's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 300
Uploads: 10
Sorry for doublepost :O

For recount (a AddOn with z as first letter for example)
Code:
CreateBorder(Recount_MainWindow, 11, 1, 1, 1)

For ShadowedUnitFrames

ShadowedUnitFrames.lua ~ line:199:
Code:
function ShadowUF:LoadUnits()

    ... some code here

    CreateBorder(SUFUnitplayer, 11, 1, 1, 1)
    CreateBorder(SUFUnittarget, 11, 1, 1, 1)
    CreateBorder(SUFUnit....)
end
Last edited by Neal : 04-18-11 at 02:47 AM.
Report comment to moderator  
Reply With Quote
Unread 04-18-11, 05:03 PM  
kamilo
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
There is no need to actually modify Shadowed Unit Frames source to load borders (nor manually list frames), you can simply override the function that does all the loading.

After playing around with the SUF internal functions, here's what I came up with, and seems to work with every frame SUF creates:

Code:
-- borders for all SUF Frames

local SUFUnits = ShadowUF.Units
local CreateUnit = SUFUnits.CreateUnit

function SUFUnits.CreateUnit(...)
	local frame = CreateUnit(...)
	CreateBorder(frame, 12, 1, 1, 1)
	return frame
end
Just put this in a new addon and you should be fine.
Report comment to moderator  
Reply With Quote
Unread 04-18-11, 05:21 PM  
flexe
A Defias Bandit
AddOn Compiler - Click to view compilations

Forum posts: 3
File comments: 7
Uploads: 1
Thankyou for those Neal, have them working now..

Right after I posted that comment yesterday I actually figured out a way of bordering kgpanel frames by inserting the CreateBorder() into the kgPanels.lua around line 403 in the getFrame() function right after the frame:Show().. it seems to add the border to each new frame when you make it.. the only problem with this way is that it will create it for every frame regardless, though this isint a huge problem for myself.

As for a screenshot: http://i1206.photobucket.com/albums/...911_001952.jpg .. still a work in progress, but slowly getting there.
Report comment to moderator  
Reply With Quote
Unread 05-02-11, 09:41 AM  
JayK83
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Really nice Addon.

I do have an request. Would it be possible that you can provide a SharedMedia compatible version of your default Border Texture?
Report comment to moderator  
Reply With Quote
Unread 05-02-11, 10:11 AM  
Neal
A Defias Bandit
 
Neal's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 300
Uploads: 10
what you you mean with "SharedMedia compatible version" ?
Report comment to moderator  
Reply With Quote
Unread 05-02-11, 10:27 AM  
JayK83
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
I meant, so that i can put that texture into sharedmedia to use it in every shared media compatible addon.

In sharedmedia the border textures are split in 4 parts in a 128x16px texture.

e.g.: http://img594.imageshack.us/img594/1116/fer1.jpg
Report comment to moderator  
Reply With Quote
Unread 05-07-11, 05:57 AM  
Gyalwa
A Kobold Labourer

Forum posts: 1
File comments: 5
Uploads: 0
famBags

Hi,
I am trying to get some borders to famBags, but with no results...
the frame name is: famBagsFrame, but !Beautycase is not able to find such?!

Any help is appreciated...
Report comment to moderator  
Reply With Quote
Unread 05-07-11, 09:28 AM  
Neal
A Defias Bandit
 
Neal's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 300
Uploads: 10
Re: famBags

Originally posted by Gyalwa
Hi,
I am trying to get some borders to famBags, but with no results...
the frame name is: famBagsFrame, but !Beautycase is not able to find such?!

Any help is appreciated...
Try famBagsLayout.lua:Line 212~

Code:
.....
self.famBagsFrame:Hide()
CreateBorder(self.famBagsFrame, 11, 1, 1, 1)
self.MAINFRAMES['bags'] = self.famBagsFrame
...
Report comment to moderator  
Reply With Quote
Unread 05-07-11, 09:36 AM  
Gyalwa
A Kobold Labourer

Forum posts: 1
File comments: 5
Uploads: 0
Fantastico^^ Worked fine.
Thank you very much und danke schön
Report comment to moderator  
Reply With Quote
Unread 05-07-11, 06:01 PM  
Timmcc
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
I for the life of me can't get borders to load around Bartender buttons. I have tried editing the Bartender .LUA and that works but I get spammed with errors. I have also made an addon called Zui and I get an error that the frame doesnt exist when I load my UI. Bartender has a frame for each button and thats what I'm trying to put a border on. Here is the code I'm using:

Code:
CreateBorder(BT4Button1, 12, R, G, B, 1, 1, 1, 1, 1, 1, 1, 1)
I can manually put that in in-game and it does it, just having trouble getting it to load on logging in via a .lua file. It seems like the button frames for bartender dont load when bartender does or something.

Also, if anyone knows a way to simplify putting a border on 36 buttons using the above code I'd be all ears. I have been browsing the internet for about 3 hours and I can't sift through all the information and/or sample veiwing of published books.

Thanks for any responses.
Report comment to moderator  
Reply With Quote
Unread 05-08-11, 10:08 AM  
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 784
File comments: 150
Uploads: 14
Originally posted by Timmcc
I for the life of me can't get borders to load around Bartender buttons. I have tried editing the Bartender .LUA and that works but I get spammed with errors. I have also made an addon called Zui and I get an error that the frame doesnt exist when I load my UI. Bartender has a frame for each button and thats what I'm trying to put a border on. Here is the code I'm using:

Code:
CreateBorder(BT4Button1, 12, R, G, B, 1, 1, 1, 1, 1, 1, 1, 1)
I can manually put that in in-game and it does it, just having trouble getting it to load on logging in via a .lua file. It seems like the button frames for bartender dont load when bartender does or something.

Also, if anyone knows a way to simplify putting a border on 36 buttons using the above code I'd be all ears. I have been browsing the internet for about 3 hours and I can't sift through all the information and/or sample veiwing of published books.

Thanks for any responses.
I know how to.

Open ButtonBar.lua.

at like line ~ 238

Code:
	if not LBF then
		for i = 1, #buttons do
			local button = buttons[i]
			if button.icon and self.config.skin.Zoom then
				button.icon:SetTexCoord(0.07,0.93,0.07,0.93)
			elseif button.icon then -- 
				button.icon:SetTexCoord(0,1,0,1)
				CreateBorder(button, 12, 1, 1, 1)
			end
		end
	end
Last edited by Aftermathhqt : 05-08-11 at 10:09 AM.
Report comment to moderator  
Reply With Quote
Unread 05-08-11, 04:09 PM  
Timmcc
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Originally posted by Game92
I know how to.

Open ButtonBar.lua.

at like line ~ 238

Code:
	if not LBF then
		for i = 1, #buttons do
			local button = buttons[i]
			if button.icon and self.config.skin.Zoom then
				button.icon:SetTexCoord(0.07,0.93,0.07,0.93)
			elseif button.icon then -- 
				button.icon:SetTexCoord(0,1,0,1)
				CreateBorder(button, 12, 1, 1, 1)
			end
		end
	end
Wow, thank you! That worked perfectly! This has helped so much, again thank you.
Report comment to moderator  
Reply With Quote
Unread 05-10-11, 03:29 PM  
Neal
A Defias Bandit
 
Neal's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 300
Uploads: 10
Originally posted by Timmcc
Wow, thank you! That worked perfectly! This has helped so much, again thank you.
Have you tried http://www.wowinterface.com/download...ftermathh.html ?
Report comment to moderator  
Reply With Quote
Unread 05-18-11, 03:03 PM  
Timmcc
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Originally posted by Neal
Have you tried http://www.wowinterface.com/download...ftermathh.html ?
I had not, but I will now. That post below turned out to not work after all. Thanks!
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: