Thread Tools Display Modes
09-28-09, 07:49 AM   #1201
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Icerat View Post
Back again sorry:

I have the following to show my experience bar and it works great does all i expected it to do, hide until mouse over and show a tooltip on my player.

For some reason though it wont show a bar for my hunters pet (pets not max lvl nor is me hunter)

Code:
-- EXPERIENCE BAR --
	if(IsAddOnLoaded('oUF_Experience') and (unit == 'player' or unit == 'pet')) then
			self.Experience = CreateFrame('StatusBar', nil, self)
			self.Experience:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 5)
			self.Experience:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 5)
				if(unit == "pet") then
					self.Experience:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -25)
					self.Experience:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, -25)
				end
			self.Experience:SetHeight(3)
			self.Experience:SetStatusBarTexture(texture2)
			self.Experience:SetStatusBarColor(0.15, 0.7, 0.1)
			self.Experience.Tooltip = true
			
			self.Experience.Rested = CreateFrame('StatusBar', nil, self)
			self.Experience.Rested:SetParent(self.Experience)  -- Parent to the Experiance bar to get it to hide
			self.Experience.Rested:SetAllPoints(self.Experience)
			self.Experience.Rested:SetStatusBarTexture(texture2)
			self.Experience.Rested:SetStatusBarColor(0, 0.4, 1, 0.6)
			self.Experience.Rested:SetBackdrop(backdrop)
			self.Experience.Rested:SetBackdropColor(0, 0, 0)

--			self.Experience.Text = self.Experience:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallOutline')
--			self.Experience.Text:SetPoint('CENTER', self.Experience)

			self.Experience.bg = self.Experience.Rested:CreateTexture(nil, 'BORDER')
			self.Experience.bg:SetAllPoints(self.Experience)
			self.Experience.bg:SetTexture(0.3, 0.3, 0.3)
			
			self.Experience:SetScript ('OnEnter', function(self) self:SetAlpha(1) end)
			self.Experience:SetScript ('OnLeave', function(self) self:SetAlpha(0) end)
			self.Experience:SetAlpha(0)
		end
What am i doing wrong? bets its something stupid, thanks in advance
You sure the pet aint the same level as the player?
 
09-28-09, 01:20 PM   #1202
Icerat
A Fallenroot Satyr
Join Date: Sep 2006
Posts: 28
At some point i swapped the reputation and experience code around for some reason and never noticed the loss of the pet experience bar, it was only after going through a few previous revision back ups that i noticed what i did, working code below:

Code:
-- REPUTATION BAR --		
	if(IsAddOnLoaded("oUF_Reputation")) then
			self.Reputation = CreateFrame("StatusBar", nil, self)
		if(IsAddOnLoaded("oUF_Experience") and UnitLevel("player") ~= MAX_PLAYER_LEVEL) then
				self.Reputation:SetPoint("BOTTOM", self, "TOP", 0, 12)
			else
				self.Reputation:SetPoint('BOTTOM', self, 'TOP', 0, 5) -- RepBar Position Once at max LvL
		end
			self.Reputation:SetHeight(3)
			self.Reputation:SetWidth(width)		
			self.Reputation:SetStatusBarTexture(texture2)
			self.Reputation:SetBackdrop(backdrop)
			self.Reputation:SetBackdropColor(0,0,0)	
			self.Reputation.PostUpdate = PostUpdateReputation
			
--			self.Reputation.Text = self.Reputation:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallOutline')
--			self.Reputation.Text:SetPoint('CENTER', self.Reputation)

			self.Reputation.bg = self.Reputation:CreateTexture(nil, "BORDER")
			self.Reputation.bg:SetAllPoints(self.Reputation)
			self.Reputation.bg:SetTexture(0.3, 0.3, 0.3)
			
			self.Reputation:SetScript ('OnEnter', function(self) self:SetAlpha(1) end)
			self.Reputation:SetScript ('OnLeave', function(self) self:SetAlpha(0) end)
			self.Reputation:SetAlpha(0)
			
			self.Reputation.Tooltip = true	
		end		
	end

