#include "ui_local.h"
Include dependency graph for ui_playersettings.c:

Go to the source code of this file.
Data Structures | |
| struct | playersettings_t |
Defines | |
| #define | ART_BACK0 "menu/art/back_0" |
| #define | ART_BACK1 "menu/art/back_1" |
| #define | ART_FRAMEL "menu/art/frame2_l" |
| #define | ART_FRAMER "menu/art/frame1_r" |
| #define | ART_FX_BASE "menu/art/fx_base" |
| #define | ART_FX_BLUE "menu/art/fx_blue" |
| #define | ART_FX_CYAN "menu/art/fx_cyan" |
| #define | ART_FX_GREEN "menu/art/fx_grn" |
| #define | ART_FX_RED "menu/art/fx_red" |
| #define | ART_FX_TEAL "menu/art/fx_teal" |
| #define | ART_FX_WHITE "menu/art/fx_white" |
| #define | ART_FX_YELLOW "menu/art/fx_yel" |
| #define | ART_MODEL0 "menu/art/model_0" |
| #define | ART_MODEL1 "menu/art/model_1" |
| #define | ID_BACK 13 |
| #define | ID_EFFECTS 12 |
| #define | ID_HANDICAP 11 |
| #define | ID_MODEL 14 |
| #define | ID_NAME 10 |
| #define | MAX_NAMELENGTH 20 |
Functions | |
| void | PlayerSettings_Cache (void) |
| void | PlayerSettings_DrawEffects (void *self) |
| void | PlayerSettings_DrawHandicap (void *self) |
| void | PlayerSettings_DrawName (void *self) |
| void | PlayerSettings_DrawPlayer (void *self) |
| void | PlayerSettings_MenuEvent (void *ptr, int event) |
| void | PlayerSettings_MenuInit (void) |
| sfxHandle_t | PlayerSettings_MenuKey (int key) |
| void | PlayerSettings_SaveChanges (void) |
| void | PlayerSettings_SetMenuItems (void) |
| void | UI_PlayerSettingsMenu (void) |
Variables | |
| int | gamecodetoui [] = {4,2,3,0,5,1,6} |
| const char * | handicap_items [] |
| playersettings_t | s_playersettings |
| int | uitogamecode [] = {4,6,2,3,1,5,7} |
|
|
Definition at line 29 of file ui_playersettings.c. |
|
|
Definition at line 30 of file ui_playersettings.c. |
|
|
Definition at line 25 of file ui_playersettings.c. |
|
|
Definition at line 26 of file ui_playersettings.c. |
|
|
Definition at line 31 of file ui_playersettings.c. Referenced by AssetCache(), and PlayerSettings_Cache(). |
|
|
Definition at line 32 of file ui_playersettings.c. Referenced by AssetCache(), and PlayerSettings_Cache(). |
|
|
Definition at line 33 of file ui_playersettings.c. Referenced by AssetCache(), and PlayerSettings_Cache(). |
|
|
Definition at line 34 of file ui_playersettings.c. Referenced by AssetCache(), and PlayerSettings_Cache(). |
|
|
Definition at line 35 of file ui_playersettings.c. Referenced by AssetCache(), and PlayerSettings_Cache(). |
|
|
Definition at line 36 of file ui_playersettings.c. Referenced by AssetCache(), and PlayerSettings_Cache(). |
|
|
Definition at line 37 of file ui_playersettings.c. Referenced by AssetCache(), and PlayerSettings_Cache(). |
|
|
Definition at line 38 of file ui_playersettings.c. Referenced by AssetCache(), and PlayerSettings_Cache(). |
|
|
Definition at line 27 of file ui_playersettings.c. Referenced by PlayerSettings_Cache(). |
|
|
Definition at line 28 of file ui_playersettings.c. Referenced by PlayerSettings_Cache(). |
|
|
Definition at line 43 of file ui_playersettings.c. |
|
|
Definition at line 42 of file ui_playersettings.c. |
|
|
Definition at line 41 of file ui_playersettings.c. Referenced by PlayerSettings_MenuEvent(). |
|
|
Definition at line 44 of file ui_playersettings.c. Referenced by PlayerSettings_MenuEvent(). |
|
|
Definition at line 40 of file ui_playersettings.c. |
|
|
Definition at line 46 of file ui_playersettings.c. Referenced by StartServer_Cache(), and StartServer_GametypeEvent(). |
|
Here is the call graph for this function:

