Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ui_network.c File Reference

#include "ui_local.h"

Include dependency graph for ui_network.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  networkOptionsInfo_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 ID_BACK   15
#define ID_DISPLAY   11
#define ID_GRAPHICS   10
#define ID_NETWORK   13
#define ID_RATE   14
#define ID_SOUND   12

Functions

void UI_NetworkOptionsMenu (void)
void UI_NetworkOptionsMenu_Cache (void)
void UI_NetworkOptionsMenu_Event (void *ptr, int event)
void UI_NetworkOptionsMenu_Init (void)

Variables

networkOptionsInfo_t networkOptionsInfo
const char * rate_items []


Define Documentation

#define ART_BACK0   "menu/art/back_0"
 

Definition at line 36 of file ui_network.c.

#define ART_BACK1   "menu/art/back_1"
 

Definition at line 37 of file ui_network.c.

#define ART_FRAMEL   "menu/art/frame2_l"
 

Definition at line 34 of file ui_network.c.

#define ART_FRAMER   "menu/art/frame1_r"
 

Definition at line 35 of file ui_network.c.

#define ID_BACK   15
 

Definition at line 44 of file ui_network.c.

#define ID_DISPLAY   11
 

Definition at line 40 of file ui_network.c.

#define ID_GRAPHICS   10
 

Definition at line 39 of file ui_network.c.

#define ID_NETWORK   13
 

Definition at line 42 of file ui_network.c.

#define ID_RATE   14
 

Definition at line 43 of file ui_network.c.

Referenced by UI_NetworkOptionsMenu_Event().

#define ID_SOUND   12
 

Definition at line 41 of file ui_network.c.


Function Documentation

void UI_NetworkOptionsMenu void   ) 
 

Definition at line 277 of file ui_network.c.

References networkOptionsInfo_t::menu, Menu_SetCursorToItem(), networkOptionsInfo_t::network, networkOptionsInfo, UI_NetworkOptionsMenu_Init(), and UI_PushMenu().

Here is the call graph for this function:

void UI_NetworkOptionsMenu_Cache void   ) 
 

Definition at line 264 of file ui_network.c.

References ART_BACK0, ART_BACK1, ART_FRAMEL, ART_FRAMER, and trap_R_RegisterShaderNoMip().

00264                                          {
00265     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00266     trap_R_RegisterShaderNoMip( ART_FRAMER );
00267     trap_R_RegisterShaderNoMip( ART_BACK0 );
00268     trap_R_RegisterShaderNoMip( ART_BACK1 );
00269 }

Here is the call graph for this function:

void UI_NetworkOptionsMenu_Event void *  ptr,
int  event
[static]
 

Definition at line 81 of file ui_network.c.

References menulist_s::curvalue, ID_BACK, ID_DISPLAY, ID_GRAPHICS, ID_NETWORK, ID_RATE, ID_SOUND, networkOptionsInfo, networkOptionsInfo_t::rate, trap_Cvar_SetValue(), UI_DisplayOptionsMenu(), UI_GraphicsOptionsMenu(), UI_PopMenu(), and UI_SoundOptionsMenu().

00081                                                                 {
00082     if( event != QM_ACTIVATED ) {
00083         return;
00084     }
00085 
00086     switch( ((menucommon_s*)ptr)->id ) {
00087     case ID_GRAPHICS:
00088         UI_PopMenu();
00089         UI_GraphicsOptionsMenu();
00090         break;
00091 
00092     case ID_DISPLAY:
00093         UI_PopMenu();
00094         UI_DisplayOptionsMenu();
00095         break;
00096 
00097     case ID_SOUND:
00098         UI_PopMenu();
00099         UI_SoundOptionsMenu();
00100         break;
00101 
00102     case ID_NETWORK:
00103         break;
00104 
00105     case ID_RATE:
00106         if( networkOptionsInfo.rate.curvalue == 0 ) {
00107             trap_Cvar_SetValue( "rate", 2500 );
00108         }
00109         else if( networkOptionsInfo.rate.curvalue == 1 ) {
00110             trap_Cvar_SetValue( "rate", 3000 );
00111         }
00112         else if( networkOptionsInfo.rate.curvalue == 2 ) {
00113             trap_Cvar_SetValue( "rate", 4000 );
00114         }
00115         else if( networkOptionsInfo.rate.curvalue == 3 ) {
00116             trap_Cvar_SetValue( "rate", 5000 );
00117         }
00118         else if( networkOptionsInfo.rate.curvalue == 4 ) {
00119             trap_Cvar_SetValue( "rate", 25000 );
00120         }
00121         break;
00122 
00123     case ID_BACK:
00124         UI_PopMenu();
00125         break;
00126     }
00127 }