-- EXPERIENCE BAR --
	if(IsAddOnLoaded('oUF_Experience') and (unit == 'player' or unit == 'pet')) then
			self.Experience = CreateFrame('StatusBar', nil, self)
			self.Experience:SetPoint('BOTTOMLEFT', self, 'TOPLEFT', 0, 5)
			self.Experience:SetPoint('BOTTOMRIGHT', self, 'TOPRIGHT', 0, 5)
				if(unit == "pet") then
					self.Experience:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, -25)
				end
			self.Experience:SetHeight(3)
			self.Experience:SetStatusBarTexture(texture2)
			self.Experience:SetStatusBarColor(0.15, 0.7, 0.1)
			self.Experience.Tooltip = true
			
			self.Experience.Rested = CreateFrame('StatusBar', nil, self)
			self.Experience.Rested:SetParent(self.Experience)  -- Parent to the Experiance bar to get it to hide
			self.Experience.Rested:SetAllPoints(self.Experience)
			self.Experience.Rested:SetStatusBarTexture(texture2)
			self.Experience.Rested:SetStatusBarColor(0, 0.4, 1, 0.6)
			self.Experience.Rested:SetBackdrop(backdrop)
			self.Experience.Rested:SetBackdropColor(0, 0, 0)

--			self.Experience.Text = self.Experience:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmallOutline')
--			self.Experience.Text:SetPoint('CENTER', self.Experience)

			self.Experience.bg = self.Experience.Rested:CreateTexture(nil, 'BORDER')
			self.Experience.bg:SetAllPoints(self.Experience)
			self.Experience.bg:SetTexture(0.3, 0.3, 0.3)
			
			self.Experience:SetScript ('OnEnter', function(self) self:SetAlpha(1) end)
			self.Experience:SetScript ('OnLeave', function(self) self:SetAlpha(0) end)
			self.Experience:SetAlpha(0)
	end
I don't understand fully why this made a difference but it did, i can only figure that it has something to do with the following in the Reputation bar code that sets the position of the rep bar at max lvl when the exp bar is no longer needed.
Code:
		if(IsAddOnLoaded("oUF_Experience") and UnitLevel("player") ~= MAX_PLAYER_LEVEL) then
				self.Reputation:SetPoint("BOTTOM", self, "TOP", 0, 12)
			else
				self.Reputation:SetPoint('BOTTOM', self, 'TOP', 0, 5) -- RepBar Position Once at max LvL
		end
As my knowledge improves I'm sure ill figure it out lol

Another question, whats the differeance between

Code:
self.Auras:SetPoint("BOTTOMRIGHT", self, 30, 0)
Code:
self.Auras:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 30, 0)
From what I've observed the first put the aura icon where i want it 30 away from the bottom right edge of my target frame and the second puts it 30 away from the top right edge of the frame.

My question is why not use the first example, why do the various layouts I've looked at use the second example, whats the point of the "BOTTOMRIGHT" in the second example?

As always thanks for the responses and i look forward to learning from them.
 
09-28-09, 11:12 PM   #1203
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Icerat View Post
Another question, whats the differeance between

Code:
self.Auras:SetPoint("BOTTOMRIGHT", self, 30, 0)
Code:
self.Auras:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 30, 0)
From what I've observed the first put the aura icon where i want it 30 away from the bottom right edge of my target frame and the second puts it 30 away from the top right edge of the frame.

My question is why not use the first example, why do the various layouts I've looked at use the second example, whats the point of the "BOTTOMRIGHT" in the second example?

As always thanks for the responses and i look forward to learning from them.
Code:
self.Auras:SetPoint("BOTTOMRIGHT", self, 30, 0)
is the same as
Code:
self.Auras:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 30, 0)
http://wowprogramming.com/docs/widgets/Region/SetPoint
__________________
「貴方は1人じゃないよ」
 
09-29-09, 01:40 PM   #1204
PaleSamurai
A Defias Bandit
Join Date: Sep 2009
Posts: 2
simeple question:

what do i put in to make the health numbers show the full value like 10,000 instead of 10k?
 
09-29-09, 03:07 PM   #1205
Icerat
A Fallenroot Satyr
Join Date: Sep 2006
Posts: 28
Originally Posted by p3lim View Post
You sure the pet aint the same level as the player?
Sorry not sure what you mean, what do you mean by same level?
 
09-30-09, 02:40 AM   #1206
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Originally Posted by PaleSamurai View Post
simeple question:

what do i put in to make the health numbers show the full value like 10,000 instead of 10k?
Using oUF_Lily as example

Code:
local updateHealth = function(self, event, unit, bar, min, max)    if(UnitIsDead(unit)) then
        bar:SetValue(0)
        bar.value:SetText"Dead"
    elseif(UnitIsGhost(unit)) then
        bar:SetValue(0)
        bar.value:SetText"Ghost"
    elseif(not UnitIsConnected(unit)) then
        bar.value:SetText"Offline"
    else
        if(not UnitIsFriend('player', unit)) then
            bar.value:SetFormattedText('%s', siValue(min))
        elseif(min ~= 0 and min ~= max) then
            bar.value:SetFormattedText("-%s", siValue(max - min))
        else
            bar.value:SetText(max)
        end
    end
 
    bar:SetStatusBarColor(.25, .25, .35)
    updateName(self, event, unit)
