Targetware: Customizing the User Interface


Widget Type: Console

This widget controls the text buffer that players use to communicate with each other, receive feedback from the system, and give the system "dot commands". The functionality of the console can be limited to a single function, such as just error messages, or it can have all possible messages flowing into it. Multiple consoles could be set up if desired, to have, for example, player to player messages on in a large console, and system messages under that in a smaller console.

Sample Console Code

  [Game Widget 8]
# console
type = console
pos = 4, -20
pos_type = 1, 1
size = -8, 18
min_lines = 4
max_lines = 30
label =
label_color = 0, 255, 0, 255
color = 0, 0, 0, 76
texture =
texcoord1 =
texcoord2 =
hl_color = 0, 0, 255, 127
hl_texture =
hl_texcoord1 =
hl_texcoord2 =
disable_text_color =
disable_color =
disable_texture =
disable_texcoord1 =
disable_texcoord2 =
error_color = 255, 0, 0, 255
alert_color = 255, 255, 0, 255
status_color = 255, 255, 0, 255
enemy_color = 255, 0, 0, 255
friendly_color = 0, 255, 0, 255
team_color = 0, 255, 0, 255
unit_color = 0, 255, 0, 255
squad_color = 0, 255, 0, 255
center = 0
disable = 0
emboss = 1
function = 1, 2, 3, 4, 5, 6, 7, 8, 9

This is the only console widget we use in the Targetware default User Interface. Note how it includes every available console function, 1-9, and how each type of message text can be assigned its own color. Also note that the size of the console in "normal" and "expanded" states (as controlled by user hitting the "TAB" key) is set by the min_lines and max_lines settings. You could have an invisible console that only showed when you hit the buffer expansion key, by setting min_lines to 0, and max_lines to 4, for example.

Text Functions

The functions for the text widget all involve system feedback to the user. The current list of available functions is as follows:

  1 error messages
2 alert messages
3 flight messages
4 enemy messages
5 friendly messages
6 team messages
7 unit messages
8 squad messages
9 resizes (consoles without this function do not change size on CTL+TAB)