|
|
Definition at line 205 of file ui_playersettings.c. References _tag_menuframework::cursor, menulist_s::curvalue, playersettings_t::fxBasePic, playersettings_t::fxPic, menulist_s::generic, menucommon_s::menuPosition, menucommon_s::parent, PROP_HEIGHT, qboolean, s_playersettings, UI_DrawHandlePic(), UI_DrawProportionalString(), UI_LEFT, menucommon_s::x, and menucommon_s::y. 00205 {
00206 menulist_s *item;
00207 qboolean focus;
00208 int style;
00209 float *color;
00210
00211 item = (menulist_s *)self;
00212 focus = (item->generic.parent->cursor == item->generic.menuPosition);
00213
00214 style = UI_LEFT|UI_SMALLFONT;
00215 color = text_color_normal;
00216 if( focus ) {
00217 style |= UI_PULSE;
00218 color = text_color_highlight;
00219 }
00220
00221 UI_DrawProportionalString( item->generic.x, item->generic.y, "Effects", style, color );
00222
00223 UI_DrawHandlePic( item->generic.x + 64, item->generic.y + PROP_HEIGHT + 8, 128, 8, s_playersettings.fxBasePic );
00224 UI_DrawHandlePic( item->generic.x + 64 + item->curvalue * 16 + 8, item->generic.y + PROP_HEIGHT + 6, 16, 12, s_playersettings.fxPic[item->curvalue] );
00225 }
|
Here is the call graph for this function:

|
|
Definition at line 179 of file ui_playersettings.c. References _tag_menuframework::cursor, menulist_s::curvalue, menulist_s::generic, handicap_items, menucommon_s::menuPosition, menucommon_s::parent, PROP_HEIGHT, qboolean, UI_DrawProportionalString(), UI_LEFT, menucommon_s::x, and menucommon_s::y. 00179 {
00180 menulist_s *item;
00181 qboolean focus;
00182 int style;
00183 float *color;
00184
00185 item = (menulist_s *)self;
00186 focus = (item->generic.parent->cursor == item->generic.menuPosition);
00187
00188 style = UI_LEFT|UI_SMALLFONT;
00189 color = text_color_normal;
00190 if( focus ) {
00191 style |= UI_PULSE;
00192 color = text_color_highlight;
00193 }
00194
00195 UI_DrawProportionalString( item->generic.x, item->generic.y, "Handicap", style, color );
00196 UI_DrawProportionalString( item->generic.x + 64, item->generic.y + PROP_HEIGHT, handicap_items[item->curvalue], style, color );
00197 }
|
Here is the call graph for this function:

