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)

Katae 12-04-09 12:46 AM

Looks great :D

BTW, it would be ToggleFrame(QuestLogFrame).

Ferous 12-04-09 01:12 AM

Quote:

Originally Posted by Katae (Post 167934)
Looks great :D

BTW, it would be ToggleFrame(QuestLogFrame).

Oh haha thanks, i looked and didn't find anything >.> Maybe it ain't updated who knows (wowwiki)

Tandurin 12-04-09 03:47 PM

I got a question how can I make the background of some panels transparent or partially transparent? I can't figure it out. :S

Katae 12-04-09 06:13 PM

Quote:

Originally Posted by Tandurin (Post 168010)
I got a question how can I make the background of some panels transparent or partially transparent? I can't figure it out. :S

Use an alpha value from 1.0 - 0.0, 1.0 being fully opaque, and 0.0 being fully transparent. (bg_alpha = 0.5)

Tandurin 12-06-09 01:38 PM

I have another question. I have the default Viewport done now however when I try to make a new layout it won't show it.

Here's the code:
Code:

lpanels:CreateLayout("Simple Viewport", {
        -- Main viewport background
        {        name = "GreyBox",
                strata = "BACKGROUND", level = 0,
                x_off = "1%", y_off = "1%",
                achor_to = "BOTTOM",
                width = "98%", height = 165,
                bg_color = "0 0 0", bg_alpha = 1,       
        },
        -- A colored border anchored to the top of the viewport
        {        name = "TopBorder", parent = "GreyBox",
                anchor_to = "TOP", y_off = 0,
                width = "100%", height = 2,
                bg_color = "0.4 0.6 1", bg_alpha = 1,
        },
        -- A colored border anchored to the bottom of the viewport
        {        name = "BottomBorder", parent = "GreyBox",
                anchor_to = "BOTTOM", y_off = 0,
                width = "100%", height = 2,
                bg_color = "0.4 0.6 1", bg_alpha = 1,
        },
        -- A colored border anchored to the left of the viewport
        {        name = "LeftBorder", parent = "GreyBox",
                anchor_to = "LEFT", x_off = 0,
                width = 2, height = "100%",
                bg_color = "0.4 0.6 1", bg_alpha = 1,
        },
        -- A colored border anchored to the right of the viewport
        {        name = "RightBorder", parent = "GreyBox",
                anchor_to = "LEFT", x_off = "98%",
                width = 2, heigth = "100%",
                bg_color = "0.4 0.6 1", bg_alpha = 1,
        },
});

lpanels:CreateLayout("Simple Topbar", {
        -- Main Topbar background
        {        name = "Simple Topbar",
                strata = "BACKGROUND", level = 0,
                x_off = "1%", y_off = 0,
                anchor_to = "BOTTOM",
                width = "98%", heigth = -55,
                bg_color = "0 0 0", bg_alpha = 1,
        },
});
lpanels:ApplyLayout(nil, "Simple Viewport", "Simple Topbar")


Rostok 12-06-09 02:57 PM

You are anchoring it to the bottom of your screen not on the bottom-part of your viewport, so they overlap and you see nothing.
You should try setting the parent of your top panel as the viewport.

Code:

parent = 'GreyBox'
You'll have to adjust the size and/or the anchoring to match your viewport borders.

Tandurin 12-06-09 03:38 PM

Ah I see, I feel stupid not noticing that. :o

Lordyfrb 12-16-09 06:37 AM

Hi just a couple of questions.

The first is how can I make button show a frame on left click then hide it again on another left click, I so far can only do this using right click to hide and left click to show, this is the code I'm using currently:

Code:

{        name="DSHider", parent="BB", anchor_from="right", anchor_to="right", width=64, height=32, tex_file="mybutton", x_off=-45,
        text={ string="DS", anchor_to="center", shadow=1, font=text.font, color=text.color, size=text.size, },
        OnClick = function(self, button)
                if button == "RightButton" then
                        LP_DS:Hide()
                        elseif button == "LeftButton" then
                        LP_DS:Show()
                end
        end
},

Next question is how do I hide a frame automaticaly when I first enter the game?
i.e. I have a frame that runs across the bottom of my UI, and another frame parented to that, but I want the second frame to only appear when I click the first frame.

Thanks for anyones help.

Lordy

Ferous 12-16-09 07:04 AM

You'd want to do something like:

Code:

OnLoad = function(self)
            self:RegisterEvent("PLAYER_ENTERING_WORLD")
            self:Hide()

Or something like that? Maybe Katae has a better answer :P

Katae 12-16-09 07:12 AM

Quote:

Originally Posted by Lordyfrb (Post 170395)
The first is how can I make button show a frame on left click then hide it again on another left click

For the button frame:
Code:

OnClick = function(self, button)
    if button == "LeftButton" then
        if myFrame:IsShown() then
            myFrame:Hide()
        else
            myFrame:Show()
        end
    end
end


demonii 12-16-09 08:25 AM

Looking at Fer's noVel ui, I can see it's possible to code in clicks to the panels (IE: toggle char frame..etc) Would it be possible to tie the click to a slash command? Example : Make a panel like one of fer's on the bottom of the screen that says 'Sort' or something that runs the /sort command of BankStack

Sorry If I happened to overlook this if its been asked >< prolly to early to ask questions.

-Thanks, Demo

Ferous 12-16-09 08:30 AM

Quote:

Originally Posted by demonii (Post 170417)
Looking at Fer's noVel ui, I can see it's possible to code in clicks to the panels (IE: toggle char frame..etc) Would it be possible to tie the click to a slash command? Example : Make a panel like one of fer's on the bottom of the screen that says 'Sort' or something that runs the /sort command of BankStack

