View Single Post
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