Closed Thread
Thread Tools Display Modes
Unread 04-24-09, 01:20 PM   #1001
Generizer
A Kobold Labourer
Join Date: Oct 2008
Posts: 1
Nub Question

Hi There. I'm very new to oUF and lua coding in general and I've had an issue arise since 3.1 hit and I really have no idea how to fix it.

I've been using the oUF_Maneut layout and when 3.1 dropped the custom coloring on my target frame disappeared.

Here is a before shot


Here is an after shot


Any ideas on what to change/update to get it working again ?

Thank you in advance.
Generizer is offline  
Unread 04-25-09, 10:53 AM   #1002
neolith
A Fallenroot Satyr
 
neolith's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 22
I'm having a few problems with my oUF layout:

1. self.Highlight does display my texture, but it is drawn beneath the healthbar and thus rendeing itself pretty useless as it is not visible. I tried messing with SetFrameLevel for the healthbar, but even though this fixes my mouseover problem it also screws up the partytargets and partypets that get set via the .xml - those get drawn with their healthbar beneath the background.

This is my self.Highlight code:
Code:
self.Highlight = self:CreateTexture(nil, 'HIGHLIGHT')
self.Highlight:SetAllPoints(self)
self.Highlight:SetBlendMode('ADD')
self.Highlight:SetTexture(mohighlight)
2. I've been trying to find some information on how to customize debuffs. I am mostly interested in filtering certain buffs and also displaying my own buffs in a different size then those of other players. Unfortunately I haven't found any layout that does this that I could learn from.

3. I'd like to have mana displayed in may raidframes for only those players that actually have mana. But since raidframes are - as far as I know - not handled as ordinary units I have no idea how to do checks for mana on every single player in the raid. I'd also like to display an icon for those raidmembers that are soulstoned - I guess that this must be checked for in the same way as the mana so it might be more or less the same problem.

4. I would like to design my layout with absolute pixel precision, but the frames that get drawn in WoW are always a bit larger than the dimensions that I define in my .lua and thin lines get blurred into oblivion. I guess the problem here is Blizzard's UI Scale. Currently I have UI Scaling turned off. What do I have to do to get a square of 100x100px in code to actually display at the same size onscreen? (I know this is not really oUF related, but I don't know where to search for an aswer... )

Any help on these topics would be much appreciated!
__________________
- The biggest trick the devil ever pulled was convincing the world he didn't exist. -
neolith is offline  
Unread 04-25-09, 11:18 AM   #1003
ObbleYeah
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 153
Originally Posted by Generizer View Post
Hi There. I'm very new to oUF and lua coding in general and I've had an issue arise since 3.1 hit and I really have no idea how to fix it.

I've been using the oUF_Maneut layout and when 3.1 dropped the custom coloring on my target frame disappeared.

Here is a before shot
<snip>

Any ideas on what to change/update to get it working again ?

Thank you in advance.
Posting your custom colour code could help :P
ObbleYeah is offline  
Unread 04-25-09, 01:10 PM   #1004
Dessembrae
A Fallenroot Satyr
 
Dessembrae's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 29
Question

NVM, all problems are solved.

Last edited by Dessembrae : 04-26-09 at 01:24 PM. Reason: All problems are solved
Dessembrae is offline  
Unread 04-26-09, 11:48 AM   #1005
nostress
A Deviate Faerie Dragon
 
nostress's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 16
@ Generizer

Line 570 of oUF_Maneut.lua

change
Code:
self.Health.colorClass = false
to
Code:
self.Health.colorClass = true
nostress is offline  
Unread 04-27-09, 11:20 AM   #1006
duhwhat
A Cyclonian
Join Date: Aug 2008
Posts: 48
Originally Posted by p3lim View Post
Basically, yes, its used to filter if you want it shown or not, based on custom filters (hence the name of the function).
I have in mind about 10 debuffs, from both self and other players, that I would whitelist. How would I go about doing this?
duhwhat is offline  
Unread 04-27-09, 12:07 PM   #1007
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,313
Originally Posted by duhwhat View Post
I have in mind about 10 debuffs, from both self and other players, that I would whitelist. How would I go about doing this?
Code:
local whitelist = {
   ['buffname1'] = true,
   ['buffname2'] = true,
}

local function customFilter(icons, unit, icon, name)
   if(whitelist[name]) then return true end
end
then use this to your layout creation function
Code:
self.CustomAuraFilter = customFilter
p3lim is online now  
Unread 04-27-09, 02:23 PM   #1008
duhwhat
A Cyclonian
Join Date: Aug 2008
Posts: 48
These go in the layout itself or in aura.lua?
duhwhat is offline  
Unread 04-27-09, 02:28 PM   #1009
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,313
Originally Posted by duhwhat View Post
These go in the layout itself or in aura.lua?
You should never need to change the files in oUF
p3lim is online now  
Unread 04-27-09, 09:54 PM   #1010
arnath_vp
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 9
I have a custom tag for name color that looks something like this (Hex is just the same RGB to Hex function used in tags.lua):

