Skip to content
Rainrider edited this page Apr 7, 2018 · 6 revisions

Introduction

This guide is for the beginner oUF layout creator. It aims to demostrate how to use oUF in a structured step-by-step way.

Prerequisites

  1. You are familiar with the Lua 5.1 basics (The Lua 5.1 Reference Manual).
  2. You know how to create a simple addon (Getting started with writing addons).
  3. Some knowledge in git is a plus (The Git Book).

If you are unfamiliar with the first two topics on this list, then this guide is not for you! Fill your gaps and come back later.

Knowing git might be helpful as it makes it possible to create separate branches for your changes and you can easily restore your local copy of the repository to a known good state if something goes wrong.

How to use this guide

The basic intent is for you to follow the commits from start to end and try to recreate them yourself. Feel free to change the code on the go to get a better understanding of how it works.

You can of course download oUF_Layout and try to customize it for your own needs if you think that this better suits the way you learn.

Installation

oUF_Layout is not meant for installation. You should rather recreate the layout yourself by following the commits. You have to install the dependencies separately as those are not embedded into the addon. Take a look at oUF_Layout.toc for a list of required and optional dependencies.

You should also install addons for capturing and displaying errors in-game. !BugGrabber and BugSack are a good choice.

If you however want to just install the layout and use it as is, you can download it here. Rename the extracted folder to oUF_Layout and copy/move it to your <WoW folder>\Interface\AddOns folder.

If you are using git, you can issue the following commands:

  1. cd <WoW folder>\Interface\AddOns
  2. git clone https://github.com/Rainrider/oUF_Layout.git

Debugging

AdiDebug has been added as an optionial dependency to aid in debugging. The Debug function is added to the addon's namespace and can be called like ns.Debug('prefix', 'message'), where 'prefix' is an optional string you could use for grouping messages, and 'message' is your debug output. It is a vararg function, so you can pass as many arguments to it as you wish. Objects and values passed to it will be coersed into their string representation.

Open AdiDebug by using the /ad or /adidebug slash commands and then select oUF_Layout from the dropdown menu to see your debug messages.

Code Structure

The code structure has evolved during the development of oUF_Layout. The current state is as follows:

  • assets - contains fonts and textures
  • elements - contains code for consuming oUF elements
  • elements\custom - contains implementation of custom oUF elements
  • units - contains the style functions for the different units divided by style type
  • fonts.xml - a XML font template
  • layout.lua - uses oUF:Factory to spawn and style the frames for all units by calling their respective style functions
  • settings.lua - the configuration file
  • utility.lua - contains some utility functions and auxiliary stuff

Visual Guide

Use this to compare your state to the one shown on the images. Please keep in mind that the screenshots were taken at the time of the corresponding commit. Errors or undescribed behaviour might occur if "outside code" (like oUF elements, third party addons or the WoW API) has changed since the commit has been made. Fixes for found problems are introduced in later commits. For some of the screenshots some internal oUF functions were temporary modified (not visible in the code) in order to get a better visual. Those are castbar (for the latency indicator), buffs, debuffs and stagger. Do not wonder if your results differ slightly.

Commit link Description Screenshot
0862c4 player and target frames' backdrop player and target
2b43c7 health bars healthbar
d0ad53 custom health colors health colors
0d7c7a powerbar powerbar
4d1103 portrait portrait
646484 castbar castbar
e54528 castbar text and time castbar text
ee1333 castbar custom time castbar time
d7ebd8 / b25f0c castbar interrupeted/failed castbar interrupted/interrupted
a15b54 castbar icon castbar icon
222dce deathknight runes runes
14b95f classpower classpower
2fb771 context menus context menus
b0ee1d unit tooltips tooltips
5a379c pet and focus pet and focus
628f97 focustarget and targettarget focustarget and targettarget
62017d castbar pet and focus castbar pet and focus
de6f82 aggro highlight aggro highlight
780d53 .. 135feb power and health text power and health text
a7d077 alt mana text altmana text
6d0f39 info text info text
986ac4 debuffs debuffs
9f2b77 buffs buffs
40cef0 auras auras
26997f power prediction power prediction
e3bdce totems totems
c11ff1 alternative power altpower
f46d0d stagger stagger
f1ee0f dispel highlight dispel
f0c5c2 artifact power artifact
62eee9 reputation reputation
efa247 experience experience
efa247 honor honor
30929b pvp indicator pvp
bc1f36 quest indicator quest
fe6e89 combat indicator combat
ddbc7d phase indicator quest

Getting Help

You can get help in the oUF section of the WoWInterface forums, but please keep the following in mind:

  • put some effort in answering your question yourself before asking others for help, and demonstrate this effort when asking the question
  • be able to show all your code
  • be receptive for feedback and suggestions
Clone this wiki locally