WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Released AddOns (https://www.wowinterface.com/forums/forumdisplay.php?f=9)
-   -   LitePanels - An art framework (https://www.wowinterface.com/forums/showthread.php?t=25283)

pRAISED 06-23-10 06:48 PM

Hi all

http://s.wowinterface.com/preview/pvw31606.jpg
http://i.imgur.com/f00eS.jpg

I need this LUA code for my UI with Chinchilla !
I just newbye in LUA , i needed help for this ^^

Thx you !

Katae 06-23-10 06:54 PM

Quote:

Originally Posted by pRAISED (Post 193784)
I need this LUA code for my UI with Chinchilla !
I just newbye in LUA , i needed help for this ^^

Here you go: http://pastebin.org/355453

pRAISED 06-24-10 05:09 AM

Thx you very much :)

Sry for my bad englis , i'm from french ^^

EDIT : After putting in LUA code Lpanels> Core.LUA I is that the graphics system code, I likewise will not have the code for LUA lstat
(See: http://s.wowinterface.com/preview/pvw31606.jpg )

Thank you in advance.
pRAISED

Canities 06-24-10 05:59 PM

Panel height math
 
Hiya Katae,
Loving both LitePanels and LiteStats.
I do however have a query about making a panel that changes size with the chat frame. I'm using chicchai to change the height of the chat frame so i need to be able to do some math on the height, for example i need it to be 100% of the frame height + 35 for the chat tabs.
So far i have my panel coded as:
Code:

        { name = "Bar10",
                parent = "UIParent", anchor_frame = "ChatFrame1",
                anchor_to = "BOTTOMLEFT", anchor_from = "BOTTOMLEFT", y_off = -10, x_off = -5,
                width = 350, height = "100%", -- this is where i need the math to change the height to be 100%+35
                gradient = "H",
                bg_color = {0,0,0}, bg_alpha = 0.5,
                gradient_color = {0,0,0}, gradient_alpha = 0,
        },

Is there a quick and easy way of applying the math in the panel layout or do i have to do something a little more special?

Thanks for your assistance.

Cani :)

zynix 06-25-10 12:26 AM

Quote:

Originally Posted by Canities (Post 194142)
Hiya Katae,
Loving both LitePanels and LiteStats.
I do however have a query about making a panel that changes size with the chat frame. I'm using chicchai to change the height of the chat frame so i need to be able to do some math on the height, for example i need it to be 100% of the frame height + 35 for the chat tabs.
So far i have my panel coded as:
Code:

        { name = "Bar10",
                parent = "UIParent", anchor_frame = "ChatFrame1",
                anchor_to = "BOTTOMLEFT", anchor_from = "BOTTOMLEFT", y_off = -10, x_off = -5,
                width = 350, height = "100%", -- this is where i need the math to change the height to be 100%+35
                gradient = "H",
                bg_color = {0,0,0}, bg_alpha = 0.5,
                gradient_color = {0,0,0}, gradient_alpha = 0,
        },

Is there a quick and easy way of applying the math in the panel layout or do i have to do something a little more special?

Thanks for your assistance.

Cani :)

I'd try and make some panels for the chat tabs, and make them 35pix high :)

Lordyfrb 06-25-10 04:43 AM

[quote=zynix;193202]
Quote:

Originally Posted by Dokee (Post 193197)
Well.. thats some of the problem, I have no idea what code(s) to use. But I could give you the stripe code for LitePanels if that helps? So basically I just have two of these on each side of all unit frames, and want them hidden when the frames are not shown. (Target, Pet, Target of Target and possibly Party)

Allright, this should fix it:
Code:

        {        name = "LeftPlayerTop",
                parent = "Stuf.Units.Player",
                anchor_to = "TOP",
                width = 75,
                height = 2,
                strata = "LOW",
                bg_color = "0 1 1",
                bg_alpha = 0,
                gradient = "H",
                gradient_color = "0 1 1",
                gradient_alpha = 1,
        },
        {        name = "LeftPlayerBottom",
                parent = "Stuf.Units.Player",
                anchor_to = "BOTTOM",
                width = 75,
                height = 2,
                strata = "LOW",
                bg_color = "0 1 1",
                bg_alpha = 0,
                gradient = "H",
                gradient_color = "0 1 1",
                gradient_alpha = 1,
        },

just add a different name for each panel, and change the parent to the frame you want to attach it to, IE:
Stuf.Units.Target for the target
Stuf.Units.Targettarget for ToT
Stuf.Units.Pet for pet
Stuf.Units.Party1 for first party member
Stuf.Units.Party2 for second, and so on.