Sorry If I happened to overlook this if its been asked >< prolly to early to ask questions.

-Thanks, Demo

I used to know the script for this but I have forgotten it a while back ... Let me see if I can find it :)

Here it is:

Code:

BankStack.SortBags()

Ferous 12-16-09 08:33 AM

Code:

{        name = "game menu",
                        anchor_to = "CENTER",
                        y_off = -435,
                        x_off = -270,
                        width = "50",
                        height = "26",
                        bg_color = {0.40,0.40,0.40},
                        bg_alpha = 0.1,
                        strata = "HIGH",
                        border = "dbA",
                        border_color = "0.25 0.25 0.25",
                        border_size = 12,
                        border_alpha = 1,
                        inset = 2,
                OnClick = function(self, button)
                        if button == "LeftButton" then
                                        BankStack.SortBags()
                        end
                end,
                        text = {
                                { string = "Menu",
                                anchor_to = "CENTER",
                                y_off = 0,
                                shadow=1,
                                font =                          "Interface\\AddOns\\LitePanels\\media\\font.ttf",
                                size=20,
                                color = "0.25 0.25 0.25"
                                },
 
                        },
 
                },

just an example :P

demonii 12-16-09 08:33 AM

Quote:

Originally Posted by Ferous (Post 170418)
I used to know the script for this but I have forgotten it a while back ... Let me see if I can find it :)

Here it is:

Code:

BankStack.SortBags()

Awesome! Ty fer ^_^

Edit: and for the example

Lordyfrb 12-16-09 12:26 PM

Thank Katae and Ferous, both them scripts worked perfectly.

I'm pretty new to scripting, and playing with LitePanels has helped me somewhat.

Pixol 12-20-09 08:20 AM

Buff Reminder
 
Is it possible to create a script to remind us of a buff such as fort or inner fire? recently got rid of powerauras for raid because it was very cpu-intensive. So now I find myself mid-fight sometimes without my spellpower buffs
thank you :)

Katae 12-24-09 11:52 AM

Quote:

Originally Posted by Pixol (Post 171057)
Is it possible to create a script to remind us of a buff such as fort or inner fire? recently got rid of powerauras for raid because it was very cpu-intensive. So now I find myself mid-fight sometimes without my spellpower buffs
thank you :)

Sorry, didn't see your post till now.

Here's a quick buff check that will watch a specific buff and tell you if it's down. As a bonus, I added a 10 second countdown for when it's falling off.

Code:

{  name = "WatchBuff",
    anchor_to = "CENTER", anchor_from = "CENTER", y_off = 300,
    text = {
        string = function()
            local buff = "Inner Fire" -- name of watched buff
            local aura, time_left = UnitAura("player", buff)
            if aura then
                time_left = floor(select(7, UnitAura("player", buff)) - GetTime())
                if time_left <= 10 and time_left > 0 then
                    return format("%s is down in %s seconds", buff, time_left)
                end
            end
            if not aura or time_left <= 0 then
                return buff.." is down."
            end
        end,
        size = 10, color = "1 0.75 0", outline = 2,
    }
}


Ferous 12-24-09 02:12 PM

Quote:

Originally Posted by Katae (Post 171757)
Sorry, didn't see your post till now.

Here's a quick buff check that will watch a specific buff and tell you if it's down. As a bonus, I added a 10 second countdown for when it's falling off.

Code:

{  name = "WatchBuff",
    anchor_to = "CENTER", anchor_from = "CENTER", y_off = 300,
    text = {
        string = function()
            local buff = "Inner Fire" -- name of watched buff
            local aura, time_left = UnitAura("player", buff)
            if aura then
                time_left = floor(select(7, UnitAura("player", buff)) - GetTime())
                if time_left <= 10 and time_left > 0 then
                    return format("%s is down in %s seconds", buff, time_left)
                end
            end
            if not aura or time_left <= 0 then
                return buff.." is down."
            end
        end,
        size = 10, color = "1 0.75 0", outline = 2,
    }
}


Oooo that looks really cool :) Thank you :O I would love this for my Tankadin buffs and making sure I have them :P Thanks Katae :O

Ferous 12-24-09 04:15 PM

Is there a way to make a panel appear and disappear ingame with a command? Thanks :P

Katae 12-24-09 04:25 PM

Quote:

Originally Posted by Ferous (Post 171791)
Is there a way to make a panel appear and disappear ingame with a command? Thanks :P

Sure, you could do '/run local f=LP_PanelName if f:IsShown() then f:Hide() else f:Show() end'.

Maybe stick it in a macro or make your own SlashCmd function.

Edit: or maybe simply ToggleFrame(panel)

Pixol 12-27-09 11:18 AM

Quote:

Originally Posted by Katae (Post 171757)
Sorry, didn't see your post till now.

Here's a quick buff check that will watch a specific buff and tell you if it's down. As a bonus, I added a 10 second countdown for when it's falling off.

Code:

{  name = "WatchBuff",
    anchor_to = "CENTER", anchor_from = "CENTER", y_off = 300,
    text = {
        string = function()
            local buff = "Inner Fire" -- name of watched buff
            local aura, time_left = UnitAura("player", buff)
            if aura then
                time_left = floor(select(7, UnitAura("player", buff)) - GetTime())
                if time_left <= 10 and time_left > 0 then
                    return format("%s is down in %s seconds", buff, time_left)
                end
            end
            if not aura or time_left <= 0 then
                return buff.." is down."
            end
        end,
        size = 10, color = "1 0.75 0", outline = 2,
    }
}


Thank you :) Works great.
I wanted to add to that to make it much more similar to power auras.
I first added a box with a background around the text (anchored to the WatchBuff frame)
then I added a texture. I first noticed when I buffed myself, the textures wouldn't go disappear.

