Thread Tools Display Modes
09-06-10, 10:25 PM   #1
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
oUF and HolyPower

Is it implemented yet over at git? I seen that it was added and downloaded it, and added this in my layout but it doesn't seem to be showing up? :O Unless its not fully implemented yet? Then forgive me lol.

Code:
local _, class = UnitClass("player")
		if (class == "PALADIN") then
			self.HolyPower = CreateFrame("Frame", nil, self)
			self.HolyPower:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, 1)
			self.HolyPower:SetSize(rwdth * PlayerScale/6 - 5, rht)
			self.HolyPower.anchor = ranchor
			self.HolyPower.growth = rgrwth
	
			for i = 1, 3 do					
				self.HolyPower[i]=CreateFrame("StatusBar", nil, self.HolyPower)
				self.HolyPower[i]:SetHeight(8)					
				self.HolyPower[i]:SetStatusBarTexture(bartex)
				self.HolyPower[i]:GetStatusBarTexture():SetHorizTile(false)
				self.HolyPower[i]:SetStatusBarColor(228/255,225/255,16/255)
			
			if i == 1 then
				self.HolyPower[i]:SetPoint("TOPLEFT", self.HolyPower, "TOPLEFT")
			else
				self.HolyPower[i]:SetPoint("RIGHT", self.HolyPower[i - 1], "LEFT", RxSpacing, RySpacing)
			end
			
			self.HolyPower[i].bg = self.HolyPower[i]:CreateTexture(nil, "BACKGROUND")
			self.HolyPower[i].bg:SetAllPoints(self.HolyPower[i])
			self.HolyPower[i].bg:SetTexture(bartex)
			self.HolyPower[i].bg.multiplier = .2
				
			self.HolyPower[i].bd = CreateFrame("Frame", nil, self.HolyPower[i])
			self.HolyPower[i].bd:SetPoint("TOPLEFT", self.HolyPower[i], "TOPLEFT", 0, 0)
			self.HolyPower[i].bd:SetPoint("BOTTOMRIGHT", self.HolyPower[i], "BOTTOMRIGHT", 0, 0)
			self.HolyPower[i].bd:SetFrameStrata("LOW")
			self.HolyPower[i].bd:SetBackdrop(backdrop)
			self.HolyPower[i].bd:SetBackdropColor(0, 0, 0, 1)
			self.HolyPower[i].bd:SetBackdropBorderColor(0, 0, 0)
		end
end
  Reply With Quote
09-06-10, 11:42 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Not sure it has been tested out properly, though you are welcome to do it
  Reply With Quote
09-07-10, 01:52 AM   #3
Broes
A Deviate Faerie Dragon
Join Date: Jul 2010
Posts: 11
I'll grab the latest commits later today and test it as well
  Reply With Quote
09-07-10, 03:15 AM   #4
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
I tested out the patch before submitting it, so I have seen it working. When adding support to my layout I created each holyRune as a texture rather than a status bar.

You example looks mostly fine, but I would make sure you set the width of each of your holyRunes, otherwise you will not see them...


------

just dry-coded this, but it might work...
Code:
	local _, class = UnitClass('player')

	if class == 'PALADIN' then
		local holyPower = CreateFrame('Frame', nil, self)
		holyPower:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -1)
		holyPower:SetSize(config.PRIMARYUNITWIDTH, config.SPACING)
		holyPower:SetBackdrop(config.BACKDROP)
		holyPower:SetBackdropColor(0, 0, 0)

		for i = 1, MAX_HOLY_POWER do
			local holyRune = holyPower:CreateTexture(nil, 'OVERLAY')
			holyRune:SetSize((config.PRIMARYUNITWIDTH / MAX_HOLY_POWER) - 1, config.SPACING)
			holyRune:SetTexture(1, 3 / 5, 0)

			if i > 1 then
				holyRune:SetPoint('LEFT', holyPower[i - 1], 'RIGHT', 1, 0)
			else
				holyRune:SetPoint('BOTTOMLEFT', holyPower, 'BOTTOMLEFT', 1, 0)
			end

			holyPower[i] = holyRune
		end

		self.HolyPower = holyPower
	end

Last edited by yj589794 : 09-07-10 at 03:37 AM. Reason: addition of example
  Reply With Quote
09-07-10, 04:46 AM   #5
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
It's working, I'm just retarded.... Thank you everyone! lol

edit - It ain't updating, anyway I can register it to an event? I did and I get no error but reloading or entering toon makes it to where it shows all three until i attack something to gain a holyrune

Last edited by Ferous : 09-07-10 at 04:51 AM.
  Reply With Quote
09-07-10, 06:16 AM   #6
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
The element should manage all the events and updating without the user having to specify anything extra.

