Thread Tools Display Modes
10-21-08, 07:21 AM   #141
Frayol
A Deviate Faerie Dragon
 
Frayol's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 10
Originally Posted by Bruners View Post
im using this to set pvp icon, might be overkill or completly wrong way of doing it but it looks nice here
I orinally used this for the PvP icon:

Code:
self.PvP = self.Power:CreateTexture(nil, "OVERLAY")
self.PvP:SetPoint("CENTER", self.Health, "CENTER", 0, 10)
self.PvP:SetHeight(33)
self.PvP:SetWidth(33)
What I have now is the text [PvP] appearing instead of the icon. If you are interested I used:

Code:
local updatePvpPlayer = function(self, unit)
	if (UnitIsPVP("player")) then
		self.PVP:SetText("[PvP]")
	else
		self.PVP:SetText("")
	end
end
Code:
self.PVP = self.Health:CreateFontString(nil, "OVERLAY")
self.PVP:SetPoint("CENTER", self.Health, "TOP", 0, 20)
self.PVP:SetFont(font, 18, "OUTLINE")
self.PVP:SetText("[PvP]")
self.PVP:SetTextColor(1, 0, 0)
self.PVP:SetShadowOffset(1,-1)
self.PVP:SetShadowColor(0, 0, 0, .7)
self.UNIT_FACTION = updatePvpPlayer
For the target I used exactly the same bit of code, but as local called "updatePvpTarget". Not sure if there is a better way or not, but this works for me.
 
10-21-08, 07:54 AM   #142
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
I've been recently trying to have 5 men raids shown as party.

It works but there's just one small glitch, say for example you're in a 5 men raid, it will be correctly shown as a party but if you move a player from group 1 to group 2, that player will be hidden, instead of 'gathered' in group 1.

Code:
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
		elseif(GetNumPartyMembers() > 0 or (GetNumRaidMembers() > 0 and GetNumRaidMembers() < 6)) then
			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'); }

Last edited by Caellian : 10-21-08 at 10:01 AM.
 
10-21-08, 08:54 AM   #143
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Bruners View Post
im using this to set pvp icon, might be overkill or completly wrong way of doing it but it looks nice here

Code:
local brunPVP = function(unit)
	isfaction = false
	local isfaction = UnitFactionGroup(unit)
	if isfaction and (UnitIsPVP(unit)) then
		isfaction = faction
	end
end
Code:
self.PvP = self.Health:CreateTexture(nil, 'OVERLAY')
if isfaction == 'Horde' then
	self.PvP:SetTexCoord(0.08, 0.58, 0.045, 0.545)
elseif isfaction == 'Alliance' then
	self.PvP:SetTexCoord(0.07, 0.58, 0.06, 0.57)
else
	self.PvP:SetTexCoord(0.05, 0.605, 0.015, 0.57)
end	
self.PvP:SetHeight(22)
self.PvP:SetWidth(22)
self.PvP:SetPoint('TOPRIGHT', 15, 10)
self.brunPVP = brunPVP
You create a global, thats not good.
Also, the textures is handled by oUF already, so you just need to provide the texture frame, like this:
Code:
self.PvP = self.Health:CreateTexture(nil, 'OVERLAY')
self.PvP:SetHeight(22)
self.PvP:SetWidth(22)
self.PvP:SetPoint('TOPRIGHT', 15, 10)
 
10-22-08, 08:26 AM   #144
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
Wanted party, raid, and MT frames, so I started looking at Caellian and p3lim's layouts as examples. Though I generally have the gist of things, one area that confuses me are party target frames.

When I dumped his (Caellian's) implementation into my layout, the target frames worked swimmingly. However, when I pulled those bits out into a separate addon, they behave oddly and inconsistently. I know they spawn because I sometimes see them half styled in the correct place (the target always seems to be me, no matter what I target). Often though, they don't show up at all. And selecting targets does not show/hide the target frame. The actual party frames work correctly.

There is clearly some canned setup going on for these frames in addition to spawning them. I'm looking for some insight into such magic.

(unsure what code is useful to post/link)
 
10-22-08, 12:03 PM   #145
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
templates are still the right way to go
 
10-22-08, 12:13 PM   #146
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
Still fuzzy on those. Are you referring to the XML variety? Like the Blizzard-type ones you inherit from (I think)?
 
10-22-08, 12:28 PM   #147
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Kellen View Post
Still fuzzy on those. Are you referring to the XML variety? Like the Blizzard-type ones you inherit from (I think)?
Thats exactly what I mean
 
10-23-08, 03:02 AM   #148
Lysiander
An Aku'mai Servant
Join Date: Dec 2007
Posts: 37
Is there a known Issue or some restriction for the player frame not to take Tags? Because no matter what I do, I can't get it to display tags. It will just show the [<tagname>] instead. Everything else seems to work fine (tho, I haven't tried anything besides party, raid and target yet), just the player frame won't.

