WowAce.com
Home
Addons
Authors
Forums
Knowledge base
Paste
Site issues
Sign in
Register new account
Skinner
Overview
Files
Pages
Repository
Localization
Subscriptions
Curse
How to skin an Addon with Skinner
r2
Source
Markup:
*
For the purposes of this document the addon is called '''MySkinnedAddon''' and it has one frame called '''MainFrame''' I recommend that you run WoW in windowed mode to make it easier to change the skin code and test it in WoW. ==Prerequisites== === Optional, but helpful === * [http://wow.curse.com/downloads/wow-addons/details/baddiel.aspx Baddiel] - used to find out Object names * [http://wow.curse.com/downloads/wow-addons/details/omnibus.aspx Omnibus] - used to test some commands * Blizzard's Editing UI - used to adjust object placement etc. An updated version for WotLK can be found [http://github.com/jncl/editingui/tree/master here] === Necessary === * Skinner * The Addon you want to skin * A Text Editor, preferably one that has Lua syntax highlighting ==Actions== # Load WoW and make sure both Skinner and '''MySkinnedAddon''' are working properly. This can save a lot of time debugging the skin code. # If you want to use Baddiel to generate some of the code for you then refer to the section [[#How to use Baddiel to help skin an Addon]] . # Enter the following slash commands to turn on Warnings and Errors for Skinner <pre>/Skinner errors<br>/Skinner warnings</pre> # Close WoW # Open the Skinner directory in the Editor and do the following: ## Edit the <u>skins.xml</u> file and add a line in the alphabetical sequence of skins for the Addon you are skinning. e.g.<pre>SkinMe/MySkinnedAddon.lua</pre> ## Edit the <u>AddonFrames.lua</u> file and add a entry to the '''''addonFrames''''' table in the alphabetical sequence for the Addon you are skinning.<br>If it's a LoadOnDemand Addon then add the entry to the '''''lodFrames''''' table # Create a new file in the SkinMe sub-directory of Skinner called '''MySkinnedAddon.lua'''.<br>In this file add the following lines <pre>function Skinner:'''MySkinnedAddon.lua'''()<br>end</pre> # Load WoW again and check that no warnings or errors were reported by Skinner Then use the following function definitions to add the required lines to the '''MySkinnedAddon.lua''' file testing them in WoW by issuing a <pre>/rl</pre> after each change to see its effect. An easier way is to use Omnibus to test the lines, building up the skin as you go and when you are happy with it, copy the code into the '''MySkinnedAddon.lua''' file. ==Functions== * Required parameters are <u>underlined</u>. * Optional parameters can be ''nil''. * Parameter types/values are shown in <nowiki>[]</nowiki> '''N.B.''' All parameters using the term object refer to the lua object NOT its name. i.e. '''MainFrame''' not "'''MainFrame'''".<br> To convert from one to the other use either '''MainFrame''':GetName() to get the Text version or _G["'''MainFrame'''"] to get the object The following functions, amongst others, can be used in the '''MySkinnedAddon.lua''' file to skin the Addon * '''applySkin'''(<u>frame</u>, header, bba, ba, fh, bd) - applies the Backdrop and the Gradient ** <u>frame</u> - the Frame object ** header <nowiki>[True/False]</nowiki> - used if the frame has a Heading Box named either '''MainFrameHeader''' or '''MainFrame_Header''' that should be removed, the enclosed Text is moved ** bba <nowiki>[0.0 - 1.0]</nowiki> - set the BackdropBorderAlpha value ** ba <nowiki>[0.0 - 1.0]</nowiki> - set the BackdropAlpha value ** fh <nowiki>[0 - 999]</nowiki> - set the Fadeheight value ** bd <nowiki>[Backdrop Table]</nowiki>- set the Backdrop to use * '''keepFontStrings'''(<u>frame</u>) - removes all Textures from the frame but leaves the FontStrings (i.e. Text) ** <u>frame</u> - the Frame object * '''moveObject'''(<u>objName</u>, <u>xAdj</u>, <u>xDiff</u>, <u>yAdj</u>, <u>yDiff</u>, relTo) - move the object ** <u>objName</u> the object to be moved ** <u>xAdj</u> <nowiki>[+/-]</nowiki> - move object right or left ** <u>xDiff</u> <nowiki>[0 - 999]</nowiki> - set the left to right value ** <u>yAdj</u> <nowiki>[+/-]</nowiki> - move object up or down ** <u>yDiff</u> <nowiki>[0 - 999]</nowiki> - set the top to bottom value ** relTo <nowiki>[object]</nowiki> - set the object to move relative to * '''skinScrollBar'''(<u>scrollFrame</u>, sbPrefix, sbObj) - skin a Scroll Bar using the Scroll Bar backdrop ** <u>scrollFrame</u> - the ScrollFrame object ** sbPrefix <nowiki>[string]</nowiki> - set the prefix to use. Used when the Scroll Bar is called ScrollFramexxxScrollBar ** sbObj <nowiki>[object]</nowiki> - set the object to skin if it has a non standard name * '''skinEditBox'''(<u>editBox</u>, regions, noSkin, noHeight) ** <u>editBox</u> - the EditBox object ** regions <nowiki>[table]</nowiki> - set the EditBox regions (textures/fontstrings etc) to keep, usually {9} * '''glazeStatusBar'''(<u>statusBar</u>, fi) ** <u>statusBar</u> - the StatusBar object ** fi <nowiki>[number]</nowiki> - set background offset * For a very simple example look at SkinMe/EasyTrack.lua or SkinMe/DoubleWide.lua * For a simple example look at SkinMe/BugSack.lua * For a more difficult example look at SkinMe/Clique.lua * For a complicated example look at SkinMe/Dewdrop.lua or SkinMe/Recount.lua Also checkout some of the code in the Skinner directory == How to use Baddiel to help skin an Addon == If you have loaded Baddiel then you can get a lot of the Skinner commands generated for you. * To find out what different object names are, hover the mouse over them when entering the slash command <pre>/baddiel ft</pre> * Enter the following as a slash command while the mouse is over the Addon frame you want to skin <pre>/baddiel sf</pre>. * The generated code is written to Baddiel's SV file, so to get it you'll need to logout to force the SV data to be written. * Then you can open the SV file and copy the contents into a new editor document.
Markup Type:
*
The type of markup for this entry.
Click here for details
.
WikiCreole
BBCode
Safe HTML
Plain Text
Markdown
Textile
Curse Wiki (Deprecated)