CogsBar

CogsBar

Created by Cogwheel - Last updated on December 22 2006
Download
Version Compatible Translations Patch Release Date
CogsBar 1.6 (Current) 汉语 汉语 한국어 Deutsch English Espańol Français English 0 December 22 2006
  • Description
  • Change Log
CogsBar

By Cogwheel — v1.6

CogsBar allows you to create a number of movable action bars of various configurations. Each bar can remap its actions based on certain types of states.

Please visit Cogwheel’s Workshop for updates, bug reports, feature requests, etc.

This started out as a simple example of the use of state headers (see v1.0) and as a replacement for my personal FlexBar setup. After the initial version I added a few tweaks here and there to let me create different setups for my different characters. You can now create an arbitrary number of bars (even single buttons) that can respond to state changes.

Creating bars

The bars are created using the /cogsbar (/cb) slash command. Running this command with no arguments shows you a list of subcommands (create, clear, list, remove, status, bind). The simplest form for creating a bar is:

/cogsbar create 6x4

This creates a bar that is 6 buttons wide by 4 buttons high and uses action ids 1-24. Note: if you do not see any buttons, it means you don’t have any abilities configured in the first 24 action slots. If you drag a spell out of your spellbook, the buttons will appear. You will also see the control box near the lower-middle of the screen which you can use to move the bar.

Notice: the current implementation uses Blizzard’s layout-cache.txt to save its position. This means that if you log into the game with CogsBar disabled, you will have to reposition your frames the next time you log in. I will try to address this in a future version.

CogsBar “consumes” action ids, so the next bar created would start with action id 25. In other words, if you now ran the command:

/cogsbar create 9x4

you would have another 9 by 4 bar using actions 25-60.

Getting information

To see your bar configuration, use the list command:

/cogsbar list
CogsBar: List of bars:
1: 6x4
2: 9x4

You can also see some generic information with the status command:

/cogsbar status
CogsBar Status:
Number of bars: 2
Number of buttons: 60
Available actions: 60

Removing bars

If you would like to remove one of your bars, use the remove command, passing it the number shown in the output from list:

/cogsbar remove 1
CogsBar: Bar 1 removed. Please reload your UI for changes to take effect.

Due to some limitations in the current implementation, you must reload your UI after removing a bar (you can type /console reloadui or log out and back in). Note also that bar 2 will now use actions 1-36 instead of 25-60. Here’s the output of status at this point:

CogsBar Status:
Number of bars: 1
Number of buttons: 36
Available actions: 84

You can also use clear to remove all the bars bars as if you had manually run the remove command (UI reload is required).

State mapping

As mentioned, CogsBar bars can be driven by state changes. Any sort of state the SecureStateDriverTemplate supports can be used with CogsBar. The general syntax is:

/cogsbar <width>x<height> [state] [state] [...]

where each optional state has the syntax:

<state-type>[:[<first>-]<last>]

state-type can be one of stance, stealth, actionbar, shift, ctrl, or alt at the time of this writing (CogsBar is structured in such a way that future additions to SecureStateDriverTemplate will be automatically supported). Here’s a simple example:

/cogsbar create 6x4 stance

If you run this command as a warrior, it will create a 6x4 button bar that maps to actions 1-24 in Battle Stance, 25-48 in Berserker Stance, and 49-72 in Defensive Stance.

Sanity checks

Because certain state types are only relevant under certain circumstances, CogsBar performs a few sanity checks. The stealth type can only be used with Rogues, Druids, Mages, and Night Elves. Stance can only be used with Warriors, Druids, Rogues, Shaman, and Priests.

first and last

The first and last parameters tell CogsBar which states of the given type to “pay attention to.” Each known state type has certain default values for them (see Reference). These defaults allow you to omit the first and last parameters under most circumstances. For instance, the example above is equivalent to:

/cogsbar create 6x4 stance:1-3

You can also omit just the first parameter and the command will use the default value. E.g.:

/cogsbar create 6x4 stance:3

This is useful for conserving action slots when you know you don’t care about certain states. Normally for a Druid the default values are 0-6. This gives you mappings for every possible shapeshift form. However, if you have neither Tree of Life nor Moonkin form and you don’t have the Burning Crusade (hence flight form), you can use the command:

/cogsbar create 12x1 stance:4

which will provide you with mappings for caster, aquatic, bear, travel, & cat forms.

The other key benefit to manual input of first and last is if Blizzard adds more state types to SecureStateDriverTemplate.

Warnings

With flexibility comes responsibility. As such, there are a few caveats to watch out for. First, because you are allowed to specify a state that CogsBar doesn't know about inherently, you must take care not to misspell your state types. For instance, if you issued the command:

/cogsbar create 12x2 satnce

CogsBar would still create the bar and use up 48 actions (the default first and last values for unknown state types are 0-1). It does display a warning about unknown state type in case you did make such a mistake. If you see this warning, you should remove the newly created bar and try again.

Also, behavior is undefined if you specify a range smaller than what might actually occur. For example, if you have a bar created like:

/cogsbar create 12x1 actionbar:1-2

and you switch to action bar page 3, I’m not exactly sure what will happen... :o)

A similar issue is the expansion of the state type. For instance, if you have a bar created with:

/cogsbar create 6x2 actionbar

while you have two available action bar pages (because the default UI’s “extra” action bars use up pages from the main action bar), it will create two mappings. Now you get all your actions set up just how you want them and for some reason decide to disable all the built-in extra action bars. When you log into the game again, CogsBar will create the bar to take advantage of all six action bar pages, effectively “eating up” the actions from any bars created after it.

Key binding

Finally, we have the bind command. It simply toggles bindings on the left 24 keys of the keyboard to the first 24 buttons of CogsBar. To be honest, this is the least flexible part of this addon. In order to customize it in any way, you’ll have to open up the source code and do some fiddling. The only reason I even included it was for my own purposes. If you have a 6x4 grid like I’ve shown above, the bindings would be layed out as:

1 2 3 4 5 6
Q W E R T Y
A S D F G H
Z X C V B N

Since I use the Dvorak layout, I have also provided keybindings for its corresponding keys. You will have to uncomment them in CogsBar.lua and comment out the QWERTY ones.

See readme.html for a complete command reference
There is no dependency information for this file.
v1.6
  • Added support for multiple states on the same bar.
  • States can now be supplied without ranges which will apply default values.
  • Added sanity checks for state types (e.g. Warriors cannot use the stealth state).

v1.5
  • First generally usable release. Added all the slash commands and configuration options.

v1.1
  • Finished one of the comments I had forgotten about.
  • Made QWERTY the default binding layout.

v1.0
  • Initial release. This version only created one 6x4 bar that responded to stance changes and was meant as a simple (and well-commented) example of the use of state headers.
XML Syndication
Current: 1.6

6161 downloads
(25 today)
Author's Website

Rate File
Thumbnail

Comments

Post a comment

You must be registered and logged in to post a comment.

Username: Password:

Register

WoW Guru
Advertise on the MMO Guru Network!

Language
MMO Guru Network