The testing I did was on a pre-made paladin in holy spec:
  • Log into character and no holy runes were shown
  • cast Holy Shock and see that player has 1 holyRune displayed
  • cast Word of Glory and see that player no longer has any holyRunes
  • repeat casting Holy Shock and Word of Glory at multiple levels of holyRunes for consistancy
  • log out with some holyRunes and then log back in. No holyRunes displayed and on casting Holy Shock the player now has 1 holyRune

While this testing is not all encompassing, it should cover basic rune display.

Can you describe the steps you are trying to perform and your HolyPower code. I'll graft it into my layout tonight and try to repeat your tests.
  Reply With Quote
09-07-10, 07:06 AM   #7
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
When I log into my Paladin, it shows all three HolyRunes, as if I have all three active. But when I cast Crusader Strike, They all dissapear and only show one. It ain't updating though when I reload or log in and out, showing all three as if all three were active until I use Crusader Strike to refresh its 'display' so to speak.

Here is my code.

Code:
		local _, class = UnitClass("player")
		if class == "PALADIN" then
			self.HolyPower = CreateFrame("Frame", nil, self)
			self.HolyPower:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 1, rypos)
			self.HolyPower:SetSize(239 * PlayerScale/3 - 5, rht)
			self.HolyPower.anchor = ranchor
			self.HolyPower.growth = rgrwth
				
			for i = 1, 3 do
				self.HolyPower[i] = CreateFrame("StatusBar", nil, self.HolyPower)
				self.HolyPower[i]:SetStatusBarTexture(bartex)
				self.HolyPower[i]:SetSize(239 * PlayerScale/3 - 5, rht)
				self.HolyPower[i]:SetStatusBarColor(1,.95,.33)
	
				if i == 1 then
					self.HolyPower[i]:SetPoint("TOPLEFT", self.HolyPower, "TOPLEFT")
				else
					self.HolyPower[i]:SetPoint("RIGHT", self.HolyPower[i - 1], "LEFT", RxSpacing, RySpacing)
				end
				
				self.HolyPower[i].bg = self.HolyPower[i]:CreateTexture(nil, "BACKGROUND")
				self.HolyPower[i].bg:SetAllPoints(self.HolyPower[i])
				self.HolyPower[i].bg:SetTexture(bartex)
				self.HolyPower[i].bg.multiplier = .2
				self.HolyPower[i].bg:SetVertexColor(0.10, 0.10, 0.10)
				
				self.HolyPower[i].bd = CreateFrame("Frame", nil, self.HolyPower[i])
				self.HolyPower[i].bd:SetPoint("TOPLEFT", self.HolyPower[i], "TOPLEFT", 0, 0)
				self.HolyPower[i].bd:SetPoint("BOTTOMRIGHT", self.HolyPower[i], "BOTTOMRIGHT", 0, 0)
				self.HolyPower[i].bd:SetFrameStrata("LOW")
				self.HolyPower[i].bd:SetBackdrop(backdrop)
				self.HolyPower[i].bd:SetBackdropColor(0, 0, 0, 1)
				self.HolyPower[i].bd:SetBackdropBorderColor(0, 0, 0)
				
			end
		end
It works fine. When I go and attack something, it refreshes and tells me my real stacks of holypower, but when I reload or log out and back in, its showing all three possible holypower stacks instead of if I only had one previous to reloading the UI.
  Reply With Quote
09-07-10, 07:22 AM   #8
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
just a thought but do you directly spawn your unit frames, or do you use oUF:Factory?

If you directly spawn the unit frames then it may be an issue with the return value from UnitPower(unit, HOLY_POWER_INDEX) when called during the loading process.
  Reply With Quote
09-07-10, 07:25 AM   #9
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
I do use oUF:Factory
Code:
oUF:Factory(function(self)
     self:SetActiveStyle("Svelte")
	--==SPAWN POINTS==--
     self:Spawn('player'):SetPoint("CENTER", -220, -200)
	 self:Spawn('pet'):SetPoint("CENTER", -282, -230)
	 self:Spawn('target'):SetPoint("CENTER", 220, -200)
	 self:Spawn('targettarget'):SetPoint("CENTER", 282, -230)
	 self:Spawn('focus'):SetPoint("CENTER", -350, -100)
	 self:Spawn('focustarget'):SetPoint("CENTER", -350, -70)
end
edit - Maybe its a bug of some sort?
  Reply With Quote
09-07-10, 07:30 AM   #10
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
It does sound like the update may not running correctly on login. It'll have to wait for now though as I cannot do any testing until I finish work.
  Reply With Quote
09-07-10, 07:51 AM   #11
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
I opened a ticket over at Hastes oUF Git, just incase it is really a bug :O
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF and HolyPower


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