DISCORD ART
by Lozareth
Overview
The Features
Slash Commands
Options Overview
Appearance Options
Texture Browser
Backdrop Options
Script Options
Misc Options
Scripting Tips
Useful Script Functions
WoW's Texture Specifications
Contact the Author
Overview:
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.
Back to Top
The Features:
Configure everything with an options window painlessly - no fiddling with slash commands or XML files.
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.
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.
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.
Configure text that displays along with your artwork and configure a highlight that appears when you move the mouse over the texture.
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.
The options window shows what frames you have your mouse over so you can easily find frames for attach points and/or parent frames.
Back to Top
Slash Commands:
/dart - toggle the options window
Back to Top
Options Overview:
You access the options window by typing /dart.
All editboxes require you to hit enter before they'll update the setting they modify.
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.
The APPEARANCE and SCRIPTS tabs are used to choose which set of options you want to modify for the selected texture.
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.
The Texture Options button will return you to the options for the texture you last selected.
The Misc Options button brings up options that affect the whole mod and is where you save and load profiles.
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.
Back to Top
Appearance Options:
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 Texture Browser Options.
Alpha - Use this to set the transparency of just the texture. It's a percent value. Typed-in values must range from 0 to 100.
Anchors - 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.
Backdrop - Click this button to bring up options for the texture's background. See Backdrop Options.
Background Alpha - 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.
Background Color - 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.
Border Alpha - 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.
Border Color - 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.
Disable Mouse - Check this to disable all mouse events on the texture. It won't intercept clicks or dragging and it won't detect mouseovers/mouseouts.
Font Size - 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.
Font - 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.
Frame Strata - 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.
Height - Use this to set the height of the texture. Typed-in values can be higher than what the slider allows.
Hide Background - Check this to hide just the background that displays behind the texture.
Hide Text - Check this to hide just the text that displays with the texture.
Hide - Check this to hide the entire texture.
Highlight Alpha - 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.
Highlight Color - 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.
Highlight On Mouseover - Check this to cause a highlight texture to be displayed when you move the mouse over the texture.
Highlight Texture - 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.
Horiz. Justify - Use this to set the horizontal justification of the texture's text within its bounding box.
Move Anchor - 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.
Padding - 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.
Parent - 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.
Scale - 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.
Text Alpha - 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.
Text Color - 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.
Text Height - Use this to set the height of the box that holds the texture's text. Text will be cropped to fit within that box.
Text Width - Use this to set the width of the box that holds the texture's text. Text will be cropped to fit within that box.
Text - Use this to set the text displayed as a texture's text.
Texture Color - 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.
Vert. Justify - Use this to set the vertical justification of the texture's text within its bounding box.
Width - Use this to set the width of the texture. Typed-in values can be higher than what the slider allows.
Back to Top
Texture Browser:
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.
Textures you add display at the bottom of the scrollframe and are highlighted in yellow. Added textures are shared among all profiles.
Left-clicking on an icon will select that artwork to be used with the texture you're currently modifying.
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.
Middle-clicking an icon will delete it if it's a texture you've added and not one of the base one.
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.
File - 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.
Coords - 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.
Height - 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.
Width - 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.
Add Texture - 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.
Back to Top
Backdrop Options:
Preset Backdrops: - Choose a backdrop from the drop-down menu to load its settings.
Background Texture - 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.
Border Texture - 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.
Tile - Check this to cause the background texture to be tiled.
Tile Size - Use this to set the size of the tiles in which the background texture displays.
Edge Size - Use this to set the width of the border.
Insets - Use these to define how far the background is inset from the outer edge of the border....I think.
Back to Top
Script Options:
It's recommended that you learn something about lua and the WoW API before you try to write your own scripts, http://www.wowwiki.com/Main_Page and http://lua-users.org/wiki/TutorialDirectory are two great sources of info.
Choose the handler for which you want to write a block of code by clicking the buttons on the left.
Enter the code for your script in the large edit box on the right.
Here's a brief description of each handler:
KeybindingDown - The block of code will be executed whenever the keybinding for the texture is pressed down.
KeybindingUp - The block of code will be executed whenever the keybinding for the texture is released.
OnClick - The block of code will be executed whenever the texture is clicked. All mouse buttons are registered for each texture.
OnEnter - 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.
OnEvent - 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.
OnHide - The block of code will be exectued whenever the texture changes state from shown to hidden.
OnLeave - 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.
OnLoad - The block of code will be executed once immediately after the mod initializes and once each time you change any of your scripts.
OnMouseDown - The block of code will be executed when a mouse button is clicked down on the texture.
OnMouseUp - The block of code will be executed when a mouse button previously clicked down on the texture is released.
OnMouseWheel - The block of code will be executed when the mouse wheel is rolled while the mouse pointer is over the texture.
OnReceiveDrag - The block of code will be executed when an object attached to the cursor is dragged to the texture and released.
OnShow - The block of code will be exectued whenever the texture changes state from hidden to shown.
OnUpdate - 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 Misc Options. This handler only operates as long as the button that holds the texture is visible.
Back to Top
Misc Options:
Options Scale - Use this to set the size of the options window.
Updates Per Second - Use this to cap the number of times per second the OnUpdate handlers for your textures are performed.
Auto-Lock Dragging - Check this cause dragging to automatically lock when you close the options window.
Current Profile - 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.
New Profile - 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.
Set Profile - Select a profile from the drop-down menu. Click the LOAD button to load it. Click the DELETE button to delete it.
Number of Textures - 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.
Back to Top
Scripting Tips:
Script size is capped at 1020 characters. SavedVariables truncates strings to 1020 characters and it won't be fixed until patch 1.8.
A variable named ti 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.
A variable named param is passed to all your scripts. Here's what it contains for different scripts:
OnUpdate - It holds the amount of time that's passed since the last time OnUpdate was called. It's a fraction of a second.
OnEvent - It holds the name of the game event that was just thrown.
OnClick, OnMouseUp, OnMouseDown - It holds the name of the mouse button that was just clicked on the texture: LeftButton, RightButton, MiddleButton, Button4, or Button5.
OnMouseWheel - It holds the direction the mouse wheel was moved. If param > 0 then the mouse wheel moved up.
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.
WoW's special variable this 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.
Back to Top
Useful Script Functions:
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.
DART_Alpha(textureIndex, alpha) - Sets the transparency of the texture; alpha must be a number from 0 to 1.
DART_Attach(textureIndex, attach, attachframe, attachpoint, attachto, xoffset, yoffset) - 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.
DART_BackgroundAlpha(textureIndex, a) - Sets the transparency of the texture's background; a must be a number from 0 to 1.
DART_BackgroundColor(textureIndex, r, g, b, a) - Set's the color of the texture's background. All parameters must be a number from 0 to 1; a is optional.
DART_BorderAlpha(textureIndex, a) - Sets the transparency of the texture's border; a must be a number from 0 to 1.
DART_BorderColor(textureIndex, r, g, b, a) - Sets the color of the texture's border. All parameters must be a number from 0 to 1; a is optional.
DART_Color(textureIndex, r, g, b, a) - Sets the color of the texture. All parameters must be a number from 0 to 1; a is optional.
DART_Height(textureIndex, height) - Sets the height of the texture.
DART_Hide(textureIndex) - Hides the texture.
DART_HighlightAlpha(textureIndex, alpha) - Sets the transparency of the texture's highlight; alpha must be a number from 0 to 1.
DART_HighlightColor(textureIndex, r, g, b, a) - Sets the color of the texture's highlight. All parameters must be a number from 0 to 1; a is optional.
DART_MoveDown(textureIndex, attachIndex, amount) - Moves the specified anchor down by the specified amount; attachIndex must be a number from 1 to 4 specifying the anchor point.
DART_MoveLeft(textureIndex, attachIndex, amount) - Moves the specified anchor left by the specified amount; attachIndex must be a number from 1 to 4 specifying the anchor point.
DART_MoveRight(textureIndex, attachIndex, amount) - Moves the specified anchor right by the specified amount; attachIndex must be a number from 1 to 4 specifying the anchor point.
DART_MoveUp(textureIndex, attachIndex, amount) - Moves the specified anchor up by the specified amount; attachIndex must be a number from 1 to 4 specifying the anchor point.
DART_Padding(textureIndex, padding) - Sets the amount of space between the texture and its border.
DART_Scale(textureIndex, scale) - Sets the texture's scale; scale is a percent.
DART_Show(textureIndex) - Shows the texture.
DART_StartFlashing(textureIndex) - Causes the texture to start fading in and out repeatedly.
DART_StopFlashing(textureIndex) - Stops the texture from fading in and out repeatedly.
DART_Text(textureIndex, text) - Sets the texture's text.
DART_TextAlpha(textureIndex, a) - Sets the transparency of the texture's text; alpha must be a number from 0 to 1.
DART_TextColor(textureIndex, r, g, b, a) - Sets the color of the texture's text All parameters must be a number from 0 to 1; a is optional.
DART_TextFontSize(textureIndex, fontsize) - Sets the size of the font the texture's text uses.
DART_TextHeight(textureIndex, height) - Sets the height of the box the texture's text is contained within.
DART_TextHide(textureIndex) - Hides the texture's text.
DART_TextMoveDown(textureIndex, amount) - Moves the text down by the specified amount.
DART_TextMoveLeft(textureIndex, amount) - Moves the text left by the specified amount.
DART_TextMoveRight(textureIndex, amount) - Moves the text right by the specified amount.
DART_TextMoveUp(textureIndex, amount) - Moves the text up by the specified amount.
DART_TextShow(textureIndex) - Shows the texture's text.
DART_TextWidth(textureIndex, width) - Sets the width of the box the texture's text is contained within.
DART_Texture(textureIndex, file, coords) - 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}.
DART_Width(textureIndex, width) - Sets the width of the texture.
Back to Top
WoW's Texture Specifications:
Must be a .tga or .blp file.
32 bits per pixel.
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:
http://www.adobe.com/support/downloads/detail.jsp?ftpID=1544
The height and width must be a power of 2 - 2, 4, 8, 16, 32, 64, 128, 256, 512, and so on.
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.
Back to Top
Contact the Author
I run a forum at www.discordmods.com where there's a thread on this mod. Good place for suggestions and bug notifications.
Email me at lozareth@clandiscord.com if email's your thing and you don't want to use a forum.
Back to Top