Code:
oUF.Tags["[customnamecolor]"] = function(unit)
   if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
      return Hex(oUF.colors.tapped)
   elseif(not UnitIsConnected(unit)) then
      return Hex(oUF.colors.disconnected)
   elseif(UnitIsPlayer(unit)) then
      local _, class = UnitClass(unit)
      return Hex(oUF.colors.class[class])
   else
      return Hex(oUF.colors.reaction[UnitReaction(unit, "player")])
   end
end
However, for some reason, when unit is a party member (e.g., "party1"), some of the time UnitClass returns nil. Anybody know why this happens and what I might be able to do to fix it?

EDIT: To update, this seems to have gone away in the latest version of oUF (released today I think) but I'm still confused as to why it was happening in the first place and would love some enlightenment.

Last edited by arnath_vp : 04-28-09 at 02:50 PM.
arnath_vp is offline  
Unread 04-28-09, 02:38 PM   #1011
bartjeeuhh
A Defias Bandit
Join Date: Apr 2009
Posts: 3
I got a little problem, when I install oUF Freebgrid, I can see the raidframes at the bottom of my screen, but how can I move it?

Thanks
bartjeeuhh is offline  
Unread 04-28-09, 03:25 PM   #1012
Nubsy
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 14
hi im wonder how do you set the strata on portraits as mine seems to over power my bars due to were i have mine,

Code
Code:
if(unit == 'player' or unit == 'target')then
		portrait = CreateFrame("PlayerModel", nil, self)
		portrait:SetScript("OnShow", function(self) self:SetCamera(0)end)
		portrait:SetWidth(290)
		portrait:SetHeight(27)
		portrait:SetPoint("TOPLEFT", self, "TOPLEFT", 4, -4)
		portrait.type = "3D"
		self.Portrait = portrait
end
ive tried adding
Code:
portrait:SetStrata ("LOW")
but it jst gives me an error

Last edited by Nubsy : 04-28-09 at 03:27 PM.
Nubsy is offline  
Unread 04-28-09, 03:34 PM   #1013
neolith
A Fallenroot Satyr
 
neolith's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 22
Originally Posted by bartjeeuhh View Post
I got a little problem, when I install oUF Freebgrid, I can see the raidframes at the bottom of my screen, but how can I move it?

Thanks
Unless the author created any menu or slashcommands to change the settings on the fly you will have to edit the .lua manually.
__________________
- The biggest trick the devil ever pulled was convincing the world he didn't exist. -
neolith is offline  
Unread 04-28-09, 03:43 PM   #1014
bartjeeuhh
A Defias Bandit
Join Date: Apr 2009
Posts: 3
Originally Posted by neolith View Post
Unless the author created any menu or slashcommands to change the settings on the fly you will have to edit the .lua manually.
Code:
local layoutName = "Freebgrid"
local layoutPath = "Interface\\Addons\\oUF_"..layoutName
local mediaPath = layoutPath.."\\media\\"

local texture = mediaPath.."gradient"
local hightlight = mediaPath.."white"
local borderTex = mediaPath.."border"

local backdrop = {
	bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
	insets = {top = -1, left = -1, bottom = -1, right = -1},
}

local font,fontsize = mediaPath.."CalibriBold.ttf",12			-- The font and fontSize for Names and Health
local symbols, symbolsSize = mediaPath.."PIZZADUDEBULLETS.ttf", 12	-- The font and fontSize for TagEvents
local symbols1, symbols1Size = mediaPath.."STYLBCC_.ttf", 12		-- The font and fontSize for TagEvents

local height, width = 40, 40
local playerClass = select(2, UnitClass("player"))

local reverseColors = false	-- Reverse Units color
local highlight = true		-- MouseOver Highlight?
local indicators = true 	-- Class Indicators?

local vertical = true 		-- Vertical bars?
local manabars = false		-- Mana Bars?
local Licon = true		-- Leader icon?
local ricon = true		-- Raid icon?

local banzai = LibStub("LibBanzai-2.0")

banzai:RegisterCallback(function(aggro, name, ...)
	for i = 1, select("#", ...) do
		local u = select(i, ...)
		local f = oUF.units[u]
		if f then
			if f.Banzai then
				f:Banzai(u, aggro)
			else
				f:UNIT_MAXHEALTH("OnBanzaiUpdate", f.unit)
			end
		end
	end
end)