|
|
Definition at line 107 of file ui_playersettings.c. References mfield_t::buffer, c, color_white, COLOR_WHITE, ColorIndex, mfield_t::cursor, _tag_menuframework::cursor, f, menufield_s::field, g_color_table, menufield_s::generic, menucommon_s::menuPosition, n, name, menucommon_s::parent, Q_CleanStr(), Q_IsColorString, Q_strncpyz(), qboolean, SMALLCHAR_WIDTH, text_color_normal, trap_Key_GetOverstrikeMode(), UI_BIGFONT, UI_CENTER, UI_DrawChar(), UI_DrawProportionalString(), UI_LEFT, x, menucommon_s::x, menucommon_s::y, and y. 00107 {
00108 menufield_s *f;
00109 qboolean focus;
00110 int style;
00111 char *txt;
00112 char c;
00113 float *color;
00114 int n;
00115 int basex, x, y;
00116 char name[32];
00117
00118 f = (menufield_s*)self;
00119 basex = f->generic.x;
00120 y = f->generic.y;
00121 focus = (f->generic.parent->cursor == f->generic.menuPosition);
00122
00123 style = UI_LEFT|UI_SMALLFONT;
00124 color = text_color_normal;
00125 if( focus ) {
00126 style |= UI_PULSE;
00127 color = text_color_highlight;
00128 }
00129
00130 UI_DrawProportionalString( basex, y, "Name", style, color );
00131
00132 // draw the actual name
00133 basex += 64;
00134 y += PROP_HEIGHT;
00135 txt = f->field.buffer;
00136 color = g_color_table[ColorIndex(COLOR_WHITE)];
00137 x = basex;
00138 while ( (c = *txt) != 0 ) {
00139 if ( !focus && Q_IsColorString( txt ) ) {
00140 n = ColorIndex( *(txt+1) );
00141 if( n == 0 ) {
00142 n = 7;
00143 }
00144 color = g_color_table[n];
00145 txt += 2;
00146 continue;
00147 }
00148 UI_DrawChar( x, y, c, style, color );
00149 txt++;
00150 x += SMALLCHAR_WIDTH;
00151 }
00152
00153 // draw cursor if we have focus
00154 if( focus ) {
00155 if ( trap_Key_GetOverstrikeMode() ) {
00156 c = 11;
00157 } else {
00158 c = 10;
00159 }
00160
00161 style &= ~UI_PULSE;
00162 style |= UI_BLINK;
00163
00164 UI_DrawChar( basex + f->field.cursor * SMALLCHAR_WIDTH, y, c, style, color_white );
00165 }
00166
00167 // draw at bottom also using proportional font
00168 Q_strncpyz( name, f->field.buffer, sizeof(name) );
00169 Q_CleanStr( name );
00170 UI_DrawProportionalString( 320, 440, name, UI_CENTER|UI_BIGFONT, text_color_normal );
00171 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 325 of file ui_playersettings.c. References menulist_s::curvalue, playersettings_t::handicap, ID_BACK, ID_HANDICAP, ID_MODEL, PlayerSettings_SaveChanges(), s_playersettings, trap_Cvar_Set(), UI_PlayerModelMenu(), UI_PopMenu(), and va(). 00325 {
00326 if( event != QM_ACTIVATED ) {
00327 return;
00328 }
00329
00330 switch( ((menucommon_s*)ptr)->id ) {
00331 case ID_HANDICAP:
00332 trap_Cvar_Set( "handicap", va( "%i", 100 - 25 * s_playersettings.handicap.curvalue ) );
00333 break;
00334
00335 case ID_MODEL:
00336 PlayerSettings_SaveChanges();
00337 UI_PlayerModelMenu();
00338 break;
00339
00340 case ID_BACK:
00341 PlayerSettings_SaveChanges();
00342 UI_PopMenu();
00343 break;
00344 }
00345 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 276 of file ui_playersettings.c. References K_MOUSE2, playersettings_t::menu, Menu_DefaultKey(), PlayerSettings_SaveChanges(), s_playersettings, and sfxHandle_t. 00276 {
00277 if( key == K_MOUSE2 || key == K_ESCAPE ) {
00278 PlayerSettings_SaveChanges();
00279 }
00280 return Menu_DefaultKey( &s_playersettings.menu, key );
00281 }
|
Here is the call graph for this function:

|
|
Definition at line 259 of file ui_playersettings.c. References mfield_t::buffer, menulist_s::curvalue, playersettings_t::effects, menufield_s::field, playersettings_t::handicap, playersettings_t::name, s_playersettings, trap_Cvar_Set(), trap_Cvar_SetValue(), and uitogamecode. Referenced by PlayerSettings_MenuEvent(), and PlayerSettings_MenuKey(). 00259 {
00260 // name
00261 trap_Cvar_Set( "name", s_playersettings.name.field.buffer );
00262
00263 // handicap
00264 trap_Cvar_SetValue( "handicap", 100 - s_playersettings.handicap.curvalue * 5 );
00265
00266 // effects color
00267 trap_Cvar_SetValue( "color1", uitogamecode[s_playersettings.effects.curvalue] );
00268 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 510 of file ui_playersettings.c. References playersettings_t::menu, PlayerSettings_MenuInit(), s_playersettings, and UI_PushMenu(). 00510 {
00511 PlayerSettings_MenuInit();
00512 UI_PushMenu( &s_playersettings.menu );
00513 }
|
Here is the call graph for this function:

|
|
Definition at line 74 of file ui_playersettings.c. Referenced by PlayerSettings_SetMenuItems(). |
|
|
Initial value: {
"None",
"95",
"90",
"85",
"80",
"75",
"70",
"65",
"60",
"55",
"50",
"45",
"40",
"35",
"30",
"25",
"20",
"15",
"10",
"5",
0
}
Definition at line 77 of file ui_playersettings.c. Referenced by PlayerSettings_DrawHandicap(). |
|
|
Definition at line 72 of file ui_playersett |