Thread Tools Display Modes
Prev Previous Post   Next Post Next
Unread 09-25-10, 02:09 PM   #1
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 979
API version 5: changes and discussion

Current changes:
- The license has been changed to MIT, from ARR.
- oUF:UpdateElement(name) has been removed. This function has been replaced with element:ForceUpdate().
- element:Update() has been renamed element:Override() to correctly reflect what it actually does.
- Elements no longer require element:GetParent() to return the oUF object. Elements now have a element.__owner which points towards self at enable.
- Support for cataclysm has been added.
- HealPredition element added.
- HolyPower element added.
- PhasingIcon element added.
- SoulShards element added.
- QuestIcon element added.
- EclipseBar element added.
- ReadyCheck element added.
- oUF automatic frame name generator has been improved. It will no longer generate names such as: oUF_LilyPartyParty.
- Elements no longer use the .Override function directly with the event system.
- Support for blank parent frames on headers.
- Added a third argument to the style function indicating if the frame was spawned from a header or not (isSingle).
- Minor optimizations of common tag paths.
- [defict:name] has been renamed [deficit:name].
- Added ['pereclipse'] tag.
- tagfs.overrideUnit has been added. It basically tells the tag system that it should feed the "real" unit to the tag function as a second argument.
- self.disallowVehicleSwap has been removed. Vehicle switching is now always enabled.
- Sub-objects now correctly have self.id set.

Known issues:
- Headers: Due to how RegisterAttributeDrive works on 4.0.x, clicking _can_ go void on frames. The solution to this is to use self:RegisterForClicks('AnyDown') instead of AnyUp. Another solution is to NOT use the visibility field in :SpawnHeader().
- Portraits: On header frames this will constantly reset their animation due to the bug mentioned above

Needs testing:
- All of the new elements require as much testing and input as possible.

Updating version 4 layouts to version 5:
- Any use of oUF:UpdateElements(name) needs to be changed to element:ForceUpdate().
- Any use of element.Update needs to be renamed element.Override.
- If you are checking for an automatically generated name in your style, then you might have to update this check.
- All usage of restricted functions on secure frames (self:Set{Width,Height,Size,Attribute} and a ton other) need to be split into two parts, one of headers and one of single spawns.
Code:
-- single units can be done within the style function:
local style = function(self, unit. isSingle)
-- 8<8<8<8<8<8<8<8<8<8<8<
    if(isSingle) then
        self:SetSize(width, height)
    end
-- >8>8>8>8>8>8>8>8>8>8>8
end

-- header units are slightly more annoying:
local party = self:SpawnHeader(
    nil, nil, 'party', 'showParty', true,
    'oUF-initialConfigFunction', [[
        -- unit can be nil here, and usually it will be: {raid,party}{,pet,target}
        local unit = ...
        -- Do note that this is an string, and you can't actually use locals like this:
        self:SetWidth(width)
        self:SetHeight(height)
    ]]
)

-- If you need local variables within oUF-initialConfigFunction, you can do:
    'oUF-initialConfigFunction', ([[
        -- unit can be nil here, and usually it will be: {raid,party}{,pet,target}
        local unit = ...
        -- Do note that this is an string, and you can't actually use locals like this:
        self:SetWidth(%d)
        self:SetHeight(%d)
    ]]):format(width, height)
__________________
「貴方は1人じゃないよ」

Last edited by haste : 10-12-10 at 12:48 PM.
haste is offline   Reply With Quote
 

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » API version 5: changes and discussion

Thread Tools
Display Modes

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