local f = CreateFrame("Frame")
f:SetScript("OnEvent", function(self, event, ...)
	return self[event](self, ...)
end)

--=========================------------- Big Thanks to jadakren! 

oUF.pomCount = {"i","h","g","f","Z","Y"}

oUF.classIndicators={
		["DRUID"] = {
				["TL"] = "[tree]",
				["TR"] = "[gotw]",
				["BL"] = "[rejuv][regrow][wg]",
				["BR"] = "[lb]"
		},
		["PRIEST"] = {
				["TL"] = "[pws][ws]",
				["TR"] = "[ds][sp][fort][fw]",
				["BL"] = "[rnw][gotn]",
				["BR"] = "[pom]"
		},
		["PALADIN"] = {
				["TL"] = "",
				["TR"] = "",
				["BL"] = "",
				["BR"] = ""
		},
		["WARLOCK"] = {
				["TL"] = "",
				["TR"] = "",
				["BL"] = "",
				["BR"] = ""
		},
		["WARRIOR"] = {
				["TL"] = "",
				["TR"] = "[sh]",
				["BL"] = "",
				["BR"] = ""
		},
		["DEATHKNIGHT"] = {
				["TL"] = "",
				["TR"] = "",
				["BL"] = "",
				["BR"] = ""
		},
		["SHAMAN"] = {
				["TL"] = "",
				["TR"] = "",
				["BL"] = "",
				["BR"] = ""
		},
		["HUNTER"] = {
				["TL"] = "",
				["TR"] = "",
				["BL"] = "",
				["BR"] = ""
		},
		["ROGUE"] = {
				["TL"] = "",
				["TR"] = "",
				["BL"] = "",
				["BR"] = ""
		},
		["MAGE"] = {
				["TL"] = "",
				["TR"] = "",
				["BL"] = "",
				["BR"] = ""
		}
		
	}

--priest
oUF.Tags["[pom]"] = function(u) local c = select(4, UnitAura(u, "Prayer of Mending")) return c and "|cffFFCF7F"..oUF.pomCount[c].."|r" or "" end
oUF.TagEvents["[pom]"] = "UNIT_AURA"

oUF.Tags["[gotn]"] = function(u) return UnitAura(u, "Gift of the Naaru") and "|cff33FF33.|r" or "" end
oUF.TagEvents["[gotn]"] = "UNIT_AURA"
oUF.Tags["[rnw]"] = function(u)
 local name, _,_,_,_,_,_, fromwho,_ = UnitAura(u, "Renew")
 if not (fromwho == "player") then return end
 return UnitAura(u, "Renew") and "|cff33FF33.|r" or ""
end
oUF.TagEvents["[rnw]"] = "UNIT_AURA"
oUF.Tags["[pws]"] = function(u) return UnitAura(u, "Power Word: Shield") and "|cff33FF33.|r" or "" end
oUF.TagEvents["[pws]"] = "UNIT_AURA"
oUF.Tags["[ws]"] = function(u) return UnitDebuff(u, "Weakened Soul") and "|cffFF5500.|r" or "" end
oUF.TagEvents["[ws]"] = "UNIT_AURA"


oUF.Tags["[sp]"] = function(u) return (UnitAura(u, "Prayer of Shadow Protection") or UnitAura(u, "Shadow Protection")) and "" or "|cff9900FF.|r" end
oUF.TagEvents["[sp]"] = "UNIT_AURA"
oUF.Tags["[fort]"] = function(u) return (UnitAura(u, "Prayer of Fortitude") or UnitAura(u, "Power Word: Fortitude")) and "" or "|cff00A1DE.|r" end
oUF.TagEvents["[fort]"] = "UNIT_AURA"
oUF.Tags["[fw]"] = function(u) return UnitAura(u, "Fear Ward") and "|cff8B4513 .|r" or "" end
oUF.TagEvents["[fw]"] = "UNIT_AURA"
oUF.Tags["[ds]"] = function(u) return (UnitAura(u, "Prayer of Spirit") or UnitAura(u, "Divine Spirit")) and "" or "|cffffff00.|r" end
oUF.TagEvents["[ds]"] = "UNIT_AURA"

