Thread Tools Display Modes
10-11-12, 11:15 AM   #1
Milkone
A Defias Bandit
Join Date: Oct 2012
Posts: 2
oUF Phanx Castbar

First off I want to thank you for your great work on oUF_Phanx.

I am a bit lost, I see that you are able to adjust the cast bar over or under the unitframe. I was wondering if you are able to move it to the right of the player frame and to the left of the target frame.

So it would be like

[Player Frame] [ Playercastbar ] [Target Frame]
-------------- [Targetcastbar]----------------
  Reply With Quote
10-11-12, 05:06 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
core.lua, after line 1166, add the 3 green lines:

Code:
		if unit == "player" then
			Castbar:ClearAllPoints()
			Castbar:SetPoint("BOTTOM", UIParent, "CENTER", 0, -100)
			Castbar:SetWidth(config.width)

			Castbar.SafeZone = Castbar:CreateTexture(nil, "BORDER")
core.lua, after line 1174 (line 1177 after the previous addition), add the 5 green lines:

Code:
		elseif (uconfig.width or 1) > 0.75 then
			if unit == "target" then
				Castbar:ClearAllPoints()
				Castbar:SetPoint("TOP", UIParent, "CENTER", 0, -112)
				Castbar:SetWidth(config.width)
			end

			Castbar.Text = ns.CreateFontString(Castbar, 16, "LEFT")
Not tested. If it doesn't work, post the actual error message you get from BugSack, or a screenshot if there is no error message but things are not in the right place.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-11-12, 05:31 PM   #3
Milkone
A Defias Bandit
Join Date: Oct 2012
Posts: 2
Worked great no errors. Thank you so much.
  Reply With Quote
10-26-12, 10:15 AM   #4
burnmaker
A Murloc Raider
Join Date: Nov 2008
Posts: 5
Its now


-------------- [Targetcastbar]----------------
-------------- [Playercastbar]----------------
[Player Frame] ---------------- [Target Frame]
  Reply With Quote
10-26-12, 05:27 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Are you asking how to make it look that way, or pointlessly saying that you changed it to look that way, or just posting something totally random for no reason?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-27-12, 07:53 PM   #6
burnmaker
A Murloc Raider
Join Date: Nov 2008
Posts: 5
Originally Posted by Phanx View Post
core.lua, after line 1166, add the 3 green lines:

Code:
		if unit == "player" then
			Castbar:ClearAllPoints()
			Castbar:SetPoint("BOTTOM", UIParent, "CENTER", 0, -100)
			Castbar:SetWidth(config.width)

			Castbar.SafeZone = Castbar:CreateTexture(nil, "BORDER")
core.lua, after line 1174 (line 1177 after the previous addition), add the 5 green lines:

Code:
		elseif (uconfig.width or 1) > 0.75 then
			if unit == "target" then
				Castbar:ClearAllPoints()
				Castbar:SetPoint("TOP", UIParent, "CENTER", 0, -112)
				Castbar:SetWidth(config.width)
			end

			Castbar.Text = ns.CreateFontString(Castbar, 16, "LEFT")
Not tested. If it doesn't work, post the actual error message you get from BugSack, or a screenshot if there is no error message but things are not in the right place.

This makes

-------------- [Targetcastbar]----------------
-------------- [Playercastbar]----------------
[Player Frame] ---------------- [Target Frame]

Not

[Player Frame] [ Playercastbar ] [Target Frame]
-------------- [Targetcastbar]----------------

sry
  Reply With Quote
10-28-12, 09:17 AM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The code in my post says:

1. Move the player castbar so that the middle of its bottom edge is 100 pixels below the center of the screen.

2. Move the target castbar so that the middle of its top edge is 112 pixels below the center of the screen.

Since 112 pixels below the center of the screen is further toward the bottom of the screen than 100 pixels, the top edge of the target castbar is 12 pixels further down the screen than the bottom edge of the player castbar.

If you are seeing something else, you probably pasted the code in the wrong place, or tried to change something and did it wrong. Just download a clean copy and try again. If it still doesn't look right, post a screenshot and your modified core.lua file.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-28-12, 05:23 PM   #8
burnmaker
A Murloc Raider
Join Date: Nov 2008
Posts: 5
Originally Posted by Phanx View Post
The code in my post says:

1. Move the player castbar so that the middle of its bottom edge is 100 pixels below the center of the screen.