I then looked at the AFK timer to see how you made the box disappear, you used this

Code:

self:RegisterEvent("PLAYER_FLAGS_CHANGED")
I tried that. It would only update everytime I change my afk tag. (I'm a n00b at coding, I just test things to see how they work first). So I tried something from Wowwiki's page...

instead of

PLAYER_FLAGS_CHANGED

I tried

COMBAT_LOG_EVENT

That worked for buffing myself but didn't work so well when I right clicked the buff off, as no combat log event occured during that time.

I tried

PLAYER_AURAS_CHANGED

Seems to be a broken function, unless it perhaps it means like a paladin aura or something.

How would I set it up to be like the afk set up?

You are afk --> box shows
You are not afk --> box disappears

You are unbuffed --> box shows
You are not unbuffed (or you are buffed) --> box disappears

Below is the code I have so far...
Code:

{  name = "WatchBuff",
    anchor_to = "CENTER", anchor_from = "CENTER", y_off = 300,
    text = {
        string = function()
            local buff = "Mark of the Wild" -- name of watched buff
            local aura, time_left = UnitAura("player", buff)
            if aura then
                time_left = floor(select(7, UnitAura("player", buff)) - GetTime())
                if time_left <= 10 and time_left > 0 then
                    return format("%s is down in %s seconds", buff, time_left)
                end
            end
            if not aura or time_left <= 0 then
                return "Mark of the Wild is down."
            end
        end,
        size = 10, color = {1, 0.75, 0}, outline = 2,level=1, update=0.1,
    },

        OnLoad = function(self)
                self:RegisterEvent("COMBAT_LOG_EVENT")
                self:Hide()
        end,
        OnEvent = function(self)
            local buff = "Mark of the Wild" -- name of watched buff
            local aura, time_left = UnitAura("player", buff)
                if not aura then
                        self:Show()
                elseif aura then
                        self:Hide()
                end
        end,
},
{ parent="WatchBuff",y_off = 5,anchor_to="TOP",width="152",height=1,bg_color={1,1,0} },
{ parent="WatchBuff",y_off = -5,anchor_to="BOTTOM",width="152",height=1,bg_color={1,1,0} },
{ parent="WatchBuff",x_off = -5,anchor_to="LEFT",width=1,height="20",bg_color={1,1,0} },
{ parent="WatchBuff",x_off = 5,anchor_to="RIGHT",width=1,height="20",bg_color={1,1,0} },
{ parent="WatchBuff",anchor_to="CENTER",width=150,height="18",bg_color={0,0,0},bg_alpha = 0.50,level=0},

    { name="Art_L", parent="WatchBuff",anchor_to="LEFT",y_off=-200, height="500",
      tex_file="Interface\\AddOns\\PowerAuras\\Aura5", width="500" },

Hope everyone had a merry christmas :)

eddiemars 12-30-09 12:08 PM

I am sorry if this has already been discussed, but I was wondering if there was a way to make a class colored bar that shows the class color of your target (and either no bar when no target or just make the bar a default color like black.)

Any help would be much appreciated. :)

Katae 12-30-09 01:53 PM

Quote:

Originally Posted by eddiemars (Post 172523)
I am sorry if this has already been discussed, but I was wondering if there was a way to make a class colored bar that shows the class color of your target (and either no bar when no target or just make the bar a default color like black.)

Any help would be much appreciated. :)

You can try adding these functions to the panel config, for example:
Code:

OnLoad = function(self)
  self:RegisterEvent'PLAYER_TARGET_CHANGED'
end,
OnEvent = function(self)
  local _,class = UnitClass'target'
  local color = RAID_CLASS_COLORS[class] or {0,0,0}
  self.bg:SetTexture(color.r, color.g, color.b, 1.0)
end,


Katae 12-30-09 02:25 PM

Quote:

Originally Posted by Pixol (Post 172153)
How would I set it up to be like the afk set up?

You are unbuffed --> box shows
You are not unbuffed (or you are buffed) --> box disappears

OnEvent would be one way to do it, but I'd opt for OnUpdate myself. For the box, you'd need to use SetAlpha instead of Show/Hide, since when you show and hide a frame, the scripts stop running. Try this out:
Code:

{    name = "WatchBuff",
    anchor_to = "CENTER", anchor_from = "CENTER", y_off = 250,
    bg_color = "0 0 0", bg_alpha = 0.5,
    border = "SOLID", border_color = "0 0 0", border_alpha = 1,
    height = 30, width = 250,
    text = { size = 12, color = "1 0.5 0", outline = 1 },
    OnUpdate = function(self, u)
        self.elapsed = self.elapsed + u
        if self.elapsed > 0.5 then
            local buff = WATCH_BUFF or "Mark of the Wild"
            local aura = UnitAura("player", buff)
            self.text:SetText(buff.." is down.")
            self:SetAlpha(aura and 0 or 1)
            self.elapsed = 0
        end
    end,
}

Added the global WATCH_BUFF in there so you could run /run WATCH_BUFF="buff" in game if needed.

eddiemars 12-30-09 03:15 PM

Quote:

Originally Posted by Katae (Post 172546)
You can try adding an OnUpdate function to the panel config

Thanks for the quick response, very much appreciated. Unfortunately I cannot get it to work, I have pasted your example where I think it should go, in the layout.lua file, but I am very likely incorrect. I was hoping I wouldn't have to make a second comment for this but the answer is not coming to me.

Reading on the forum I see you might ask for a link to the layout like this:
http://pastebin.com/m1959cf0a
I really do appreciate your help, you definitely go above and beyond here.

Katae 12-30-09 11:36 PM

Quote:

Originally Posted by eddiemars (Post 172557)
Unfortunately I cannot get it to work

