Closed Thread
Thread Tools Display Modes
Unread 10-11-08, 05:16 PM   #81
Balkeep
A Cyclonian
 
Balkeep's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 43
layout

Is that possible to make a code to force hide nonmana bars on party and raid frames? I tried something like this:

if (Bal_HideNonMana and UnitPowerType("Self") > 0) then
self.Health:SetHeight(40)
self.Power:SetHeight(0)
else
self.Health:SetHeight(35)
self.Power:SetHeight(5)
end
but im too noob to understand why it doesnt work =P
Balkeep is offline  
Unread 10-12-08, 12:11 AM   #82
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 268
I'm trying to add my own frame to the party frames, so i add 'showPlayer', true to the attributes and it's just fine but there is a problem with the party targets.
It's like if i was ignored, when a party member pick a target it's displayed just fine but not my own, why ?

here's my party/party target code.

Code:
local party = oUF:Spawn('header', 'oUF_Party')
party:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
party:SetManyAttributes('yOffset', -5, 'showParty', true, 'showPlayer', true)
Code:
local partytarget = {}
for i = 1, 5 do
	partytarget[i] = oUF:Spawn('party'..i..'target', 'oUF_Party'..i..'Target')
	if i == 1 then
		partytarget[i]:SetPoint('TOPLEFT', party, 'TOPRIGHT', 5, 0)
	else
		partytarget[i]:SetPoint('TOP', partytarget[i-1], 'BOTTOM', 0, -5)
	end
end
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline  
Unread 10-12-08, 10:37 AM   #83
Balkeep
A Cyclonian
 
Balkeep's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 43
lol

It could be logical to try and add same attribute to ur party targets spawn code...
Balkeep is offline  
Unread 10-12-08, 10:57 AM   #84
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 268
lol...

Originally Posted by Balkeep View Post
It could be logical to try and add same attribute to ur party targets spawn code...
And that would be helpfull because ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline  
Unread 10-12-08, 11:01 AM   #85
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 979
You're ignored because you don't spawn a target frame for yourself. You only spawn for party1-5. showPlayer = true just spawns a player unit together with the party.

Originally Posted by Balkeep View Post
Is that possible to make a code to force hide nonmana bars on party and raid frames? I tried something like this:

if (Bal_HideNonMana and UnitPowerType("Self") > 0) then
self.Health:SetHeight(40)
self.Power:SetHeight(0)
else
self.Health:SetHeight(35)
self.Power:SetHeight(5)
end
but im too noob to understand why it doesnt work =P
Just don't create the power bars for such units?

You can't set the height of something to 0 also. Running :Hide() on the element would make much more sense.
haste is offline  
Unread 10-12-08, 11:01 AM   #86
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,231
Caellian, using an XML file you can add partytargets directly parented to your party frames

http://ixo.no/git/oUF.git/commit/?id...738f02a6859b65
p3lim is offline  
Unread 10-12-08, 11:03 AM   #87
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 979
Originally Posted by p3lim View Post
Caellian, using an XML file you can add partytargets directly parented to your party frames

http://ixo.no/git/oUF.git/commit/?id...738f02a6859b65
That will make the header using polling to update the player's target, as you end up with a playertarget unit, and not target.
haste is offline  
Unread 10-12-08, 11:10 AM   #88
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 268
Originally Posted by haste View Post
You're ignored because you don't spawn a target frame for yourself. You only spawn for party1-5. showPlayer = true just spawns a player unit together with the party.
So the only thing that needs to be changed is for i = 1, 5 but to what, because it takes only numbers ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline  
Unread 10-12-08, 11:13 AM   #89
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 979
Originally Posted by Caellian View Post
So the only thing that needs to be changed is for i = 1, 5 but to what, because it takes only numbers ?
No that won't work. There are only four party units (party1, party2, party3, party4). The player frame is just appended onto the party frame list as player when you use showPlayer. It's basically the same as anchoring the party header under the player frame.
haste is offline  
Unread 10-12-08, 11:18 AM   #90
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 268
Hmm ok, it's something someone asked for my layout but i have no clue how to do that so i guess they'll have to do it themselves
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 10-12-08 at 11:32 AM.
Caellian is offline  
Unread 10-13-08, 04:46 AM   #91
Alanor
A Murloc Raider
Join Date: Oct 2008
Posts: 8
Originally Posted by haste View Post
Anyway, I've just quickly browsed through your code, and it seems you register unit watch on the header. Which causes the unit watch system to hide it as it doesn't have a existing unit. It's just a quick theory, but it would explain your debug stack :)
Sorry for the late reply, for some reason I haven't been able access wowinterface.com from home since Friday, traceroute stops at dallas-datacenter.com, so I can only post now from work.

Not registering unit watch for the header does the trick, and I have no issues with party disappearing anymore. Still weird that it was working without ClearFont2, but it's solved now, thanks again!