--druid
oUF.Tags["[lb]"] = function(u) local c = select(4, UnitAura(u, "Lifebloom")) return c and "|cffA7FD0A"..c.."|r" or "" end
oUF.Tags["[rejuv]"] = function(u) return UnitAura(u, "Rejuvenation") and "|cff00FEBF.|r" or "" end
oUF.Tags["[regrow]"] = function(u) return UnitAura(u, "Regrowth") and "|cff00FF10.|r" or "" end
oUF.Tags["[wg]"] = function(u) return UnitAura(u, "Wild Growth") and "|cff33FF33.|r" or "" end
oUF.Tags["[tree]"] = function(u) return UnitAura(u, "Tree of Life") and "|cff33FF33.|r" or "" end
oUF.Tags["[gotw]"] = function(u) return UnitAura(u, "Gift of the Wild") and "|cff33FF33.|r" or "" end
oUF.TagEvents["[lb]"] = "UNIT_AURA"
oUF.TagEvents["[rejuv]"] = "UNIT_AURA"
oUF.TagEvents["[regrow]"] = "UNIT_AURA"
oUF.TagEvents["[wg]"] = "UNIT_AURA"
oUF.TagEvents["[tree]"] = "UNIT_AURA"
oUF.TagEvents["[gotw]"] = "UNIT_AURA"

--warrior
oUF.Tags["[sh]"] = function(u) return (UnitAura(u, "Battle Shout") or UnitAura(u, "Commanding Shout")) and "" or "|cffffff00.|r" end
oUF.TagEvents["[sh]"] = "UNIT_AURA"


local function applyAuraIndicator(self)
--========= ----- =========--
		self.AuraStatusTL = self.Health:CreateFontString(nil, "OVERLAY")
		self.AuraStatusTL:ClearAllPoints()
		self.AuraStatusTL:SetPoint("BOTTOMLEFT", self, "TOPLEFT", -5, -5)
		self.AuraStatusTL:SetFont(font, 22, "OUTLINE")
		self:Tag(self.AuraStatusTL, oUF.classIndicators[playerClass]["TL"])
	
		self.AuraStatusTR = self.Health:CreateFontString(nil, "OVERLAY")
		self.AuraStatusTR:ClearAllPoints()
		self.AuraStatusTR:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 5, -5)
		self.AuraStatusTR:SetFont(font, 22, "OUTLINE")
		self:Tag(self.AuraStatusTR, oUF.classIndicators[playerClass]["TR"])

		self.AuraStatusBL = self.Health:CreateFontString(nil, "OVERLAY")
		self.AuraStatusBL:ClearAllPoints()
		self.AuraStatusBL:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", -5, -5)
		self.AuraStatusBL:SetFont(font, 22, "OUTLINE")
		self:Tag(self.AuraStatusBL, oUF.classIndicators[playerClass]["BL"])	

		self.AuraStatusBR = self.Health:CreateFontString(nil, "OVERLAY")
		self.AuraStatusBR:ClearAllPoints()
		self.AuraStatusBR:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 7, -3)
		self.AuraStatusBR:SetFont(symbols, symbolsSize, "OUTLINE")
		self:Tag(self.AuraStatusBR, oUF.classIndicators[playerClass]["BR"])	
	--========= ----- =========--
end
 
-- Credits to zariel

local debuffs = {
	["Viper Sting"] = 12,

	["Wound Poison"] = 9,
	["Mortal Strike"] = 8,
	["Aimed Shot"] = 8,

	["Counterspell - Silenced"] = 11,
	["Counterspell"] = 10,

	["Blind"] = 10,
	["Cyclone"] = 10,

	["Polymorph"] = 7,

	["Entangling Roots"] = 7,
	["Freezing Trap Effect"] = 7,

	["Crippling Poison"] = 6,
	["Hamstring"] = 5,
	["Wing Clip"] = 5,

	["Fear"] = 3,
	["Psychic Scream"] = 3,
	["Howl of Terror"] = 3,
}

local dispellClass
do
	local t = {
		["PRIEST"] = {
			["Magic"] = true,
			["Disease"] = true,
		},
		["SHAMAN"] = {
			["Poison"] = true,
			["Disease"] = true,
			--["Curse"] = true, -- uncomment to enable curses for shamans
		},
		["PALADIN"] = {
			["Poison"] = true,
			["Magic"] = true,
			["Disease"] = true,
		},
		["MAGE"] = {
			["Curse"] = true,
		},
		["DRUID"] = {
			["Curse"] = true,
			["Poison"] = true,
		},
	}
	if t[playerClass] then
		dispellClass = {}
		for k, v in pairs(t[playerClass]) do
			dispellClass[k] = v
		end
		t = nil
	end
end

local dispellPiority = {
	["Magic"] = 4,
	["Poison"] = 3,
	["Disease"] = 1,
	["Curse"] = 2,
}