It was drycoded at the time, edited the post with a working function. (also, changed to OnEvent, I was being lazy with OnUpdate)

terracloud 12-31-09 12:54 AM

I'm not sure if I've seen this option before, but I wanna repeat an image file over the span of the block. Does a repeat option exist within the options?

I'm also having issues getting the frames to line up properly. Is there a set way to make each frame in a row show up one against the next instead of overlapping?

Katae 12-31-09 05:25 AM

Quote:

Originally Posted by terracloud (Post 172661)
I'm not sure if I've seen this option before, but I wanna repeat an image file over the span of the block. Does a repeat option exist within the options?

No setting for that currently.
Quote:

Originally Posted by terracloud (Post 172661)
I'm also having issues getting the frames to line up properly. Is there a set way to make each frame in a row show up one against the next instead of overlapping?

You can line panels up side by side by parenting panel B to panel A, and setting panel B's anchor_to to "LEFT" or whatever side of panel A you want it to border.

eddiemars 12-31-09 12:24 PM

Ultra thanks, it works perfectly now. It looks pretty wicked too :D

terracloud 12-31-09 11:42 PM

After a bit of work, I have failed to figure out why my images aren't working the way I wanted them to. I'd love to know what I'm doing wrong.

Here's a link to the pastebin

I have uploaded the images I'm using to a friends website

xandora 01-01-10 03:16 AM

I don't think you need to include the .tga extensions for the texture files.

terracloud 01-02-10 03:17 AM

I've finally figured out what the problem was, I'm putting it on pastebin for reference

http://pastebin.com/m48d88472

Victimize 01-04-10 03:17 AM

I'm having a bit of trouble getting started. I made my own layout.lua file, and this is what I have in it:

Code:

lpanels:CreateLayout("ActionBars", {
        {        name = "Bar",
                anchor_to = "BOTTOM",
                y_off = 20,
                width = "100%",
                height = 30,
                bg_color = "0 0 0",
                bg_alpha = 0.5,
        }
})
lpanels:ApplyLayout("n:Victimize r:EmeraldDream", "ActionBars")

Nothing is showing up. What am I doing wrong?

Ferous 01-04-10 05:19 PM

Code:

LPanels = {
        ["Default"] = {
               
                {        name = "Actionbar",
                        anchor_to = "CENTER",
                        y_off = -419,
                        width = 484,
                        height = 41,
                        bg_color = {0.15,0.15,0.15},
                        strata = "LOW",
                        bg_alpha = 0.9
                },
               
        },
}

Example in my layout. You don't need to add 'ApplyLayout' or anything like that. Just rename Default and rename Actionbar to what ever :)

edit - I think the reason why yours wasn't working was it doesn't have a comma after the }, should be },

Victimize 01-04-10 07:29 PM

Dead on! I was missing a comma. Thanks mate :)

eddiemars 01-06-10 04:14 PM

I was having a problem where an image file was just not showing up not matter what I did. After I left the computer for a couple hours though and logged on after it showed up. I hadn't touched anything since when it was not showing up... *is confused*

Anyways! I was hoping for a suggestion again. I'm trying now to have a texture file show up only if there is a target, and I tried salvaging as much I could from your original suggestion to me and it starts when you log in with the image hidden, then when you select your first target the texture file is shown.. easy. Problem is I am not sure what code I would use to make it hide again after you remove a target.

Code:

    { name="Art_P", parent="UIParent", anchor_to="BOTTOM", height=70,
      tex_file="moo", width=75, x_off = 223, y_off = 35, level=2, flip_h = false,
                OnLoad = function(self)
                  self:RegisterEvent'PLAYER_TARGET_CHANGED'
                  self:Hide()
                end,
                OnEvent = function(self)
                  self:Show()
                end,
    },

This is the best I could come up with that actually sort of worked. I felt sure that the real answer lies somewhere in using an 'if' and 'else' scenario or 'true' and 'false' but after many google searches I could only guess at doing this with the 'OnStatus' handler which is not supported. Any ideas?

velrhis 01-09-10 09:34 AM

hi,
Is it possible to create a script to remind me of a weapon enchant, like windfury weapon or poisons?

I´ve read the code for "normal" buffs, but this won´t work for weapon buffs.

thanks in advance

keep on your great work

Katae 01-11-10 02:14 AM

Quote:

Originally Posted by eddiemars (Post 173547)
Problem is I am not sure what code I would use to make it hide again after you remove a target.

This is the best I could come up with that actually sort of worked. I felt sure that the real answer lies somewhere in using an 'if' and 'else' scenario or 'true' and 'false' but after many google searches I could only guess at doing this with the 'OnStatus' handler which is not supported. Any ideas?

Try something more along the lines of this:
Code:

        OnLoad = function(self)
          self:RegisterEvent'PLAYER_TARGET_CHANGED'
          self:SetAlpha(0)
        end,
        OnEvent = function(self)
          if UnitGUID'target' then
            self:SetAlpha(1)
          else
            self:SetAlpha(0)
          end
        end,