I converted all the strings to tags now, and I got a question. From what I tried so far it seems that the tags set on login stay no matter what until a reload UI. For example, I set [curhp] for player health, then in game I change it to [missinghp], the text on frame shows as "[missinghp]" right after I change it, then on a UNIT_HEALTH event it goes back to what the result of [curhp] is. Is there a way I can force the tag string to update or it needs a reload UI?
Alanor is offline  
Unread 10-13-08, 09:06 AM   #92
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 979
The current tag-system doesn't allow you to do updates later on, at least not easily. I _really_ want to get a new tag-system out, but I'm pretty much overworked with other stuff to the end of October.
haste is offline  
Unread 10-13-08, 09:58 AM   #93
Alanor
A Murloc Raider
Join Date: Oct 2008
Posts: 8
Originally Posted by haste View Post
The current tag-system doesn't allow you to do updates later on, at least not easily. I _really_ want to get a new tag-system out, but I'm pretty much overworked with other stuff to the end of October.
Thanks, it isn't that important really, since the text strings are probably the easiest things to decide once and for all, no need to fiddle with them in game. Was just something nice to add, without a compelling reason to do so. :p
Alanor is offline  
Unread 10-14-08, 09:13 AM   #94
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,231
Disbanding oUF_DruidMana

oUF_DruidMana is no more, its easier for me and you to add this to the layout instead.

Here is an example (like the original)
Code:
local function PreUpdatePower(self, event, unit)
	ifi(self.unit ~= 'player') then return end

	local _, powertype = UnitPowerType('player')
	local min = UnitPower('player', SPELL_POWER_MANA)
	local max = UnitPowerMax('player', SPELL_POWER_MANA)

	self.DruidMana:SetMinMaxValues(0, max)
	self.DruidMana:SetValue(min)

	if(min ~= max) then
		self.DruidMana.Text:SetFormattedText('%d%%', math.floor(min / max * 100))
	else
		self.DruidMana.Text:SetText()
	end

	self.DruidMana:SetAlpha((powertype ~= 0) and 1 or 0)
	self.DruidMana.Text:SetAlpha((powertype ~= 0) and 1 or 0)
end
You can use either Pre- or PostUpdatePower
p3lim is offline  
Unread 10-14-08, 05:08 PM   #95
ObbleYeah
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 127
im getting the finishing touches done on ouf_obble now, and want the self.health.bg to colour by class, while the healthbar colours by the gradient i currently have set. ive so far attempted adding a few lines of code to the healthupdate (id quote it but im currently on my work laptop, so will add it later.) and have rather hopelessly tried self.health.bg.colorclass = true. is this possible to do?
ObbleYeah is online now  
Unread 10-14-08, 05:14 PM   #96
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,231
Originally Posted by ObbleYeah View Post
im getting the finishing touches done on ouf_obble now, and want the self.health.bg to colour by class, while the healthbar colours by the gradient i currently have set. ive so far attempted adding a few lines of code to the healthupdate (id quote it but im currently on my work laptop, so will add it later.) and have rather hopelessly tried self.health.bg.colorclass = true. is this possible to do?
First, dont quote code.. ever!

Take a look at oUF how it does the coloring, you just do the same for your background.
p3lim is offline  
Unread 10-15-08, 04:03 AM   #97
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 268
Blizzard removed CancelPlayerBuff so i no longer can use the following code to right click cancel buffs.

Code:
	button:SetScript('OnMouseUp', function(self, mouseButton)
		if mouseButton == 'RightButton' then
			local name, rank = UnitBuff('player', index)
			CancelPlayerBuff(name, rank)
		end
	end)
Is there any way to replace that functionnality ?
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline  
Unread 10-15-08, 04:25 AM   #98
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 979
It's CancelUnitBuff() now. You can post it as a feature request if you'd like also now (as the aura systems are merged now).
haste is offline  
Unread 10-16-08, 01:03 PM   #99
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 268
Can anyone look at this and tell me what's wrong, it was just fine before patch but now gives me an error whenever i log in on my hunter with a pet out, not with any other character.

Unfortunately i can't report exactly what the error is, my server is still going down every 2 minutes but it's something like 'bad argument to unpack'

Code:
local function OverrideUpdateName(self, event, unit)
	if(self.unit ~= unit) then return end
	local _, class = UnitClass(unit)

	if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
		color = self.colors.tapped
	elseif(UnitIsDead(unit) or UnitIsGhost(unit) or not UnitIsConnected(unit)) then
		color = self.colors.disconnected
	elseif(unit =='pet') then
		color = self.colors.happiness[GetPetHappiness()] or self.colors.power[UnitPowerType(unit)]
	elseif(not UnitIsPlayer(unit)) then
		local r, g, b = UnitSelectionColor(unit)
		color = {r, g, b} or self.colors.health
	else
		color = self.colors.class[class] or self.colors.disconnected
	end

	self.Name:SetTextColor(unpack(color))
Wild guess would be that sometimes when u log in, ur pet is 'offline', i tried to add a self.colors.disconnected to the pet line, it fixed the error but then when login on a warlock the name wasn't being colored.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline  
Unread 10-16-08, 01:48 PM   #100
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,231
The order of the if checks etc matters
p3lim is offline  
Closed Thread

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion

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