MAIN
home
modding home
ARITCLES
basic scenario creation
uniform modding overview
the order of things
variables reference
commands reference
map layout
INI FILES
cwbr.ini
level.ini
MAP CSV LAYOUT
map_name.csv
SCENARIO CSV LAYOUT
units.csv
events.csv
objectives.csv
MAIN CSV LAYOUT
artyammo.csv
effects.csv
formation.csv
gamescreens.csv
gamesounds.csv
levels.csv
mainscreens.csv
mainsounds.csv
names.csv
openobjs.csv
openplay.csv
sprites.csv
tables.csv
toolbar.csv
tooltext.csv
unitcommon.csv
units.csv
unitsprite.csv
weapons.csv
toolbar.csv

The toolbar.csv file defines all of the toolbars in the game. There is a limit of 200 total toolbars. That means that you can only have 200 different toolbar names in the toolbar.csv file. The reason for this limit is that by hardcoding a number we are able to increase the access time to all of the different toolbars. We may increase this number in our next game release, but not for a patch.

This file describes all graphical components of toolbars, the text for the toolbars is in the tooltext.csv file. These files use the same exact names to refer to the different toolbars. The unitcommon.csv file assigns the toolbars to the different units in the game.

Each toolbar comes in 3 versions. The first version is the version that you use when this unit is under your command. The second version is when the unit is in your army but not under your command. The third version is the toolbar that is shown to the enemy. Depending on your design, you could possibly combine the friendly and enemy toolbars, but that choice is up to you, we do not. If you exceed the 200 limit, the results could cause a crash.

Toolbars are drawn in descending order. That means that you must place the background of the toolbar first. If you place the buttons and then place the background, the buttons will be hidden. The toolbar graphics are drawn in the same exact order as they are presented in the file.

Toolbars support inheritance. That means that you can create a base class toolbar with common functions, and have other toolbars INHERIT from it. This really eases the process when making global changes and keeps the file smaller and more easily managable.

Each button supports 4 states: Normal - the normal button with no changes, Highlighted - shown when the highlight condition is met, gray - we do not currently use this state, Active - shown when the mouse cursor is over the button.

Column Explanation
A: Toolbar This is the name of the toolbar. This same exact name is used in tooltext.csv and unitcommon.csv. Since there can be a lot of toolbars, we suggest using a naming convention that will be easily understood, because you can become lost.
B: Sprite This is either the name of the sprite from the sprites.csv file or the word INHERIT. If you use the word INHERIT here, the next column must contain the name of the toolbar from which you want to INERHIT from. Meaning that the inherited toolbar will be completely included for this toolbar.
C: loc x (across) If you are using INHERIT, this colum will contain the name of the toolbar from which you wish to INHERIT. Otherwise it contains the 2D X coordinate of the upper left corner of where you want to draw the sprite. Remember that these coordinates are 2D with the screen being an 800x600 area.
D: loc y (down) This is the 2D Y coordinate of the upper left corner of where you want to draw the sprite.
E: Button Sound This contains the name of a sound from the gamesounds.csv file. This is only used when this line references a button with an associated function. The default sound is click, unless a different one is specified here. This sound is played when the user presses and releases the button.
F: Normal (across) This is the 0 based index of the graphic from sprite referenced, just start at 0 and count across until you reach the column of the sprite that you want. We group the button sprites together in one file for ease of use. This specifies the index normal state of the graphic. This state will be shown if the graphic does not qualify for any of the other states explained below. Leave this as 0 if there is only 1 graphic in the sprite.
G: Normal (down) This is the 0 based index of the graphic from sprite referenced, just start at 0 and count down until you reach the row of the sprite that you want. We group the button sprites together in one file for ease of use. This specifies the index normal state of the graphic. This state will be shown if the graphic does not qualify for any of the other states explained below. Leave this as 0 if there is only 1 graphic in the sprite.
H: Highlighted (across) Same as Normal (across), but specifies the highlighted state.
I: Highlighted (down) Same as Normal (down), but specifies the highlighted state.
J: Gray (across) Same as Normal (across), but specifies the grayed out state.
K: Gray (down) Same as Normal (down), but specifies the grayed out state.
L: Active (across) Same as Normal (across), but specifies the active state. The active state is used when the cursor is over the button.
M: Active (down) Same as Normal (down), but specifies the active state. The active state is used when the cursor is over the button.
N: mod left If you want to have a smaller active area for particular buttons, you can use the mod parameters. We currently only use this for the wheeling buttons. Basically if you put a number in here it is added to the current side of the rectangle in order to obtain a hit area. For example: in our wheel right button, we put a value of 19 in here. This means that 19 is added to the left side of the rectangle of this button. So this effectively creates 2 buttons out of 1, but specifying a hit area on only the right side of the button.
O: mod top This works the same as mod left, but adds the value to the top of the rectangle, we do not currently use this option in any of our buttons.
P: mod right This works the same as the mod left, but adds the value to the right side of the triangle. For example: in our wheel left button, we put a value of -19 in here. This means that -19 is added to the right side of the rectangle of this button. So this effectively creates 2 buttons out of 1, but specifying a hit area on only the left side of the button.
Q: mod bottom This works the same as mod left, but adds the value to the bottom of the rectangle, we do not currently use this option in any of our buttons.
R: func This is the function for the button. If this field is blank, then the program assumes that this is not a button. Please see the command reference for a list of valid function names.
S: text This is the tooltip text. This will appear whenever the user has the cursor over this graphic. You can have a tooltip for any graphic, it does not have to be a button.
T: Special

Currently the special field is only used for progress bars. We show them in many of our screens. On our toolbars, we use them for the morale, strength, and fatigue backgrounds. A sample progress bar looks like this:

progbar:#moralemin-#moralecur-#moralemax

This defines a progress bar. The sprite for a progress bar is assumed to be the proper size for when the progress bar is fully extended. The program will shrink the progress bar in order to show values that are smaller. Our progress bars currently only work left to right, we do not support up and down progress bars. Notice the 3 values used. These are variables that can be found in the variable reference document. All of the variables are preceded by the # sign. This means that the variable will be read and used as a number. The first variable is the value for the left side of the progress bar, the last variable is the value for the right side of the progress bar. The middle variable is the current value. The program will automatically calculate the length of the progress bar based on these 3 values. Don't forget to put the - between the values and make sure that there are no spaces. The code that reads these is not very robust.

U: Show Condition The show condition column is what it says, it will determine whether or not to draw this graphic. Please see the variable reference document on how to create condition functions. This can be used for any graphic, it does not have to be a button.
V: Highlight Condition This works the same as the Show Condition column, except that this determines whether or not to show the button in the highlighted state.