Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(23 Kb)
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:6,207
Favorites:66
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)


Archived Files (1)
File Name
Version
Size
Author
Date
1.0.3
21kB
Neal
04-17-11 02:24 PM


Post A Reply Comment Options
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
JayK83 is offline 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: 15
what you you mean with "SharedMedia compatible version" ?
Neal is offline 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?
JayK83 is offline 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.
flexe is offline 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.
kamilo is offline 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: 15
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.
Neal is offline Report comment to moderator  
Reply With Quote
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: 15
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.
Neal is offline Report comment to moderator  
Reply With Quote
Unread 04-17-11, 09:08 PM  
flexe
A Defias Bandit
AddOn Compiler - Click to view compilations

Forum posts: 3
File comments: 7
Uploads: 1
Hello Neal,

I was wondering if you could give possible examples of being able to apply Beautycase to frames created by kgpanels, I have tried without success to apply your borders to Recount, Shadowed Unit Frames and also kgpanel frames.

Since the frames are created dymanically by these addons, it seems each time I have tried to link Beautycase up, it has returned an error saying the frame isint found, or in recount's case, it just didnt like it.

The way I tried to do it was simply creating a new addon, following your instructions of making sure it had loaded after kgpanels, but it still wasnt abel to find the name, even after trying what I named the panel through the addon, and also the actual frame name that the mouse over macro provides.

Im not fairly fluent with lua but I do have prior coding experience with other languages, so I could say im fairly confident that I tried all methods I thought would work, its probably something Im just completely overlooking and any examples would be appreciated

Thanks in advance.
Last edited by flexe : 04-17-11 at 09:08 PM.
flexe is offline Report comment to moderator  
Reply With Quote
Unread 04-17-11, 10:50 AM  
Neal
A Defias Bandit
 
Neal's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 300
Uploads: 15
And I search and search but don't understand the problem because all worked fine.. -.-
Last edited by Neal : 04-17-11 at 10:51 AM.
Neal is offline Report comment to moderator  
Reply With Quote
Unread 04-17-11, 08:51 AM  
rakkarage
A Murloc Raider

Forum posts: 6
File comments: 100
Uploads: 1
Args! Must check this tomorrow :-/
i i needed to do the created first i think
rakkarage is offline Report comment to moderator  
Reply With Quote
Unread 04-16-11, 12:38 PM  
Neal
A Defias Bandit
 
Neal's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 300
Uploads: 15
Originally posted by Sniffles
You should add a 4. function to create white borders. So you can see the colors better (e.g. colored Debuff Borders).
Code:
for i = 1, 8 do
        self.Border[i]:SetTexture()
end
Ah got a new idea...

BorderTexture(YourTexturehere.tga)



Originally posted by rakkarage
when i try (in _DevPad)

ColorBorderShadow(Minimap, 0, 1, 0);

like in the screenshot, it says

!Beautycase:Invalid frame!

it says that for all the frames i have tried so far...?
thanks
Args! Must check this tomorrow :-/
Last edited by Neal : 04-16-11 at 12:44 PM.
Neal is offline Report comment to moderator  
Reply With Quote
Unread 04-16-11, 12:20 PM  
Sniffles
A Black Drake
 
Sniffles's Avatar
AddOn Author - Click to view AddOns

Forum posts: 86
File comments: 76
Uploads: 16
You should add a 4. function to create white borders. So you can see the colors better (e.g. colored Debuff Borders).
__________________
Sniffles is offline Report comment to moderator  
Reply With Quote
Unread 04-16-11, 08:07 AM  
Toran
A Nerdscale Dorkin
 
Toran's Avatar

Forum posts: 142
File comments: 430
Uploads: 0
Originally posted by Neal
should now work correct



Open the !Beautycase.lua file and go to line ~80
Code:
if (borderSize >= 10) then
   space = 3
else
   space = borderSize/3.5
end
change the space (like 4 or 5)
That didn't do it - instead created a padding space between the beautycase border and the shadow.
Toran is offline Report comment to moderator  
Reply With Quote
Unread 04-15-11, 04:43 PM  
Neal
A Defias Bandit
 
Neal's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 300
Uploads: 15
should now work correct

Originally posted by Toran
Is there a way I can make the border shadow span out a bit more? Right now it just looks like a colored line around my border. I'd like to make the shadow thicker.
Open the !Beautycase.lua file and go to line ~80
Code:
if (borderSize >= 10) then
   space = 3
else
   space = borderSize/3.5
end
change the space (like 4 or 5)
Last edited by Neal : 04-16-11 at 12:53 AM.
Neal is offline Report comment to moderator  
Reply With Quote
Unread 04-15-11, 11:27 AM  
Game92
A Molten Giant
 
Game92's Avatar
AddOn Author - Click to view AddOns

Forum posts: 623
File comments: 697
Uploads: 14
The new version, doens't really work propper, as the old one


----> new version <----

http://img135.imageshack.us/img135/2...1511190919.jpg

----> old version <-------

http://img703.imageshack.us/img703/3...1511191135.jpg

and btw the code looks abit funnie like;

http://img850.imageshack.us/img850/3157/40566686.png

how you remove it; -> top right x, top right] y

http://img52.imageshack.us/img52/4407/be2.png
Game92 is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: