Thread Tools Display Modes
11-27-10, 11:53 PM   #1
Zanaken
A Deviate Faerie Dragon
Join Date: Apr 2009
Posts: 12
Question oUF Smooth support

So how exactly would a LUA novice like me go about adding oUF smooth update support for my first oUF layout (drk)?

I've looked though the LUA files and frankly have no idea what code to insert where, can someone point me in the right direction please?
  Reply With Quote
11-28-10, 05:55 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
self.Health.smooth = true
self.Power.smooth = true

Add that once after the self.Health and self.Power elements have been created.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
11-28-10, 01:23 PM   #3
Zanaken
A Deviate Faerie Dragon
Join Date: Apr 2009
Posts: 12
Originally Posted by zork View Post
self.Health.smooth = true
self.Power.smooth = true

Add that once after the self.Health and self.Power elements have been created.
Copy - Paste - /rl

I must have inserted it into about a thousand places that look like they generate the bars. Every time I do a /rl the unit frames just disappear. I wasn't lying about being a novice btw, the most I have done with LUA is usually stripping code away rather than finding a place for it. Even then it's just roughly guessing what lines do what I don't want happening and removing them (butcher style)

I have been applying the code you gave me to several places in the LUA files "lib" and "core". I assume I have to add it to the actual DRK version of oUF, rather than the oUF addon itself?
  Reply With Quote
11-28-10, 06:43 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You would add that in the layout, not in the oUF core addon. oUF itself does not create any bars, or even any frames. It merely provides an engine for layouts to use to create stuff. You would also only want to add it once in the layout. Find where the layout creates the health bar; it should look something like this:

Code:
self.Health = CreateFrame("StatusBar", nil, self)
or

Code:
local hp = CreateFrame("StatusBar", nil, self)
...
self.Health = hp
Immediately after self.Health is defined, add, on a new line:

Code:
self.Health.Smooth = true
(Note that "Smooth" is capitalized.)

Do the same for self.Power.
  Reply With Quote
11-28-10, 08:14 PM   #5
Zanaken
A Deviate Faerie Dragon
Join Date: Apr 2009
Posts: 12
Code:
  --gen powerbar func
  lib.gen_ppbar = function(f)
    --statusbar
    local s = CreateFrame("StatusBar", nil, f)
    s:SetStatusBarTexture(cfg.powerbar_texture)
	s:GetStatusBarTexture():SetHorizTile(true)
	s:SetHeight(retVal(f,15,5,3))
    s:SetWidth(f:GetWidth())
    s:SetPoint("BOTTOM",f,"BOTTOM",0,0)
    --helper
	if f.mystyle == "target" or f.mystyle == "player" then
		local h = CreateFrame("Frame", nil, s)
		h:SetFrameLevel(0)
		h:SetPoint("TOPLEFT",-5,5)
		h:SetPoint("BOTTOMRIGHT",5,-5)
		lib.gen_backdrop(h)
	end
    --bg
    local b = s:CreateTexture(nil, "BACKGROUND")
    b:SetTexture(cfg.powerbar_texture)
    b:SetAllPoints(s)
    f.Power = s
    f.Power.bg = b
  end
Is the best I found (Power is my prio right now) and that did nothing - By the way on my earlier point, I save the file and revert the changes if the /rl didn't work ^^ I haven't got hundreds pasted over the code.

So far I have managed to remove the combo points, change the font, and the cast bar positions, and I feel great for it. The smooth update will be the death of me however, I searched all the LUA files for the types of code you mentioned and just couldn't find it

My initial plan was to get this "easy" one done and try and get combat text working, but it seem I have fallen flat on my face at the first learning curve...

What's the point... I feel I should be learning more about LUA code, the code I pulled up above probably has something to do with the colour of the target debuffs knowing my luck

Last edited by Zanaken : 11-28-10 at 08:17 PM.
  Reply With Quote
11-29-10, 01:56 AM   #6
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Your example has it. Look out for ".Health" and ".Power"

Code:
f.Power = s
make it
Code:
f.Power = s
f.Power.smooth = true
"s" is a statusbar object
"f" is your self object (the unitframeobject like playerframe)

so f.Power is the power statusbar of your unitframe.

".Health" will be in sth like lib.gen_hpbar or sth. alike
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 11-29-10 at 01:58 AM.
  Reply With Quote
11-29-10, 09:51 AM   #7
Zanaken
A Deviate Faerie Dragon
Join Date: Apr 2009
Posts: 12
Originally Posted by zork View Post
Your example has it. Look out for ".Health" and ".Power"

Code:
f.Power = s
make it
Code:
f.Power = s
f.Power.smooth = true
"s" is a statusbar object
"f" is your self object (the unitframeobject like playerframe)

so f.Power is the power statusbar of your unitframe.

".Health" will be in sth like lib.gen_hpbar or sth. alike
I made those changes exactly but it still wont work

Am I right in thinking that the oUF smooth update addon has to be put in my addons folder and not my oUF_drk folder? I also tried to capitalise the word smooth in the line of code in both HP and Power. The only thing I can say is unlike other changes this one doesn't break the unit frames on /rl, however the updates are still jumping about 22 energy at a time instead of filling smoothly.
  Reply With Quote
11-29-10, 12:00 PM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
oUF_Smooth is a seperate addon unless you embedd it into your layout. So you need to put it in your addons folder. Make sure you update the TOC file or chosse "load out of date addons".
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
11-29-10, 03:31 PM   #9
Zanaken
A Deviate Faerie Dragon
Join Date: Apr 2009
Posts: 12
Aye, that's what I already did, but the lines you suggested did nothing I'm afraid It's near on impossible for me to use this layout as a rogue otherwise, energy coming in ticks means I can't predict when to pool energy and when I am about to cap.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF Smooth support


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