Remember, always start with a capital letter, in Stuf parents :)

Quote:

Originally Posted by Dokee (Post 193209)
Hmm.. it's not working, weird. I get no errors or anything but the frame never shows up now. I'll try with some variations and see if I can come out with anything. Do you have any more ideas?
Thanks a bunch for the help btw!

EDIT: Found a much better-looking way, instead of using LitePanels to just add the transparency as a decoration I made fading status bars instead, much more functional for Unit Frame usage. But thanks for the effort in helping me.

the reason it didn't work is the frame names that stuf uses, they should be in the following format:
Stuf.units.'framename'

i.e. for the pet frame its:
Stuf.units.pet

Notice the only capital letter is the S in Stuf, the rest is lower case.

zynix 06-25-10 07:51 AM

[quote=Lordyfrb;194257]
Quote:

Originally Posted by zynix (Post 193202)



the reason it didn't work is the frame names that stuf uses, they should be in the following format:
Stuf.units.'framename'

i.e. for the pet frame its:
Stuf.units.pet

Notice the only capital letter is the S in Stuf, the rest is lower case.


Ahh, my bad :P

haylie 06-25-10 01:10 PM

Quote:

Originally Posted by Canities (Post 194142)
Hiya Katae,
Loving both LitePanels and LiteStats.
I do however have a query about making a panel that changes size with the chat frame. I'm using chicchai to change the height of the chat frame so i need to be able to do some math on the height, for example i need it to be 100% of the frame height + 35 for the chat tabs.

You need to set the parent to ChatFrame1, the height to "100%" (this will change your panel's height to always match the height of the thing you're parenting to, in this case the ChatFrame1). Then for the chat tabs, set the y offset of the panel to 35.

Code:

parent = "ChatFrame1",
height = "100%",
y_off = 35,


Miralen 06-25-10 01:19 PM

I was curious if someone had a litepanel or knewhow to set a panel to make the recount window hide when in a capital city (stormwind, dalaran, orgrimmar, etc.) and making a chatframe appear instead while in a capital city and of course making the chatframe disappear while out of a capital city and recount appear in its place.

Canities 06-25-10 03:53 PM

Quote:

Originally Posted by haylie (Post 194372)
You need to set the parent to ChatFrame1, the height to "100%" (this will change your panel's height to always match the height of the thing you're parenting to, in this case the ChatFrame1). Then for the chat tabs, set the y offset of the panel to 35.

Thanks for the reply haylie,
Only issue i have with that solution is the panel sits at the bottom of the chat frame and not 10pix below. I forgot to mention that i have another bar anchored to the bottom of the chat panel (see images below). Ended up opting for this solution:
Code:

        { name = "Bar10", --Gen Chat Frame
                parent = "UIParent", anchor_frame = "ChatFrame1",
                anchor_to = "BOTTOMLEFT", anchor_from = "BOTTOMLEFT", y_off = -10, x_off = -5,
                width = 350, height = "100%",
                gradient = "H",
                bg_color = {0,0,0}, bg_alpha = 0.5,
                gradient_color = {0,0,0}, gradient_alpha = 0,
        },
        { name = "BorderBottom", parent = "Bar10",
                anchor_to = "BOTTOM",
                width = "100%", height = 1,
                bg_color = {0,0,0}, bg_alpha = 0.75,
        },
        { name = "Bar11", --Gen Chat Tab
                parent = "Bar10", anchor_frame = "Bar10",
                anchor_to = "BOTTOMLEFT", anchor_from = "TOPLEFT", y_off = 0, x_off = 0,
                width = 350, height = 35,
                gradient = "H",
                bg_color = {0,0,0}, bg_alpha = 0.5,
                gradient_color = {0,0,0}, gradient_alpha = 0,
        },
        { name = "BorderTop", parent = "Bar11",
                anchor_to = "TOP",
                width = "100%", height = 1,
                bg_color = {0,0,0}, bg_alpha = 0.75,
        },

Works a treat with Chicchai and changes size respectivly.
Minimised:Maximised:

Cani :)

Miralen 06-25-10 11:57 PM

Ok so here is my stab in the dark at making recount disappear while in a capital city and for the life of me I can't figure it out at all, it doesn't seem to be working. Basically I ripped off a sample script from the kgpanel sample script help page area and have no idea why this isn't working so hopefully someone can give me some insight on what I am doing wrong, I am thinking I have the actual code in the wrong spot of my layout section but I don't know. This is a snippet from my layout file, I can post my file up as a download if needed too. Thanks in advance for any help you can give. :banana:

Code:

        -- Recount Panel
        {        name = "RecountPanel",
                        anchor_to = "BOTTOMRIGHT",
                        width = 400,
                        height = 143,
                        y_off = 5,
                        x_off = -5,
                        bg_color = {.01,.01,.01},
                        bg_alpha = 1,
                        strata = "BACKGROUND"
        },
        OnLoad = function(self)
            self:RegsiterEvent('CHAT_MSG_CHANNEL_NOTICE')
        end,

        OnEvent = function(self)
        if event == "CHAT_MSG_CHANNEL_NOTICE" then
        if arg1 == "YOU_JOINED" and arg7 == 2 then
            Recount_MainWindow:Hide()
        elseif arg1 == "YOU_LEFT" and arg7 == 2 then
            Recount_MainWindow:Show()
            end
        end
    end,


haylie 06-26-10 08:55 AM

Are you getting any errors? I think your syntax for bg_color (line 8) should be:

Code:

bg_color = "0.01 0.01 0.01",
Edit: Also try this syntax for your script:

Code:

OnLoad=function(self)
            self:RegsiterEvent'CHAT_MSG_CHANNEL_NOTICE'
end,
OnEvent=function(self)
        if event == "CHAT_MSG_CHANNEL_NOTICE" then
        if arg1 == "YOU_JOINED" and arg7 == 2 then
            Recount_MainWindow:Hide()
        elseif arg1 == "YOU_LEFT" and arg7 == 2 then
            Recount_MainWindow:Show()
            end
        end
end,

You're also putting it in the wrong spot, it should be before the "}," at line 11.

You're also missing a comma after strata = "BACKGROUND"

Miralen 06-26-10 09:38 AM

No errors whatsoever, just not doing what I want it to going to try this once I get home from work tonight thanks alot for the help! :banana:

Miralen 06-26-10 08:59 PM

1 Attachment(s)
Well tried this out and no go, I for the life of me can't figure out what I am doing wrong here, I tried changing a few things around but nothing seems to help. All my frames load properly except for the recount frame, the frame loads just without its border. Anyhow here is the error I am getting and my layout file to see if someone could make some sense of the mess I've made.

Code:

1x LitePanels-30300.2\layout.lua:78: attempt to call method 'RegsiterEvent' (a nil value)
LitePanels-30300.2\core.lua:295: in function `MakePanel'
LitePanels-30300.2\core.lua:345: in function `Init'
LitePanels-30300.2\core.lua:364: in function <LitePanels\core.lua:354>

Locals:
self = <table> {
 Exit = <function> @ LitePanels\core.lua:348:
 defaults = <table> {}
 media = "LitePanels\media\"
 ApplyLayout = <function> @ LitePanels\core.lua:86:
 CreateFrame = <function> @ LitePanels\core.lua:373:
 MakePanel = <function> @ LitePanels\core.lua:122:
 Init = <function> @ LitePanels\core.lua:323:
 RegisterEvent = <function> @ LitePanels\core.lua:106:
 OnEvent = <function> @ LitePanels\core.lua:354:
 profile = <table> {}
 MatchProf = <function> @ LitePanels\core.lua:77:
 events = <table> {}
 cinfo = <table> {}
 defaultv = <table> {}
 temp = <table> {}
 sides = <table> {}
 CreateLayout = <function> @ LitePanels\core.lua:61:
}
f = <table> {
 anchor_to = "BOTTOMRIGHT"
 y_off = 5
 OnLoad = <function> @ LitePanels\layout.lua:77:
 parent = UIParent {}
 x_off = -5
 width = 400
 bg_color = "0.01 0.01 0.01"
 name = "LP_RecountPanel"
 height = 143
 OnEvent = <function> @ LitePanels\layout.lua:80:
 strata = "BACKGROUND"
 bg_alpha = 1
}
origparent = nil
origanchor = nil
panel = LP_RecountPanel {
 RegisterEvent = <function> defined =[C]:-1
 height = 143
 0 = <userdata>
 bg = <unnamed> {}
 width = 400
}
ipairs = <function> defined =[C]:-1
d = <table> {
 text = <table> {}
 strata = "BACKGROUND"
 y_off = 0
 gradient_color = "1 1 1"
 parent = "UIParent"
 anchor_from = "BOTTOMLEFT"
 border = "Interface/Tooltips/UI-Tooltip-Border"
 width = 0
 border_alpha = 1
 bg_color = "0 0 0"
 bg_alpha = 1
 border_color = "1 1 1"
 height = 0
 border_size = 16
 x_off = 0
 anchor_to = "BOTTOMLEFT"
}
pairs = <function> defined =[C]:-1
is = <function> @ LitePanels\core.lua:44:
hidden = <table> {
}
IsAddOnLoaded = <function> defined =[C]:-1
deps = <table> {
}
strmatch = <function> defined =[C]:-1
lp = lp_C {
 0 = <userdata>
}
Resize = <function> @ LitePanels\core.lua:110:
unpack = <function> defined =[C]:-1
setcolor = <function> @ LitePanels\core.lua:48:
gsub = <function> defined =[C]:-1
hooksecurefunc = <function> defined =[C]:-1

  ---

