Thread Tools Display Modes
06-28-10, 11:24 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
oUF tutorial layout for oUF 1.5

oUF_Simple, a oUF 1.5 tutorial layout.

HOW TO USE
In this tutorial I'm showing you step by step how I wrote the following layout. You can follow the steps by checking each Googlecode link under each step. You can even highlight the differences from each step to another by clicking on DIFF at the Googlecode pages. Try to analyse what I'm doing. Copy the code and try to edit it. Reload your UI and see what happens. This way you will gain knowledge on how to write your own oUF layout.

FINAL CODE
http://code.google.com/p/rothui/sour...unk/oUF_Simple for oUF 1.4.x
http://code.google.com/p/rothui/sour...nk/oUF_Simple2 for oUF 1.5.x

DOWNLOAD
http://www.wowinterface.com/download...oUFSimple.html

MAJOR FILES
- config
- lib (functions)
- core (layout)
- tags

The TOC-file calls the 3 LUA-files in the following order: config, library and core.
The config is the first file to be called. It can contains all your config variables. All the config variables will be saved in the namespace object (ns).
Next file is the library. It contains all the function that will be used by your layout files. Currently there is only one layout file (core.lua) but you could have more of them like party.lua, raid.lua and so on.
The last file is the core.lua which registers the styles and activates different styles for each unit.

FEATURES
- how to do outer glow with using SetBackDrop
- frames are moveable with SHIFT+ALT+DRAG
- spawns player/target and shows how you can copy the style function for any other unit you want to spawn
- how to add strings to frames
- how to apply color to self.Health and self.Power
- how to work with the namespace object (ns)

DEVELOPMENT STEPS
If you want to follow the development steps check out the links and click on DIFF!

1) Initial release with some basic files
http://code.google.com/p/rothui/source/detail?r=503




2) Some error fixes
http://code.google.com/p/rothui/source/detail?r=504
http://code.google.com/p/rothui/source/detail?r=505


3) Added focus and pet frame
http://code.google.com/p/rothui/source/detail?r=506




4) Added targettarget frame
http://code.google.com/p/rothui/source/detail?r=507




5) Added portraits and castbar and new statusbar texture (bling bling!)
http://code.google.com/p/rothui/source/detail?r=508
http://code.google.com/p/rothui/source/detail?r=509



6) Added aura icons, party and right-click menu
http://code.google.com/p/rothui/source/detail?r=510



7) Added a raid layout

http://code.google.com/p/rothui/source/detail?r=512

-------------------------------------------------

New version: oUF_Simple2 !!!

-------------------------------------------------

8) Update for oUF 1.5.x
Initial release with the files of the 1.4.x layout. What changed is the init function. It is not allowed to use init-width, height and scale anymore.
http://code.google.com/p/rothui/source/detail?r=718

9) Raid, oUF_MovableFrames and more
- now supports oUF_MovableFrames
- added raid frames
- 3 different raidframes are spawned depending on raid size to show how to do it and to have the opportunity to scale each raid individually with oUF_MovableFrames
- moved the init function to the core and splitted it into initHeader and init. (Unit spawned under header must be handled specially)
- removed the default movabilty, only castbars for player and target have the move function now (to make them dragable)
- new menu function (updated for cataclysm and removed focus selection from menu)
- added 3 attributes to the self object: hidename, hptag and nametag. Once those are given the text strings will be handled different. (Thus you can use specific tags just for one style or hide the name in anothers etc.)

http://code.google.com/p/rothui/source/detail?r=719

10) how to add personal tags
http://code.google.com/p/rothui/source/detail?r=720



11) How to add a module (oUF_DebuffHighlight in this case)
http://code.google.com/p/rothui/source/detail?r=721



12) How to add threat coloring



http://code.google.com/p/rothui/source/detail?r=723

13) Enhanced config

Adding more values to the config and using them in the spawn and style functions.

http://code.google.com/p/rothui/source/detail?r=724

.
.
__________________
| 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 : 05-19-11 at 01:38 PM.
  Reply With Quote
05-16-11, 01:28 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Updated for oUF 1.5.

http://www.wowinterface.com/download...o.php?id=14831

- Party/raid will be added in the next days.
- Creating personal TAGs will be added aswell.

*udate*

Ok so update is there.

- now supports oUF_MovableFrames
- added raid frames
- 3 different raidframes are spawned depending on raid size to show how to do it and to have the opportunity to scale each raid individually with oUF_MovableFrames
- moved the init function to the core and splitted it into initHeader and init. (Unit spawned under header must be handled specially)
- removed the default movabilty, only castbars for player and target have the move function now (to make them dragable)
- new menu function (updated for cataclysm and removed focus selection from menu)
- added 3 attributes to the self object: hidename, hptag and nametag. Once those are given the text strings will be handled different. (Thus you can use specific tags just for one style or hide the name in anothers etc.)

http://code.google.com/p/rothui/source/detail?r=719

Next step:
- create your own tags
- move width/height to the config
- make a small config for each unit
__________________
| 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 : 05-18-11 at 01:57 AM.
  Reply With Quote