Here is the call graph for this function:

void UI_NetworkOptionsMenu_Init void   )  [static]
 

Definition at line 135 of file ui_network.c.

References networkOptionsInfo_t::back, networkOptionsInfo_t::banner, BIGCHAR_HEIGHT, menucommon_s::callback, menutext_s::color, menulist_s::curvalue, networkOptionsInfo_t::display, menucommon_s::flags, menubitmap_s::focuspic, networkOptionsInfo_t::framel, networkOptionsInfo_t::framer, _tag_menuframework::fullscreen, menulist_s::generic, menubitmap_s::generic, menutext_s::generic, networkOptionsInfo_t::graphics, menubitmap_s::height, menucommon_s::id, menulist_s::itemnames, memset(), networkOptionsInfo_t::menu, Menu_AddItem(), menucommon_s::name, networkOptionsInfo_t::network, networkOptionsInfo, QMF_LEFT_JUSTIFY, QMF_PULSEIFFOCUS, QMF_RIGHT_JUSTIFY, networkOptionsInfo_t::rate, networkOptionsInfo_t::sound, menutext_s::string, menutext_s::style, trap_Cvar_VariableValue(), menucommon_s::type, UI_NetworkOptionsMenu_Cache(), menubitmap_s::width, _tag_menuframework::wrapAround, menucommon_s::x, y, and menucommon_s::y.

Referenced by UI_NetworkOptionsMenu().

