Reply
 
Thread Tools Display Modes
Old 07-10-14, 05:45 PM   #1
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 6,892
6.0 UI Add-On Changes

Note: For a list of changes in previous patches, please see thread titled: UI Add-On Changes Compilation.

In a pre-Warlords of Draenor patch, there will be a number of updates and changes to functions that affect how User Interface Add-Ons will work. We're in the process of enabling Add-Ons in an upcoming build (TBD) for the Beta client that will allow UI Add-On authors will have a chance to test these changes out.

To help keep things organized, please specify the section you’re referencing when providing feedback.

Saving Keybinds/Macros/UI Settings

Saving keybinds/macros/UI settings has changed a little. Most of the changes were on the backend to make things more in-line with our current architecture.

The main is difference is we no longer compare local versions with the server versions of keybinds/macros/UI settings to determine which ones to load on the client. Instead, we have local CVars that toggle looking at local files or server files. All clients default to server side storage. If you don’t want that, you can change the following CVars to only look at local files instead.
“synchronizeConfig” [0/1] – defaults to 1 which will save character & account UI configurations (i.e. CVars) to the server.
“synchronizeBindings” [0/1] – defaults to 1 which will save character & account keybindings to the server.
“synchronizeMacros” [0/1] – defaults to 1 which will save character & account macros to the server.
“synchronizeSettings” [0/1] – defaults to 1 which will save all character & account information to the server (this is exactly like setting the previous three to 1 or 0).

Add-On Communications

Add-on communication is now available through custom chat channels.
SendAddonMessage() where Type is "CHANNEL", and target is the channel name.

KeyValues

To enable the creation of better self-contained templates that are easier to configure, (i.e. you don’t have to remember to override the OnLoad and call the original) we’re allowing both key and value types to be modified using “keyType” and “type” respectively. The default for both is “string”. Other available options are: string, boolean, number, global (where the value is looked up in the global table).

When we make templates that make use of this sort of option, we plan to add a commented out KeyValues section listing all available options so you don’t have to go digging through the code.

Example:
Code:
<Frame name="RoleButtonTemplate" virtual="true">
 <!-- Available options
 <KeyValues>
 <KeyValue key="role" value="tank"/>
 <KeyValue key="tooltip" value="TALENT_SPEC_TANK_TOOLTIP" type="global"/>
 <KeyValue key="roleID" value="1" type="number"/>
 </KeyValues>
 -->
 <OnLoad>
 self.Texture:SetTexture(GetTextureForRole(self.role));
 </OnLoad>

 <OnClick>
 DoSomethingWithRole(self.role);
 DoSomethingWithRoleID(self.roleID);
 </OnClick>

 <OnEnter>
 GameTooltip:SetText(self.tooltip);
 GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
 GameTooltip:Show();
 </OnEnter>

 <OnLeave function="GameTooltip_Hide"/>
</Frame>

<Frame name="TankButton" inherits="RoleButtonTemplate">
 <KeyValues>
 <KeyValue key="role" value="tank"/>
 <KeyValue key="tooltip" value="TALENT_SPEC_TANK_TOOLTIP" type="global"/>
 <KeyValue key="roleID" value="1" type="number"/>
 </KeyValues>
</Frame>

<Frame name="HealerButton" inherits="RoleButtonTemplate">
 <KeyValues>
 <KeyValue key="role" value="healer"/>
 <KeyValue key="tooltip" value="TALENT_SPEC_HEALER_TOOLTIP" type="global"/>
 <KeyValue key="roleID" value="2" type="number"/>
 </KeyValues>
</Frame>
Atlas

Atlases are textures with mappings onto standard textures that include normalized texture coordinates.
useAtlasSize - Use the actual pixel size of the sub-texture as the in-game rectangle size.
Example:
XML
Code:
<Texture atlas="_Garr_InfoBox-Top" horizTile="true" useAtlasSize="true">
 <Anchors>
 <Anchor point="TOPLEFT" y="7"/>
 <Anchor point="TOPRIGHT" y="7"/>
 </Anchors>
<!--This uses the top-left quarter of this atlas entry, not the top-left quarter of the whole texture-->
 <TexCoords left="0" right="0.5" top="0.0" bottom="0.5"/> 
</Texture>
Lua
Code:
filename, width, height, left, right, top, bottom, tilesHoriz, tilesVert = GetAtlasInfo("name")
someTexture:SetAtlas("_Garr_InfoBox-Top");
atlas = someTexture:GetAtlas()
New Timer System

There is a new timer system being added in. Documentation is available in C_TimerAugment.lua

Functions:
C_Timer.After(duration, callback) – Calls the callback cafter duration seconds.
timer = C_Timer.NewTimer(duration, callback) – Calls callback after duration seconds. This is more expensive than C_Timer.After, so this only should be used if you need it to be cancellable.
timer:Cancel() – Cancels a timer
ticker = C_Timer.NewTicket(duration, callback, iterations) – Calls callback every duration seconds (up to iterations times)
ticker:Cancel() – Cancels a ticker
Animation System

Animation system is receiving a few changes and various bug fixes.
Alpha animation has fromAlpha and toAlpha. This is a variant from just a change delta.
Scale animataion has fromScale and toScale.
childKey is the same as targetKey with automatically pre-pending “$parent.$parent.”
AnimGroups now have a “setToFinalAlpha” setting that will apply the animations final resulting alpha to all animating regions.
Reminder: To help keep things organized, please specify the section you’re referencing when providing feedback.


Source
Cairenn is offline   Reply With Quote
Old 07-12-14, 12:31 AM   #2
SDPhantom
A Molten Giant
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 941
Originally Posted by Cairenn View Post
ticker = C_Timer.NewTicket(duration, callback, iterations) – Calls callback every duration seconds (up to iterations times)
They fixed the typo on the source post. It's C_Timer.NewTicker() now.
__________________
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
SDPhantom is offline   Reply With Quote
Reply

Go BackWoWInterface » Site Forums » News » 6.0 UI Add-On Changes

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