Closed Thread
Thread Tools Display Modes
Unread 11-10-08, 05:11 PM   #241
Jabar
Premium Member
 
Jabar's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 8
I was thinking of making my own "UpdatePortrait" function in the layout to use class icons, but that seems too hard for me. :'(

EDIT: nvm, i got it working !

Last edited by Jabar : 11-14-08 at 05:10 AM.
Jabar is offline  
Unread 11-12-08, 04:48 AM   #242
Quokka
A Chromatic Dragonspawn
 
Quokka's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 196
I know that thread can be shown static or with a bar.

Code:
	local function OverrideUpdateThreat(self, event, unit)
	local isTanking, state, scaledPercent, rawPercent, threatValue = UnitDetailedThreatSituation("player", unit)
		if threatValue < 50 then
			self.Threat:SetText("[-]")
			self.Threat:SetTextColor(r,g,b)
                        self.Threat:Show()
		if threatValue > 50 and  threatValue < 90 then
			self.Threat:SetText("[50%]")
			self.Threat:SetTextColor(r,g,b)
                        self.Threat:Show()
		elseif threatValue > 90 then	
			self.Threat:SetText("[90%]")
			self.Threat:SetTextColor(r,g,b)
			self.Threat:Show()
		elseif (class == 'HUNTER') and threatValue > 110 then	
			self.Threat:SetText("[110% FD]")
			self.Threat:SetTextColor(r,g,b)
			self.Threat:Show()
		else
			self.Threat:Hide()
		end
	end
I'd like to have some textbased warning
But for some reason I'ts not working I know i'm missing something

Last edited by Quokka : 11-12-08 at 06:14 AM.
Quokka is offline  
Unread 11-12-08, 06:00 AM   #243
dafire
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 216
I think UpdateThreat is only called when something serios changed with threat and not all the time.

also you call self.Threat:Show() only with threatvalue > 90 ...
dafire is offline  
Unread 11-12-08, 06:15 AM   #244
Quokka
A Chromatic Dragonspawn
 
Quokka's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 196
Originally Posted by dafire View Post
I think UpdateThreat is only called when something serios changed with threat and not all the time.

also you call self.Threat:Show() only with threatvalue > 90 ...
nevermind. found out the coloring works without unsing rgb.
and might use an nice texture to hava a block showing

Last edited by Quokka : 11-12-08 at 06:23 AM.
Quokka is offline  
Unread 11-12-08, 06:24 AM   #245
dafire
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 216
I'm at work and don't have the code here but I think the function is only called when UNIT_THREAT_SITUATION_UPDATE is fired. And this will only fire when you get Aggro, loose aggro or get that blizzard "High Threat!" warning.

If you want a finer threat display you will need to call a function that checks threat using a timer or onupdate function.
dafire is offline  
Unread 11-16-08, 02:12 PM   #246
Bridgesc24
A Defias Bandit
Join Date: Nov 2008
Posts: 2
DruidEnergy vs. DruidMana

Pardon me if this can already be done with the given framework, I'm pretty new to Lua, the WoW API and the oUF API...

I know that DruidMana is supported (and have that working fine, thanks p3lim/Haste) but I am trying to understand if I can make "DruidEnergy" work; the druid talent "Furor" states:
"Gives you 100% chance to gain 10 Rage when you shapeshift into Bear and Dire Bear Form, and you keep up to 100 of your Energy when you shapeshift into Cat Form, ..."

And it would be interesting for some of us to know how much energy we have accumulated in Bear/Caster/Travel forms without having to switch to cat form, the same way DruidMana provides information about current mana in bear and cat forms.

Is this possible with the current oUF code or would it require additional support?

Once again, thanks to Haste and all the layout developers, I've had a blast using and learning with your stuff.
Bridgesc24 is offline  
Unread 11-16-08, 02:39 PM   #247
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,296
Originally Posted by Bridgesc24 View Post
Pardon me if this can already be done with the given framework, I'm pretty new to Lua, the WoW API and the oUF API...