Mostly sure using Hide() will stop scripts from running (maybe it's only OnUpdate, not completely sure). UnitGUID if/else is just checking if target is a valid unit or not.

Quote:

Originally Posted by velrhis (Post 173899)
hi,
Is it possible to create a script to remind me of a weapon enchant, like windfury weapon or poisons?

The function for weapon buffs:
http://www.wowwiki.com/API_GetWeaponEnchantInfo

eddiemars 01-11-10 12:46 PM

Quote:

Originally Posted by Katae (Post 174149)
Mostly sure using Hide() will stop scripts from running (maybe it's only OnUpdate, not completely sure). UnitGUID if/else is just checking if target is a valid unit or not.

It works perfectly thank you. unitGUID... very handy to know about this, I have a feeling it will come in handy for multiple situations I might encounter.

shinchih2001 01-21-10 05:13 AM

1 Attachment(s)
i copy afker and minimap layout into layout.lua but can't work

Quote:

lpanels:CreateLayout("Load For All", {
-- Create a global layout right here

})

--------------------------------------------------
-- Example layout, you may modify or delete it. --
--------------------------------------------------
lpanels:CreateLayout("Minimap", {
-- Minimap backdrop and border
{ name = "Minimap_border",
parent = "Minimap", anchor_to = "CENTER",
height = 150, width = 150, bg_alpha = 0.5,
border = "SOLID", border_color = "0 0 0",
border_alpha = 0.3, level = 0, inset = 2.5
},
-- Text backgrounds for data inside the minimap
{ name = "Minimap_location",
anchor_frame = "Minimap", anchor_to = "TOPLEFT",
height = 13, width = 112,
bg_alpha = 0.3, level = 99,
},
{ name = "Minimap_location_border",
parent = "Minimap_location", anchor_to = "BOTTOM",
width = "100%", height = 1, y_off = -1,
bg_alpha = 0.5,
},
{ name = "Minimap_tracking",
anchor_frame = "Minimap",
height = 11, width = 112,
bg_alpha = 0.3, level = 99,
},
{ name = "Minimap_tracking_border",
parent = "Minimap_tracking", anchor_to = "TOP",
width = "100%", height = 1, y_off = 1,
bg_alpha = 0.5,
},
})

lpanels:CreateLayout("Afker", {
{ name = "AFK", anchor_to = "TOP", y_off = -210,
bg_alpha = 0.5, width = 200, height = 75,
border = "SOLID", border_color = "1 1 0",
text = {
-- "YOU ARE AFK!"
{ string = "You are AFK!", anchor_to = "TOP", y_off = -10,
shadow=1, font = "Fonts\\FRIZQT__.TTF", size=14,
},
-- "0:00" TIMER
{ string=function()
if afk_timer then
local secs = mod(time() - afk_timer, 60)
local mins = floor((time() - afk_timer) / 60)
return format("%s:%02.f", mins, secs)
end
end, update=0.1,
shadow=1, font = "Fonts\\FRIZQT__.TTF", size=16,
anchor_to = "CENTER", color = "1 0.3 0.3"
},
-- "RIGHT CLICK TO HIDE"
{ string="Right click to hide.", anchor_to="BOTTOM", y_off = 10,
shadow=1, size=8, font = "Fonts\\FRIZQT__.TTF",
}
},
OnLoad = function(self)
self:RegisterEvent("PLAYER_FLAGS_CHANGED")
self:Hide()
end,
OnEvent = function(self)
if UnitIsAFK("player") and not afk_timer then
self.text2:SetText("0:00")
afk_timer = time()
self:Show()
elseif not UnitIsAFK("player") then
self:Hide()
afk_timer = nil
end
end,
OnClick = function(self, b)
self:Hide()
if b == "LeftButton" then SendChatMessage("", "AFK") end
end,
OnEnter = function(self) self.bg:SetTexture(.1,.1,.1,.5) end,
OnLeave = function(self) self.bg:SetTexture(0,0,0,.5) end
}
})

lpanels:ApplyLayout(nil, "Load For All")
lpanels:ApplyLayout("n:Character r:Realm c:Class", "Minimap", "Afker")


Katae 01-21-10 11:24 AM

Quote:

Originally Posted by shinchih2001 (Post 175419)
i copy afker and minimap layout into layout.lua but can't work

Code:

"n:Character r:Realm c:Class"
Set your character name there, for example: "n:sinchih". Alternatively, Setting it to nil instead will load it on all characters.
Code:

lpanels:ApplyLayout(nil, "Minimap", "Afker")
Good day :)

shinchih2001 01-21-10 02:04 PM

Quote:

Originally Posted by Katae (Post 175470)
Code:

"n:Character r:Realm c:Class"
Set your character name there, for example: "n:sinchih". Alternatively, Setting it to nil instead will load it on all characters.
Code:

lpanels:ApplyLayout(nil, "Minimap", "Afker")
Good day :)

thanks a lot
afk is work now, but the difault minimap(round) not gone=.=

Katae 01-21-10 02:13 PM

Quote:

Originally Posted by shinchih2001 (Post 175512)
thanks a lot
afk is work now, but the difault minimap(round) not gone=.=

You need a minimap addon for that.

shinchih2001 01-21-10 03:26 PM

Quote:

Originally Posted by Katae (Post 175514)
You need a minimap addon for that.

haha...i'm fool...=.=

brkndoll 01-21-10 06:44 PM

Thank you!!
 
Just wanted to say a big 'Thank you!!' for this addon. :) It's been fun learning to code for it.

Oh.. and here is a SS. It's a bit generic, but I love it!


Shestak 01-24-10 08:45 PM

Hi. I can not understand.
I created a panel for the buttons.
Create a button that launches the setup DBM.
And like that would bar was mousover.

All is well, everything works, and the panel and the button. DBM run. But mousover works only on an area of the panel, where there is no text. And if you move the cursor to an area where there is text, the panel does not appear.

Where can I go wrong in the code?

Code:

{        name = "Buttons panel",
        anchor_to = "BOTTOM", x_off = 285, y_off = 6,
        width = 200, height = 7,
        bg_alpha = 1,
        OnLoad = function(self) self:SetAlpha(0) end,
        OnEnter = function(self) self:SetAlpha(1) end,
        OnLeave = function(self) self:SetAlpha(0) end,
},
{        name = "DBM Button", parent = "Buttons panel",
        anchor_to = "LEFT", x_off = 0, y_off = 1,
        OnClick = function(self, button)
                if button == "LeftButton" then
                        DBM:LoadGUI()
                end
        end,
        text = {
                { string = "DBM",
                        anchor_to = "CENTER",
                        outline=1,
                        font = main_font,
                        size = main_font_size,
                        color = "CLASS"
                },
        },
},


