Thread: The 1.4 list
View Single Post
01-11-10, 03:02 AM   #1
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
The 1.4 list

I currently have quite a few changes I want to push out in oUF, but I've been holding them back as it will break quite a few APIs however. Most of these changes are in the form of:
- Incorrectly named functions (ie. :PreAuraSetPosition).
- Every single element hook resides with a "generic" name in the object namespace. (ie. :SetAuraPosition).

The basic idea with 1.4 is to clean up all of this, while reviewing some other parts of oUF. The reason I'm publishing this right now is to give people the possibility to chip in regarding what they find frustrating/will find frustrating.

Core
:Spawn(unit, name, template, disableBlizz)
I don't like how the current spawn works. What should be done is moving disableBlizz into it's own function and removing template. The arguments should be changed into: unit, name, showParty, showRaid. Where showParty/showRaid act true to their name.

A quick example would be having showParty set til true and showRaid set to nil/false. This would make the frame only show when you aren't in a raid.

:DisableBlizzard(unit)
Supplement as disableBlizz will be removed from :Spawn. The question is really if it still should be automatically called from :Spawn.

What I mean with <element>PostCreateIcon is basically:
self.Buffs.PostCreateIcon = function() end

The following is pretty much just renaming/moving of functions.

Aura
:PostCreateAuraIcon -> <element>PostCreateIcon
:CreateAuraIcon -> <element>CreateIcon
:CustomAuraFilter -> <element>CustomFilter
:PostUpdateAuraIcon -> <element>PostUpdateIcon
:PreUpdateAura -> <element>PreUpdate
:PreAuraSetPosition -> <element>PreSetPosition
:SetAuraPosition -> <element>SetPosition
:PostUpdateAura -> <element>PostUpdate

This allows us to define custom functions to all of these on all of the aura elements we use. With the current solution we have to check if we're on self.Auras or self.Buffs or self.Debuffs. It also helps the entire API to be consistent (or at least more consistent).

Castbar
:PostCastStart -> <element>PostCastStart
:PostCastFailed -> <element>PostCastFailed
:PostCastInterrupted -> <element>PostCastInterrupted
:PostCastDelayed -> <element>PostCastDelayed
:PostCastStop -> <element>PostCastStop
:PostChannelStart -> <element>PostChannelStart
:PostChannelUpdate -> <element>PostChannelUpdate
:PostChannelStop -> <element>PostChannelStop
.OnCastbarUpdate -> <element>OnUpdate

Happiness
:PostUpdateHappiness -> <element>PostUpdate

Health
:PreUpdateHealth -> <element>PreUpdate
:OverrideUpdateHealth -> <element>Update
:PostUpdateHealth -> <element>PostUpdate

Portraits
:PreUpdatePortrait -> <element>PreUpdate
:PostUpdatePortrait -> <element>PostUpdate

Power
:PreUpdatePower -> <element>PreUpdate
:OverrideUpdatePower -> <element>Update
:PostUpdatePower -> <element>PostUpdate

Threat
:PreUpdateThreat -> <element>PreUpdate
:OverrideUpdateThreat -> <element>Update
:PostUpdateThreat -> <element>PostUpdate

Runes
The current version of the rune element uses the following unneeded variables:
- height (required)
- width (required)
- spacing
- anchor
- growth

All of these are just used for positioning the bars initially. It's a one-time set-up and can be done from the layouts without requiring any extra effort from the layout authors.

{Pre,Post}Update arguments
The old behavior was defined as:
Lua Code:
  1. local PostUpdate = function(self, event, unit, arg1, arg2, arg3)
  2. end

I suggest changing this to:
Lua Code:
  1. local PostUpdate = function(element, unit, arg1, arg2, arg3)
  2. end
Just so it's said: You won't loose access to the main frame object. You can still access this through element:GetParent(). So conditional manipulation of other elements is still possible.

I'm dropping the event argument as it's pretty redundant for these functions.
_________________________________

I'm also pondering about removing most of the overrides, but that's pretty foggy right now.

There's also a need for some real documentation, but I'm not going to tackle that task alone :).

Revision history
3
- Added example on what are changes being made to the pre/post update functions.
2
- Added potential changes to the Runes element.
1
- Renamed OverrideUpdate to Update. It now acts as a full replacement to the internal Update function.
__________________
「貴方は1人じゃないよ」

Last edited by haste : 01-13-10 at 09:33 AM.
  Reply With Quote