I know that DruidMana is supported (and have that working fine, thanks p3lim/Haste) but I am trying to understand if I can make "DruidEnergy" work; the druid talent "Furor" states:
"Gives you 100% chance to gain 10 Rage when you shapeshift into Bear and Dire Bear Form, and you keep up to 100 of your Energy when you shapeshift into Cat Form, ..."

And it would be interesting for some of us to know how much energy we have accumulated in Bear/Caster/Travel forms without having to switch to cat form, the same way DruidMana provides information about current mana in bear and cat forms.

Is this possible with the current oUF code or would it require additional support?

Once again, thanks to Haste and all the layout developers, I've had a blast using and learning with your stuff.
Just use the same example as youve used in DruidMana just replace the string 'MANA' with 'ENERGY'
p3lim is offline  
Unread 11-16-08, 02:44 PM   #248
Bridgesc24
A Defias Bandit
Join Date: Nov 2008
Posts: 2
<--- newb

Originally Posted by p3lim View Post
Just use the same example as youve used in DruidMana just replace the string 'MANA' with 'ENERGY'
Wow, that IS easy. Thanks.
Bridgesc24 is offline  
Unread 11-17-08, 11:42 AM   #249
Quokka
A Chromatic Dragonspawn
 
Quokka's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 196
Ist there a way to cancel aura/buffs


Cancel part
Code:
	button:SetScript('OnMouseUp', function(self, mouseButton)
		if mouseButton == 'RightButton' then
			CancelUnitBuff('player', index)
		end
	end)
Since this cancels a buff even if I click on a pary members buff.
And it does cancel a random buff (not allways the one I click on)


Code:
local function PostCreateAuraIcon(self, button, icons, index, debuff)
	icons.showDebuffType = true
    button.cd:SetReverse() 
    button.icon:SetTexCoord(0, 1, 0, 1)
	button.overlay:SetTexture(bordertexture) 
    button.overlay:SetTexCoord(0,1,0,1) 
	button.overlay.Hide = noHide 
    button.count:SetPoint('BOTTOMRIGHT', button, 1, 0) 
    button.count:SetFont(font, fSize, 'OUTLINE') 
    button.count:SetTextColor(1,1,1) 
	
	button:SetScript('OnMouseUp', function(self, mouseButton)
		if mouseButton == 'RightButton' then
			CancelUnitBuff('player', index)
		end
	end) 
end
thank
Quokka is offline  
Unread 11-17-08, 12:20 PM   #250
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,296
Originally Posted by Quokka View Post
Ist there a way to cancel aura/buffs


Cancel part
Code:
	button:SetScript('OnMouseUp', function(self, mouseButton)
		if mouseButton == 'RightButton' then
			CancelUnitBuff('player', index)
		end
	end)
Since this cancels a buff even if I click on a pary members buff.
And it does cancel a random buff (not allways the one I click on)


Code:
local function PostCreateAuraIcon(self, button, icons, index, debuff)
	icons.showDebuffType = true
    button.cd:SetReverse() 
    button.icon:SetTexCoord(0, 1, 0, 1)
	button.overlay:SetTexture(bordertexture) 
    button.overlay:SetTexCoord(0,1,0,1) 
	button.overlay.Hide = noHide 
    button.count:SetPoint('BOTTOMRIGHT', button, 1, 0) 
    button.count:SetFont(font, fSize, 'OUTLINE') 
    button.count:SetTextColor(1,1,1) 
	
	button:SetScript('OnMouseUp', function(self, mouseButton)
		if mouseButton == 'RightButton' then
			CancelUnitBuff('player', index)
		end
	end) 
end
thank

Try this
Code:
button:SetScript('OnMouseUp', function(self, mouseButton)
  if(mouseButton == 'RightButton' and not debuff and self:GetParent().unit == 'player') then
    CancelUnitBuff('player', index, self:GetParent().filter)
  end
end)
p3lim is offline  
Unread 11-18-08, 03:36 AM   #251
Quokka
A Chromatic Dragonspawn
 