Katae 01-24-10 08:58 PM

Quote:

Originally Posted by Shestak (Post 175958)
All is well, everything works, and the panel and the button. DBM run. But mousover works only on an area of the panel, where there is no text. And if you move the cursor to an area where there is text, the panel does not appear.

This is happening because the cursor is being intercepted by the DBM button, so the parent "thinks" that the cursor is leaving it, thus triggering the OnLeave function.

You can get around this pretty easily by checking if the cursor is not hovering over a child panel:
Code:

OnLeave = function(self)
    if GetMouseFocus():GetParent() ~= self then self:SetAlpha(0) end
end,


Shestak 01-24-10 09:34 PM

Quote:

Originally Posted by Katae (Post 175965)
This is happening because the cursor is being intercepted by the DBM button, so the parent "thinks" that the cursor is leaving it, thus triggering the OnLeave function.

You can get around this pretty easily by checking if the cursor is not hovering over a child panel:
Code:

OnLeave = function(self)
    if GetMouseFocus():GetParent() ~= self then self:SetAlpha(0) end
end,


Thank you for your help.

Now, sometimes diverting the cursor on the panel, it does not disappear.

Code:
Code:

{        name = "Buttons panel",
        anchor_to = "BOTTOM", x_off = 285, y_off = 6,
        width = 200, height = 7,
        bg_alpha = 1,
        OnLoad = function(self) self:SetAlpha(0) end,
        OnEnter = function(self) self:SetAlpha(1) end,
        OnLeave = function(self)
                if GetMouseFocus():GetParent() ~= self then self:SetAlpha(0) end
        end,
},
{        name = "DBM Button", parent = "Buttons panel",
        anchor_to = "LEFT", x_off = 0, y_off = 1,
        OnClick = function(self, button)
                if button == "LeftButton" then
                        DBM:LoadGUI()
                end
        end,
        text = {
                { string = "DBM",
                        anchor_to = "CENTER",
                        outline=1,
                        font = main_font,
                        size = main_font_size,
                        color = "CLASS"
                },
        },
},


Tandurin 01-28-10 04:56 PM

Hehe sry to bust in again :o

I wrote a new code after my hard-drive crashed. Though again it doesn't show up =S.

I thought I did everything right this time...

here's the code

Code:

lpanels:CreateLayout("Chat", {
        -- Main Chat Background
        {        name = "Chat",
                strata = "BACKGROUND", level = 0,
                x_off = 0, y_off = "1%",
                width = "20%", height = 125,
                bg_color = "1 1 1", bg_alpha = 0.5,
                anchor_to = "BOTTOMLEFT",
                border_size = 1, Border_color = "1 1 1",
        },
}),

lpanels:CreateLayout("Combat", {
        -- Main Chat Background
        {        name = "Combat",
                strata = "BACKGROUND", level = 0,
                x_off = 0, y_off = "-1%",
                width = "20%", height = 125,
                bg_color = "1 1 1", bg_alpha = 0.5,
                anchor_to = "BOTTOMRIGHT",
                border_size = 1, Border_color = "1 1 1",
        },
}),

lpanels:CreateLayout("Hotbar", {
        -- Main Chat Background
        {        name = "Hotbar",
                strata = "BACKGROUND", level = 0,
                x_off = 0, y_off = "1%",
                width = "55%", height = 55,
                bg_color = "1 1 1", bg_alpha = 0.5,
                anchor_to = "BOTTOM",
                border_size = 1, Border_color = "1 1 1",
        },
}), lpanels:ApplyLayout(nil, "Chat", "Combat", "Hotbar");


Katae 01-28-10 05:08 PM

These commas, delete them:

}),

crashbeaga 02-03-10 05:13 PM

Guys I have a question, I have my UI set up and i placed a bottom panel on the (of course) bottom of screen which is 200px height.

and using bartender as actionbar mod, i like to use the blizzard vehicle ui as default, so what i wanted to do is, when i enter on vehicle, when that frame pops up, a black panel shows behind which hides my current panel (its texture)

i guess u can have a clear view from these picz

http://img692.imageshack.us/img692/8...0310231112.jpg

http://img442.imageshack.us/img442/6...0310231139.jpg

thanks guys ;)

Katae 02-03-10 05:41 PM

You'll need to script a little to watch the UNIT_ENTERED_VEHICLE and UNIT_EXITED_VEHICLE events. You'll also need to set the strata of this new panel to be just high enough to cover your textures.

As an example:
Code:

{
    x_off = 0, y_off = 0, bg_color = "0 0 0", bg_alpha = 0, strata = "HIGH",
    OnLoad = function(self)
        self:RegisterEvent'UNIT_ENTERED_VEHICLE'
        self:RegisterEvent'UNIT_EXITED_VEHICLE'
        if UnitHasVehicleUI'player' then
            self.bg:SetAlpha(1)
        end
    end,
    OnEvent = function(self, event, unit)
        if unit == "player" then
            if event == "UNIT_ENTERED_VEHICLE" then
                self.bg:SetAlpha(1)
            else
                self.bg:SetAlpha(0)
            end
        end
    end,
}


Star1814 02-20-10 11:13 AM

Border disappearing
 