local name, rank, buffTexture, count, duration, timeLeft, dtype
function f:UNIT_AURA(unit)
	if not oUF.units[unit] then return end

	local frame = oUF.units[unit]

	if not frame.Icon then return end
	local current, bTexture, dispell, dispellTexture
	for i = 1, 40 do
		name, rank, buffTexture, count, dtype, duration, timeLeft = UnitDebuff(unit, i)
		if not name then break end

		if dispellClass and dispellClass[dtype] then
			dispell = dispell or dtype
			dispellTexture = dispellTexture or buffTexture
			if dispellPiority[dtype] > dispellPiority[dispell] then
				dispell = dtype
				dispellTexture = buffTexture
			end
		end

		if debuffs[name] then
			current = current or name
			bTexture = bTexture or buffTexture

			local prio = debuffs[name]
			if prio > debuffs[current] then
				current = name
				bTexture = buffTexture
			end
		end
	end

	if dispellClass then
		if dispell then
			if dispellClass[dispell] then
				local col = DebuffTypeColor[dispell]
				frame.border:Show()
				frame.border:SetVertexColor(col.r, col.g, col.b)
				frame.Dispell = true
				if not bTexture and dispellTexture then
					current = dispell
					bTexture = dispellTexture
				end
			end
		else
			frame.border:SetVertexColor(1, 1, 1)
			frame.Dispell = false
			frame.border:Hide()
		end
	end

	if current and bTexture then
		frame.IconShown = true
		frame.Icon:SetTexture(bTexture)
		frame.Icon:ShowText()
		frame.DebuffTexture = true
	else
		frame.IconShown = false
		frame.DebuffTexture = false
		frame.Icon:HideText()
	end
end
-- Target Border
local ChangedTarget = function(self)
	if (UnitInRaid'player' == 1 or GetNumPartyMembers() > 0 ) and UnitIsUnit('target', self.unit) then
		self.TargetBorder:Show()
	else
		self.TargetBorder:Hide()
	end
end

--===========================--
local colors = setmetatable({
	power = setmetatable({
		['MANA'] = {.31,.45,.63},
		['RAGE'] = {.69,.31,.31},
		['FOCUS'] = {.71,.43,.27},
		['ENERGY'] = {.65,.63,.35},
		['RUNIC_POWER'] = {0,.8,.9},
	}, {__index = oUF.colors.power}),
	class =setmetatable({
		["DEATHKNIGHT"] = { 0.77, 0.12, 0.23 },
		["DRUID"] = { 1.0 , 0.49, 0.04 },
		["HUNTER"] = { 0.67, 0.83, 0.45 },
		["MAGE"] = { 0.41, 0.8 , 0.94 },
		["PALADIN"] = { 0.96, 0.55, 0.73 },
		["PRIEST"] = { 1.0 , 1.0 , 1.0 },
		["ROGUE"] = { 1.0 , 0.96, 0.41 },
		["SHAMAN"] = { 0.14,  0.35,  1.00 },
		["WARLOCK"] = { 0.58, 0.51, 0.7 },
		["WARRIOR"] = { 0.78, 0.61, 0.43 },
	}, {__index = oUF.colors.class}),
}, {__index = oUF.colors})

local round = function(x, y)
	return math.floor((x * 10 ^ y)+ 0.5) / 10 ^ y
end

local updateHealth = function(self, event, unit, bar, current, max)
	local def = max - current
	bar:SetValue(current)

	local r, g, b, t
	if UnitIsDeadOrGhost(unit) or not UnitIsConnected(unit) then
		r, g, b = .3, .3, .3
	elseif(UnitIsPlayer(unit)) then
		local _, class = UnitClass(unit)
		t = colors.class[class]	
	else		
		-- MainTank target and Party Pet color
		r, g, b = .1, .8, .3
	end

	if(t) then
		r, g, b = t[1], t[2], t[3]
	end

	local per = round(current/max, 100)
	if (UnitIsPlayer(unit)) and (banzai:GetUnitAggroByUnitId(unit)) then
		self.Name:SetVertexColor(1, 0, 0)
	else	
		-- Name Color
		self.Name:SetTextColor(r, g, b)
	end

	if(not UnitIsConnected(unit)) then
		self.Name:SetText('|cffD7BEA5'..'D/C')
	elseif(UnitIsDead(unit)) then
		self.Name:SetText('|cffD7BEA5'..'Dead')
	elseif(UnitIsGhost(unit)) then
		self.Name:SetText('|cffD7BEA5'..'Ghost')
	elseif (per > 0.9) then
		self.Name:SetText(UnitName(unit):utf8sub(1, 3))
	else
		self.Name:SetFormattedText("-%0.1f",math.floor(def/100)/10)
	end

	bar.bg:SetVertexColor(r, g, b)

	if(reverseColors)then
	  bar:SetStatusBarColor(r, g, b)
  	else	
	  bar:SetStatusBarColor(0, 0, 0)
	end
end

