Thread Tools Display Modes
09-07-09, 03:28 AM   #61
Miralen
A Rage Talon Dragon Guard
 
Miralen's Avatar
Join Date: Dec 2006
Posts: 341
Ya basically I want the panels to be positioned in roughly the same screen location no matter what screen resolution I am using I am going to check this out and see if this will work.
__________________
Never hold discussions with the monkey when the organ grinder is in the room.

- Winston Churchill
  Reply With Quote
09-07-09, 03:39 AM   #62
Gnoore
A Defias Bandit
AddOn Compiler - Click to view compilations
Join Date: Jun 2009
Posts: 2
Originally Posted by Yhor View Post
Might parent it to a raid frame... but.

What is the purpose of the frame you want to display? A little more detail will get you much better help .

An extra panel is displayed when I am in the raid then you can see where to Grid and Decursive.
  Reply With Quote
09-07-09, 05:01 AM   #63
Yhor
A Pyroguard Emberseer
 
Yhor's Avatar
Join Date: May 2007
Posts: 1,077
Originally Posted by Gnoore View Post
An extra panel is displayed when I am in the raid then you can see where to Grid and Decursive.
A static frame shouldn't be hard at all. You tell it the dimensions of your frame and parent it to whatever raid frame you wish. Find the frame's name via a mouse-over script, or the addon MoveAnything! can also give you the exact frame name.

Assuming you are using a texture, I'll give an example. This will only show the panel frame when the raid frame is there, and will disappear when the raid frame is not there.

Code:
{ name="TheNameOfYourFrame", parent="YourRaidFrameName", tex_file="YourTextureFileNameInMediaFolder.tga", 
      bg_alpha=.95, anchor_to="CENTER", width="735", height="575", y_off = 143, x_off = -143 },
Fill in TheNameOfYourFrame with the name of your frame, YourRaidFrameName with your raid frame name you want to parent it to..etc.... Don't remove the quotes, they belong there. Adjust width, height, x and y position according to your needs. Be sure to have a tga or blp texture that meets WoW's standards in the media folder inside the LitePanels addon folder. There are texture packs available on the site for download as well , if you care to use them.

I hope this helps, and wasn't overkill on information you already knew. If you want a dynamic panel (adjusts to size), then hopefully someone with more skill than I have can help (if it's possible). There's more information inside the example layout.lua file also, if needed.
  Reply With Quote
