Thread Tools Display Modes
01-12-12, 06:43 PM   #341
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
Okay so this might be your problem. Are you moving the file you are trying to use the the litepanels media folder? That folder is located in the Litepanels Addon folder, it should be empty or might have a couple files in it already.

If yes... then
lua Code:
  1. tex_file = "glosstex",
... like in your example will work if the file is in correct format.

If no... then you need to make sure the path is correct.
Example:
lua Code:
  1. tex_file = "Interface\\Addons\\oUF_Karma\\media\\Statusbar.tga",
  2. tex_file = "Interface\\Addons\\FOLDER\\TEXTURE",

That could explain your black box problem.

One of my panels looks like:

lua Code:
  1. {   name = "CenterGraphic",
  2.     anchor_to = "BOTTOM", anchor_from = "BOTTOM",
  3.     y_off = 10, x_off = 0,
  4.     height = 100, width = "25%", level = 1,
  5.     tex_file = "Interface\\Addons\\oUF_Karma\\media\\Statusbar.tga",
  6.     bg_color = {.15,.15,.15}, bg_alpha = 1,
  7.     border = "SOLID", border_size = 2, border_color = {0,0,0}, border_alpha = 1,
  8. },
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"
  Reply With Quote
01-13-12, 01:51 PM   #342
Aerilyn
A Murloc Raider
Join Date: Apr 2009
Posts: 4
Gloss

Yes, they are in the media folder within Lite Panels. I used your code and installed OUF & OUF_Karma to fully test and it works perfectly. I put the texture within the media folder of Lite Panels and it works correctly. I think the problem with my code is that I need to tinker with the color coding for the texture and playing with different textures. I found the one that I like and it's as close as I can get to what I want until I have time to find another texture.

Thanks for all of your help!
  Reply With Quote