local updatePower = function(self, event, unit, bar, current, max)	
	local powerType, powerTypeString = UnitPowerType(unit)

	local perc = round(current/max, 100)
	if (perc < 0.1 and UnitIsConnected(unit) and powerTypeString == 'MANA' and not UnitIsDeadOrGhost(unit)) then
		self.manaborder:Show()
	else
		self.manaborder:Hide()
	end
end

local OnEnter = function(self)
	UnitFrame_OnEnter(self)
	self.Highlight:Show()
end

local OnLeave = function(self)
	UnitFrame_OnLeave(self)
	self.Highlight:Hide()
end

-- Style
local func = function(self, unit)
	self.colors = colors
	
	self:EnableMouse(true)
	self:SetScript("OnEnter", OnEnter)
	self:SetScript("OnLeave", OnLeave)
	self:RegisterForClicks"anyup"
	self:SetAttribute("*type2", "menu")

	-- Health
	local hp = CreateFrame"StatusBar"
	hp:SetStatusBarTexture(texture)
	if(reverseColors)then
	  hp:SetAlpha(1)
	else
	  hp:SetAlpha(0.8)
  	end
	hp.frequentUpdates = true
	if(manabars)then
	  if(vertical)then
	    hp:SetWidth(width*.93)
	    hp:SetOrientation("VERTICAL")
	    hp:SetParent(self)
	    hp:SetPoint"TOP"
	    hp:SetPoint"BOTTOM"
	    hp:SetPoint"LEFT"
  	  else
	    hp:SetHeight(height*.93)
	    hp:SetParent(self)
	    hp:SetPoint"LEFT"
	    hp:SetPoint"RIGHT"
	    hp:SetPoint"TOP"
	  end
  	else
	  if(vertical)then
	    hp:SetWidth(width)
	    hp:SetOrientation("VERTICAL")
	    hp:SetParent(self)
	    hp:SetPoint"TOPLEFT"
	    hp:SetPoint"BOTTOMRIGHT"
  	  else
	    hp:SetParent(self)
	    hp:SetPoint"TOPLEFT"
	    hp:SetPoint"BOTTOMRIGHT"
	  end
	end

	local hpbg = hp:CreateTexture(nil, "BORDER")
	hpbg:SetAllPoints(hp)
	hpbg:SetTexture(texture)
	if(reverseColors)then
	  hpbg:SetAlpha(0.3)
	else
	  hpbg:SetAlpha(1)
  	end

	-- Backdrop
	self:SetBackdrop(backdrop)
	self:SetBackdropColor(0, 0, 0)

	-- Health Text
	local hpp = hp:CreateFontString(nil, "OVERLAY")
	hpp:SetFont(font, fontsize)
	hpp:SetShadowOffset(1,-1)
	hpp:SetPoint("CENTER")
	hpp:SetJustifyH("CENTER")

	hp.bg = hpbg
	hp.value = hpp
	self.Health = hp
	self.OverrideUpdateHealth = updateHealth

	-- PowerBars
	if(manabars)then
	  local pp = CreateFrame"StatusBar"
	  pp:SetStatusBarTexture(texture)
	  pp.colorPower = true
	  pp.frequentUpdates = true
	
	  if(vertical)then
	    pp:SetWidth(width*.05)
	    pp:SetOrientation("VERTICAL")
	    pp:SetParent(self)
	    pp:SetPoint"TOP"
	    pp:SetPoint"BOTTOM"
	    pp:SetPoint"RIGHT"
  	  else
	    pp:SetHeight(height*.05)
	    pp:SetParent(self)
	    pp:SetPoint"LEFT"
	    pp:SetPoint"RIGHT"
	    pp:SetPoint"BOTTOM"
	  end

	  local ppbg = pp:CreateTexture(nil, "BORDER")
	  ppbg:SetAllPoints(pp)
	  ppbg:SetTexture(texture)
	  ppbg.multiplier = .3
	  pp.bg = ppbg

	  self.Power = pp
	  self.PostUpdatePower = updatePower
	end
	
	-- Highlight
	if(highlight)then
	  local hl = hp:CreateTexture(nil, "OVERLAY")
	  hl:SetAllPoints(self)
	  hl:SetTexture(hightlight)
	  hl:SetVertexColor(1,1,1,.1)
	  hl:SetBlendMode("ADD")
	  hl:Hide()

	  self.Highlight = hl
	end

	-- Range Alpha/SpellRange
	if(IsAddOnLoaded('oUF_SpellRange')) then
	  self.SpellRange = true
	  self.inRangeAlpha = 1.0 -- Frame alpha when in range
	  self.outsideRangeAlpha = 0.5 -- Frame alpha when out of range
	else
	  if(not unit) then
		self.Range = true
		self.inRangeAlpha = 1
		self.outsideRangeAlpha = .5
	  end
  	end

	-- Name
	local name = hp:CreateFontString(nil, "OVERLAY")
	name:SetPoint("CENTER")
	name:SetJustifyH("CENTER")
	name:SetFont(font, fontsize)
	name:SetShadowOffset(1.25, -1.25)
	name:SetTextColor(1,1,1,1)

	self.Name = name

	local manaborder = self:CreateTexture(nil, "OVERLAY")
	manaborder:SetPoint("LEFT", self, "LEFT", -5, 0)
	manaborder:SetPoint("RIGHT", self, "RIGHT", 5, 0)
	manaborder:SetPoint("TOP", self, "TOP", 0, 5)
	manaborder:SetPoint("BOTTOM", self, "BOTTOM", 0, -5)
	manaborder:SetTexture(borderTex)
	manaborder:Hide()
	manaborder:SetVertexColor(0, .1, .9, .8)
	self.manaborder = manaborder

	tBorder = self:CreateTexture(nil, "OVERLAY")
	tBorder:SetPoint("LEFT", self, "LEFT", -6, 0)
	tBorder:SetPoint("RIGHT", self, "RIGHT", 6, 0)
	tBorder:SetPoint("TOP", self, "TOP", 0, 6)
	tBorder:SetPoint("BOTTOM", self, "BOTTOM", 0, -6)
	tBorder:SetTexture(borderTex)
	tBorder:Hide()
	tBorder:SetVertexColor(.8, .8, .8, .8)
	self.TargetBorder = tBorder

