Ah. It's a library to provide shared handling of fonts, sounds, and textures between addons. For example, if you use BigWigs and Quartz, even though BigWigs doesn't include the statusbar texture "Rocks", you can use that texture in BigWigs, because Quartz does include it, and both use LibSharedMedia-3.0. Also, users can install the addon SharedMedia, which does nothing but provide a bunch of fonts and textures.
so if i get Tekkub's tekKonfig libraries and the whole SharedMedia-3.0 thing going the user can choose font and textures from other addons in the options menu?
LibSharedMedia-3.0 is just a registry. Let's say you have AddonA and AddonX. Both support LibSharedMedia-3.0, and both include two unique fonts. When AddonA loads, it registers FontA1, and FontA2 with LibSharedMedia-3.0. When AddonB loads, it registers FontX1 and FontX2 with LibSharedMedia-3.0. When a user opens the configuration for AddonA, the font selection option simply gives him a list of all fonts registered with LibSharedMedia-3.0: A1, A2, X1, and X2. Neither AddonA nor LibSharedMedia-3.0 are aware of which addon registered those fonts. Now let's say you log in without AddonX enabled. Since AddonX isn't loading, it isn't registering FontX1 or FontX2. So, now when you open AddonA's configuration, the list from LibSharedMedia-3.0 just includes A1 and A2. So really, you're not choosing fonts from "other addons". You're just choosing fonts from the pool of fonts registered with LibSharedMedia-3.0. They may or may not come from other addons; LibSharedMedia-3.0's default font pool includes the four fonts that are part of the game itself.
As for tekKonfig, the answer to your question is essentially "yes", but it's not as simple as "drop files in folder, magically get options menu". tekKonfig just gives you shortcuts for creating the GUI elements yourself. You still have to create them, arrange them, and program them to change the right stuff when used. You can see examples of use in most of Tekkub's addons... I found Squeenix to be particularly helpful because it uses a nice variety of different widget types.
If that looks like it's more complicated than you want to work with just yet, AceConfig-3.0 isn't bad. It's just big. I don't use it personally, but there are tons of addons around here that use it. Instead of directly creating, arranging, and programming GUI elements, you just supply a table with each option's name, description, type (i.e. is is a toggle? a selection? a color?), and the functions you want called when the user changes the option, and AceConfig-3.0 uses AceGUI-3.0 to turn it all into a GUI.
ok i ended up finding this website/page ( http://github.com/tekkub/tekkonfig/graphs/languages ) and got the entire thing. i don't see any faqs or tutorials on this site. so based on what u said i have to look at his other addons to figure it out?
i also found " Tekkub's Emporium of Random Crap " ( http://tekkub.net/ )
Also where is the lock/unlock frame in Speedometer?
Also where is the lock/unlock frame in Speedometer?
Just run a search for the word "lock". Part of it is in the initialization function, to determine if it should be locked or unlocked at login. The rest of it is in the slash command handler (CMD_LOCK) near the end of the file, called when the user types "/speed lock".
oh alright i'll check that out but it seem you have to look at it in word pad then notepad.
I highly recommend using Notepad2 over Notepad or Wordpad. It supports different types of line endings, it supports UTF8 encoding, it shows you line numbers, and has a few other handy features like matching brace highlights, auto-indenting, etc.
i've been busy a lot with stuff and raids but i've been using the addon. i ended up calling it Custom Power. i'm not gonna release it till it has at least the lock/unlock thing for now i'm pretty happy with it.
i'll double post when i get to read Tekkub's stuff
db.lock is a reference to the "lock" key in the saved variables table, where user preferences are stored. "db" is a local upvalue to the global table "SpeedometerDB". You can see the upvalue initialized in the VARIABLES_LOADED event handler, and the "lock" key checked in the same function to determine whether or not the frame should be mouse-aware.
CMD_LOCK is a method on the addon object "Speedometer". When the user types a slash command, the slash command handler checks to see if there's a method matching "CMD_" followed by the first word in the user's command. If there is, that method is called, with anything else the user typed passed in as arguments. So, when the user types "/speed lock", the addon calls "Speedometer:CMD_LOCK()", and that function toggles the locked status of the frame.
is there something i can read on wow wiki that tells me how to add it to my addon?
from what i understand i need to
make an event for lock
unreg the lock event for unlock
add the slash command for lock/unlock
however if i do that then i need to change it all to add in tekconfig or ace3... i think
also i noticed last night the addon has been showing player mana. i didn't change anything in the .lua when i named the addon. granted i updated the toc, folders and w/e.
Everything the addon needs to function is in the Lua file. You don't need an XML file at all, and in fact if you have an XML file that contains only the three lines you posted, it doesn't do anything anyway.
Add a closing parenthese ")" after the word "end" on line 79 to fix the error.
The fact that you have no idea what that error message means makes it hard to know if anything I'm trying to explain is making any sense, or if you're just copying and pasting and hoping it works... :(
man i read it over 4 times and everything i thought the error was, it wasn't but i missed a stupid thing like a damn ")" /sigh. Like i thought the long form of the slash command had to be b4 the short one because of the example on wow wiki for example.
Phanx i have no problem with giving u some kinda of thanks or something when it is released. i honestly will say " This addon could have never been finished without Phanx". Really though major face palm at a dumb ")".
theses are the changes i've made so far but i have a raid soon so i'll double post when i'm done.
http://paste.wowace.com/549/
*note for me to see the frame i need to take out line 23. when i do that the frame is locked and won't move even if i try the slash commands.
If you don't want it to be locked by default, then change the value in the defaults table from "true" to "false". However, since you've already logged in and generated saved variables based on the defaults, your saved value is now "true".
Line 50 is giving you errors because you're doing:
local defaults = {
self.db.lock = true
}
which is NOT proper table construction, instead of
local defaults = {
lock = true
}
which is. When you say "self.db.lock = true" you're basically doing:
local self = {
db = {
lock = true
}
}
Since you can't use a lookup for a value in table B as a key in table A (at least not the way you're doing, and not to accomplish what you want), you're getting an error. Leave it the way I wrote it and you'll be fine.
What do you mean "there seems to be no rule as to when it's shown"? You hide it when you first create it, because your settings are not yet initialized, and because there's not really any reason to run OnUpdates on it when you can't even see it yet (because the loading screen is up). Then, when the ADDON_LOADED event fires (after your addon and its saved variables are loaded and any file-scope code is executed), you show it. Very simple. Create it, hide it (frames are shown by default when you create them), apply your settings to it, then show it.
there is one command " /cp or custompower lock " to toggle the state and no unlock command?
also is " if cmd and cmd == "lock" then " wrong? Or does that enable it to be on/off the way it's written?
doesn't in the slash command handler when referring to the state of the frame to use self.db.lock ?
if i use CustomPower.db.lock db is nil if i use self.db.lock then self is nil i can't figure out why it's nil.
i disabled the show and hide by putting " -- " in front of them other then that i'm not fully sure if i changed anything this time except for moving the unitpower to a different spot.
also if self :hide() is a nil value wouldn't self:show() be as well? Even if i put both of them with CustomPower:hide/show() it still doesn't seem to work.
As for tekKonfig, the answer to your question is essentially "yes", but it's not as simple as "drop files in folder, magically get options menu". tekKonfig just gives you shortcuts for creating the GUI elements yourself. You still have to create them, arrange them, and program them to change the right stuff when used. You can see examples of use in most of Tekkub's addons... I found Squeenix to be particularly helpful because it uses a nice variety of different widget types.
If that looks like it's more complicated than you want to work with just yet, AceConfig-3.0 isn't bad. It's just big. I don't use it personally, but there are tons of addons around here that use it. Instead of directly creating, arranging, and programming GUI elements, you just supply a table with each option's name, description, type (i.e. is is a toggle? a selection? a color?), and the functions you want called when the user changes the option, and AceConfig-3.0 uses AceGUI-3.0 to turn it all into a GUI.
i also found " Tekkub's Emporium of Random Crap " ( http://tekkub.net/ )
Also where is the lock/unlock frame in Speedometer?
Just run a search for the word "lock". Part of it is in the initialization function, to determine if it should be locked or unlocked at login. The rest of it is in the slash command handler (CMD_LOCK) near the end of the file, called when the user types "/speed lock".
I highly recommend using Notepad2 over Notepad or Wordpad. It supports different types of line endings, it supports UTF8 encoding, it shows you line numbers, and has a few other handy features like matching brace highlights, auto-indenting, etc.
i'll double post when i get to read Tekkub's stuff
what is:
db.lock
CMD_LOCK
i can't find it.
CMD_LOCK is a method on the addon object "Speedometer". When the user types a slash command, the slash command handler checks to see if there's a method matching "CMD_" followed by the first word in the user's command. If there is, that method is called, with anything else the user typed passed in as arguments. So, when the user types "/speed lock", the addon calls "Speedometer:CMD_LOCK()", and that function toggles the locked status of the frame.
from what i understand i need to
make an event for lock
unreg the lock event for unlock
add the slash command for lock/unlock
however if i do that then i need to change it all to add in tekconfig or ace3... i think
also i noticed last night the addon has been showing player mana. i didn't change anything in the .lua when i named the addon. granted i updated the toc, folders and w/e.
Custom Power.lua line 82:
')' expected (to close '(' at line 42) near 'SLASH_CUSTOMPOWER1'
could it be because there is nothing in my xml file at all? i'm pretty sure that is why but what exactly do i put in there?
just this? :
<OnLoad>
Custom Power_OnLoad();
</OnLoad>
Add a closing parenthese ")" after the word "end" on line 79 to fix the error.
The fact that you have no idea what that error message means makes it hard to know if anything I'm trying to explain is making any sense, or if you're just copying and pasting and hoping it works... :(
Phanx i have no problem with giving u some kinda of thanks or something when it is released. i honestly will say " This addon could have never been finished without Phanx". Really though major face palm at a dumb ")".
theses are the changes i've made so far but i have a raid soon so i'll double post when i'm done.
http://paste.wowace.com/549/
*note for me to see the frame i need to take out line 23. when i do that the frame is locked and won't move even if i try the slash commands.
i'm not done yet so let me work on it abit more
i also don't understand why it's lock by default.
http://paste.wowace.com/556/
so far that is wut i've tried there is an error on line 50
Message: ..\AddOns\Custom Power\Custom Power.lua line 50:
'}' expected (to close '{' at line 49) near '='
also if i make line 50 not error and try /cp lock there is an error on line 100.
Why are theses popping up?
Line 50 is giving you errors because you're doing:
which is NOT proper table construction, instead of
which is. When you say "self.db.lock = true" you're basically doing:
Since you can't use a lookup for a value in table B as a key in table A (at least not the way you're doing, and not to accomplish what you want), you're getting an error. Leave it the way I wrote it and you'll be fine.
What do you mean "there seems to be no rule as to when it's shown"? You hide it when you first create it, because your settings are not yet initialized, and because there's not really any reason to run OnUpdates on it when you can't even see it yet (because the loading screen is up). Then, when the ADDON_LOADED event fires (after your addon and its saved variables are loaded and any file-scope code is executed), you show it. Very simple. Create it, hide it (frames are shown by default when you create them), apply your settings to it, then show it.
also is " if cmd and cmd == "lock" then " wrong? Or does that enable it to be on/off the way it's written?
doesn't in the slash command handler when referring to the state of the frame to use self.db.lock ?
if i use CustomPower.db.lock db is nil if i use self.db.lock then self is nil i can't figure out why it's nil.
i disabled the show and hide by putting " -- " in front of them other then that i'm not fully sure if i changed anything this time except for moving the unitpower to a different spot.
http://paste.wowace.com/557/
also if self :hide() is a nil value wouldn't self:show() be as well? Even if i put both of them with CustomPower:hide/show() it still doesn't seem to work.