00135                                                {
00136     int     y;
00137     int     rate;
00138 
00139     memset( &networkOptionsInfo, 0, sizeof(networkOptionsInfo) );
00140 
00141     UI_NetworkOptionsMenu_Cache();
00142     networkOptionsInfo.menu.wrapAround = qtrue;
00143     networkOptionsInfo.menu.fullscreen = qtrue;
00144 
00145     networkOptionsInfo.banner.generic.type      = MTYPE_BTEXT;
00146     networkOptionsInfo.banner.generic.flags     = QMF_CENTER_JUSTIFY;
00147     networkOptionsInfo.banner.generic.x         = 320;
00148     networkOptionsInfo.banner.generic.y         = 16;
00149     networkOptionsInfo.banner.string            = "SYSTEM SETUP";
00150     networkOptionsInfo.banner.color             = color_white;
00151     networkOptionsInfo.banner.style             = UI_CENTER;
00152 
00153     networkOptionsInfo.framel.generic.type      = MTYPE_BITMAP;
00154     networkOptionsInfo.framel.generic.name      = ART_FRAMEL;
00155     networkOptionsInfo.framel.generic.flags     = QMF_INACTIVE;
00156     networkOptionsInfo.framel.generic.x         = 0;  
00157     networkOptionsInfo.framel.generic.y         = 78;
00158     networkOptionsInfo.framel.width             = 256;
00159     networkOptionsInfo.framel.height            = 329;
00160 
00161     networkOptionsInfo.framer.generic.type      = MTYPE_BITMAP;
00162     networkOptionsInfo.framer.generic.name      = ART_FRAMER;
00163     networkOptionsInfo.framer.generic.flags     = QMF_INACTIVE;
00164     networkOptionsInfo.framer.generic.x         = 376;
00165     networkOptionsInfo.framer.generic.y         = 76;
00166     networkOptionsInfo.framer.width             = 256;
00167     networkOptionsInfo.framer.height            = 334;
00168 
00169     networkOptionsInfo.graphics.generic.type        = MTYPE_PTEXT;
00170     networkOptionsInfo.graphics.generic.flags       = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
00171     networkOptionsInfo.graphics.generic.id          = ID_GRAPHICS;
00172     networkOptionsInfo.graphics.generic.callback    = UI_NetworkOptionsMenu_Event;
00173     networkOptionsInfo.graphics.generic.x           = 216;
00174     networkOptionsInfo.graphics.generic.y           = 240 - 2 * PROP_HEIGHT;
00175     networkOptionsInfo.graphics.string              = "GRAPHICS";
00176     networkOptionsInfo.graphics.style               = UI_RIGHT;
00177     networkOptionsInfo.graphics.color               = color_red;
00178 
00179     networkOptionsInfo.display.generic.type         = MTYPE_PTEXT;
00180     networkOptionsInfo.display.generic.flags        = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
00181     networkOptionsInfo.display.generic.id           = ID_DISPLAY;
00182     networkOptionsInfo.display.generic.callback     = UI_NetworkOptionsMenu_Event;
00183     networkOptionsInfo.display.generic.x            = 216;
00184     networkOptionsInfo.display.generic.y            = 240 - PROP_HEIGHT;
00185     networkOptionsInfo.display.string               = "DISPLAY";
00186     networkOptionsInfo.display.style                = UI_RIGHT;
00187     networkOptionsInfo.display.color                = color_red;
00188 
00189     networkOptionsInfo.sound.generic.type           = MTYPE_PTEXT;
00190     networkOptionsInfo.sound.generic.flags          = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
00191     networkOptionsInfo.sound.generic.id             = ID_SOUND;
00192     networkOptionsInfo.sound.generic.callback       = UI_NetworkOptionsMenu_Event;
00193     networkOptionsInfo.sound.generic.x              = 216;
00194     networkOptionsInfo.sound.generic.y              = 240;
00195     networkOptionsInfo.sound.string                 = "SOUND";
00196     networkOptionsInfo.sound.style                  = UI_RIGHT;
00197     networkOptionsInfo.sound.color                  = color_red;
00198 
00199     networkOptionsInfo.network.generic.type         = MTYPE_PTEXT;
00200     networkOptionsInfo.network.generic.flags        = QMF_RIGHT_JUSTIFY;
00201     networkOptionsInfo.network.generic.id           = ID_NETWORK;
00202     networkOptionsInfo.network.generic.callback     = UI_NetworkOptionsMenu_Event;
00203     networkOptionsInfo.network.generic.x            = 216;
00204     networkOptionsInfo.network.generic.y            = 240 + PROP_HEIGHT;
00205     networkOptionsInfo.network.string               = "NETWORK";
00206     networkOptionsInfo.network.style                = UI_RIGHT;
00207     networkOptionsInfo.network.color                = color_red;
00208 
00209     y = 240 - 1 * (BIGCHAR_HEIGHT+2);
00210     networkOptionsInfo.rate.generic.type        = MTYPE_SPINCONTROL;
00211     networkOptionsInfo.rate.generic.name        = "Data Rate:";
00212     networkOptionsInfo.rate.generic.flags       = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
00213     networkOptionsInfo.rate.generic.callback    = UI_NetworkOptionsMenu_Event;
00214     networkOptionsInfo.rate.generic.id          = ID_RATE;
00215     networkOptionsInfo.rate.generic.x           = 400;
00216     networkOptionsInfo.rate.generic.y           = y;
00217     networkOptionsInfo.rate.itemnames           = rate_items;
00218 
00219     networkOptionsInfo.back.generic.type        = MTYPE_BITMAP;
00220     networkOptionsInfo.back.generic.name        = ART_BACK0;
00221     networkOptionsInfo.back.generic.flags       = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
00222     networkOptionsInfo.back.generic.callback    = UI_NetworkOptionsMenu_Event;
00223     networkOptionsInfo.back.generic.id          = ID_BACK;
00224     networkOptionsInfo.back.generic.x           = 0;
00225     networkOptionsInfo.back.generic.y           = 480-64;
00226     networkOptionsInfo.back.width               = 128;
00227     networkOptionsInfo.back.height              = 64;
00228     networkOptionsInfo.back.focuspic            = ART_BACK1;
00229 
00230     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.banner );
00231     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.framel );
00232     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.framer );
00233     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.graphics );
00234     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.display );
00235     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.sound );
00236     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.network );
00237     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.rate );
00238     Menu_AddItem( &networkOptionsInfo.menu, ( void * ) &networkOptionsInfo.back );
00239 
00240     rate = trap_Cvar_VariableValue( "rate" );
00241     if( rate <= 2500 ) {
00242         networkOptionsInfo.rate.curvalue = 0;
00243     }
00244     else if( rate <= 3000 ) {
00245         networkOptionsInfo.rate.curvalue = 1;
00246     }
00247     else if( rate <= 4000 ) {
00248         networkOptionsInfo.rate.curvalue = 2;
00249     }
00250     else if( rate <= 5000 ) {
00251         networkOptionsInfo.rate.curvalue = 3;
00252     }
00253     else {
00254         networkOptionsInfo.rate.curvalue = 4;
00255     }
00256 }

Here is the call graph for this function:


Variable Documentation

networkOptionsInfo_t networkOptionsInfo [static]
 

Definition at line 73 of file ui_network.c.

Referenced by UI_NetworkOptionsMenu(), UI_NetworkOptionsMenu_Event(), and UI_NetworkOptionsMenu_Init().

const char* rate_items[] [static]
 

Initial value:

 {
    "<= 28.8K",
    "33.6K",
    "56K",
    "ISDN",
    "LAN/Cable/xDSL",
    0
}

Definition at line 47 of file ui_network.c.


Generated on Thu Aug 25 14:33:04 2005 for Quake III Arena by  doxygen 1.3.9.1