Thread Tools Display Modes
11-01-10, 10:43 PM   #1
Yooya
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 20
A few questions on oUF (Power/Resource/Cast)

I downloaded oUF Ph3lim and am trying to modify it too me. So far I have all the frames positioned and added auras to the player frame. My questions are as follows:
  1. The power bar appears to be attached to the Health bar and I can't find anyway of independently controlling it. I would like to separate the power bar as well as make it a bit larger in height.
  2. Holy Power, Shards, etc... Do not seem to be included in Ph3lim's oUF. Is there some magical formula that I could add to Ph3lim's oUF to get these resource systems?
  3. Last, but most definitely not least, I would like to add a cast bar to my player/target/focus frames. I would also like too add an icon beside it to clearly identify the spell.
I imagine these questions have been brought up many times. Believe me I did search but I couldn't find anything specific enough to get it running myself. So I ask you to bear with me; this really is my first attempt at even using an oUF. If some generous soul is willing to help me along it would be much appreciated.

Here is an image of what I'm hoping the final outcome to be.
  Reply With Quote
11-02-10, 02:51 AM   #2
Yooya
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 20
I was able to get holy power in text through tags. Not exactly what I wanted but I would be content with it. However, cast bars still elude me. I've looked through various oUFs and have yet to been able to reproduce even the most basic cast bar. The cast bar is my key issue; I can live with rest as it looks good as is, I'm content, but a cast bar a bare necessity. Not to mention it completes the look.

Thanks beforehand to anyone who helps me out.

Last edited by Yooya : 11-02-10 at 02:58 AM.
  Reply With Quote
11-03-10, 12:07 AM   #3
Yooya
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 20
Well no one has been able to help me yet. I did manage to figure somethings out for myself though. I got the Holy Power, and Cast Bar working fine.

I think maybe if I only ask for one thing and give some code it might help. Its not expertly formatted, or written, but hopefully it will be enough. So what I'm looking to do is put a 1 pixel thick border around the cast bar icon. It sounds simple, and maybe it is, but I've tried plenty things to get it done and just haven't had any luck.

buffs.PostCreateIcon = PostCreateAura

This seems to do it for buffs but I tried changing buff to Icon and it didn't do a thing. There is probably something I'm missing and I will keep trying, but if someone could just save me a lot of time its much appreciated.

Code:
		
local Castbar = CreateFrame("StatusBar", nil, self)
	Castbar:SetStatusBarTexture(TEXTURE)
	Castbar:SetStatusBarColor(1/6, 1/6, 2/7)
	Castbar:SetSize(230, 12)
	Castbar:SetPoint('TOP', self, 0, 16)
	Castbar:SetPoint('LEFT', self, 0, 16)
	Castbar:SetPoint('RIGHT', self, 0, 16)
			
	Castbar:SetBackdrop(BACKDROP)
	Castbar:SetBackdropColor(0, 0, 0)

local Icon = Castbar:CreateTexture(nil, "OVERLAY")
	Icon:SetSize(20, 20)
	Icon:SetPoint("TOPRIGHT", self, "TOPRIGHT", 25, 0)

local Time = Castbar:CreateFontString(nil, "OVERLAY")
	Time:SetPoint("RIGHT", Castbar)
	Time:SetFont(FONT, 8, 'OUTLINEMONOCHROME')

local Text = Castbar:CreateFontString(nil, "OVERLAY")
	Text:SetPoint("LEFT", Castbar, 2, 0)
	Text:SetFont(FONT, 8, 'OUTLINEMONOCHROME')

self.Castbar = Castbar
self.Castbar.bg = Background
self.Castbar.Icon = Icon
self.Castbar.Time = Time
self.Castbar.Text = Text
  Reply With Quote
11-03-10, 02:14 AM   #4
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
I don't see where your trying to apply a border to the icon in that code. Do you want "BACKDROP" to be the border? If so, you need to create a dummy frame and set a backdrop to it.

Code:
local Castbar = CreateFrame("StatusBar", nil, self)
	Castbar:SetStatusBarTexture(TEXTURE)
	Castbar:SetStatusBarColor(1/6, 1/6, 2/7)
	Castbar:SetSize(230, 12)
	Castbar:SetPoint('TOP', self, 0, 16)
	Castbar:SetPoint('LEFT', self, 0, 16)
	Castbar:SetPoint('RIGHT', self, 0, 16)
			
	Castbar:SetBackdrop(BACKDROP)
	Castbar:SetBackdropColor(0, 0, 0)

local Icon = Castbar:CreateTexture(nil, "OVERLAY")
	Icon:SetSize(20, 20)
	Icon:SetPoint("TOPRIGHT", self, "TOPRIGHT", 25, 0)

local IconBackdrop = CreateFrame("Frame", nil, Castbar)
        IconBackdrop:SetAllPoints(Icon)
        IconBackdrop:SetFrameStrata("LOW")
        IconBackdrop:SetBackdrop(BACKDROP)
        IconBackdrop:SetBackdropColor(0, 0, 0)
        IconBackdrop:SetBackdropBorderColor(0, 0, 0)

local Time = Castbar:CreateFontString(nil, "OVERLAY")
	Time:SetPoint("RIGHT", Castbar)
	Time:SetFont(FONT, 8, 'OUTLINEMONOCHROME')

local Text = Castbar:CreateFontString(nil, "OVERLAY")
	Text:SetPoint("LEFT", Castbar, 2, 0)
	Text:SetFont(FONT, 8, 'OUTLINEMONOCHROME')

self.Castbar = Castbar
self.Castbar.bg = Background
self.Castbar.Icon = Icon
self.Castbar.Time = Time
self.Castbar.Text = Text
  Reply With Quote
11-03-10, 02:30 AM   #5
Yooya
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 20
I didn't try anywhere in that code to apply a border/backdrop. I couldn't get anything that worked (it would just prevent the unit frames from loading) so I removed it.

Thank you very much for your help. It works, but its not exactly what I'm looking for. The rounded corners still show on top with a Backdrop frame. I'm looking for something I can put on top to cover the edges. I'm aware that its possible but not how to do it - at all.

A screen shot to reiterate what I'm trying to say:

http://img560.imageshack.us/img560/2...0310012813.jpg

The cast bar icon has the backdrop and the buffs are an example of what I want to achieve.
  Reply With Quote
11-03-10, 02:36 AM   #6
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
The default border on icons can be removed with SetTexCoord.

Code:
Icon:SetTexCoord(.1, .9, .1, .9)
  Reply With Quote
11-03-10, 02:40 AM   #7
Yooya
A Fallenroot Satyr
Join Date: Oct 2010
Posts: 20
Originally Posted by Freebaser View Post
The default border on icons can be removed with SetTexCoord.

Code:
Icon:SetTexCoord(.1, .9, .1, .9)

Thank you. Really, a godsend. It works perfectly.
  Reply With Quote
11-03-10, 04:00 AM   #8
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
For castbar creation etc, you can find all the possible parts in castbar.lua located in the elements folder of oUF itself. Or on the wiki, evilpaul's been updating it, with samples of code.

My best recommendation is to check a few addons how they implemented what you want. But based on the image you've supplied, it shouldn't be too hard.
Although I have to admit, - and this isn't in oUF but in a plugin - I can't get my totems to show up exactly as I wanted them, but this is due to my positioning.

If you have extra questions, throw em at us If someone knows a hint or even an answer, they'll post it. We don't bite *much*

Also : put your entire layout in a pastey, that generally helps to get an issue tracked down or a solution to what you can't find
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » A few questions on oUF (Power/Resource/Cast)


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