01-13-12, 04:40 PM   #343
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
You can also do "CLASS" instead of {#,#,#} for your colors anywhere in the layout btw.

Glad its working for you. Let me know if I can be of anymore help.
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"
  Reply With Quote
01-16-12, 04:01 PM   #344
Skynniman
A Murloc Raider
Join Date: Jan 2012
Posts: 5
Lite problem

Hi,

Nowdays I edit my minimap with Litepanels but I've got a little problem. I'm trying to make disappear 2 bars when I enter in combat and appear again when get out of combat. I'm not really good in Lua so I found the code copy/paste it, and when I use it one time, it work really good, but when I use it twice it make all my frame disapear =/

Here you can fin my layout.lua : http://pastebin.com/4Une5Rpe

Can someone help me ?
  Reply With Quote
01-16-12, 05:09 PM   #345
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
Originally Posted by Unkn View Post
............

OOC and InCombat Panels

Code:
{	name = "Tester1", --in combat show
	anchor_to = "CENTER", y_off = 0, x_off = 0,
	width = 100, height = 100, strata = "background",
	bg_color = {0,0,0}, bg_alpha = 1,
	OnLoad=function(self)
		self:RegisterEvent'PLAYER_REGEN_ENABLED'
		self:RegisterEvent'PLAYER_REGEN_DISABLED'
		self:Hide()
	end,
	OnEvent=function(self) ToggleFrame(self) end
},
{	name = "Tester2",  --NOT in combat show
	anchor_to = "CENTER", y_off = 200, x_off = 200,
	width = 100, height = 100, strata = "background",
	bg_color = {0,0,0}, bg_alpha = 1,
	OnLoad=function(self)
		self:RegisterEvent'PLAYER_REGEN_ENABLED'
		self:RegisterEvent'PLAYER_REGEN_DISABLED'
		self:Show()
	end,
	OnEvent=function(self) ToggleFrame(self) end
},
This was me testing to move some elements when I was in combat or out. The panels "move". Can do the same thing for different color depending on combat state. Just place the panels - same width and height - in exact same place and make them different colors.
Quoting myself... oh yeah...

I would suggest doing something similar with your panels. Just a toggle for in/out combat. Let me know how if it works I may be able to tweak it for you.
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"
  Reply With Quote
01-16-12, 05:23 PM   #346
Skynniman
A Murloc Raider
Join Date: Jan 2012
Posts: 5
OMG, I'm a real noob --'

I don't how I haven't seen you're post...
But Thanks for the quickly reply I wil test on my side too
  Reply With Quote
01-16-12, 05:43 PM   #347
Skynniman
A Murloc Raider
Join Date: Jan 2012
Posts: 5
I read my code again, I've got the same as you, ( exept for my wish to make two frame disappear ) and I really don't understand why , 1 disapear is good, ans 2 make alle my panels bug =/

EDIT : I don't have paste the write layout I re upload the right lua

EDIT 2 : http://pastebin.com/kXdqsyxF but it's the same when "Minimap_location" and "Minimap_tracking" have the code when I enter in combat all my frames disapear

Last edited by Skynniman : 01-16-12 at 05:54 PM.
  Reply With Quote
01-16-12, 07:27 PM   #348
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
Its not the same. I just use a toggle frame vs show/hide on event. I fixed it and should have a working copy below. Try it out. It is your entire layout. I just checked to make sure it worked correctly multiple times with test panels. It should work to do the following - show intended panels (ie Minimap_location and Minimap_tracking) unless you are in combat then those 2 panels will hide.

lua Code:
  1. lpanels:CreateLayout("Minimap", {
  2.         -- Bordure minimap int
  3.         {       name = "Minimap_border",
  4.                 parent = "Minimap", anchor_to = "TOP",
  5.                 height = "100%", width = "100%" , bg_alpha = 0,
  6.                 border = "SOLID", border_color = "0 0 0",
  7.                 border_alpha = 0.5, level = 99, inset = -2.5
  8.         },
  9.         -- barre supérieur carte
  10.         {       name = "Minimap_location",
  11.                 anchor_frame = "Minimap", anchor_to = "TOPLEFT",
  12.                 height = 11, width = "100%",
  13.                 bg_alpha = 0.3, level = 99,
  14.     OnLoad=function(self)
  15.         self:RegisterEvent'PLAYER_REGEN_ENABLED'
  16.         self:RegisterEvent'PLAYER_REGEN_DISABLED'
  17.         self:Show()
  18.     end,
  19.     OnEvent=function(self) ToggleFrame(self) end
  20.         },    
  21.         {       name = "Minimap_location_border",
  22.                 parent = "Minimap_location", anchor_to = "BOTTOM",
  23.                 width = "100%", height = 1, y_off = -1,
  24.                 bg_alpha = 0.5,
  25.         },
  26.        
  27.         -- Barre inférieur carte
  28.         {       name = "Minimap_tracking",
  29.                 anchor_frame = "Minimap",
  30.                 height = 18, width = "100%",
  31.                 bg_alpha = 0.3, level = 99,
  32.     OnLoad=function(self)
  33.         self:RegisterEvent'PLAYER_REGEN_ENABLED'
  34.         self:RegisterEvent'PLAYER_REGEN_DISABLED'
  35.         self:Show()
  36.     end,
  37.     OnEvent=function(self) ToggleFrame(self) end
  38.                
  39.         },
  40.         {       name = "Minimap_tracking_border",
  41.                 parent = "Minimap_tracking", anchor_to = "TOP",
  42.                 width = "100%", height = 1, y_off = 1,
  43.                 bg_alpha = 0.5,
  44.         },
  45.  
  46.         -- barre inférieur extérieur carte
  47.         {       name = "Minimap_stat",
  48.                 parent = "Minimap_tracking", anchor_to = "BOTTOM",
  49.                 border = "SOLID", border_color = "0 0 0",
  50.                 border_alpha = 0.5, level = 0, inset = 1,
  51.                 height = 15, width = 140, y_off = -17.5,
  52.                 bg_alpha = 0.3, level = 99,
  53.                
  54.         }
  55. })
  56.  
  57. lpanels:CreateLayout("Afker", {
  58.     {    name = "AFK", anchor_to = "TOP", y_off = -350,
  59.         bg_alpha = 0.5, width = 200, height = 50,
  60.         border = "SOLID", border_color = "1 0.3 0.3",
  61.         text = {
  62.         -- "YOU ARE AFK!"
  63.             {    string = "Tu es AFK !", anchor_to = "TOP", y_off = -10,
  64.                 shadow=1, font = "Fonts\\FRIZQT__.TTF", size=14,
  65.             },
  66.             -- "0:00" TIMER
  67.             {    string=function()
  68.                     if afk_timer then
  69.                         local secs = mod(time() - afk_timer, 60)
  70.                         local mins = floor((time() - afk_timer) / 60)
  71.                         return format("%s:%02.f", mins, secs)
  72.                     end
  73.                 end, update=0.1,
  74.                 shadow=1, font = "Fonts\\FRIZQT__.TTF", size=16,
  75.                 anchor_to = "CENTER", y_off = -7, color = "1 0.3 0.3"
  76.             }
  77.         },
  78.         OnLoad = function(self)
  79.             self:RegisterEvent("PLAYER_FLAGS_CHANGED")
  80.             self:Hide()
  81.         end,
  82.         OnEvent = function(self)
  83.             if UnitIsAFK("player") and not afk_timer then
  84.                 self.text2:SetText("0:00")
  85.                 afk_timer = time()
  86.                 self:Show()
  87.             elseif not UnitIsAFK("player") then
  88.                 self:Hide()
  89.                 afk_timer = nil
  90.             end
  91.         end,
  92.         OnClick = function(self, b)
  93.             self:Hide()
  94.             if b == "LeftButton" then SendChatMessage("", "AFK") end
  95.         end,
  96.         OnEnter = function(self) self.bg:SetTexture(.1,.1,.1,.5) end,
  97.         OnLeave = function(self) self.bg:SetTexture(0,0,0,.5) end
  98.     }
  99. })
  100.  
  101. lpanels:ApplyLayout(nil, "Minimap", "Afker")
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"

Last edited by Unkn : 01-16-12 at 07:29 PM. Reason: typo...
  Reply With Quote
01-17-12, 12:29 PM   #349
Skynniman
A Murloc Raider
Join Date: Jan 2012
Posts: 5
I've just try you're code but it the same, all my panel disapear =/
  Reply With Quote
01-17-12, 03:07 PM   #350
Skynniman
A Murloc Raider
Join Date: Jan 2012
Posts: 5
Solved : The problem were not the code but the parents... Thanks you for your help =)
  Reply With Quote
