Reply
Thread Tools Display Modes
Unread 06-11-09, 05:46 PM   #1
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
A few simple issues/inquiries

Thanks for any help with the below issues, I'm not an experienced lua wizard at all. I'm using a self-modified version of oUF_Asym and have a few features/things I need worked out but have no idea how to do it.

#1- Raid frame growth. The frames currently grow from top-bottom-right. I would like them to grow left-right-down.
Code:
--
-- raid
--
local raid = {}
for i = 1, 5 do
	local raidgroup = oUF:Spawn('header', 'oUF_Raid'..i)
	raidgroup:SetManyAttributes('groupFilter', tostring(i), 'showRaid', true, 'yOffSet', -12)
	table.insert(raid, raidgroup)
	if(i==1) then
		raidgroup:SetPoint('TOPLEFT', UIParent, 'CENTER', -135, -225)
	else
		raidgroup:SetPoint('TOPLEFT', raid[i-1], 'TOPRIGHT', 12, 0)
	end
end
#2- Raid health color. I was wondering if there is a tag or anything I can add to make the text red and where I would go about adding it.

#3- Raid frame text locations. The name and health text of any frame seem to have a default location (ie- name on the left, health on the right). I've tried
Code:
"self.Health.value:SetPoint("BOTTOM", 0, 2)
for both health and name and nothing is changing the location of the texts on the raid frames (tried CENTER, TOP, etc... nothing worked).

#4- Buff filtering. I'd like to see every debuff on my target and only the buffs that I cast. I tried a few things and nothing worked just got errors.
Code:
--
		-- buffs
		--
		self.Buffs = CreateFrame("Frame", nil, self) -- buffs
		self.Buffs.size = 30
		self.Buffs:SetHeight(self.Buffs.size)
		self.Buffs:SetWidth(self.Buffs.size * 6)
		self.Buffs:SetPoint("BOTTOMLEFT", self, "RIGHT", 8, -15)
		self.Buffs.initialAnchor = "BOTTOMLEFT"
		self.Buffs["growth-y"] = "TOP"
		self.Buffs.num = 6
		self.Buffs.spacing = 1
		
		--
		-- debuffs
		--
		self.Debuffs = CreateFrame("Frame", nil, all)
		self.Debuffs.size = 20
		self.Debuffs:SetHeight(self.Debuffs.size)
		self.Debuffs:SetWidth(self.Debuffs.size * 9)
		self.Debuffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", -2, 8)
		self.Debuffs.initialAnchor = "BOTTOMLEFT"
		self.Debuffs["growth-y"] = "TOP"
		self.Debuffs.filter = "HARMFUL|PLAYER"
		self.Debuffs.num = 20
		self.Debuffs.spacing = 1
#5- The reformatting text that makes anything over 1000=1k is not working on raid frames, the text that pertains to every other frame abbreviates any health text over 10k properly, though.
Code:
local numberize_raid = function(v)
	if v <= 999 then return v end
	if v >= 1000000 then
		local value = string.format("%.1fm", v/1000000)
		return value
	elseif v >= 1000 then
		local value = string.format("%.1fk", v/1000)
		return value
	end
end
Sorry for a long post, I'm nearly clueless. And thanks again for any help!

Last edited by Qupe : 06-11-09 at 11:52 PM.
Qupe is offline   Reply With Quote
Unread 06-15-09, 06:07 PM   #2
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
Was I wrong to assume these issues were easy to fix? =/
Qupe is offline   Reply With Quote
Unread 06-16-09, 04:28 AM   #3
Luzzifus
A Warpwood Thunder Caller
 
Luzzifus's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 94
#1 - try this:
Code:
local raid = {}
for i = 1, 5 do
	local raidgroup = oUF:Spawn('header', 'oUF_Raid'..i)
	raidgroup:SetManyAttributes('groupFilter', tostring(i), 'showRaid', true, 'xOffSet', 12, 'point', "LEFT")
	table.insert(raid, raidgroup)
	if(i==1) then
		raidgroup:SetPoint('TOPLEFT', UIParent, 'CENTER', -135, -225)
	else
		raidgroup:SetPoint('TOPLEFT', raid[i-1], 'BOTTOMLEFT', 0, -12)
	end
end
#3 - Try the detailed notation:
Code:
self.Health.value:SetPoint("BOTTOM", self.Health, "BOTTOM", 0, 2)
And also make sure to call "self.Health.value:ClearAllPoints()" before, if it is not the first time you set the points.

#5 - Use this one instead:
Code:
local number = function(n)
	if n >= 1e7 then
		return ('%.1fm'):format(n / 1e6):gsub('%.?0([km])$', '%1')
	elseif n >= 1e6 then
		return ('%.2fm'):format(n / 1e6):gsub('%.?0+([km])$', '%1')
	elseif n >= 1e5 then
		return ('%.0fk'):format(n / 1e3)
	elseif (n >= 1e3) or (n <= -1e3) then
		return ('%.1fk'):format(n / 1e3):gsub('%.?0([km])$', '%1')
	else
		return n
	end
end
Luzzifus is offline   Reply With Quote
Unread 06-16-09, 06:07 AM   #4
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
You are amazing! Only had time to try out the raid frame growth before the server shut down for maintenance - but it worked perfectly.

I'll be sure to thank you for the changes in the layout lua and on my compilation page. Your help is very very very very much appreciated.
Qupe is offline   Reply With Quote
Reply

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » A few simple issues/inquiries

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