Quokka's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 196
p3lim testing that code wont let me cancel any buffs at all
Quokka is offline  
Unread 11-18-08, 06:59 PM   #252
sweede
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 18
Does anyone have a working example of an oUF layout with a working threat display ?

Something that would display aggro % similar to how the tooltip displays threat %%
sweede is offline  
Unread 11-20-08, 11:21 AM   #253
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
Revisiting Main Tank target frames. Although Blizzard allows you designate a raid member as an MT, it doesn't seem to provide a specialized UnitID for them (according to http://www.wowwiki.com/UnitId). Otherwise it should be easy to spawn something for 'maintank1target' or something like that.

It seems that what I'd need to do is:

1. Make a list of raid members who are designated as MTs.
2. On some raid update event (that I haven't found yet):
a. Update list
b. Spawn/despawn target frames for each member of the MT list.


Unsure if you can actually despawn frames though. If you can't, this would be a bad idea to implement.

Anyone else tried something like this before? Any thoughts on if this'd work? (flash of inspiration at the job, so haven't tried it yet)
Kellen is offline  
Unread 11-20-08, 11:48 AM   #254
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,296
Originally Posted by Kellen View Post
Revisiting Main Tank target frames. Although Blizzard allows you designate a raid member as an MT, it doesn't seem to provide a specialized UnitID for them (according to http://www.wowwiki.com/UnitId). Otherwise it should be easy to spawn something for 'maintank1target' or something like that.

It seems that what I'd need to do is:

1. Make a list of raid members who are designated as MTs.
2. On some raid update event (that I haven't found yet):
a. Update list
b. Spawn/despawn target frames for each member of the MT list.


Unsure if you can actually despawn frames though. If you can't, this would be a bad idea to implement.

Anyone else tried something like this before? Any thoughts on if this'd work? (flash of inspiration at the job, so haven't tried it yet)
oUF_Perfect has MT and OT frames, with their target's name in a fontstring (but can also be spawned as an own frame using custom templates)
p3lim is offline  
Unread 11-21-08, 03:11 PM   #255
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 268
I would like to have some help with this, i'll paste a part of my frames spawn code below. After WotLK my wife had to respec her shaman to resto and asked me to include the player frame in the party, that wasn't too complicated but then i found no way to have the party targets to work accordingly.
So in short what i need to do with this is add the player frame to the party with its target added to the list of the party targets. Could anyone help ?

Code:
local party = oUF:Spawn('header', 'oUF_Party')
party:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
party:SetManyAttributes('yOffset', -5, 'showParty', true)

local partyToggle = CreateFrame('Frame')
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

local raid = {}
for i = 1, 8 do
	local raidgroup = oUF:Spawn('header', 'oUF_Raid'..i)
	raidgroup:SetManyAttributes('groupFilter', tostring(i), 'showRaid', true, 'yOffSet', -5)
	table.insert(raid, raidgroup)
	if(i==1) then
		raidgroup:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
	else
		raidgroup:SetPoint('TOPLEFT', raid[i-1], 'TOPRIGHT', 5, 0)
	end
end

partyToggle:RegisterEvent('PLAYER_LOGIN')
partyToggle:RegisterEvent('RAID_ROSTER_UPDATE')
partyToggle:RegisterEvent('PARTY_LEADER_CHANGED')
partyToggle:RegisterEvent('PARTY_MEMBERS_CHANGED')
partyToggle:SetScript('OnEvent', function(self)
	if(InCombatLockdown()) then
		self:RegisterEvent('PLAYER_REGEN_ENABLED')
	else
		self:UnregisterEvent('PLAYER_REGEN_ENABLED')
		if(GetNumRaidMembers() > 5) then
			party:Hide()
			for i,v in ipairs(raid) do v:Show() end
			for i,v in ipairs(partytarget) do v:Disable()	end
		else
			party:Show()
			for i,v in ipairs(raid) do v:Hide() end
			for i,v in ipairs(partytarget) do v:Enable() end
		end
	end
end)
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
Caellian is offline  
Unread 11-21-08, 03:36 PM   #256
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,296
Originally Posted by Caellian View Post
I would like to have some help with this, i'll paste a part of my frames spawn code below. After WotLK my wife had to respec her shaman to resto and asked me to include the player frame in the party, that wasn't too complicated but then i found no way to have the party targets to work accordingly.
So in short what i need to do with this is add the player frame to the party with its target added to the list of the party targets. Could anyone help ?

