Thread Tools Display Modes
12-27-09, 11:18 AM   #141
Pixol
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 13
Originally Posted by Katae View Post
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

Last edited by Pixol : 12-27-09 at 11:21 AM.
  Reply With Quote
12-30-09, 12:08 PM   #142
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
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.
  Reply With Quote
12-30-09, 01:53 PM   #143
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by eddiemars View Post
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,

Last edited by Katae : 12-30-09 at 11:55 PM. Reason: fix't
  Reply With Quote
12-30-09, 02:25 PM   #144
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by Pixol View Post
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.

Last edited by Katae : 12-30-09 at 02:28 PM.
  Reply With Quote
12-30-09, 03:15 PM   #145
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
Originally Posted by Katae View Post
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.
  Reply With Quote
12-30-09, 11:36 PM   #146
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by eddiemars View Post
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)

Last edited by Katae : 12-30-09 at 11:56 PM.
  Reply With Quote
12-31-09, 12:54 AM   #147
terracloud
A Murloc Raider
 
terracloud's Avatar
Join Date: Apr 2009
Posts: 8
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?

Last edited by terracloud : 12-31-09 at 01:28 AM.
  Reply With Quote
12-31-09, 05:25 AM   #148
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by terracloud View Post
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.
Originally Posted by terracloud View Post
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.
  Reply With Quote
12-31-09, 12:24 PM   #149
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
Ultra thanks, it works perfectly now. It looks pretty wicked too
  Reply With Quote
12-31-09, 11:42 PM   #150
terracloud
A Murloc Raider
 
terracloud's Avatar
Join Date: Apr 2009
Posts: 8
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

Last edited by terracloud : 12-31-09 at 11:56 PM.
  Reply With Quote
01-01-10, 03:16 AM   #151
xandora
A Chromatic Dragonspawn
 
xandora's Avatar
Join Date: Feb 2009
Posts: 188
I don't think you need to include the .tga extensions for the texture files.
  Reply With Quote
01-02-10, 03:17 AM   #152
terracloud
A Murloc Raider
 
terracloud's Avatar
Join Date: Apr 2009
Posts: 8
I've finally figured out what the problem was, I'm putting it on pastebin for reference

http://pastebin.com/m48d88472
  Reply With Quote
01-04-10, 03:17 AM   #153
Victimize
A Murloc Raider
Join Date: Dec 2009
Posts: 5
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?
  Reply With Quote
01-04-10, 05:19 PM   #154
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
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 },
  Reply With Quote
01-04-10, 07:29 PM   #155
Victimize
A Murloc Raider
Join Date: Dec 2009
Posts: 5
Dead on! I was missing a comma. Thanks mate
  Reply With Quote
01-06-10, 04:14 PM   #156
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
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?

Last edited by eddiemars : 01-07-10 at 03:30 AM.
  Reply With Quote
01-09-10, 09:34 AM   #157
velrhis
A Kobold Labourer
Join Date: Jan 2010
Posts: 1
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
  Reply With Quote
01-11-10, 02:14 AM   #158
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by eddiemars View Post
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.

Originally Posted by velrhis View Post
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

Last edited by Katae : 01-11-10 at 02:17 AM.
  Reply With Quote
01-11-10, 12:46 PM   #159
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
Originally Posted by Katae View Post
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.
  Reply With Quote
01-21-10, 05:13 AM   #160
shinchih2001
A Defias Bandit
Join Date: Nov 2008
Posts: 3
i copy afker and minimap layout into layout.lua but can't work

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")
Attached Files
File Type: lua layout.lua (17.0 KB, 662 views)

Last edited by shinchih2001 : 01-21-10 at 05:17 AM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Released AddOns » LitePanels - An art framework


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off