2. Move the target castbar so that the middle of its top edge is 112 pixels below the center of the screen.

Since 112 pixels below the center of the screen is further toward the bottom of the screen than 100 pixels, the top edge of the target castbar is 12 pixels further down the screen than the bottom edge of the player castbar.

If you are seeing something else, you probably pasted the code in the wrong place, or tried to change something and did it wrong. Just download a clean copy and try again. If it still doesn't look right, post a screenshot and your modified core.lua file.
Here it is
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_102912_001604.jpg
Views:	992
Size:	614.6 KB
ID:	7327  
Attached Files
File Type: lua core.lua (43.8 KB, 544 views)
  Reply With Quote
10-28-12, 06:45 PM   #9
Ekaterina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 65
Burn,
You just need to adjust the set point a little.

The SetPoint api works like this: Part of the frame you are anchoring from ie Castbar; the frame you are anchoring to ie UI Parent; part of the frame you are anchoring the part of the frame you are anchoring from to ie Center; horizontal offset; vertical offset.

From what I understand of your reqest you should just be able to do the below, but you will need to either move the unit frames a little further apart or change the size of the cast bar.

If you wish to move the frames either ouf:Movable frames or edit the point value in the config for player and target.

Lua Code:
  1. if unit == "player" then
  2.             [color=palegreen]Castbar:ClearAllPoints()[/color]
  3. [color=palegreen]            Castbar:SetPoint("BOTTOM", UIParent, "CENTER", 0, -230)[/color]
  4. [color=palegreen]            Castbar:SetWidth(config.width)[/color]
  5.  
  6.             Castbar.SafeZone = Castbar:CreateTexture(nil, "BORDER")


Lua Code:
  1. elseif (uconfig.width or 1) > 0.75 then
  2. [color=palegreen] if unit == "target" then[/color]
  3. [color=palegreen] Castbar:ClearAllPoints()[/color]
  4. [color=palegreen] Castbar:SetPoint("TOP", UIParent, "CENTER", 0, -232)[/color]
  5. [color=palegreen] Castbar:SetWidth(config.width)[/color]
  6. [color=palegreen] end[/color]
  7.  
  8. Castbar.Text = ns.CreateFontString(Castbar, 16, "LEFT")

I hope I've understood your request correctly and not confused you.

Ekat
  Reply With Quote
10-28-12, 09:37 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by burnmaker View Post
Here it is
Okay, I see the problem. There are actually two problems.

1. You are confusing the player/target castbars. In your own screenshot, the player castbar is the one on top with time text, and the target castbar is the one on the bottom with the name shown.

2. I was looking at the wrong coordinate when I wrote that code, and based the castbar position on the frame X position, not the frame Y position. Here are the correct castbar coordinates, also adjusted to take into account the extra width of the icon, and made taller to match the full height of the player/target unit frames:

Code:
		if unit == "player" then
			Castbar:ClearAllPoints()
			Castbar:SetPoint("BOTTOM", UIParent, "CENTER", 0.5 * height, -230)
			Castbar:SetWidth(config.width)
			Castbar:SetHeight(config.height)
Code:
		elseif (uconfig.width or 1) > 0.75 then
			if unit == "target" then
				Castbar:ClearAllPoints()
				Castbar:SetPoint("TOP", UIParent, "CENTER", 0.5 * height, -242)
				Castbar:SetWidth(config.width)
				Castbar:SetHeight(config.height)
			end
You will also, as Ekaterina said, need to either move the frames further apart using oUF_MovableFrames or by editing the coodrinates in config.lua:

Code:
ns.uconfig = {
	player = {
		point = "BOTTOMRIGHT UIParent CENTER -146 -230",
		power = true,
		castbar = true,
	},
	...
	target = {
		point = "BOTTOMLEFT UIParent CENTER 146 -230",
		power = true,
		castbar = true,
	},
Adjust the X values in the uconfig section as desired.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 10-28-12 at 10:24 PM.
  Reply With Quote
07-11-13, 09:00 AM   #11
Mamantz
A Defias Bandit
Join Date: Jul 2013
Posts: 2
Phanx great layout! Trying to make it a bit more friendly for myself (i mostly pvp). Would it be simple to add cast bar to my focus target?
  Reply With Quote
07-15-13, 07:45 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Just add the castbar = true line you see in other unit seconds of the uconfig table to the focus section.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF Phanx Castbar

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