A basic library for registering slash commands in the WAR interface.
If you're downloading this because an addon you want to use requires it, just extract it into the interface\addons directory, and that's all you need to do.
With LibSlash installed, you'll also be able to use /addon or /uimod to open the Addons window in-game.
If you're writing an addon and want to utilize LibSlash, place it in the proper addons directory along with your other addons. Then, add it as a dependency in your addon's .mod file, like so:
<Dependencies>
<Dependency name="LibSlash" />
</Dependencies>
This will ensure that LibSlash is loaded before your addon, so that its functions will be available for use.
To register a slash command handler, call LibSlash.RegisterSlashCmd() with the slash command you want to register (a string, NOT INCLUDING THE /) and a function to serve as the handler:
LibSlash.RegisterSlashCmd("myslash", function(input) MyAddonHandleSlash(input) end)
The single argument passed to the handler is a string containing the rest of the chat line entered after the initial slash command, so the above code would call MyAddonHandleSlash with an argument of "testing" if I typed "/myslash testing" at the command line.
Alternatively, LibSlash.RegisterWSlashCmd() can be used to register a handler to receive a wstring version of the chat line, instead of having it automatically translated to a string.
To unregister a slash command, use LibSlash.UnregisterSlashCmd("myslash") - the only argument it takes is a string specifying the slash command to unregister. You can also use LibSlash.IsSlashCmdRegistered("myslash") to see if a slash command is already registered, possibly by another addon.
Both the register and unregister functions will return true on success, or false on failure for any reason such as attempting to register a slash command which is already registered, or other silly things.
------------------------------------------------------------------------
r54 | aiiane | 2009-10-16 21:31:36 +0000 (Fri, 16 Oct 2009) | 1 line
Changed paths:
A /tags/v2.93-release (from /trunk:53)
Tagging as 2.93
------------------------------------------------------------------------
r53 | aiiane | 2009-10-16 21:31:09 +0000 (Fri, 16 Oct 2009) | 1 line
Changed paths:
M /trunk/LibSlash.mod
1.3.2 versioninfo.
------------------------------------------------------------------------
Installation Guide
- Exit "Warhammer Online" completely
- Download the mod you want to install
- Make a folder on your desktop called "My Mods"
- Save the .zip/.rar files to this folder.
- If, when you try to download the file, it automatically "opens" it... you need to RIGHT click on the link and "save as..." or "Save Target As".
- Extract the file - commonly known as 'unzipping'
Do this ONE FILE AT A TIME!
- Windows
- Windows XP has a built in ZIP extractor. Double click on the file to open it, inside should be the file or folders needed. Copy these outside to the "My Mods" folder.
- WinRAR: Right click the file, select "Extract Here"
- WinZip: You MUST make sure the option to "Use Folder Names" is CHECKED or it will just extract the files and not make the proper folders how the Authors designed
- Verify your WAR Installation Path
That is where you are running WAR from and THAT is where you need to install your mods.
- Move to the Addon folder
- Open your Warhammer Online folder. (default is C:\Program Files\Warhammer Online\)
- Go into the "Interface" folder.
- Go into the "AddOns" folder.
- In a new window, open the "My Mods" folder.
- The "My Mods" folder should have the "Addonname" folder in it.
- Move the "Addonname" folder into the "AddOns" folder
- Start Warhammer Online
Translations
When you download a mod, please be sure that the mod is compatible with your translation of WAR. Some mods only work on the US versions, while some only work on some of the various European versions. These variations are called "Localizations".
Directory Structure
Warhammer Online
|_ Interface
|_AddOns
|_*AddonName*
|_ *AddonName*.mod
|_ *AddonName*.lua
|_ (possibly others as well)...