end
The red should be changed to just min and max - min
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
 
09-30-09, 08:46 AM   #1207
PaleSamurai
A Defias Bandit
Join Date: Sep 2009
Posts: 2
The red should be changed to just min and max - min[/quote]

ok i got it all set thanks a bunch
 
10-01-09, 01:03 PM   #1208
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
anyone know a layout with party frames spawned individually i could check out? trying to figure how to spawn rames as follows:

party3 party1 player target party2 party4
 
10-01-09, 01:20 PM   #1209
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Originally Posted by Aerials View Post
anyone know a layout with party frames spawned individually i could check out? trying to figure how to spawn rames as follows:

party3 party1 player target party2 party4


Something like this.

Code:
-- This defines the position

local player = oUF:Spawn("player")
player:SetPoint("TOPRIGHT", UIParent, "CENTER", -3, 0)

-- going left

local party1 = oUF:Spawn("party1")
 party1:SetPoint("RIGHT", player, "LEFT", -6, 0)

local party3 = oUF:Spawn("party3")
  party3:SetPoint("RIGHT", party1, "LEFT", -6, 0)

-- going right

local target = oUF:Spawn("target")
target:SetPoint("LEFT", player, "RIGHT", 3, 0)

local party2 = oUF:Spawn("party2")
 party2:SetPoint("LEFT", target, "RIGHT", 6, 0)

local party4 = oUF:Spawn("party4")
  party4:SetPoint("LEFT", party2, "RIGHT", 6, 0)
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 10-01-09 at 01:36 PM.
 
10-01-09, 01:42 PM   #1210
Aerials
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 92
thanks, i'll give it a try.... just wasn't sure if there was naming or something i needed to know. was gonna be trying this:

Code:
local partymember = {}
for i = 1, 4 do
	local party = oUF:Spawn('oUF_Party'..i)

	party:SetManyAttributes(

		'showParty', true, 

		"template", "oUF_TestingParty"

	)

	table.insert(partymember, party)
	if(i==1) then
		partymember[i]:SetPoint('RIGHT', player, 'LEFT', -30, 0)
	elseif(i==2) then
		partymember[i]:SetPoint('LEFT', target, 'RIGHT', 30, 0)
	elseif(i==3) then
		partymember[i]:SetPoint('RIGHT', partymember[1], 'LEFT', -30, 0)
	elseif(i==4) then
		partymember[i]:SetPoint('LEFT', partymember[2], 'RIGHT', 30, 0)
	end
end
but no idea if it would have worked at all.
lol, didn work fully..... gonna try a couple more times this way thn try it your way

well.... doesnt seem like either way is working well, the way i was doing it gives me 4 party groups (all the same group), then they way you said doesn't do anything..... I really don't know much about the way the groups are spawned and there's no documentation for ouf anywhere and info on the actual wow api for it is incredibly lacking.

Last edited by Aerials : 10-01-09 at 02:37 PM.
 
10-01-09, 03:08 PM   #1211
giakaama
A Murloc Raider
Join Date: Nov 2008
Posts: 5
Hi i couldn't read 61 pages and the search tool didn't get me any results so i'll ask !

Is there a way to make the player border frame glow red when you are targeted by an hostile ?
 
10-01-09, 03:16 PM   #1212
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
I think oUF_Freebgrid and a few other use UnitThreatSituation(friendlyunit)==3

Afraid I don't have an example.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
 
10-01-09, 05:47 PM   #1213
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
Probably just register your own UNIT_THREAT_SITUATION_UPDATE event and manipulate your border color in that function.
 
10-02-09, 02:03 AM   #1214
giakaama
A Murloc Raider
Join Date: Nov 2008
Posts: 5
Originally Posted by Waverian View Post
Probably just register your own UNIT_THREAT_SITUATION_UPDATE event and manipulate your border color in that function.
Hmmm interesting, never thought of that ... thank you !
 
10-02-09, 05:01 AM   #1215
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
In my raid frames I have a small corner indicator for showing who has threat using the UNIT_THREAT_SITUATION_UPDATE event. It shouldn't be difficult to change it to colour the border instead.

Have a look here:
http://github.com/Evilpaul/oUF_EPRaid
 
10-06-09, 12:22 AM   #1216
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I've decided to close this thread due to the following reasons:
1. It's insanely large
2. Searching it for information is close to impossible.
3. There is a entire forum dedicated to oUF here, yet people use this thread even though I've recommended people not to several times.

If something you posted here hasn't been answered -- make a new thread. Your question might have been absorbed in the mess that this thread is.
__________________
「貴方は1人じゃないよ」
 

WoWInterface » 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