vanilla-wow-addons – Rev 1

Subversion Repositories:
Rev:
<HTML>

<HEAD>
<STYLE>
A {font: 12pt Verdana; text-decoration: none;  color: #ff0000;}
A:hover {color: #ffff00; background-color: #ff0000;}
.top {font: 9pt Verdana; text-decoration: none;  color: #ff0000;}
</STYLE>
</HEAD>

<BODY>
<center><FONT size=5 color=red><b>DISCORD ART</b><br>
<FONT size=3>by Lozareth</FONT></FONT></center><br>

<center><a href="#1">Overview</a><br><br>
<a href="#2">The Features</a><br><br>
<a href="#3">Slash Commands</a><br><br>
<a href="#3.5">Options Overview</a><br><br>
<a href="#4">Appearance Options</a><br><br>
<a href="#5">Texture Browser</a><br><br>
<a href="#6">Backdrop Options</a><br><br>
<a href="#7">Script Options</a><br><br>
<a href="#8">Misc Options</a><br><br>
<a href="#9">Scripting Tips</a><br><br>
<a href="#10">Useful Script Functions</a><br><br>
<a href="#11">WoW's Texture Specifications</a><br><br>
<a href="#99">Contact the Author</a><br>
</center>
<br>

<a name="1"><b>Overview:</b></a><br><br>

This mod provides you with 20 or more textures to configure and add to your UI.  In addition to sprucing up your UI with artwork, they're also fully programmable buttons that can be set to do anything you can code in lua.

<center><a href=#top class="top">Back to Top</a></center><br>

<a name="2"><b>The Features:</b></a><br><br>

<li>Configure everything with an options window painlessly - no fiddling with slash commands or XML files.</li>
<li>Pretty much every conceivable way you can modify a texture has an option in the options window: size, color, scale, transparency, background texture, background color, border texture, border color, parent frame, frame strata, and more.</li>
<li>Easily add, choose, and configure textures via a separate window known as the Texture Browser.  Over 150 textures from the default UI are already included.  Any textures you add are shared among all profiles.</li>
<li>Save and load different layouts on the fly.  Different characters can share a profile, cutting down on SavedVariables size and causing changes you make on any one of those characters to apply to all thos characters, or you can create separate profiles for each character.</li>
<li>Configure text that displays along with your artwork and configure a highlight that appears when you move the mouse over the texture.</li>
<li>Each texture is a fully programmable button.  Scripts for different game events and user interaction can be defined via the options window.  Each texture has it's own unique set of scripts.  The scripts are compiled in a memory-friendly manner to cut down on garbage collection.</li>
<li>The options window shows what frames you have your mouse over so you can easily find frames for attach points and/or parent frames.</li>

<center><a href=#top class="top">Back to Top</a></center><br>

<a name="3"><b>Slash Commands:</b></a><br><br>
<li><b>/dart </b>- toggle the options window</li>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="3.5"><b>Options Overview:</b></a><br><br>
You access the options window by typing /dart. <br>
All editboxes require you to hit enter before they'll update the setting they modify.<br>
Select your texture by choosing it from the Select Texture drop-down menu in the upper-right corner of the window.  Additionally, you can scroll your mousewheel up and down over the options window to go to the next and previous textures in the list.<br>
The APPEARANCE and SCRIPTS tabs are used to choose which set of options you want to modify for the selected texture.<br>
The Unlock Dragging button in the lower-left allows you to drag all textures with the left mouse button.  Clicking it again will re-lock the textures.<br>
The Texture Options button will return you to the options for the texture you last selected.<br>
The Misc Options button brings up options that affect the whole mod and is where you save and load profiles.<br>
The text in the lower right of the options window tells what frame you have your mouse over, the parent of that frame, and the parent of the parent of that frame.<br>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="4"><b>Appearance Options:</b></a><br><br>
The picture in the top-middle is a preview of what your texture will look like.  Changing settings will update this preview as well as the texture object.  Clicking on it will bring up a new window for choosing your texture, see <a href=#5 class=top>Texture Browser Options</a>.
<li><b>Alpha</b> - Use this to set the transparency of just the texture.  It's a percent value.  Typed-in values must range from 0 to 100.</li>
<li><b>Anchors</b> - Type in the name of the frame to attach the texture to.  Use the Attach Point menu to select which part of the texture attaches to that frame.  Use the Attach To menu to select which part of that frame the texture's Attach Point attaches to.  Use the X and Y boxes to set how far from the anchor point the texture displays.  If a frame has more than anchor, it will be stretched between all its anchors and will automatically resize if one or more objects it's attached to are moved.</li>
<li><b>Backdrop</b> - Click this button to bring up options for the texture's background.  See <a href=#6 class=top>Backdrop Options</a>.</li>
<li><b>Background Alpha</b> - Use this to set the transparency of just the texture's background.  It's a percent value.  Typed-in values must range from 0 to 100.</li>
<li><b>Background Color</b> - Use this to modify the color of the texture's background.  Clicking the button will bring up a color chooser window you use to set the color.  It's the same window chat frames use.  Because it modifies a texture's color rather than replaces it, you won't get true color unless your texture is a grayscale.</li>
<li><b>Border Alpha</b> - Use this to set the transparency of just the texture's border.  It's a percent value.  Typed-in values must range from 0 to 100.</li>
<li><b>Border Color</b> - Use this to modify the color of the texture's border.  Clicking the button will bring up a color chooser window you use to set the color.  It's the same window chat frames use.  Because it modifies a texture's color rather than replaces it, you won't get true color unless your texture is a grayscale.</li>
<li><b>Disable Mouse</b> - Check this to disable all mouse events on the texture.  It won't intercept clicks or dragging and it won't detect mouseovers/mouseouts.</li>
<li><b>Font Size</b> - Use this to set the size of the font in which the texture's text displays.  Typed-in values can be greater than what the slider allows.</li>
<li><b>Font</b> - Enter the filepath of a font to use for the texture's text.  Entering just the file's name will cause the mod to assume it's in the DiscordArt/CustomFonts folder.</li>
<li><b>Frame Strata</b> - Select a strata in which the frame displays.  They're listed in order from lowest to highest.  Note on some of the higher stratas the texture won't receive mouse input.</li>
<li><b>Height</b> - Use this to set the height of the texture.  Typed-in values can be higher than what the slider allows.</li>
<li><b>Hide Background</b> - Check this to hide just the background that displays behind the texture.</li>
<li><b>Hide Text</b> - Check this to hide just the text that displays with the texture.</li>
<li><b>Hide</b> - Check this to hide the entire texture.</li>
<li><b>Highlight Alpha</b> - Use this to set the transparency of just the texture's highlight.  It's a percent value.  Typed-in values must range from 0 to 100.</li>
<li><b>Highlight Color</b> - Use this to modify the color of the highlight texture.  Clicking the button will bring up a color chooser window you use to set the color.  It's the same window chat frames use.  Because it modifies a texture's color rather than replaces it, you won't get true color unless your texture is a grayscale.</li>
<li><b>Highlight On Mouseover</b> - Check this to cause a highlight texture to be displayed when you move the mouse over the texture.</li>
<li><b>Highlight Texture</b> - Enter the filepath of a texture to use as the highlight texture.  Entering just the file's name will cause the mod to assume it's in the DiscordArt/CustomTextures folder.</li>
<li><b>Horiz. Justify</b> - Use this to set the horizontal justification of the texture's text within its bounding box.</li>
<li><b>Move Anchor</b> - Use the drop-down menu to select which anchor you want to move.  Left-clicking on the directional buttons (<>v^) will move that anchor by 1 unit in the direction you clicked.  Right-clicking a button will move the anchor 10 units.  Middle-clicking and holding on a button will keep that anchor moving until you release the middle mouse button.</li>
<li><b>Padding</b> - Use this to set the distance between the texture and its border.  Typed-in values can be greater or less than what the slider allows.</li>
<li><b>Parent</b> - Type in the name of a frame you want to set as the texture's parent frame.  The texture will hide and show when its parent frame hides and shows.</li>
<li><b>Scale</b> - Use this to set the scale of the texture.  It's a percent value.  Typed-in values can be higher than what the slider allows.</li>
<li><b>Text Alpha</b> - Use this to set the transparency of just the texture's text.  It's a percent value.  Typed-in values must range from 0 to 100.</li>
<li><b>Text Color</b> - Use this to modify the color of the texture's text.  Clicking the button will bring up a color chooser window you use to set the color.  It's the same window chat frames use.</li>
<li><b>Text Height</b> - Use this to set the height of the box that holds the texture's text.  Text will be cropped to fit within that box.</li>
<li><b>Text Width</b> - Use this to set the width of the box that holds the texture's text.  Text will be cropped to fit within that box.</li>
<li><b>Text</b> - Use this to set the text displayed as a texture's text.</li>
<li><b>Texture Color</b> - Use this to modify the color of the texture.  Clicking the button will bring up a color chooser window you use to set the color.  It's the same window chat frames use.  Because it modifies a texture's color rather than replaces it, you won't get true color unless your texture is a grayscale.</li>
<li><b>Vert. Justify</b> - Use this to set the vertical justification of the texture's text within its bounding box.</li>
<li><b>Width</b> - Use this to set the width of the texture.  Typed-in values can be higher than what the slider allows.</li>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="5"><b>Texture Browser:</b></a><br><br>
The texture browser is accessed by clicking on a texture's preview in Appearance options.  It allows you select the art for a specific texture to use and add new textures.<br>
Textures you add display at the bottom of the scrollframe and are highlighted in yellow.  Added textures are shared among all profiles.<br>
Left-clicking on an icon will select that artwork to be used with the texture you're currently modifying.<br>
Right-clicking on an icon will causes that artwork's info to "stick" in the editboxes below the scrollframe.  The data won't clear when you move the mouse off the icon.  This can be useful if you just want to modify an existing texture rather than add a completely new one.<br>
Middle-clicking an icon will delete it if it's a texture you've added and not one of the base one.<br>
At the bottom of the window you can see a preview of the texture you're modifying.  The preview updates as you make changes to the editboxes above.
<li><b>File</b> - Type in the path and name of a texture to add to the browser.  If you enter just the name, the mod assumes the texture is location in the DiscordArt/CustomTextures folder.</li>
<li><b>Coords</b> - Use these editboxes to define just a portion of the texture to use.  They're all numbers from 0 to 1 and represent a percent of the texture.  X1 sets the starting left point of the area you're defining.  X2 sets the ending right point of the area you're defining.  Y1 sets the starting top point of the area you're defining.  Y2 sets the bottom point of the area you're defining.  If X2 is greater than X1, the image will be flipped horizontally.  If Y2 is greater than Y1, the image will be flipped vertically.  The + and - buttons can be used to easily fine tune the coords.  Left-clicking a button will modify that coord by .01, right-clicking by .001, and middle-clicking by .0001.</li>
<li><b>Height</b> - Use this to set the default height of the artwork.  When a piece of artwork is chosen, it automatically sets the height and width properties of the texture you're modifying to the default height and width of the artwork.  This is so the correct / intended aspect ratio of the artwork will be set initially when it's chosen.</li>
<li><b>Width</b> - Use this to set the default width of the artwork.  When a piece of artwork is chosen, it automatically sets the height and width properties of the texture you're modifying to the default height and width of the artwork.  This is so the correct / intended aspect ratio of the artwork will be set initially when it's chosen.</li>
<li><b>Add Texture</b> - Click this button when you're finished modifying the attributes of the artwork to add the artwork to the list of choosable textures.  If you've forgotten to enter a value for any of the editboxes, those editboxes will gain focus when you click the Add Texture button.  All editboxes must be filled out before the artwork can be added.</li>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="6"><b>Backdrop Options:</b></a><br><br>
<li><b>Preset Backdrops:</b> - Choose a backdrop from the drop-down menu to load its settings.</li>
<li><b>Background Texture</b> - Enter the filepath of a texture to use as the background texture.  Entering just the file's name will cause the mod to assume it's in the DiscordArt/CustomTextures folder.</li>
<li><b>Border Texture</b> - Enter the filepath of a texture to use as the border texture.  Entering just the file's name will cause the mod to assume it's in the DiscordArt/CustomTextures folder.</li>
<li><b>Tile</b> - Check this to cause the background texture to be tiled.</li>
<li><b>Tile Size</b> - Use this to set the size of the tiles in which the background texture displays.</li>
<li><b>Edge Size</b> - Use this to set the width of the border.</li>
<li><b>Insets</b> - Use these to define how far the background is inset from the outer edge of the border....I think.</li>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="7"><b>Script Options:</b></a><br><br>
It's recommended that you learn something about lua and the WoW API before you try to write your own scripts, <a href=http://www.wowwiki.com/Main_Page class=top>http://www.wowwiki.com/Main_Page</a> and <a href=http://lua-users.org/wiki/TutorialDirectory class=top>http://lua-users.org/wiki/TutorialDirectory</a> are two great sources of info.<br>
Choose the handler for which you want to write a block of code by clicking the buttons on the left.  <br>
Enter the code for your script in the large edit box on the right.<br>
Here's a brief description of each handler:
<blockquote>
<li><b>KeybindingDown</b> - The block of code will be executed whenever the keybinding for the texture is pressed down.</li>
<li><b>KeybindingUp</b> - The block of code will be executed whenever the keybinding for the texture is released.</li>
<li><b>OnClick</b> - The block of code will be executed whenever the texture is clicked.  All mouse buttons are registered for each texture.</li>
<li><b>OnEnter</b> - The block of code will be executed when the mouse pointer is moved over the area the texture occupies.  It only works if the button that holds the texture is visible.</li>
<li><b>OnEvent</b> - The block of code will be executed in response to any game events the texture has been registered to receive.  To have a texture register an event, use this:RegisterEvent("event's name"); in the texture's OnLoad handler.</li>
<li><b>OnHide</b> - The block of code will be exectued whenever the texture changes state from shown to hidden.</li>
<li><b>OnLeave</b> - The block of code will be executed when the mouse pointer is moved over the area the texture occupies.  It only works if the button that holds the texture is visible.</li>
<li><b>OnLoad</b> - The block of code will be executed once immediately after the mod initializes and once each time you change any of your scripts.</li>
<li><b>OnMouseDown</b> - The block of code will be executed when a mouse button is clicked down on the texture.</li>
<li><b>OnMouseUp</b> - The block of code will be executed when a mouse button previously clicked down on the texture is released.</li>
<li><b>OnMouseWheel</b> - The block of code will be executed when the mouse wheel is rolled while the mouse pointer is over the texture.</li>
<li><b>OnReceiveDrag</b> - The block of code will be executed when an object attached to the cursor is dragged to the texture and released.</li>
<li><b>OnShow</b> - The block of code will be exectued whenever the texture changes state from hidden to shown.</li>
<li><b>OnUpdate</b> - The block of code will be executed repeatedly in fraction of a second intervals.  Generally it's executed a number of times per second equal to your framerate.  The max updates per second can be set in <a href=#8 class=top>Misc Options</a>.  This handler only operates as long as the button that holds the texture is visible.</li>
</blockquote>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="8"><b>Misc Options:</b></a><br><br>
<li><b>Options Scale</b> - Use this to set the size of the options window.</li>
<li><b>Updates Per Second</b> - Use this to cap the number of times per second the OnUpdate handlers for your textures are performed.</li>
<li><b>Auto-Lock Dragging</b> - Check this cause dragging to automatically lock when you close the options window.</li>
<li><b>Current Profile</b> - This displays the name of the profile your character is currently using.  Different characters can use different profiles and a new profile can be loaded at any time.</li>
<li><b>New Profile</b> - Enter the name of a new profile and click the CREATE button.  Your current settings will be copied to the new profile and it will become the active profile.</li>
<li><b>Set Profile</b> - Select a profile from the drop-down menu.  Click the LOAD button to load it.  Click the DELETE button to delete it.</li>
<li><b>Number of Textures</b> - Use the + and - buttons to set the total number of textures you have available.  When you remove a texture, it will always be the highest numbered texture.</li>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="9"><b>Scripting Tips:</b></a><br><br>
Script size is capped at 1020 characters.  SavedVariables truncates strings to 1020 characters and it won't be fixed until patch 1.8.<br>
A variable named <b>ti</b> is passed to all your scripts.  It contains the ID of the texture that caused that script to run.  Using this in place of an actual number can make cut n' pasting much easier since you won't need to change your script for each of your textures.<br>
A variable named <b>param</b> is passed to all your scripts.  Here's what it contains for different scripts:
<blockquote><li>OnUpdate - It holds the amount of time that's passed since the last time OnUpdate was called.  It's a fraction of a second.</li>
<li>OnEvent - It holds the name of the game event that was just thrown.</li>
<li>OnClick, OnMouseUp, OnMouseDown - It holds the name of the mouse button that was just clicked on the texture: LeftButton, RightButton, MiddleButton, Button4, or Button5.</li>
<li>OnMouseWheel - It holds the direction the mouse wheel was moved.  If param > 0 then the mouse wheel moved up.</li>
</blockquote>
If you want just the art to hide so that OnEnter and OnLeave scripts work to show/hide it, use DART_Texture_#_Texture:Show() and DART_Texture_#_Texture:Hide() instead of the DART_Show and DART_Hide functions.  Replace # with the number of the texture object.<br>
WoW's special variable <b>this</b> will always refer to the button that contains the texture.  The texture resizes/scales/etc. along with the button so most widget functions called on the button will act just like you're using them on the texture.<br>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="10"><b>Useful Script Functions:</b></a><br><br>
You can find the definition for all these functions in the DART_Functions.lua file.  For each of the functions below textureIndex is the number of the texture you want to modify.  The number of a texture is listed next to its name in the dropdown menu for selecting a texture.  These functions are designed to be safe rather than fast so you won't get all sorts of UI errors if you do something wrong.  These all update your settings in addition to changing the texture so your texture keeps the attributes defined by any of these functions.<br><br>
<li><b>DART_Alpha(textureIndex, alpha)</b> - Sets the transparency of the texture; alpha must be a number from 0 to 1.</li>
<li><b>DART_Attach(textureIndex, attach, attachframe, attachpoint, attachto, xoffset, yoffset)</b> - Sets the specified attach point of the texture.  Attach is a number from 1 to 4 specifying which attach point to set.  Attachframe must be the name of a frame, not a frame object.</li>
<li><b>DART_BackgroundAlpha(textureIndex, a)</b> - Sets the transparency of the texture's background; a must be a number from 0 to 1.</li>
<li><b>DART_BackgroundColor(textureIndex, r, g, b, a)</b> - Set's the color of the texture's background.  All parameters must be a number from 0 to 1; a is optional.</li>
<li><b>DART_BorderAlpha(textureIndex, a)</b> - Sets the transparency of the texture's border; a must be a number from 0 to 1.</li>
<li><b>DART_BorderColor(textureIndex, r, g, b, a)</b> - Sets the color of the texture's border.  All parameters must be a number from 0 to 1; a is optional.</li>
<li><b>DART_Color(textureIndex, r, g, b, a)</b> - Sets the color of the texture.  All parameters must be a number from 0 to 1; a is optional.</li>
<li><b>DART_Height(textureIndex, height)</b> - Sets the height of the texture.</li>
<li><b>DART_Hide(textureIndex)</b> - Hides the texture.</li>
<li><b>DART_HighlightAlpha(textureIndex, alpha)</b> - Sets the transparency of the texture's highlight; alpha must be a number from 0 to 1.</li>
<li><b>DART_HighlightColor(textureIndex, r, g, b, a)</b> - Sets the color of the texture's highlight.  All parameters must be a number from 0 to 1; a is optional.</li>
<li><b>DART_MoveDown(textureIndex, attachIndex, amount)</b> - Moves the specified anchor down by the specified amount; attachIndex must be a number from 1 to 4 specifying the anchor point.</li>
<li><b>DART_MoveLeft(textureIndex, attachIndex, amount)</b> - Moves the specified anchor left by the specified amount; attachIndex must be a number from 1 to 4 specifying the anchor point.</li>
<li><b>DART_MoveRight(textureIndex, attachIndex, amount)</b> - Moves the specified anchor right by the specified amount; attachIndex must be a number from 1 to 4 specifying the anchor point.</li>
<li><b>DART_MoveUp(textureIndex, attachIndex, amount)</b> - Moves the specified anchor up by the specified amount; attachIndex must be a number from 1 to 4 specifying the anchor point.</li>
<li><b>DART_Padding(textureIndex, padding)</b> - Sets the amount of space between the texture and its border.</li>
<li><b>DART_Scale(textureIndex, scale)</b> - Sets the texture's scale; scale is a percent.</li>
<li><b>DART_Show(textureIndex)</b> - Shows the texture.</li>
<li><b>DART_StartFlashing(textureIndex)</b> - Causes the texture to start fading in and out repeatedly.</li>
<li><b>DART_StopFlashing(textureIndex)</b> - Stops the texture from fading in and out repeatedly.</li>
<li><b>DART_Text(textureIndex, text)</b> - Sets the texture's text.</li>
<li><b>DART_TextAlpha(textureIndex, a)</b> - Sets the transparency of the texture's text; alpha must be a number from 0 to 1.</li>
<li><b>DART_TextColor(textureIndex, r, g, b, a)</b> - Sets the color of the texture's text  All parameters must be a number from 0 to 1; a is optional.</li>
<li><b>DART_TextFontSize(textureIndex, fontsize)</b> - Sets the size of the font the texture's text uses.</li>
<li><b>DART_TextHeight(textureIndex, height)</b> - Sets the height of the box the texture's text is contained within.</li>
<li><b>DART_TextHide(textureIndex)</b> - Hides the texture's text.</li>
<li><b>DART_TextMoveDown(textureIndex, amount)</b> - Moves the text down by the specified amount.</li>
<li><b>DART_TextMoveLeft(textureIndex, amount)</b> - Moves the text left by the specified amount.</li>
<li><b>DART_TextMoveRight(textureIndex, amount)</b> - Moves the text right by the specified amount.</li>
<li><b>DART_TextMoveUp(textureIndex, amount)</b> - Moves the text up by the specified amount.</li>
<li><b>DART_TextShow(textureIndex)</b> - Shows the texture's text.</li>
<li><b>DART_TextWidth(textureIndex, width)</b> - Sets the width of the box the texture's text is contained within.</li>
<li><b>DART_Texture(textureIndex, file, coords)</b> - Sets the texture.  File must be a full filepath and you must use 2 \'s where you'd normally use one.  For example, Interface\\AddOns\\DiscordArt\\CustomTextures\\Elite.  Coords is optional.  It's used to define a subsection of the texture to use.  It's a table parameter in the form {x1, x2, y1, y2}.</li>
<li><b>DART_Width(textureIndex, width)</b> - Sets the width of the texture.</li>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="11"><b>WoW's Texture Specifications:</b></a><br><br>
<li>Must be a .tga or .blp file.</li>
<li>32 bits per pixel.</li>
<li>Must have an alpha channel.  I use Photoshop 6.0 which creates an alpha channel just by adding a new channel.  With Photoshop 7.0 and possibly later versions you'll need the alpha channel plug-in:<br>
<a href=http://www.adobe.com/support/downloads/detail.jsp?ftpID=1544>http://www.adobe.com/support/downloads/detail.jsp?ftpID=1544</a></li>
<li>The height and width must be a power of 2 - 2, 4, 8, 16, 32, 64, 128, 256, 512, and so on.</li>
<li>You must completely exit and restart WoW to get it to recognize a texture you just added a folder.  Texture files added while WoW was running won't be recognized.</li>
<center><a href=#top class="top">Back to Top</a></center><br>

<a name="99"><b>Contact the Author</b></a><br><br>
I run a forum at <a href="http://www.discordmods.com" class="top">www.discordmods.com</a> where there's a thread on this mod.  Good place for suggestions and bug notifications.
<br>Email me at <a href="mailto:lozareth@clandiscord.com" class="top">lozareth@clandiscord.com</a> if email's your thing and you don't want to use a forum.
<center><a href=#top class="top">Back to Top</a></center><br>
</BODY>
</HTML>

Generated by GNU Enscript 1.6.5.90.