Why, oh why, do the border keep disappearing and reappearing when the values of x_off and y_off are changed? Am trying to parent a panel with a background color and border to a Bartender4 bar (well, button to be specific as there's no frame for the bar, sucks -- any suggestion on that anyone?), and it's driving me insane.

Breetard 03-07-10 06:44 PM

Quote:

Originally Posted by Katae (Post 146495)
Gradients with a stats display



I'll start with some scripts I've been using. This is the same layout code I used for the stats display, copy and paste this into the default or your character's profile. This also demonstrates the built-in class coloring.

If you want to only use the gradient box, you could remove the stats panel (name = "Stats") and tweak the dimensions, locations, and colors. (Font in the screenshot is 04B_03)

Code:

lpanels:CreateLayout("Stats", {
    -- Stat Container
    {    name = "Container",
        anchor_to = "TOP",
        width = 280, height = 20,
        x_off = 0, y_off = -30,
        bg_alpha = 0,
    },
    -- Left mid-section of the box
    {    name = "BoxL", parent = "Container",
        anchor_to = "LEFT",
        width = "50%", height = "100%",
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.2,
    },
    -- Right mid-section
    {    name = "BoxR", parent = "Container",
        anchor_to = "RIGHT",
        width = "50%", height = "100%",
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.2, gradient_alpha = 0,
    },
    -- Top Left gradient line
    {    name = "LineTL",
        parent = "BoxL", anchor_to = "TOP",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.8,
    },
    -- Top right line
    {    name = "LineTR",
        parent = "BoxR", anchor_to = "TOP",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.8, gradient_alpha = 0,
    },
    -- Bottom left line
    {    name = "LineBL",
        parent = "BoxL", anchor_to = "BOTTOM",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.8,
    },
    -- Bottom right line
    {    name = "LineBR",
        parent = "BoxR", anchor_to = "BOTTOM",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.8, gradient_alpha = 0,
    },
    -- Text display
    {    name = "Stats", parent = "Container",
        anchor_to = "CENTER", anchor_from = "CENTER",
        text = {
            string = function()
                -- monies
                local gold = format("%.1f|cffffd700g|r",GetMoney()/10000)

                -- durability
                local durability = 100
                for i = 1, 11 do
                    if GetInventoryItemDurability(i) ~= nil then
                        local dur, max = GetInventoryItemDurability(i)
                        local perc = dur / max * 100
                        if perc < durability then
                            durability = floor(perc)
                        end
                    end
                end

                -- fps
                local fps = floor(GetFramerate())

                -- memory
                local memory = 0
                UpdateAddOnMemoryUsage()
                for i = 1, GetNumAddOns() do
                    if IsAddOnLoaded(i) then
                        memory = memory + GetAddOnMemoryUsage(i)
                    end
                end
                memory = format("%.1f", memory/1024)

                -- latency
                local latency = select(3,GetNetStats())

                return format(":: %s :: %s%%dur :: %sfps :: %smB :: %sms ::", gold, durability, fps, memory, latency)
            end, update = 1,
            size=10, shadow=1, font = "Fonts\\FRIZQT__.TTF",
        }
    }
}); lpanels:ApplyLayout(nil, "Stats")


Say if I wanted to add the server time into that, how would I go about doing that (so tottaly noob to this)

btw love this! makes my ui look so clean!

xandora 03-07-10 06:59 PM

Try using GetGameTime() somewhere.

http://www.wowwiki.com/API_GetGameTime

Breetard 03-07-10 09:08 PM

Quote:

Originally Posted by xandora (Post 180949)
Try using GetGameTime() somewhere.

http://www.wowwiki.com/API_GetGameTime

Didnt seem to work, do you think you could help me by adding it in the code?

Katae 03-07-10 09:41 PM

Quote:

Originally Posted by Breetard (Post 180962)
Didnt seem to work, do you think you could help me by adding it in the code?

You can just add this code, then add the variables hour and minute to the end of the existing format function, like so:

Code:

-- Server Clock
local hour, minute, aptime, pm = GetGameTime(), true
if aptime then
  if hour == 0 then hour = 12 end
  if hour > 12 then hour = hour - 12 end
  if hour >= 12 then pm = true end
end

return format(":: %s :: %s%%dur :: %sfps :: %smB :: %sms :: %s:%s%s ::", gold, durability, fps, memory, latency, hour, minute, aptime and pm and "pm" or "am" or "")

Should work, did not test.

Breetard 03-07-10 11:11 PM

Quote:

Originally Posted by Katae (Post 180966)
You can just add this code, then add the variables hour and minute to the end of the existing format function, like so:

Code:

-- Server Clock
local hour, minute, aptime, pm = GetGameTime(), true
if aptime then
  if hour == 0 then hour = 12 end
  if hour > 12 then hour = hour - 12 end
  if hour >= 12 then pm = true end
end

return format(":: %s :: %s%%dur :: %sfps :: %smB :: %sms :: %s:%s%s ::", gold, durability, fps, memory, latency, hour, minute, aptime and pm and "pm" or "am" or "")

Should work, did not test.

Its all gone now :( this is what I have.

Code:

lpanels:CreateLayout("Stats", {
    -- Stat Container
    {    name = "Container",
        anchor_to = "BOTTOM",
        width = 1020, height = 20,
        x_off = 0, y_off = 0,
        bg_alpha = 0,
    },
    -- Left mid-section of the box
    {    name = "BoxL", parent = "Container",
        anchor_to = "LEFT",
        width = "50%", height = "100%",
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.2,
    },
    -- Right mid-section
    {    name = "BoxR", parent = "Container",
        anchor_to = "RIGHT",
        width = "50%", height = "100%",
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.2, gradient_alpha = 0,
    },
    -- Top Left gradient line
    {    name = "LineTL",
        parent = "BoxL", anchor_to = "TOP",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.8,
    },
    -- Top right line
    {    name = "LineTR",
        parent = "BoxR", anchor_to = "TOP",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.8, gradient_alpha = 0,
    },
    -- Bottom left line
    {    name = "LineBL",
        parent = "BoxL", anchor_to = "BOTTOM",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.8,
    },
    -- Bottom right line
    {    name = "LineBR",
        parent = "BoxR", anchor_to = "BOTTOM",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.8, gradient_alpha = 0,
    },
    -- Text display
    {    name = "Stats", parent = "Container",
        anchor_to = "CENTER", anchor_from = "CENTER",
        text = {
            string = function()
                -- monies
                local gold = format("%.1f|cffffd700g|r",GetMoney()/10000)

                -- durability
                local durability = 100
                for i = 1, 11 do
                    if GetInventoryItemDurability(i) ~= nil then
                        local dur, max = GetInventoryItemDurability(i)
                        local perc = dur / max * 100
                        if perc < durability then
                            durability = floor(perc)
                        end
                    end
                end

                -- fps
                local fps = floor(GetFramerate())

                -- memory
                local memory = 0
                UpdateAddOnMemoryUsage()
                for i = 1, GetNumAddOns() do
                    if IsAddOnLoaded(i) then
                        memory = memory + GetAddOnMemoryUsage(i)
                    end
                end
                memory = format("%.1f", memory/1024)

                -- latency
                local latency = select(3,GetNetStats())

-- Server Clock
local hour, minute, aptime, pm = GetGameTime(), true
if aptime then
  if hour == 0 then hour = 12 end
  if hour > 12 then hour = hour - 12 end
  if hour >= 12 then pm = true end
end



                return format(":: %s :: %s%%dur :: %sfps :: %smB :: %sms :: %s:%s%s ::", gold, durability, fps, memory, latency, hour, minute, aptime and pm and "pm" or

"am" or "")
            end, update = 1,
            size=10, shadow=1, font = "Fonts\\FRIZQT__.TTF",
        }
    }
}); lpanels:ApplyLayout(nil, "Stats")


Katae 03-07-10 11:25 PM

Code:

"am" or "")
Should be on the same line with format.
Code:

return format(":: %s :: %s%%dur :: %sfps :: %smB :: %sms :: %s:%s%s ::",  gold, durability, fps, memory, latency, hour, minute, aptime and (pm and  "pm" or "am") or "")

Breetard 03-08-10 03:30 AM

Quote:

Originally Posted by Katae (Post 180976)
Code:

"am" or "")
Should be on the same line with format.
Code:

return format(":: %s :: %s%%dur :: %sfps :: %smB :: %sms :: %s:%s%s ::",  gold, durability, fps, memory, latency, hour, minute, aptime and (pm and  "pm" or "am") or "")

ffs I must be super noob because I'm not getting it at all. I'm sorry >.<

Code:

lpanels:CreateLayout("Stats", {
    -- Stat Container
    {    name = "Container",
        anchor_to = "BOTTOM",
        width = 1020, height = 20,
        x_off = 0, y_off = 0,
        bg_alpha = 0,
    },
    -- Left mid-section of the box
    {    name = "BoxL", parent = "Container",
        anchor_to = "LEFT",
        width = "50%", height = "100%",
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.2,
    },
    -- Right mid-section
    {    name = "BoxR", parent = "Container",
        anchor_to = "RIGHT",
        width = "50%", height = "100%",
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.2, gradient_alpha = 0,
    },
    -- Top Left gradient line
    {    name = "LineTL",
        parent = "BoxL", anchor_to = "TOP",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.8,
    },
    -- Top right line
    {    name = "LineTR",
        parent = "BoxR", anchor_to = "TOP",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.8, gradient_alpha = 0,
    },
    -- Bottom left line
    {    name = "LineBL",
        parent = "BoxL", anchor_to = "BOTTOM",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.8,
    },
    -- Bottom right line
    {    name = "LineBR",
        parent = "BoxR", anchor_to = "BOTTOM",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.8, gradient_alpha = 0,
    },
    -- Text display
    {    name = "Stats", parent = "Container",
        anchor_to = "CENTER", anchor_from = "CENTER",
        text = {
            string = function()
                -- monies
                local gold = format("%.1f|cffffd700g|r",GetMoney()/10000)

                -- durability
                local durability = 100
                for i = 1, 11 do
                    if GetInventoryItemDurability(i) ~= nil then
                        local dur, max = GetInventoryItemDurability(i)
                        local perc = dur / max * 100
                        if perc < durability then
                            durability = floor(perc)
                        end
                    end
                end

                -- fps
                local fps = floor(GetFramerate())

                -- memory
                local memory = 0
                UpdateAddOnMemoryUsage()
                for i = 1, GetNumAddOns() do
                    if IsAddOnLoaded(i) then
                        memory = memory + GetAddOnMemoryUsage(i)
                    end
                end
                memory = format("%.1f", memory/1024)

                -- latency
                local latency = select(3,GetNetStats())

-- Server Clock
local hour, minute, aptime, pm = GetGameTime(), true
if aptime then
  if hour == 0 then hour = 12 end
  if hour > 12 then hour = hour - 12 end
  if hour >= 12 then pm = true end
end



                return format(":: %s :: %s%%dur :: %sfps :: %smB :: %sms :: %s:%s%s ::",  gold, durability, fps, memory, latency, hour, minute, aptime and (pm and  "pm" or "am") or "")
            end, update = 1,
            size=10, shadow=1, font = "Fonts\\FRIZQT__.TTF",
        }
    }
}); lpanels:ApplyLayout(nil, "Stats")

It just takes away the font and there is a blank bar :(


All times are GMT -6. The time now is 09:23 PM.

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