09-07-09, 05:25 AM   #64
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by Yhor View Post
If you want a dynamic panel (adjusts to size), then hopefully someone with more skill than I have can help (if it's possible).
A width or height of "100%" would do just that. It can be adjusted pixel by pixel by using the inset attribute.

For the moment, a % uses the parent's dimensions, but the next version will use anchor_frame's.
  Reply With Quote
09-07-09, 06:37 AM   #65
Yhor
A Pyroguard Emberseer
 
Yhor's Avatar
Join Date: May 2007
Posts: 1,077
Originally Posted by Katae View Post
A width or height of "100%" would do just that. It can be adjusted pixel by pixel by using the inset attribute.

For the moment, a % uses the parent's dimensions, but the next version will use anchor_frame's.
Does the current version allow for "105%" (or any % greater than 100)? I ask this because it may be useful for an

{ if blah blah blah = "10", then "100%";
if blah blah blah = "15", then "201%";
end... }
etc.. situation. Does that even make any sense?

Sorry for the terrible example, I've been studying button/bar api and lua manual for about 14 hours and have work in 1 1/2 hours... I hate my OCD and already (before fixations..) abnormal sleep habits. All of which should should make my lazy example inexcusable... but there it is.
  Reply With Quote
09-07-09, 06:52 AM   #66
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by Yhor View Post
Does the current version allow for "105%" (or any % greater than 100)? I ask this because it may be useful for an

{ if blah blah blah = "10", then "100%";
if blah blah blah = "15", then "201%";
end... }
etc.. situation. Does that even make any sense?
Well, yes and no, you can use any n% as the width/height, but it currently cannot be changed on the fly like in your example since the config is only read once.

It's totally possible to implement that sort of behavior. For instance, allowing width/height to be a function and change itself conditionally.

But for the time being, to alter the width/height as a % conditionally, something like this could be used...
Code:
OnUpdate = function(self)
    local height, width
    if true then
        height = "100%"
    elseif condition == 5 then
        height = "201%"
    end
    width = "100%"

    local pwidth, pheight = self:GetParent():GetWidth(), self:GetParent():GetHeight()

    if width then self:SetWidth(strmatch(width,"%%") and pwidth * strmatch(width, "(%d+)%%") * .01 or width) end
    if height then self:SetHeight(strmatch(height,"%%") and pheight * strmatch(height, "(%d+)%%") * .01 or height) end
end

Last edited by Katae : 09-10-09 at 06:41 AM. Reason: onupdate script
  Reply With Quote
09-19-09, 09:47 AM   #67
Pixol
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 13
Simply Clock/WG Timer Display

Originally Posted by Katae View Post
I actually just wrote a clock module for a stats layout I was working on the other day. Pick it apart if you like: http://pastebin.com/f486e5824
Awesome add-on. I see a lot of potential in this once I learn more about lua.
I never figured out why your lua code never worked for me... But it gave me a good start for the Clock and WG timer codes. Not sure how they are in terms of efficiency but it appears to work fine, I have yet to test the clock in PM range and yet to test the WG timer in progress and in an instance away from map, but I guess it should get the timer from our BG queueing window.

Code:
-- Left mid-section of the box
{	name = "BoxLx",
	anchor_to = "TOP",
	width = 140,		height = 20,
	x_off = -140/2,		y_off = -60,
	gradient = "H",
	bg_color = "CLASS",	gradient_color = "CLASS",
	bg_alpha = 0,		gradient_alpha = 0.2,
},
-- Right mid-section
{	name = "BoxRx",		parent = "BoxLx",
	anchor_to = "LEFT",	anchor_from = "RIGHT",
	width = "100%",		height = "100%",
	gradient = "H",
	bg_color = "CLASS",	gradient_color = "CLASS",
	bg_alpha = 0.2,		gradient_alpha = 0,
},
-- Top Left gradient line
{	name = "LineTLx",
	parent = "BoxLx",	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 = "LineTRx",
	parent = "BoxRx",	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 = "LineBLx",
	parent = "BoxLx",	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 = "LineBRx",
	parent = "BoxRx",	anchor_to = "BOTTOM",
	width = "100%",		height = 1,
	gradient = "H",
	bg_color = "CLASS",	gradient_color = "CLASS",
	bg_alpha = 0.8,		gradient_alpha = 0,
},




{	name = "Clock", parent = "BoxLx", anchor_to = "CENTER", anchor_from="RIGHT",
	text = {
		string = function()
			-- Clock
			local hour, min, sec, pm = GetGameTime()
			if hour > 12 then hour = hour - 12; pm = true elseif hour == 0 then hour = 12 end
			local timehour = format("%02.f",hour)
			local timemin = format("%02.f",min)
			local timeframe = format("%s", pm and " PM" or " AM")

			-- WG Timer
			local wgtimeinseconds = GetWintergraspWaitTime() or nil
			if wgtimeinseconds == nil then
				wgtime = "In Progress"
			else
			--local wghour = floor(wgtimeinseconds/3600)
			--local wgmin = floor(wgtimeinseconds/60 - (wghour*60)
			--local wgsec = floor(wgtimeinseconds - wghour*3600 - wgmin *60)				
			local wgtime = format("%02.f:%02.f:%02.f",floor(wgtimeinseconds/3600), floor(wgtimeinseconds/60 - floor(wgtimeinseconds/3600)*60), floor(wgtimeinseconds - floor(wgtimeinseconds/60)*60))
			end


			return "Clock:"..timehour..":"..timemin..""..timeframe.."::: Wintergrasp: "..wgtime..""
		end, update = 1, font = "Fonts\\FRIZQT__.TTF", size = 10, alpha = 1.0, justify_h = "right", justify_v = "bottom", y_off = -2,
	},


--This part below seems to be acting funny for me when removing my mouse from the area, the tooltip takes a while to disappear and sometimes disappears instantly.
	OnEnter = function(self)
		GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT")
		GameTooltip:ClearLines()
		
		local hour, min, pm = GetGameTime()
		if hour > 12 then hour = hour - 12; pm = true elseif hour == 0 then hour = 12 end
		local rtime = hour..":"..format("%02.f",min)..(pm and "pm" or "am")
		local ltime = format("%01.f",date("%I"))..":"..date("%M")..strlower(date("%p"))
		
		local wgtime = GetWintergraspWaitTime() or nil
		if wgtime == nil then
			wgtime = "In Progress"
		else
			local hour = tonumber(format("%01.f", floor(wgtime/3600)))
			local min = format(hour>0 and "%02.f" or "%01.f", floor(wgtime/60 - (hour*60)))
			local sec = format("%02.f", floor(wgtime - hour*3600 - min *60))				
			wgtime = (hour>0 and hour..":" or "")..min..":"..sec
		end
		
		GameTooltip:AddLine(date("%A, %B %d"),0.4,0.78,1)
		GameTooltip:AddLine(" ")
		GameTooltip:AddDoubleLine("Local Time",ltime,0.75,0.9,1,1,1,1)
		GameTooltip:AddDoubleLine("Realm Time",rtime,0.75,0.9,1,1,1,1)
		GameTooltip:AddLine(" ")
		GameTooltip:AddDoubleLine("Time to Wintergrasp",wgtime,0.75,0.9,1,1,1,1)
		GameTooltip:Show()
	end,
	OnLeave = HideTT,
	OnClick = function(_,b) (b == "RightButton" and ToggleTimeManager or ToggleCalendar)() end

},
All code credited to Katae, I modified it to work for me since I couldn't get the original one to work.
Edit:
So after adding in the tooltip part, I noticed mousing over back and forth, the tooltip doesn't disappear instantaneously, in fact, sometimes it seems random as if it takes forever until it disappears when moving my mouse up and down. left and right mousing motion seems better it seems.
Also after enabling tooltip, is there a function supported to disable mouse clicks? say if I were to remove the OnClick function?

Thanks

Last edited by Pixol : 09-19-09 at 10:23 AM.
  Reply With Quote
09-19-09, 10:57 AM   #68
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by Pixol View Post
So after adding in the tooltip part, I noticed mousing over back and forth, the tooltip doesn't disappear instantaneously
I forgot to add the "HideTT" function I have in my original code, which is attached to OnLeave. Sorry about that. Change it to this code so it works properly.
Code:
function() ToggleFrame(GameTooltip) end
Originally Posted by Pixol View Post
Also after enabling tooltip, is there a function supported to disable mouse clicks? say if I were to remove the OnClick function?
Mouse interaction is enabled automatically for OnClick, OnEnter, and OnLeave. None of those actions would do anything otherwise.

Also, I wonder if it didn't work because of my font, did you remove that bit?

Last edited by Katae : 10-10-09 at 12:34 AM.
  Reply With Quote
10-05-09, 01:37 AM   #69
Pseudopod
A Deviate Faerie Dragon
Join Date: Apr 2008
Posts: 16
Question

I took this lua text from the "LuaTexts" thread in EJ, which collects some lua stuff for Pitbull. Since it's a bit different to import that to LitePanels, I'm wondering what's the correct way to update this info:

Code:
local base, posBuff, negBuff = UnitRangedAttackPower("player");
local ap = base + posBuff + negBuff;
local cr,arpp, hrp = GetRangedCritChance(), GetCombatRatingBonus(25), GetCombatRatingBonus(7)
local cr = format("%.2f", cr)
local hrp = format("%.2f", hrp)
local arpp = format("%.2f", arpp)

return "AP: "..ap.." crit: "..cr.."% ArP: "..arpp.."% hit: "..hrp.."%"
end
So it's supposed to show your current ranged attack power, crit, armor penetration & hit. Of those four, at least RAP & crit will change during combat, and ArP too if you have e.g. an item that procs ArP. I'm interested in getting them show without much delay, but without unnecessary updating. I've put it for now in your money/fps/memory/latency script so that "update = 1," but I figure that might not be the best way to do it?
  Reply With Quote
10-05-09, 02:45 AM   #70
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by Pseudopod View Post
I'm interested in getting them show without much delay, but without unnecessary updating. I've put it for now in your money/fps/memory/latency script so that "update = 1," but I figure that might not be the best way to do it?
It would be possible to RegisterEvent to UNIT_STATS, UNIT_DAMAGE, COMBAT_RATING_UPDATE (tested with /eventtrace, and at least ArP triggers this) in your OnLoad function, then assign your variables and output the string to the text object within the OnEvent function.

I don't think it would be necessary to check if specific stats have changed, since your variable assignments are pretty light already. I imagine that these events may, at times, fire more than a 1 sec timer during a raid scenario, but I don't believe it would make a noticeable impact on performance.

Last edited by Katae : 10-05-09 at 12:14 PM.
  Reply With Quote
10-07-09, 08:36 PM   #71
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Made big changes to the layout and profile system with 1.5 and edited some of my posts to reflect them. Older layout code should still work with this version.
  Reply With Quote
10-11-09, 09:20 AM   #72
Canities
A Wyrmkin Dreamwalker
Join Date: Oct 2007
Posts: 54
Hi,
Ive juist updated to the latest version and i'm having an issue with my code and cant figure out whats wrong with it.

The error mrssage i get is:
ID: -1
Error occured in: Global
Count: 1
Message: ..\AddOns\LitePanels\layout.lua line 473:
unexpected symbol near ')'

the full code is here: Pastebin Link (ps line 473 in my layout lua is line 189 on the pastebin)

Any help would be greatly appreciated.

Cani
  Reply With Quote
10-11-09, 03:29 PM   #73
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Is there more to the file? That code alone doesn't produce an error for me. There must be a syntax error somewhere else.

But there is one problem, your layout is contained in an extra pair of braces. http://pastebin.com/m6f1bff10

Originally Posted by Canities View Post
Message: ..\AddOns\LitePanels\layout.lua line 473:
unexpected symbol near ')'
  Reply With Quote
10-11-09, 04:57 PM   #74
Dajova
A Wyrmkin Dreamwalker
 
Dajova's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 58
Any idea how to make a frame hide/show in combat? like i have a dps frame, but i dont wanna see it when im not in combat

EDIT: Or rather, making it so it doesn't show unless it's updated, like if you are a healer, you dont want a dps frame showing, but want it show on a dps char. If you follow how i mean
__________________
Livestream | Twitter | YouTube

Last edited by Dajova : 10-11-09 at 06:04 PM.
  Reply With Quote
10-11-09, 06:08 PM   #75
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Originally Posted by richerich View Post
Any idea how to make a frame hide/show in combat? like i have a dps frame, but i dont wanna see it when im not in combat
This should get you going
Code:
{ width=50, height=50,
  OnLoad=function(self)
    self:RegisterEvent'PLAYER_REGEN_ENABLED'
    self:RegisterEvent'PLAYER_REGEN_DISABLED'
    self:Hide()
  end,
  OnEvent=function(self) ToggleFrame(self) end
}
Originally Posted by richerich View Post
EDIT: Or rather, making it so it doesn't show unless it's updated, like if you are a healer, you dont want a dps frame showing, but want it show on a dps char. If you follow how i mean
You'll probably need to make a custom function to check if the character is a healer and not a deeps, probably by checking where they put their talent points.

Last edited by Katae : 10-11-09 at 06:19 PM.
  Reply With Quote
10-11-09, 07:14 PM   #76
Dajova
A Wyrmkin Dreamwalker
 
Dajova's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 58
Originally Posted by Katae View Post
This should get you going
Code:
{ width=50, height=50,
  OnLoad=function(self)
    self:RegisterEvent'PLAYER_REGEN_ENABLED'
    self:RegisterEvent'PLAYER_REGEN_DISABLED'
    self:Hide()
  end,
  OnEvent=function(self) ToggleFrame(self) end
}
You'll probably need to make a custom function to check if the character is a healer and not a deeps, probably by checking where they put their talent points.
Yay, that code worked, although i had to work with it a bit to make it fit with my layout

Anyhow, that wasn't how i meant really. I meant if you could make it ONLY show it when u do damage to something, in compilation with the hide/show in combat. So when you dont do damage in combat, it stays hidden


EDIT: Hmm, now i notice something weird... The frame like is like flashing shown/hidden all the time o.O Seems to happen when i just do something, like moving the mouse or typing something o.O Can provide u with the code, see if u can find the problem

Code:
-- DPS Frame
{	name = "DPS", anchor_to = "BOTTOM", y_off = "175",
	text = {
		string = function(self)
			self = self:GetParent()
			self.dps = self.active and format("%.1f", self.damage / (GetTime() - self.starttime)) or self.dps or "0.0"
			return self.dps.." dps" -- "5433.4 dps"
		end, update = 0.5, color = {1,1,1}, size = 15, shadow=2, font = "Fonts\\FRIZQT__.TTF",
	},
	OnLoad = function(self)
		self:RegisterEvent("UNIT_PET")
		self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
		self:RegisterEvent("PLAYER_REGEN_ENABLED")
		self:RegisterEvent("PLAYER_REGEN_DISABLED")
		self.events = "SWING_DAMAGE RANGE_DAMAGE SPELL_DAMAGE SPELL_PERIODIC_DAMAGE DAMAGE_SHIELD DAMAGE_SPLIT"
		self.player, self.pet, self.damage, self.active = UnitGUID'player', UnitGUID'pet' or '0x0', 0, false
		self:RegisterEvent'PLAYER_REGEN_ENABLED'
		self:RegisterEvent'PLAYER_REGEN_DISABLED'
		self:Hide()
	end,
	OnEvent = function(self, event, ...) ToggleFrame(self) 
		if event == "COMBAT_LOG_EVENT_UNFILTERED" then
			local _,spellevent,unit,_,_,_,_,_,type,_,_,damage = ...
			if not strmatch(self.events,spellevent) then return end
			if unit == self.player or unit == self.pet then
				if spellevent == "SWING_DAMAGE" then damage = type end
				self.damage = self.damage + damage
			end
		end
		if event == "UNIT_PET" then self.pet = UnitGUID'pet' or '0x0' end
		if event == "PLAYER_REGEN_ENABLED" then self.active = false end
		if event == "PLAYER_REGEN_DISABLED" then
			self.starttime, self.damage, self.active = GetTime(), 0, true
		end
	end,
	OnClick = function(self, button)
		if button == "RightButton" then
			self.starttime, self.damage, self.dps = GetTime(), 0, '0.0'
			self.text:SetText("0.0 dps")
		end
	end
	},
__________________
Livestream | Twitter | YouTube

Last edited by Dajova : 10-11-09 at 07:21 PM.
  Reply With Quote
10-11-09, 07:40 PM   #77
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Take out the RegisterEvents I gave you since it is already registered on your side. Instead of the toggle, you can approach this another way by showing when damage is done and hiding when leaving combat.

See lines 24 and 32: http://pastebin.com/m71acbac3
  Reply With Quote
10-12-09, 07:24 AM   #78
Canities
A Wyrmkin Dreamwalker
Join Date: Oct 2007
Posts: 54
Katae,
Thanks for that, I will give that a try when I get back from work this afternoon.
The only other information in the file is the coding notation, will try it with creating a new LUA file.

Originally Posted by Katae View Post
Is there more to the file? That code alone doesn't produce an error for me. There must be a syntax error somewhere else.

But there is one problem, your layout is contained in an extra pair of braces. http://pastebin.com/m6f1bff10
EDIT: That worked fine, i'm still unsure what the issue with it was but it is fixed now, thanks for the help and a great addon!

Cani

Last edited by Canities : 10-13-09 at 12:40 PM.
  Reply With Quote
10-13-09, 01:47 PM   #79
Jooze
A Wyrmkin Dreamwalker
 
Jooze's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jul 2007
Posts: 52
Just a bit of code i want to share. Use this in a text element and it will display when you have new mail.

Code:
string = function()
local hasMail = HasNewMail()
local MailText
if (hasMail == 1) then
MailText = format("%s", "New Mail!")
else
MailText = format("%s", "No Mail")
end
return MailText
end,
  Reply With Quote
11-21-09, 06:37 PM   #80
Dajova
A Wyrmkin Dreamwalker
 
Dajova's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 58
One thing that still buggers me that keeps me from completely go from kgPanels to LitePanels is the way that it works with blending textures...

for example, here's a screenshot with kgPanels (and LitePanels for gradient style) that im currently using:



but when i switch entirely to LitePanels (used class color gradient this time), it shows like this:



It doesn't blend in as nicely as kgPanel does or is there a way to do that?
__________________
Livestream | Twitter | YouTube
  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