05-18-11, 12:05 PM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
tag-system added
http://code.google.com/p/rothui/source/detail?r=720



How to add a module
http://code.google.com/p/rothui/source/detail?r=721

__________________
| 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 : 05-18-11 at 12:46 PM.
  Reply With Quote
05-18-11, 12:50 PM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by zork View Post
- now supports oUF_MovableFrames
Did you have to do anything at all? The general idea is that it should just, work :P.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
05-18-11, 01:54 PM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I had my own move function at first. Removed the calls for that on everything except player/target castbars.

Added threat coloring



http://code.google.com/p/rothui/source/detail?r=723
__________________
| 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
05-21-11, 10:41 AM   #6
Carbo
A Murloc Raider
Join Date: Oct 2010
Posts: 7
Roles

Is there a way we can add role icons?
  Reply With Quote
06-15-11, 11:41 PM   #7
dreamcatcher
A Black Drake
 
dreamcatcher's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2010
Posts: 82
It says this is a tutorial layout, but I don't see any read me file explaining how to make a layout, add tags, or elements. All it is a layout already done for you.

Are you going to add some explanations so we that are new to oUF can learn how to make a layout?

Or is this for ones that already know oUF code and they can just add or remove parts of your layout?

I'm completely new to oUF and would love to learn how to make a layout. I have been taking looks at others and removing things I don't want and trying to make it more simple. But I can't find any info on how to add elements. I only want one core file and a element folder with the plug-ins. I don't like to have a addon that has 5+ lua files and a bunch of other plug-ins I have to select enable in the addon manager.
  Reply With Quote
06-16-11, 08:21 AM   #8
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Hm, I do get your point, but I think you didn't put enough effort into your approach.

First of all: Here you can see every little step. You may also view the diffs between the files, so you can easily see, how the code is modified to add certain elements.

Second:
No, this is no tutorial. You see a good programmer with good style creating a layout and indeed, you can learn a lot of him doing this stuff. But it's no howto in the sense of "Oh, let's create a health-bar... Now create a portrait... Let's create raid icons now..."

Third:
But I can't find any info on how to add elements. I only want one core file and a element folder with the plug-ins. I don't like to have a addon that has 5+ lua files and a bunch of other plug-ins I have to select enable in the addon manager.
You should not do it that way. Really, to me, the charme of oUF (as whole architecture) is, that I can specifically choose, which plugins I do activate on which toon (as user) and which plugin I want to support in my layout (layout creator).
You should not "put everything together". You're just cutting your own possibilities of module-usage, which allows you better control of "what is loaded in which case".


If there is really a need for a "layout-creation-howto", let's say from Photoshop to the final product, I would be able to put something together this weekend.
But there should be more than one reader, to be honest.
__________________
  Reply With Quote
06-16-11, 12:09 PM   #9
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
The guides intends that you follow the diffs while creating the layout step by step. You can check the diffs to see what changed. Each step is for a specific topic.

Combine that with
http://www.wowwiki.com/World_of_Warcraft_API
http://wowprogramming.com/docs/api
https://github.com/haste/oUF/wiki/

And you are set to go.

Go to the next step once you have understood the current step. Try out code. Comment out stuff and see what happens.

"/reload" is your friend.
__________________
| 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
06-16-11, 05:01 PM   #10
dreamcatcher
A Black Drake
 
dreamcatcher's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2010
Posts: 82
Ok I understand a little better thank you both for your reply.

Good work Zork.

One question the plug in for rep and experience bar how do I get it to work? I have it installed but it dos not show up.

This is one example on not knowing how to add elements / plugins to my layout.

I guise I'm not good at understanding this stuff, but I don't want to give up.
  Reply With Quote
06-28-10, 01:49 PM   #11
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Nice work.

I wouldn't use another file for libs, though. But that's just me.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
06-28-10, 02:38 PM   #12
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Makes sense when you are going to have different lua files for raid and party and all the other units.
__________________
| 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
06-28-10, 02:46 PM   #13
Politig
A Chromatic Dragonspawn
AddOn Compiler - Click to view compilations
Join Date: May 2009
Posts: 176
Originally Posted by zork View Post
Makes sense when you are going to have different lua files for raid and party and all the other units.
So let me get this straight: This is a beginner's tool for create oUF frames with oUF 1.4?

...Sweet
  Reply With Quote
06-28-10, 04:07 PM   #14
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Originally Posted by zork View Post
Makes sense when you are going to have different lua files for raid and party and all the other units.
Yeah, that's right. I didn't think of that.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
06-28-10, 05:30 PM   #15
xandora
A Chromatic Dragonspawn
 
xandora's Avatar
Join Date: Feb 2009
Posts: 188
Can you edit oUF layouts while WoW is open and then reloadui to see instant changes?
__________________

Last edited by xandora : 06-28-10 at 05:47 PM. Reason: Spellllllllllllllling
  Reply With Quote
06-28-10, 05:54 PM   #16
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by xandora View Post
Can you edit oUF layouts while WoW is open and then reloadui to see instant changes?
As long its not file remove/rename/add and toc changes, then yes.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF tutorial layout for oUF 1.4


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