Thread Tools Display Modes
09-25-10, 02:09 PM   #1
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
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.
  Reply With Quote
09-27-10, 03:33 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Download 'oUF'
__________________
| 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 : 10-13-10 at 12:38 AM.
  Reply With Quote
09-27-10, 03:41 AM   #3
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by zork View Post
Could you post the changed license?
http://github.com/haste/oUF/commit/b...3e15fceb015647

It basically is what I tell people to treat the ARR license as. So there aren't exactly any changes.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-30-10, 06:29 PM   #4
Monolit
A Black Drake
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 81
Originally Posted by haste View Post
Current changes:

Known issues:
Hm, what about that issue with party/raid frames I told you about a week ago, where you get "sluggish" response from clicking on raid and party units.

It looks like some sort of problem with input handling for secure headers, though since you didn't list it maybe there's a workaround for that kind of behavior?
  Reply With Quote
09-30-10, 11:37 PM   #5
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I haven't been able to write a small test case on that yet, so I don't know if it's a general issue or something with oUF.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
10-01-10, 10:39 AM   #6
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
haste give me a hint. I currently stopped working on my layout because I thought 1.4.xx would be a version to go live with Cataclysm.

So I assume this is not the case?
__________________
| 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
10-01-10, 02:07 PM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by zork View Post
haste give me a hint. I currently stopped working on my layout because I thought 1.4.xx would be a version to go live with Cataclysm.

So I assume this is not the case?
The initial plan was to keep 1.4.x going a good while. There was some minor annoyances with 1.4.x that were reported shortly after it was pushed however, and I decided that I might as well break the API with Cataclysm coming.

The changes between 1.4.x and 1.5.x aren't exactly extensive on the surface, and they'll probably not get any worse than they currently are.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
10-01-10, 07:50 PM   #8
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
I'm not sure if this is a 1.5 error or just user error (more likely), but since I'm only developing on the beta I can't really compare to any earlier version.

However, I want my partyframes to be shown even when I'm in a raid. Thus I spawn them using this:

Code:
local party = self:SpawnHeader(nil, nil, 'party,raid',
          -- http://wowprogramming.com/docs/secure_template/Group_Headers
          -- Set header attributes
          "showRaid", true,
          "showParty", true,          
          "yOffset", -30
)
party:SetPoint("TOP", player, "BOTTOM", -20, -90)
This is pretty much based on the boilerplate for 1.4. However, when I have showRaid set to 'true', it creates the partyframe as a raidbutton and since I'm not doing any specific stylings to any raidframe it turns out all weird-looking. This was tested by adding solo to visibility and adding showPlayer = true and showSolo = true. But I first noticed it when I joined a party. I didn't want to file it as a bug because it's very possible I'm either doing it wrong or assuming it's going to work in another way then it really does.

Apologies if this should've gone in it's own thread or someplace else.

The elements for HolyPower and SoulShards works beautifully on the other hand, no problems at all so far. Only done limited testing on warlocks though. Incoming heals was working fine as well as far as I can tell.

Is there any reason why a ReadyCheck-element isn't included in oUF itself, instead of relying on a plugin? Seems like a default thing to have available on any unitframe in my humble opinion. Not bashing p3lims plugin, just curious. I spend five minutes trying to find something about it in the elements-folder before figuring it wasn't included.
__________________
Oh, the simulated horror!
  Reply With Quote
10-04-10, 01:16 PM   #9
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
I have an issue with portraits. On live, I'm setting an alpha and force it to update and set the camera position (0). Otherwise alpha and camera setting will "bug out". Aka alpha resets to 1 and stays @1. Camera resets to full body view (2, afaik).

Anyway, I fixed this with the following function (on live).
Code:
local Portrait_PostUpdate = function(Portrait, unit)
	if (not UnitExists(unit) or not UnitIsConnected(unit) or not UnitIsVisible(unit)) then
		Portrait:Hide()
	else
		Portrait:Show()
		Portrait:SetCamera(0)
		Portrait:SetAlpha(cfg.pAlpha)
	end
end
Code:
self.Portrait.PostUpdate = Portrait_PostUpdate
This works ace on live, but beta once again ****s it up.

I tried to set an alpha without using the function. Doesn't work at all
I tried to self.Portrait.Override = Portrait_PostUpdate. Which hides the frames that have a portrait, no lua error.

Some things to note:
Directly setting an alpha without the update function doesn't work, but it works with it - for player (model never changes, alpha stays the same) and initially also for the target, but no longer after the first switch. Which inditactes to me that it's called at least once, but not updated.

Long story short, what am I doing wrong?


Btw, I want to suggest for 1.5 to hide non existent portraits, instead of showing the question mark.
__________________
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
10-13-10, 01:28 PM   #10
Zilver
A Fallenroot Satyr
 
Zilver's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 29
CancelUnitBuff() tainted

Hi you all

Do we have anyway to create secure aura/buff/debuff buttons or are we locked out by Blizzard ?

Currently this is how I create my Auras buttons:
Code:
	do -- setup buffs and debuffs
		self.Auras = CreateFrame("Frame",nil,self);
		self.Auras:SetWidth(22*10); self.Auras:SetHeight(22*2);
		self.Auras:SetPoint("BOTTOMLEFT",self,"TOPLEFT",10,0);
		self.Auras:SetFrameStrata("BACKGROUND");
		self.Auras:SetFrameLevel(4);
		-- settings
		self.Auras.size = 20; self.Auras.spacing = 1;
		self.Auras.initialAnchor = "BOTTOMLEFT";
		self.Auras["growth-x"] = "RIGHT";
		self.Auras["growth-y"] = "UP";
		self.Auras.gap = true;
		self.Auras.numBuffs = 10;
		self.Auras.numDebuffs = 10;
		
		self.Auras.PostUpdate = PostUpdateAura;
	end
Anyone know a way to create em without taint?
  Reply With Quote
10-13-10, 01:30 PM   #11
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You need to use the SecureAuraHeader to create player auras. I haven't had time to look much into it yet. It's on my TODO heap somewhere however.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
10-13-10, 02:40 PM   #12
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
I used to set my frame sizes in a separate config file and inject them in the layout file with something like this:

Code:
self:SetAttribute('initial-height', cfg.heightR + cfg.NumbFS + cfg.PPyOffset + cfg.InfoOffset)
self:SetAttribute('initial-width', cfg.widthR)
While this is still possible with SetSize for single frames, it's not for header frames, due to the setSize/Width being a string?! Locals don't work, but can I somehow workaround it, to still be able to set frame sizes (for headers) via config?
__________________
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
10-13-10, 02:47 PM   #13
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Third example first post
__________________
「貴方は1人じゃないよ」
  Reply With Quote
10-13-10, 03:59 PM   #14
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Originally Posted by haste View Post
Third example first post
Meh, I'm blind. Thanks, works fine.
__________________
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
10-13-10, 03:52 PM   #15
Zilver
A Fallenroot Satyr
 
Zilver's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 29
Originally Posted by haste View Post
You need to use the SecureAuraHeader to create player auras. I haven't had time to look much into it yet. It's on my TODO heap somewhere however.
Thanks for the nudge in the right direction, I'll take a look at the path and report back what I find
  Reply With Quote

WoWInterface » 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