--==========--
--  ICONS   --
--==========--
-- Dispel Icons
	local icon = hp:CreateTexture(nil, "OVERLAY")
	icon:SetPoint("CENTER")
	icon:SetHeight(18)
	icon:SetWidth(18)
	icon:SetTexCoord(0.07, 0.93, 0.07, 0.93)
	icon:Hide()
	icon.ShowText = function(s)
		self.Name:Hide()
		s:Show()
	end
	icon.HideText = function(s)
		self.Name:Show()
		s:Hide()
	end
	self.Icon = icon

	local border = self:CreateTexture(nil, "OVERLAY")
	border:SetPoint("LEFT", self, "LEFT", -5, 0)
	border:SetPoint("RIGHT", self, "RIGHT", 5, 0)
	border:SetPoint("TOP", self, "TOP", 0, 5)
	border:SetPoint("BOTTOM", self, "BOTTOM", 0, -5)
	border:SetTexture(borderTex)
	border:Hide()
	border:SetVertexColor(1, 1, 1)
	self.border = border

-- Leader Icon
	if(Licon)then
	self.Leader = self.Health:CreateTexture(nil, "OVERLAY")
	self.Leader:SetPoint("TOPLEFT", self, 0, 8)
	self.Leader:SetHeight(16)
	self.Leader:SetWidth(16)
	end

-- Raid Icon
	if(ricon)then
	self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
	self.RaidIcon:SetPoint("TOP", self, 0, 8)
	self.RaidIcon:SetHeight(16)
	self.RaidIcon:SetWidth(16)
	end

-- ReadyCheck	
	self.ReadyCheck = self.Health:CreateTexture(nil, "OVERLAY")
	self.ReadyCheck:SetPoint("TOPRIGHT", self, 0, 8)
	self.ReadyCheck:SetHeight(16)
	self.ReadyCheck:SetWidth(16)
	self.ReadyCheck.delayTime = 8
	self.ReadyCheck.fadeTime = 2

	if not(self:GetAttribute('unitsuffix') == 'target')then
	  if(indicators)then
	    applyAuraIndicator(self)
  	  end
	
	  self.applyHealComm = true
	end

	self:RegisterEvent('PLAYER_TARGET_CHANGED', ChangedTarget)
	f:RegisterEvent("UNIT_AURA")

	self:SetAttribute('initial-height', height)
	self:SetAttribute('initial-width', width)

	return self
end

oUF:RegisterStyle("Freebgrid", func)

oUF:SetActiveStyle"Freebgrid"  

local party = oUF:Spawn('header', 'oUF_Party')
party:SetPoint('CENTER', UIParent, 0, -420)
party:SetManyAttributes('showParty', true, 
			'showPlayer', true,
			'point', 'LEFT', -- Remove to grow vertically
			'xOffset', 5)
party:SetAttribute("template", "oUF_Freebpets")

local raid = {}
for i = 1, 8 do
	local raidg = oUF:Spawn('header', 'oUF_Raid'..i)
	raidg:SetManyAttributes('groupFilter', tostring(i), 
				'showRaid', true,
				'point', 'LEFT', -- Remove to grow vertically
				'xOffset', 5)
	table.insert(raid, raidg)
	if(i == 1) then	
		raidg:SetPoint('CENTER', UIParent, 0, -420)
	else
		raidg:SetPoint('BOTTOMLEFT', raid[i-1], 'TOPLEFT', 0, 5)
	end