01-17-12, 06:04 PM   #351
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
Yay! Glad its working for you now
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"
  Reply With Quote
09-08-12, 01:14 PM   #352
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
For those interested. LitePanels is still fully functioning in patch 5.0.4 pre MoP and should continue to work in MoP.

LiteStats works fine if you disable the "Talents" module in the config.lua for that addon.

__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"
  Reply With Quote
04-30-13, 08:40 AM   #353
maven79
A Defias Bandit
Join Date: Oct 2011
Posts: 2
Function for repeated panels

Maintenance at the moment so wanted to play with my layout a bit. Awesome addon btw.

For an example I will use a simple 1px class-colored border on the minimap:
Lua Code:
  1. lpanels:CreateLayout("Minimap_border",{
  2.     {   name="Minimap_border",parent="Minimap",strata="BACKGROUND",level=4,anchor_to="TOP",width="100%",height="100%",bg_color="CLASS",bg_alpha=1,inset=-1},
  3. }
  4. lpanels:ApplyLayout(nil,"Minimap_border")

And the same one with a black border.

Lua Code:
  1. lpanels:CreateLayout("Minimap_border",{
  2.     {   name="Minimap_border",parent="Minimap",strata="BACKGROUND",level=4,anchor_to="TOP",width="100%",height="100%",bg_color="0 0 0",bg_alpha=1,inset=-1},
  3. }
  4. lpanels:ApplyLayout(nil,"Minimap_border")

So what I would like is a means to turn those 2 simple border lines into a function so I then simply say something like border_class("somenewframe") or border_black("somenewframe") and not have to repeat all that lua for each of dozens of frames, and more importantly, just tweak one line when I want to add a shadow, or change a detail for every frame with one edit. Hope that makes sense. Could you provide any samples for making those functions within the lua file if it is possible? If the functions won't work, perhaps just some variables would work to simplify global changes to all panels? Thanks!
  Reply With Quote
05-01-13, 12:04 AM   #354
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
@maven

Forgive me, I haven't coded Lua for over a year and I'm doing this on my phone. But perhaps something along these lines?

Lua Code:
  1. function border(parent, color)
  2.   return {
  3.       name = parent .. "_border",
  4.       parent = parent,
  5.       anchor_to = "TOP",
  6.       bg_color = color or "CLASS",
  7.       bg_alpha = 1,
  8.       width = "100%",
  9.       height = "100%",
  10.       strata = "BACKGROUND",
  11.       level = 4,
  12.       inset = -1
  13.   }
  14. end
  15. lpanels:CreateLayout("Minimap_border", border("Minimap"))

Should use "CLASS" if you omit the color parameter.

Last edited by Katae : 05-01-13 at 03:52 AM.
  Reply With Quote
05-19-13, 01:53 AM   #355
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
OnLeave problem

Hi, I have used LitePanels in a simple way for long time ...

Now I'd like to use it trying to make something more complex, but I am having some difficulties:

Lua Code:
  1. lpanels:CreateLayout("Back2", {
  2.     {   name = "P1", anchor_to = "BOTTOM", x_off = 0, y_off = 4,
  3.         bg_alpha = 0.5, width = 460, height = 120,
  4.         border = "SOLID", border_color = "CLASS",
  5.     },
  6.    
  7.     {   name = "P2",
  8.         anchor_to="BOTTOMLEFT", anchor_from="BOTTOMRIGHT", anchor_frame = "P1",
  9.         x_off = 2, y_off = 0,
  10.         bg_alpha = 0.5, width = 115, height = 120,
  11.         border = "SOLID", border_color = "CLASS",
  12.         OnLoad  = function(self) self:SetAlpha(0) end,
  13.         OnEnter = function(self)
  14.             self:SetAlpha(1)
  15.             -- BT4Bar3:Show()
  16.         end,
  17.         OnLeave = function(self)
  18.             print( "DEBUG: The mouse is over " .. GetMouseFocus():GetName())
  19.             if GetMouseFocus():GetParent() ~= self then
  20.                 self:SetAlpha(0)
  21.             end
  22.         end,
  23.     },
  24.    
  25. } )

The problem is, as pointed out in this forum earlier, that I'd like to make P2 panel show and hide on the event Enter and Leave.
But I have filled the P2 panel with a 3x3 bar of BT4 and when I hovering over it the P2 panel disappear if I use a simple self:SetAlpha(0) condition.

Also the solution I found in this thread, as posted above, isn't working.

Any idea ? Thanks.

P.s.
This is really a great addon.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
05-19-13, 12:38 PM   #356
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Solved, thanks to other answer in this forum in this way:

Lua Code:
  1. lpanels:CreateLayout("Back2", {
  2.     {   name = "P1", anchor_to = "BOTTOM", x_off = 0, y_off = 4,
  3.         bg_alpha = 1, width = 460, height = 122,
  4.         border = "SOLID", border_color = "CLASS",
  5.     },
  6.    
  7.     {   name = "P2", parent = "BT4Bar10",
  8.         anchor_to="BOTTOMLEFT", anchor_from="BOTTOMRIGHT", anchor_frame = "P1",
  9.         x_off = 2, y_off = 0,
  10.         bg_alpha = 1, width = 115, height = 122,
  11.         border = "SOLID", border_color = "CLASS",
  12.     },
  13.  
  14.     {   name = "P3", parent = "BT4Bar9",
  15.         anchor_to="BOTTOMRIGHT", anchor_from="BOTTOMLEFT", anchor_frame = "P1",
  16.         x_off = -2, y_off = 0,
  17.         bg_alpha = 1, width = 115, height = 122,
  18.         border = "SOLID", border_color = "CLASS",
  19.     },
  20.    
  21. } )

Without parenting with BT4 bars I think it is impossible.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
06-29-13, 12:23 PM   #357
Rakkerzero
A Defias Bandit
 
Rakkerzero's Avatar
Join Date: Aug 2009
Posts: 3
I've a couple of panels that i want to hide in Pet Battles. How can do that?
  Reply With Quote
06-29-13, 01:30 PM   #358
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Originally Posted by Rakkerzero View Post
I've a couple of panels that i want to hide in Pet Battles. How can do that?
You need to have the two events PET_BATTLE_CLOSE and PET_BATTLE_OPENING_START registered for a frame (one you want to hide). And assuming they're not secure frames then in its OnEvent function:

Code:
if event == "PET_BATTLE_CLOSE" then
	if self.PetBattleHidden then
		self.PetBattleHidden = nil
		self:Show();
                OtherPanel:Show()
                -- Show other panels
		return
	end
end
if not self:IsVisible() then return; end
if event == "PET_BATTLE_OPENING_START" then
	self.PetBattleHidden = true
        self:Hide()
        OtherPanel:Hide()
        -- Hide other panels
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-29-13 at 01:32 PM.
  Reply With Quote
06-29-13, 02:51 PM   #359
Rakkerzero
A Defias Bandit
 
Rakkerzero's Avatar
Join Date: Aug 2009
Posts: 3
Originally Posted by Fizzlemizz View Post
You need to have the two events PET_BATTLE_CLOSE and PET_BATTLE_OPENING_START registered for a frame (one you want to hide). And assuming they're not secure frames then in its OnEvent function:

Code:
if event == "PET_BATTLE_CLOSE" then
	if self.PetBattleHidden then
		self.PetBattleHidden = nil
		self:Show();
                OtherPanel:Show()
                -- Show other panels
		return
	end
end
if not self:IsVisible() then return; end
if event == "PET_BATTLE_OPENING_START" then
	self.PetBattleHidden = true
        self:Hide()
        OtherPanel:Hide()
        -- Hide other panels
end
I'm not getting it. I'm not familiar with LUA scripting. I got the following panelframe which i want to hide in pet battles:
Code:
lpanels:CreateLayout("Button Bar", {
	-- Buttonbar background
	{	name = "Buttonbar",
		width = "783", height = 86, 
		y_off = 7, x_off = "552",
		bg_color = "0.1 0.1 0.1", bg_alpha = 1,
		level = 4,
	},
		-- Lines around the box
		{	name = "BB_left", parent = "Buttonbar",
			anchor_to = "LEFT",
			width = 1, height = 86, x_off = -1,
			bg_color = "0.3 0.3 0.3", bg_alpha = 1,
			level = 5,
		},
		{	name = "BB_right", parent = "Buttonbar",
			anchor_to = "RIGHT",
			width = 1, height = 86,
			bg_color = "0.3 0.3 0.3", bg_alpha = 1,
			level = 5,
		},
		{	name = "BB_top", parent = "Buttonbar",
			anchor_to = "TOP",
			width = 783, height = 1,
			bg_color = "0.3 0.3 0.3", bg_alpha = 1,
			level = 5,
		},
		{	name = "BB_bottom", parent = "Buttonbar",
			anchor_to = "BOTTOM",
			width = 783, height = 1,
			bg_color = "0.3 0.3 0.3", bg_alpha = 1,
			level = 5,
		},
})
Where do i have to put that script you're showing?
  Reply With Quote
06-29-13, 11:49 PM   #360
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
I haven't used LitePanels (so backup your layout file) but a quick look at the docs and I think something like this might work, assuming you want all the panels in this layout to hide and assuming LP parents all subsequent frames to the first in a layout:

Code:
lpanels:CreateLayout("Button Bar", {
	-- Buttonbar background
	{	name = "Buttonbar",
		width = "783", height = 86, 
		y_off = 7, x_off = "552",
		bg_color = "0.1 0.1 0.1", bg_alpha = 1,
		level = 4,
                OnLoad = function(self)
                    self:RegisterEvent("PET_BATTLE_OPENING_START")
                    self:RegisterEvent("PET_BATTLE_CLOSE")
                end,
                OnEvent = function(self, event)
                    if event == "PET_BATTLE_CLOSE" then
                    	if self.PetBattleHidden then
                    		self.PetBattleHidden = nil
                    		self:Show()
                    		return
                    	end
                    end
                    if not self:IsVisible() then return; end
                    if event == "PET_BATTLE_OPENING_START" then
                    	self.PetBattleHidden = true
                        self:Hide()
                    end
                end,
	},
		-- Lines around the box
		{	name = "BB_left", parent = "Buttonbar",
			anchor_to = "LEFT",
			width = 1, height = 86, x_off = -1,
			bg_color = "0.3 0.3 0.3", bg_alpha = 1,
			level = 5,
		},
		{	name = "BB_right", parent = "Buttonbar",
			anchor_to = "RIGHT",
			width = 1, height = 86,
			bg_color = "0.3 0.3 0.3", bg_alpha = 1,
			level = 5,
		},
		{	name = "BB_top", parent = "Buttonbar",
			anchor_to = "TOP",
			width = 783, height = 1,
			bg_color = "0.3 0.3 0.3", bg_alpha = 1,
			level = 5,
		},
		{	name = "BB_bottom", parent = "Buttonbar",
			anchor_to = "BOTTOM",
			width = 783, height = 1,
			bg_color = "0.3 0.3 0.3", bg_alpha = 1,
			level = 5,
		},
})
If it doesn't work, posting in the LitePanles comments page might find someone who can massage the code correctly.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-30-13 at 01:43 AM.
  Reply With Quote

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

Thread Tools
Display Modes

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