Im trying to write myself a buff reminder, like I had in Pitbull, to display a '*' in different colors when I am missing my own buffs.
 
10-23-08, 06:46 AM   #149
Kellen
A Deviate Faerie Dragon
Join Date: Mar 2008
Posts: 18
Originally Posted by Lysiander View Post
Is there a known Issue or some restriction for the player frame not to take Tags?
I believe you need to tell it to scan for your tags. I've used something like this:

Code:
local name = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
-- ...more setup
name:SetText('[level] [name]')
self.TaggedStrings[#self.TaggedStrings + 1] = name
 
10-23-08, 07:35 AM   #150
Lysiander
An Aku'mai Servant
Join Date: Dec 2007
Posts: 37
Weird, although I tried that before and it didn't work. This time it did. Maybe I had a typo somewhere. Anyway, im not sure what your code does, but

self.TaggedStrings = {buffs}

at the end of the tag section did the trick for me. Thanks for pointing me in the right direction. Now, I have all that I had in Pitbull in my oUF layout with ~150kb memory, compared to 3mb. Im a happy camper.
 
10-23-08, 11:54 AM   #151
Balkeep
A Cyclonian
 
Balkeep's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 43
Doest any1 have a clue why i always get error with my layout when im in combat and some1 joins party/raid...
SecureHandlers.lua:511
And it says that u cant use secure handlers in combat...

Also for some reason castbar for chaneling spell doesnt show first time u cans chaneing after a normal spell

Last edited by Balkeep : 10-23-08 at 04:14 PM.
 
10-24-08, 01:58 PM   #152
Arvak
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 4
Originally Posted by p3lim View Post
The chess aura is not a player created buff
So should I use CancelPlayerBuff() instead and is it safe to pass index? If not, what variable should I look for here?
 
10-24-08, 03:11 PM   #153
Arvak
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 4
This is what I have so far:

Code:
	self.PostUpdateAura = function (event, unit)
	
		local auras = self.Auras
		local max = auras.numBuffs + auras.numDebuffs 
		
		local visibleBuffs, visibleDebuffs = 0, 0
		for index = 1, max do
			local name, rank, icon, count, duration, timeLeft = UnitBuff("player", index)
			
			if(icon) then
				--print(name .. " " .. rank .. " (index: " .. index .. ")")

			end
			
		end
	end
What object would I have to call upon in order to set an event to the current Aura's icon frame? I only have index as a reference point. Do I need to gather more information such as debuff offset?

Last edited by Arvak : 10-24-08 at 04:11 PM.
 
10-24-08, 03:17 PM   #154
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Kellen View Post
I believe you need to tell it to scan for your tags. I've used something like this:

Code:
local name = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
-- ...more setup
name:SetText('[level] [name]')
self.TaggedStrings[#self.TaggedStrings + 1] = name
Code:
table.insert(self.TaggedStrings, name)
self.TaggedStrings is a table
 
10-25-08, 08:09 AM   #155
Reinhearthe
A Kobold Labourer
Join Date: Oct 2008
Posts: 1
oUF_D3Orbs and general layout features

Is there some sort of primer for oUF ?

oUF_D3Orbs specfically


I want to disable unit frames and casting bar and let another addon deal with that.

I want to move the orbs up and apart.

i.e. I use Sunn-Veiwport I would like the globes off the bottom of the screen and on top of the view port. I also want the orbs spread apart to be on the edges of the screen...

Other than just hacking around... what lines would I change??

Thx for your consideration. I know D3Orbs is not your specific project.
 
10-25-08, 09:42 AM   #156
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Originally Posted by Reinhearthe View Post
Is there some sort of primer for oUF ?

oUF_D3Orbs specfically


I want to disable unit frames and casting bar and let another addon deal with that.

I want to move the orbs up and apart.

i.e. I use Sunn-Veiwport I would like the globes off the bottom of the screen and on top of the view port. I also want the orbs spread apart to be on the edges of the screen...

Other than just hacking around... what lines would I change??

Thx for your consideration. I know D3Orbs is not your specific project.
Since it is released here, your best bet is to actually ask the author Opening lua to find things like "castbar" would help with your castbar issue. And the unitframes disabled, well then you can just remove the addon >.< The orbs ARE unitframes.
 
10-25-08, 06:26 PM   #157
Balkeep
A Cyclonian
 
Balkeep's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 43
I have nasty issue with color updating...
Im trying to make some kind of visual representation of some buffs and debuffs on frames BUT...
I was trying to start from coloring of the frames... I was testing it on my pala and basicly code stollen fro banzai works pretty well BUT only on targettarget, tagettargettarget and focustarget frames... (maybe group frames aswel havent tested that yet) and it refuses to work on player target and focus.
Im using following code, can some please tell me why it only updates colors of player by reloading ui, and target by untargeting and then targeting that unit again, so basicly update occures on recreating of that frames only... why?
Code:
--Buffs approach
local function Buffed(unit, auraName)
	for i=1,100 do
		if auraName == select(1,UnitAura(unit, i))
		then 
			return true
		else
			return false
		end
	end
end
local ignoredUnits = {
	target = false,
	targettarget = false,
	targettargettarget = false,
}
local function ApplyColor(frame, event, unit, bar)
	if not ignoredUnits[unit] then
		if(Buffed(unit, "Seal of Righteousness"))
			then
				bar:SetStatusBarColor(204/255, 204/255, 255/255)
		end
	end

	oUF:UNIT_MAXHEALTH(event, unit)
end
local function UpdateColor(frame)
	local o = frame.PostUpdateHealth
	frame.PostUpdateHealth = function(...)
		if o then o(...) end
		ApplyColor(...)
	end
end
for i, frame in ipairs(oUF.objects) do UpdateColor(frame) end
oUF:RegisterInitCallback(UpdateColor)
 
10-25-08, 08:30 PM   #158
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Balkeep View Post
I have nasty issue with color updating...
Im trying to make some kind of visual representation of some buffs and debuffs on frames BUT...
I was trying to start from coloring of the frames... I was testing it on my pala and basicly code stollen fro banzai works pretty well BUT only on targettarget, tagettargettarget and focustarget frames... (maybe group frames aswel havent tested that yet) and it refuses to work on player target and focus.
Im using following code, can some please tell me why it only updates colors of player by reloading ui, and target by untargeting and then targeting that unit again, so basicly update occures on recreating of that frames only... why?
Code:
--Buffs approach
local function Buffed(unit, auraName)
	for i=1,100 do
		if auraName == select(1,UnitAura(unit, i))
		then 
			return true
		else
			return false
		end
	end
end
local ignoredUnits = {
	target = false,
	targettarget = false,
	targettargettarget = false,
}
local function ApplyColor(frame, event, unit, bar)
	if not ignoredUnits[unit] then
		if(Buffed(unit, "Seal of Righteousness"))
			then
				bar:SetStatusBarColor(204/255, 204/255, 255/255)
		end
	end

	oUF:UNIT_MAXHEALTH(event, unit)
end
local function UpdateColor(frame)
	local o = frame.PostUpdateHealth
	frame.PostUpdateHealth = function(...)
		if o then o(...) end
		ApplyColor(...)
	end
end
for i, frame in ipairs(oUF.objects) do UpdateColor(frame) end
oUF:RegisterInitCallback(UpdateColor)

there is no script to update it
 
10-26-08, 01:46 AM   #159
Balkeep
A Cyclonian
 
Balkeep's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 43
So there is no way of forcing player, target, focus to update onthefly?

Also who can tell me why this function doesnt work? it supposed to determine if unit has certain buff or not...
Code:
local function Buffed(unit, auraName)
	local i = 1
	while false do
		if i == 73 then break end
		if auraName == select(1,UnitAura(unit, i)) then	return true end
		i = i +1
		end
	end
pfff... i feel that i need to start from basics cuz my usual research method is too slow for programming (figuring out how similar things work and adapting them for myself).

Last edited by Balkeep : 10-26-08 at 02:42 AM.
 
10-26-08, 02:38 AM   #160
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Balkeep View Post
So there is no way of forcing player, target, focus to update onthefly?
You need to register an event, or hook and existing one.
 

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


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