Code:
local party = oUF:Spawn('header', 'oUF_Party')
party:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
party:SetManyAttributes('yOffset', -5, 'showParty', true)

local partyToggle = CreateFrame('Frame')
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

local raid = {}
for i = 1, 8 do
	local raidgroup = oUF:Spawn('header', 'oUF_Raid'..i)
	raidgroup:SetManyAttributes('groupFilter', tostring(i), 'showRaid', true, 'yOffSet', -5)
	table.insert(raid, raidgroup)
	if(i==1) then
		raidgroup:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
	else
		raidgroup:SetPoint('TOPLEFT', raid[i-1], 'TOPRIGHT', 5, 0)
	end
end

partyToggle:RegisterEvent('PLAYER_LOGIN')
partyToggle:RegisterEvent('RAID_ROSTER_UPDATE')
partyToggle:RegisterEvent('PARTY_LEADER_CHANGED')
partyToggle:RegisterEvent('PARTY_MEMBERS_CHANGED')
partyToggle:SetScript('OnEvent', function(self)
	if(InCombatLockdown()) then
		self:RegisterEvent('PLAYER_REGEN_ENABLED')
	else
		self:UnregisterEvent('PLAYER_REGEN_ENABLED')
		if(GetNumRaidMembers() > 5) then
			party:Hide()
			for i,v in ipairs(raid) do v:Show() end
			for i,v in ipairs(partytarget) do v:Disable()	end
		else
			party:Show()
			for i,v in ipairs(raid) do v:Hide() end
			for i,v in ipairs(partytarget) do v:Enable() end
		end
	end
end)
To answer your question: dont spawn party targets like that, you should use a custom template.


Aswell, a tip:
Why spawn party frames in such a way when they are using the same style as the raid frames?
p3lim is offline  
Unread 11-21-08, 03:53 PM   #257
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 268
Originally Posted by p3lim View Post
To answer your question: dont spawn party targets like that, you should use a custom template.


Aswell, a tip:
Why spawn party frames in such a way when they are using the same style as the raid frames?
a. Well i would love to do otherwhise but i don't know how to use those custom templates, and honnestly can't look any deeper these days, reason why i was asking for help from anyone who would know exactly how to do.

b. No reason really, it worked, guess it can always be better ofc.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 11-22-08 at 01:12 AM.
Caellian is offline  
Unread 11-21-08, 03:59 PM   #258
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,296
Originally Posted by Caellian View Post
a. Well i would love to do otherwhise but i don't know how to use those custom templates, and honnestly can't look any deeper these days, reason why i was almost begging for help from anyone who would know exactly how to do.

b. No reason really, it worked, guess it can always be better ofc.
I know how to use templates, partly, but I prefer using the units target name in a fontstring, as I did in oUF Perfect
p3lim is offline  
Unread 11-21-08, 04:02 PM   #259
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 268
I'd like to use a frame personally not just a fontstring but i know nothing about those custom templates, alreday asked about that in the past but all i got was: use a custom template...
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 11-22-08 at 01:12 AM.
Caellian is offline  
Unread 11-22-08, 10:52 AM   #260
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
Originally Posted by p3lim View Post
oUF_Perfect has MT and OT frames, with their target's name in a fontstring (but can also be spawned as an own frame using custom templates)
Thanks for the pointer! Perhaps you could offer another?

I'm looking to anchor the player frame to the pet frame (odd, I know) but then have it re-anchor to another secure frame should my pet disappear/die. Some very basic testing shows that this works...out of combat.

To do it in combat, my research points to me using SecureHandlers, which are frankly a bit scary. Is this the correct route to take? If so, is it the only way to re-parent secure frames/statusbars during combat?
Kellen 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