My Layout File for close scrutiny, thanks again for any assistance given, I know I am being a pain, kind of feel stupid in fact that I can't figure this out but what are ya going to do. :banana:

Attachment 4527

haylie 06-27-10 10:23 AM

You're missing a lot of commas, before nearly every "},".

The correct syntax for border size is "border_size = 5," (without quotes around the value). Same for border_alpha.

As for the script itself, I'm not that knowledgeable, so can't help you there :p

Miralen 06-27-10 01:56 PM

Well I get no errors and everything loads fine when I dont have this bit in there:
Code:

        OnLoad=function(self)
            self:RegsiterEvent'CHAT_MSG_CHANNEL_NOTICE'
        end,
        OnEvent=function(self)
            if event == "CHAT_MSG_CHANNEL_NOTICE" then
            if arg1 == "YOU_JOINED" and arg7 == 2 then
                Recount_MainWindow:Hide()
            elseif arg1 == "YOU_LEFT" and arg7 == 2 then
                Recount_MainWindow:Show()
                end
            end
        end,

the only time I get an error is with that code in there but I guess for now I will just do without it sadly but if someone has the answer sometime I'd appreciate it, I will probably dink about a little more with it and try to get it going a little while longer but I don't hold out much hope.

nulir 06-28-10 12:21 PM

just a stupid question,

im using the little statsblock from the first page, but is it possible to add a dps meter in there ? or do i have to use a different addon ?
i wanted to have as little as possible addon windows on my screen, but im a total noob with lua.

Lordyfrb 06-28-10 04:56 PM

Quote:

Originally Posted by Miralen (Post 194743)
Well I get no errors and everything loads fine when I dont have this bit in there:
Code:

        OnLoad=function(self)
            self:RegsiterEvent'CHAT_MSG_CHANNEL_NOTICE'
        end,
        OnEvent=function(self)
            if event == "CHAT_MSG_CHANNEL_NOTICE" then
            if arg1 == "YOU_JOINED" and arg7 == 2 then
                Recount_MainWindow:Hide()
            elseif arg1 == "YOU_LEFT" and arg7 == 2 then
                Recount_MainWindow:Show()
                end
            end
        end,

the only time I get an error is with that code in there but I guess for now I will just do without it sadly but if someone has the answer sometime I'd appreciate it, I will probably dink about a little more with it and try to get it going a little while longer but I don't hold out much hope.

The only thing I can think of is the comma's after the function end's(highlighted for easy reference). Try removing them and see how it goes.

Miralen 06-28-10 05:17 PM

I believe I've tried that and it didn't help and since their in the same spot as Katae's example for the afk mod I figure they should be there but I will try it again and double check just to make sure.

Edit: yep tried it and it didnt work in fact when I tried it none of my panels showed up.

Lordyfrb 06-29-10 03:24 PM

Thats ok I'm not to sure about lua syntax.

However I've spotted a spelling mistake in your code:
Code:

        OnLoad=function(self)
            self:RegsiterEvent'CHAT_MSG_CHANNEL_NOTICE'
        end,
        OnEvent=function(self)
            if event == "CHAT_MSG_CHANNEL_NOTICE" then
            if arg1 == "YOU_JOINED" and arg7 == 2 then
                Recount_MainWindow:Hide()
            elseif arg1 == "YOU_LEFT" and arg7 == 2 then
                Recount_MainWindow:Show()
                end
            end
        end,

should be:
Code:

        OnLoad=function(self)
            self:RegisterEvent'CHAT_MSG_CHANNEL_NOTICE'
        end,
        OnEvent=function(self)
            if event == "CHAT_MSG_CHANNEL_NOTICE" then
            if arg1 == "YOU_JOINED" and arg7 == 2 then
                Recount_MainWindow:Hide()
            elseif arg1 == "YOU_LEFT" and arg7 == 2 then
                Recount_MainWindow:Show()
                end
            end
        end,

See if that helps.


All times are GMT -6. The time now is 07:22 PM.

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