end

local tank = oUF:Spawn('header', 'oUF_MainTank')
tank:SetPoint('LEFT', UIParent, 5, 100)
tank:SetManyAttributes('showRaid', true, 
			'groupFilter', 'MAINTANK', 
			'yOffset', -5)
tank:SetAttribute("template", "oUF_FreebMtargets")

local partyToggle = CreateFrame('Frame')

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
			tank:Hide() --tank:Show() to enable MTs
		else
			party:Show()
			for i,v in ipairs(raid) do v:Hide() end
		end
	end
end)
where can I find the part where I need to adjust the position of it?

Last edited by bartjeeuhh : 04-28-09 at 04:00 PM.
bartjeeuhh is offline  
Unread 04-28-09, 07:48 PM   #1015
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 125
line 667
Code:
party:SetPoint('CENTER', UIParent, 0, -420)
line 683
Code:
raidg:SetPoint('CENTER', UIParent, 0, -420)
how to use SetPoint http://www.wowwiki.com/API_Region_SetPoint
Freebaser is offline  
Unread 04-29-09, 01:02 AM   #1016
bartjeeuhh
A Defias Bandit
Join Date: Apr 2009
Posts: 3
Originally Posted by Freebaser View Post
line 667
Code:
party:SetPoint('CENTER', UIParent, 0, -420)
line 683
Code:
raidg:SetPoint('CENTER', UIParent, 0, -420)
how to use SetPoint http://www.wowwiki.com/API_Region_SetPoint

thanks for the help mate
bartjeeuhh is offline  
Unread 04-29-09, 06:23 PM   #1017
Tastyfrog
A Deviate Faerie Dragon
Join Date: Mar 2009
Posts: 15
I wanted to change ouf_BarFader to fade the bars slowly... unfortunately im pretty new to lua
This is what i have so far, but it doesnt seem to be working
Code:
local function Update(self)
	local currentAlpha = self:GetAlpha()
	if(Validation(self, self.unit)) then
		if(currentAlpha > 0.2) then
			self:SetAlpha((currentAlpha - 0.1))
		end
	else
		if(currentAlpha < 1.0) then
			self:SetAlpha((currentAlpha + 0.1))
		end
	end
end
any help?
Tastyfrog is offline  
Unread 04-30-09, 07:24 AM   #1018
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,313
Originally Posted by Tastyfrog View Post
I wanted to change ouf_BarFader to fade the bars slowly... unfortunately im pretty new to lua
This is what i have so far, but it doesnt seem to be working
Code:
local function Update(self)
	local currentAlpha = self:GetAlpha()
	if(Validation(self, self.unit)) then
		if(currentAlpha > 0.2) then
			self:SetAlpha((currentAlpha - 0.1))
		end
	else
		if(currentAlpha < 1.0) then
			self:SetAlpha((currentAlpha + 0.1))
		end
	end
end
any help?
Im gonna add this to oUF BarFader myself, once I get time to do it.
p3lim is online now  
Unread 04-30-09, 08:39 PM   #1019
Tastyfrog
A Deviate Faerie Dragon
Join Date: Mar 2009
Posts: 15
I found a way to do it, but i need to be able to wait or pause for half a second or so.. does anyone know how to do this.
Tastyfrog is offline  
Unread 05-10-09, 10:22 AM   #1020
neolith
A Fallenroot Satyr
 
neolith's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 22
Originally Posted by phrequency View Post
I have a quick question:
I'm using oUF_coree and I wanted to know how to change the location of the names of my pet and my targettarget frames- any help would be appreciated.

This is my first time working with LUA and I managed to position the frames how I wanted them, but I dont see the tag for pet or targettarget name in the code.
Code:
if(unit ~= "player") then
		self.Info = SetFontString(self.Health, fontn, 14, "THINOUTLINE")
		self.Info:SetPoint("LEFT", self.Health, 1, -23)
		if(unit == "targettarget" or unit == "pet") then		
			self.Info:SetPoint("RIGHT", self.Health.Text2
This currently sets a relative position for the pet and targettarget names, I think, but I want to make the position absolute and be able to change it around an anchor.
I'm not sure I fully understand your problem, but this
Code:
self.Info:SetPoint("LEFT", self.Health)
anchors self.Info to self.Health. Change it to whatever you want to stick it to.
__________________
- The biggest trick the devil ever pulled was convincing the world he didn't exist. -

Last edited by neolith : 05-10-09 at 10:30 AM.
neolith 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