View Single Post
04-04-09, 02:11 PM   #966
neolith
A Fallenroot Satyr
 
neolith's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 22
I'm trying to get my raidframes to show a manabar if the char of that certain frame actually has mana.

This is my code:
Code:
local _, powertype = UnitPowerType(unit)
if powertype == "MANA" then

	hp:SetHeight(height-10)
		
	local pp = CreateFrame"StatusBar"
		
	pp:SetHeight(2)
	pp:SetStatusBarTexture(texture)
	pp.colorPower = true
	pp.frequentUpdates = true
	pp:SetParent(self)
	pp:SetPoint("BOTTOM", 0, 4)
	pp:SetPoint("LEFT", 4, 0)
	pp:SetPoint("RIGHT", -4, 0)
		
	self.Power = pp

end
However the first line of it brings up two errors that I don't understand:
Code:
[2009/04/04 22:02:10-3758-x8]: oUF_ReebooRaid-ALPHA\oUF_ReebooRaid.lua:174: Usage: UnitPowerType("unit"[, index])
oUF_ReebooRaid-ALPHA\oUF_ReebooRaid.lua:174: in function `style'
oUF-1.3.8\ouf.lua:222: in function <Interface\AddOns\oUF\ouf.lua:214>
oUF-1.3.8\ouf.lua:279: in function `configFunction'
Interface\FrameXML\SecureTemplates.lua:518: in function <Interface\FrameXML\SecureTemplates.lua:515>:
<in C code>: in function `securecall'
Interface\FrameXML\SecureTemplates.lua:525: in function `SetupUnitButtonConfiguration':
Interface\FrameXML\SecureTemplates.lua:604: in function <Interface\FrameXML\SecureTemplates.lua:558>:
Interface\FrameXML\SecureTemplates.lua:853: in function `SecureGroupHeader_Update':
<string>:"*:OnShow":1: in function <[string "*:OnShow"]:1>
<in C code>: in function `Show'
oUF_ReebooRaid-ALPHA\oUF_ReebooRaid.lua:350: in main chunk
Code:
[2009/04/04 22:02:10-3758-x3]: oUF_ReebooRaid-ALPHA\oUF_ReebooRaid.lua:174: Usage: UnitPowerType("unit"[, index])
oUF_ReebooRaid-ALPHA\oUF_ReebooRaid.lua:174: in function `style'
oUF-1.3.8\ouf.lua:222: in function <Interface\AddOns\oUF\ouf.lua:214>
oUF-1.3.8\ouf.lua:279: in function `configFunction'
Interface\FrameXML\SecureTemplates.lua:518: in function <Interface\FrameXML\SecureTemplates.lua:515>:
<in C code>: in function `securecall'
Interface\FrameXML\SecureTemplates.lua:525: in function `SetupUnitButtonConfiguration':
Interface\FrameXML\SecureTemplates.lua:604: in function <Interface\FrameXML\SecureTemplates.lua:558>:
Interface\FrameXML\SecureTemplates.lua:853: in function `SecureGroupHeader_Update':
Interface\FrameXML\SecureTemplates.lua:448: in function `SecureGroupHeader_OnAttributeChanged':
<string>:"*:OnAttributeChanged":1: in function <[string "*:OnAttributeChanged"]:1>
<in C code>: in function `SetAttribute'
Interface\FrameXML\SecureTemplates.lua:605: in function <Interface\FrameXML\SecureTemplates.lua:558>:
Interface\FrameXML\SecureTemplates.lua:853: in function `SecureGroupHeader_Update':
<string>:"*:OnShow":1: in function <[string "*:OnShow"]:1>
<in C code>: in function `Show'
oUF_ReebooRaid-ALPHA\oUF_ReebooRaid.lua:350: in main chunk
What's happening here and what is my mistake?
__________________
- The biggest trick the devil ever pulled was convincing the world he didn't exist. -