本文整理汇总了C++中Menu_AddItem函数的典型用法代码示例。如果您正苦于以下问题:C++ Menu_AddItem函数的具体用法?C++ Menu_AddItem怎么用?C++ Menu_AddItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Menu_AddItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UI_SPSkillMenu_Init
//.........这里部分代码省略.........
skillMenuInfo.item_medium.generic.type = MTYPE_PTEXT;
skillMenuInfo.item_medium.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
skillMenuInfo.item_medium.generic.x = 320;
skillMenuInfo.item_medium.generic.y = 227;
skillMenuInfo.item_medium.generic.callback = UI_SPSkillMenu_SkillEvent;
skillMenuInfo.item_medium.generic.id = ID_MEDIUM;
#ifdef TA_MISC // SRB2_SKILLS
skillMenuInfo.item_medium.string = "Hard";
#else
skillMenuInfo.item_medium.string = "Hurt Me Plenty";
#endif
skillMenuInfo.item_medium.color = text_big_color;
skillMenuInfo.item_medium.style = UI_CENTER;
skillMenuInfo.item_hard.generic.type = MTYPE_PTEXT;
skillMenuInfo.item_hard.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
skillMenuInfo.item_hard.generic.x = 320;
skillMenuInfo.item_hard.generic.y = 255;
skillMenuInfo.item_hard.generic.callback = UI_SPSkillMenu_SkillEvent;
skillMenuInfo.item_hard.generic.id = ID_HARD;
#ifdef TA_MISC // SRB2_SKILLS
skillMenuInfo.item_hard.string = "Very Hard";
#else
skillMenuInfo.item_hard.string = "Hardcore";
#endif
skillMenuInfo.item_hard.color = text_big_color;
skillMenuInfo.item_hard.style = UI_CENTER;
skillMenuInfo.item_nightmare.generic.type = MTYPE_PTEXT;
skillMenuInfo.item_nightmare.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
skillMenuInfo.item_nightmare.generic.x = 320;
skillMenuInfo.item_nightmare.generic.y = 283;
skillMenuInfo.item_nightmare.generic.callback = UI_SPSkillMenu_SkillEvent;
skillMenuInfo.item_nightmare.generic.id = ID_NIGHTMARE;
#ifdef TA_MISC // SRB2_SKILLS
skillMenuInfo.item_nightmare.string = "Ultimate";
#else
skillMenuInfo.item_nightmare.string = "NIGHTMARE!";
#endif
skillMenuInfo.item_nightmare.color = text_big_color;
skillMenuInfo.item_nightmare.style = UI_CENTER;
skillMenuInfo.item_back.generic.type = MTYPE_BITMAP;
skillMenuInfo.item_back.generic.name = ART_BACK;
skillMenuInfo.item_back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
skillMenuInfo.item_back.generic.x = 0;
skillMenuInfo.item_back.generic.y = 480-64;
skillMenuInfo.item_back.generic.callback = UI_SPSkillMenu_BackEvent;
skillMenuInfo.item_back.generic.id = ID_BACK;
skillMenuInfo.item_back.width = 128;
skillMenuInfo.item_back.height = 64;
skillMenuInfo.item_back.focuspic = ART_BACK_FOCUS;
#ifndef TA_MISC // SRB2_SKILLS
skillMenuInfo.art_skillPic.generic.type = MTYPE_BITMAP;
skillMenuInfo.art_skillPic.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
skillMenuInfo.art_skillPic.generic.x = 320-64;
skillMenuInfo.art_skillPic.generic.y = 368;
skillMenuInfo.art_skillPic.width = 128;
skillMenuInfo.art_skillPic.height = 96;
#endif
skillMenuInfo.item_fight.generic.type = MTYPE_BITMAP;
skillMenuInfo.item_fight.generic.name = ART_FIGHT;
skillMenuInfo.item_fight.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
skillMenuInfo.item_fight.generic.callback = UI_SPSkillMenu_FightEvent;
skillMenuInfo.item_fight.generic.id = ID_FIGHT;
skillMenuInfo.item_fight.generic.x = 640;
skillMenuInfo.item_fight.generic.y = 480-64;
skillMenuInfo.item_fight.width = 128;
skillMenuInfo.item_fight.height = 64;
skillMenuInfo.item_fight.focuspic = ART_FIGHT_FOCUS;
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.art_frame );
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.art_banner );
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.item_baby );
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.item_easy );
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.item_medium );
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.item_hard );
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.item_nightmare );
#ifndef TA_MISC // SRB2_SKILLS
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.art_skillPic );
#endif
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.item_back );
Menu_AddItem( &skillMenuInfo.menu, ( void * )&skillMenuInfo.item_fight );
skill = (int)Com_Clamp( 1, 5, trap_Cvar_VariableValue( "g_spSkill" ) );
#ifdef TURTLEARENA
SetSkillColor( skill, color_orange );
#else
SetSkillColor( skill, color_white );
#endif
#ifndef TA_MISC // SRB2_SKILLS
skillMenuInfo.art_skillPic.shader = skillMenuInfo.skillpics[skill - 1];
if( skill == 5 ) {
trap_S_StartLocalSound( skillMenuInfo.nightmareSound, CHAN_ANNOUNCER );
}
#endif
}
示例2: InGame_MenuInit
//.........这里部分代码省略.........
s_ingame.removebots.generic.callback = InGame_Event;
s_ingame.removebots.string = "REMOVE BOTS";
s_ingame.removebots.color = color_red;
s_ingame.removebots.style = UI_CENTER | UI_SMALLFONT;
if (!trap_Cvar_VariableValue("sv_running") || !trap_Cvar_VariableValue("bot_enable") || (trap_Cvar_VariableValue("g_gametype") == GT_SINGLE_PLAYER)) {
s_ingame.removebots.generic.flags |= QMF_GRAYED;
}
y += INGAME_MENU_VERTICAL_SPACING;
s_ingame.setup.generic.type = MTYPE_PTEXT;
s_ingame.setup.generic.flags = QMF_CENTER_JUSTIFY | QMF_PULSEIFFOCUS;
s_ingame.setup.generic.x = 320;
s_ingame.setup.generic.y = y;
s_ingame.setup.generic.id = ID_SETUP;
s_ingame.setup.generic.callback = InGame_Event;
s_ingame.setup.string = "SETUP";
s_ingame.setup.color = color_red;
s_ingame.setup.style = UI_CENTER | UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
s_ingame.loadout.generic.type = MTYPE_PTEXT;
s_ingame.loadout.generic.flags = QMF_CENTER_JUSTIFY | QMF_PULSEIFFOCUS;
s_ingame.loadout.generic.x = 320;
s_ingame.loadout.generic.y = y;
s_ingame.loadout.generic.id = ID_LOADOUT;
s_ingame.loadout.generic.callback = InGame_Event;
s_ingame.loadout.string = "LOADOUT";
s_ingame.loadout.color = color_red;
s_ingame.loadout.style = UI_CENTER | UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
s_ingame.server.generic.type = MTYPE_PTEXT;
s_ingame.server.generic.flags = QMF_CENTER_JUSTIFY | QMF_PULSEIFFOCUS;
s_ingame.server.generic.x = 320;
s_ingame.server.generic.y = y;
s_ingame.server.generic.id = ID_SERVERINFO;
s_ingame.server.generic.callback = InGame_Event;
s_ingame.server.string = "SERVER INFO";
s_ingame.server.color = color_red;
s_ingame.server.style = UI_CENTER | UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
s_ingame.restart.generic.type = MTYPE_PTEXT;
s_ingame.restart.generic.flags = QMF_CENTER_JUSTIFY | QMF_PULSEIFFOCUS;
s_ingame.restart.generic.x = 320;
s_ingame.restart.generic.y = y;
s_ingame.restart.generic.id = ID_RESTART;
s_ingame.restart.generic.callback = InGame_Event;
s_ingame.restart.string = "RESTART ARENA";
s_ingame.restart.color = color_red;
s_ingame.restart.style = UI_CENTER | UI_SMALLFONT;
if (!trap_Cvar_VariableValue("sv_running")) {
s_ingame.restart.generic.flags |= QMF_GRAYED;
}
y += INGAME_MENU_VERTICAL_SPACING;
s_ingame.resume.generic.type = MTYPE_PTEXT;
s_ingame.resume.generic.flags = QMF_CENTER_JUSTIFY | QMF_PULSEIFFOCUS;
s_ingame.resume.generic.x = 320;
s_ingame.resume.generic.y = y;
s_ingame.resume.generic.id = ID_RESUME;
s_ingame.resume.generic.callback = InGame_Event;
s_ingame.resume.string = "RESUME GAME";
s_ingame.resume.color = color_red;
s_ingame.resume.style = UI_CENTER | UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
s_ingame.leave.generic.type = MTYPE_PTEXT;
s_ingame.leave.generic.flags = QMF_CENTER_JUSTIFY | QMF_PULSEIFFOCUS;
s_ingame.leave.generic.x = 320;
s_ingame.leave.generic.y = y;
s_ingame.leave.generic.id = ID_LEAVEARENA;
s_ingame.leave.generic.callback = InGame_Event;
s_ingame.leave.string = "LEAVE ARENA";
s_ingame.leave.color = color_red;
s_ingame.leave.style = UI_CENTER | UI_SMALLFONT;
y += INGAME_MENU_VERTICAL_SPACING;
s_ingame.quit.generic.type = MTYPE_PTEXT;
s_ingame.quit.generic.flags = QMF_CENTER_JUSTIFY | QMF_PULSEIFFOCUS;
s_ingame.quit.generic.x = 320;
s_ingame.quit.generic.y = y;
s_ingame.quit.generic.id = ID_QUIT;
s_ingame.quit.generic.callback = InGame_Event;
s_ingame.quit.string = "EXIT GAME";
s_ingame.quit.color = color_red;
s_ingame.quit.style = UI_CENTER | UI_SMALLFONT;
Menu_AddItem(&s_ingame.menu, &s_ingame.frame);
Menu_AddItem(&s_ingame.menu, &s_ingame.team);
Menu_AddItem(&s_ingame.menu, &s_ingame.addbots);
Menu_AddItem(&s_ingame.menu, &s_ingame.removebots);
Menu_AddItem(&s_ingame.menu, &s_ingame.setup);
Menu_AddItem(&s_ingame.menu, &s_ingame.loadout);
Menu_AddItem(&s_ingame.menu, &s_ingame.server);
Menu_AddItem(&s_ingame.menu, &s_ingame.restart);
Menu_AddItem(&s_ingame.menu, &s_ingame.resume);
Menu_AddItem(&s_ingame.menu, &s_ingame.leave);
Menu_AddItem(&s_ingame.menu, &s_ingame.quit);
}
示例3: UI_AddBotsMenu_Init
//.........这里部分代码省略.........
addBotsMenuInfo.arrows.height = 128;
addBotsMenuInfo.up.generic.type = MTYPE_BITMAP;
addBotsMenuInfo.up.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
addBotsMenuInfo.up.generic.x = 200;
addBotsMenuInfo.up.generic.y = 128;
addBotsMenuInfo.up.generic.id = ID_UP;
addBotsMenuInfo.up.generic.callback = UI_AddBotsMenu_UpEvent;
addBotsMenuInfo.up.width = 64;
addBotsMenuInfo.up.height = 64;
addBotsMenuInfo.up.focuspic = ART_ARROWUP;
addBotsMenuInfo.down.generic.type = MTYPE_BITMAP;
addBotsMenuInfo.down.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
addBotsMenuInfo.down.generic.x = 200;
addBotsMenuInfo.down.generic.y = 128+64;
addBotsMenuInfo.down.generic.id = ID_DOWN;
addBotsMenuInfo.down.generic.callback = UI_AddBotsMenu_DownEvent;
addBotsMenuInfo.down.width = 64;
addBotsMenuInfo.down.height = 64;
addBotsMenuInfo.down.focuspic = ART_ARROWDOWN;
for( n = 0, y = 120; n < count; n++, y += 20 ) {
addBotsMenuInfo.bots[n].generic.type = MTYPE_PTEXT;
addBotsMenuInfo.bots[n].generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
addBotsMenuInfo.bots[n].generic.id = ID_BOTNAME0 + n;
addBotsMenuInfo.bots[n].generic.x = 320 - 56;
addBotsMenuInfo.bots[n].generic.y = y;
addBotsMenuInfo.bots[n].generic.callback = UI_AddBotsMenu_BotEvent;
addBotsMenuInfo.bots[n].string = addBotsMenuInfo.botnames[n];
addBotsMenuInfo.bots[n].color = color_orange;
addBotsMenuInfo.bots[n].style = UI_LEFT|UI_SMALLFONT;
}
y += 12;
addBotsMenuInfo.skill.generic.type = MTYPE_SPINCONTROL;
addBotsMenuInfo.skill.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
addBotsMenuInfo.skill.generic.x = 320;
addBotsMenuInfo.skill.generic.y = y;
addBotsMenuInfo.skill.generic.name = "Skill:";
addBotsMenuInfo.skill.generic.id = ID_SKILL;
addBotsMenuInfo.skill.itemnames = skillNames;
addBotsMenuInfo.skill.curvalue = Com_Clamp( 0, 4, (int)UI_trap_Cvar_VariableValue( "g_spSkill" ) - 1 );
y += SMALLCHAR_HEIGHT;
addBotsMenuInfo.team.generic.type = MTYPE_SPINCONTROL;
addBotsMenuInfo.team.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
addBotsMenuInfo.team.generic.x = 320;
addBotsMenuInfo.team.generic.y = y;
addBotsMenuInfo.team.generic.name = "Team: ";
addBotsMenuInfo.team.generic.id = ID_TEAM;
if( gametype >= GT_TEAM ) {
addBotsMenuInfo.team.itemnames = teamNames2;
}
else {
addBotsMenuInfo.team.itemnames = teamNames1;
addBotsMenuInfo.team.generic.flags = QMF_GRAYED;
}
addBotsMenuInfo.go.generic.type = MTYPE_BITMAP;
addBotsMenuInfo.go.generic.name = ART_FIGHT0;
addBotsMenuInfo.go.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
addBotsMenuInfo.go.generic.id = ID_GO;
addBotsMenuInfo.go.generic.callback = UI_AddBotsMenu_FightEvent;
addBotsMenuInfo.go.generic.x = 320+128-128;
addBotsMenuInfo.go.generic.y = 256+128-64;
addBotsMenuInfo.go.width = 128;
addBotsMenuInfo.go.height = 64;
addBotsMenuInfo.go.focuspic = ART_FIGHT1;
addBotsMenuInfo.back.generic.type = MTYPE_BITMAP;
addBotsMenuInfo.back.generic.name = ART_BACK0;
addBotsMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
addBotsMenuInfo.back.generic.id = ID_BACK;
addBotsMenuInfo.back.generic.callback = UI_AddBotsMenu_BackEvent;
addBotsMenuInfo.back.generic.x = 320-128;
addBotsMenuInfo.back.generic.y = 256+128-64;
addBotsMenuInfo.back.width = 128;
addBotsMenuInfo.back.height = 64;
addBotsMenuInfo.back.focuspic = ART_BACK1;
addBotsMenuInfo.baseBotNum = 0;
addBotsMenuInfo.selectedBotNum = 0;
addBotsMenuInfo.bots[0].color = color_white;
UI_AddBotsMenu_GetSortedBotNums();
UI_AddBotsMenu_SetBotNames();
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.arrows );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.up );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.down );
for( n = 0; n < count; n++ ) {
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.bots[n] );
}
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.skill );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.team );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.go );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.back );
}
示例4: GraphicsOptions_MenuInit
//.........这里部分代码省略.........
s_graphicsoptions.geometry.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.geometry.generic.x = 400;
s_graphicsoptions.geometry.generic.y = y;
s_graphicsoptions.geometry.itemnames = quality_names;
y += BIGCHAR_HEIGHT+2;
// references/modifies "r_picmip"
s_graphicsoptions.tq.generic.type = MTYPE_SLIDER;
s_graphicsoptions.tq.generic.name = "Texture Detail:";
s_graphicsoptions.tq.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.tq.generic.x = 400;
s_graphicsoptions.tq.generic.y = y;
s_graphicsoptions.tq.minvalue = 0;
s_graphicsoptions.tq.maxvalue = 3;
s_graphicsoptions.tq.generic.callback = GraphicsOptions_TQEvent;
y += BIGCHAR_HEIGHT+2;
// references/modifies "r_textureBits"
s_graphicsoptions.texturebits.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.texturebits.generic.name = "Texture Quality:";
s_graphicsoptions.texturebits.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.texturebits.generic.x = 400;
s_graphicsoptions.texturebits.generic.y = y;
s_graphicsoptions.texturebits.itemnames = tq_names;
y += BIGCHAR_HEIGHT+2;
// references/modifies "r_textureMode"
s_graphicsoptions.filter.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.filter.generic.name = "Texture Filter:";
s_graphicsoptions.filter.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.filter.generic.x = 400;
s_graphicsoptions.filter.generic.y = y;
s_graphicsoptions.filter.itemnames = filter_names;
y += 2*BIGCHAR_HEIGHT;
s_graphicsoptions.driverinfo.generic.type = MTYPE_PTEXT;
s_graphicsoptions.driverinfo.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
s_graphicsoptions.driverinfo.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.driverinfo.generic.id = ID_DRIVERINFO;
s_graphicsoptions.driverinfo.generic.x = 320;
s_graphicsoptions.driverinfo.generic.y = y;
s_graphicsoptions.driverinfo.string = "Driver Info";
s_graphicsoptions.driverinfo.style = UI_CENTER|UI_SMALLFONT;
s_graphicsoptions.driverinfo.color = color_red;
y += BIGCHAR_HEIGHT+2;
s_graphicsoptions.back.generic.type = MTYPE_BITMAP;
s_graphicsoptions.back.generic.name = GRAPHICSOPTIONS_BACK0;
s_graphicsoptions.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_graphicsoptions.back.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.back.generic.id = ID_BACK2;
s_graphicsoptions.back.generic.x = 0;
s_graphicsoptions.back.generic.y = 480-64;
s_graphicsoptions.back.width = 128;
s_graphicsoptions.back.height = 64;
s_graphicsoptions.back.focuspic = GRAPHICSOPTIONS_BACK1;
s_graphicsoptions.apply.generic.type = MTYPE_BITMAP;
s_graphicsoptions.apply.generic.name = GRAPHICSOPTIONS_ACCEPT0;
s_graphicsoptions.apply.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_HIDDEN|QMF_INACTIVE;
s_graphicsoptions.apply.generic.callback = GraphicsOptions_ApplyChanges;
s_graphicsoptions.apply.generic.x = 640;
s_graphicsoptions.apply.generic.y = 480-64;
s_graphicsoptions.apply.width = 128;
s_graphicsoptions.apply.height = 64;
s_graphicsoptions.apply.focuspic = GRAPHICSOPTIONS_ACCEPT1;
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.banner );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.framel );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.framer );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.graphics );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.display );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.sound );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.list );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.driver );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.allow_extensions );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.mode );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.colordepth );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.fs );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.lighting );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.geometry );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.tq );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.texturebits );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.filter );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.driverinfo );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.back );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.apply );
GraphicsOptions_SetMenuItems();
GraphicsOptions_GetInitialVideo();
if ( uis.glconfig.driverType == GLDRV_ICD &&
uis.glconfig.hardwareType == GLHW_3DFX_2D3D )
{
s_graphicsoptions.driver.generic.flags |= QMF_HIDDEN|QMF_INACTIVE;
}
}
示例5: M_Msgbox_Init
static void M_Msgbox_Init( void )
{
int i, j, s;
int lineend, len;
int n = 0;
const char *p;
menucommon_t *menuitem = NULL;
char menuitem_name[40];
char scnd_btn_name[120] = { '\0' }, scnd_btn_action[120] = { '\0' };
int width = 0, yoffset = 40;
s_msgbox_menu.nitems = 0;
mbtext[0] = 0;
for( i = 1; i < trap_Cmd_Argc(); i++ )
{
Q_strncpyz( mbtext, trap_Cmd_Argv(i), sizeof( mbtext ) );
len = strlen( mbtext );
// a secret second button
if( !strncmp( mbtext, "\\btn\\", 5 ) )
{
p = strstr( mbtext + 6, "\\" );
if( p ) {
mbtext[p - mbtext] = '\0';
Q_strncpyz( scnd_btn_name, mbtext + 5, sizeof( scnd_btn_name ) );
Q_strncpyz( scnd_btn_action, p + 1, sizeof( scnd_btn_action ) );
}
continue;
}
// split the text into lines
for( s = 0; s <= len; s += j + 1 )
{
lineend = min( len - s, M_MSGBOX_LINELEN );
for( j = lineend; j && mbtext[s+j] && mbtext[s+j] != ' '; j-- );
if( !j ) j = lineend;
mbtext[s+j] = '\0';
Q_snprintfz( menuitem_name, sizeof( menuitem_name ), "m_msgbox_textline_%i", n );
menuitem = UI_InitMenuItem( menuitem_name, mbtext + s, 0, yoffset, MTYPE_SEPARATOR, ALIGN_CENTER_TOP, uis.fontSystemSmall, NULL );
Menu_AddItem( &s_msgbox_menu, menuitem );
yoffset += trap_SCR_strHeight( menuitem->font );
n++;
}
}
//if we printed something, add one line separation
if( menuitem )
yoffset += trap_SCR_strHeight( menuitem->font );
if( scnd_btn_name[0] && scnd_btn_action[0] )
width = UI_StringWidth( "close", uis.fontSystemBig );
else
width = 0;
menuitem = UI_InitMenuItem( "m_msgbox_close", "close", -width, yoffset, MTYPE_ACTION, ALIGN_CENTER_TOP, uis.fontSystemBig, M_genericBackFunc );
Menu_AddItem( &s_msgbox_menu, menuitem );
if( scnd_btn_name[0] && scnd_btn_action[0] )
{
UI_SetupButton( menuitem, qtrue );
menuitem = UI_InitMenuItem( "m_msgbox_connect", scnd_btn_name, width, yoffset, MTYPE_ACTION, ALIGN_CENTER_TOP, uis.fontSystemBig, M_Msgbox_SecondButton );
menuitem->itemlocal = UI_CopyString( scnd_btn_action );
Menu_AddItem( &s_msgbox_menu, menuitem );
}
yoffset += UI_SetupButton( menuitem, qtrue ) + UI_BUTTONBOX_VERTICAL_SPACE;
Menu_Center( &s_msgbox_menu );
Menu_Init( &s_msgbox_menu, qfalse );
Menu_SetStatusBar( &s_msgbox_menu, NULL );
}
示例6: GraphicsOptions_MenuInit
//.........这里部分代码省略.........
s_graphicsoptions.flares.generic.x = 400;
s_graphicsoptions.flares.generic.y = y;
s_graphicsoptions.flares.itemnames = enabled_names;
y += BIGCHAR_HEIGHT+2;
// references/modifies "r_lodBias" & "subdivisions"
s_graphicsoptions.geometry.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.geometry.generic.name = "Geometric Detail:";
s_graphicsoptions.geometry.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.geometry.generic.x = 400;
s_graphicsoptions.geometry.generic.y = y;
s_graphicsoptions.geometry.itemnames = quality_names;
y += BIGCHAR_HEIGHT+2;
// references/modifies "r_picmip"
s_graphicsoptions.tq.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.tq.generic.name = "Texture Detail:";
s_graphicsoptions.tq.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.tq.generic.x = 400;
s_graphicsoptions.tq.generic.y = y;
s_graphicsoptions.tq.itemnames = detail_names;
y += BIGCHAR_HEIGHT+2;
// references/modifies "r_textureBits"
s_graphicsoptions.texturebits.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.texturebits.generic.name = "Texture Quality:";
s_graphicsoptions.texturebits.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.texturebits.generic.x = 400;
s_graphicsoptions.texturebits.generic.y = y;
s_graphicsoptions.texturebits.itemnames = tq_names;
y += BIGCHAR_HEIGHT+2;
// references/modifies "r_textureMode"
s_graphicsoptions.filter.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.filter.generic.name = "Texture Filter:";
s_graphicsoptions.filter.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.filter.generic.x = 400;
s_graphicsoptions.filter.generic.y = y;
s_graphicsoptions.filter.itemnames = filter_names;
y += 2*BIGCHAR_HEIGHT;
s_graphicsoptions.driverinfo.generic.type = MTYPE_PTEXT;
s_graphicsoptions.driverinfo.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
s_graphicsoptions.driverinfo.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.driverinfo.generic.id = ID_DRIVERINFO;
s_graphicsoptions.driverinfo.generic.x = 320;
s_graphicsoptions.driverinfo.generic.y = y;
s_graphicsoptions.driverinfo.string = "Driver Info";
s_graphicsoptions.driverinfo.style = UI_CENTER|UI_SMALLFONT;
s_graphicsoptions.driverinfo.color = text_big_color;
s_graphicsoptions.back.generic.type = MTYPE_BITMAP;
s_graphicsoptions.back.generic.name = GRAPHICSOPTIONS_BACK0;
s_graphicsoptions.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_graphicsoptions.back.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.back.generic.id = ID_BACK2;
s_graphicsoptions.back.generic.x = 0;
s_graphicsoptions.back.generic.y = 480-64;
s_graphicsoptions.back.width = 128;
s_graphicsoptions.back.height = 64;
s_graphicsoptions.back.focuspic = GRAPHICSOPTIONS_BACK1;
s_graphicsoptions.apply.generic.type = MTYPE_BITMAP;
s_graphicsoptions.apply.generic.name = GRAPHICSOPTIONS_ACCEPT0;
s_graphicsoptions.apply.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_HIDDEN|QMF_INACTIVE;
s_graphicsoptions.apply.generic.callback = GraphicsOptions_ApplyChanges;
s_graphicsoptions.apply.generic.x = 640;
s_graphicsoptions.apply.generic.y = 480-64;
s_graphicsoptions.apply.width = 128;
s_graphicsoptions.apply.height = 64;
s_graphicsoptions.apply.focuspic = GRAPHICSOPTIONS_ACCEPT1;
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.banner );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.framel );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.framer );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.graphics );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.display );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.sound );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.network );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.list );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.ratio );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.mode );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.fs );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.multisample );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.lighting );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.flares );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.geometry );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.tq );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.texturebits );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.filter );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.driverinfo );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.back );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.apply );
GraphicsOptions_SetMenuItems();
GraphicsOptions_GetInitialVideo();
}
示例7: Signup_MenuInit
//.........这里部分代码省略.........
s_signup.password.generic.id = ID_PASSWORD;
s_signup.password.generic.x = 310;
s_signup.password.generic.y = y;
s_signup.password.string = "PASSWORD";
s_signup.password.style = UI_RIGHT|UI_SMALLFONT;
s_signup.password.color = s_signup_color_prompt;
s_signup.password_box.generic.type = MTYPE_FIELD;
s_signup.password_box.generic.ownerdraw = Rankings_DrawPassword;
s_signup.password_box.generic.name = "";
s_signup.password_box.generic.flags = 0;
s_signup.password_box.generic.x = 330;
s_signup.password_box.generic.y = y;
s_signup.password_box.field.widthInChars = 16;
s_signup.password_box.field.maxchars = 16;
y += 20;
s_signup.again.generic.type = MTYPE_PTEXT;
s_signup.again.generic.flags = QMF_RIGHT_JUSTIFY|QMF_INACTIVE;
s_signup.again.generic.id = ID_AGAIN;
s_signup.again.generic.x = 310;
s_signup.again.generic.y = y;
s_signup.again.string = "(AGAIN)";
s_signup.again.style = UI_RIGHT|UI_SMALLFONT;
s_signup.again.color = s_signup_color_prompt;
s_signup.again_box.generic.type = MTYPE_FIELD;
s_signup.again_box.generic.ownerdraw = Rankings_DrawPassword;
s_signup.again_box.generic.name = "";
s_signup.again_box.generic.flags = 0;
s_signup.again_box.generic.x = 330;
s_signup.again_box.generic.y = y;
s_signup.again_box.field.widthInChars = 16;
s_signup.again_box.field.maxchars = 16;
y += 20;
s_signup.email.generic.type = MTYPE_PTEXT;
s_signup.email.generic.flags = QMF_RIGHT_JUSTIFY|QMF_INACTIVE;
s_signup.email.generic.id = ID_EMAIL;
s_signup.email.generic.x = 310;
s_signup.email.generic.y = y;
s_signup.email.string = "EMAIL";
s_signup.email.style = UI_RIGHT|UI_SMALLFONT;
s_signup.email.color = s_signup_color_prompt;
s_signup.email_box.generic.type = MTYPE_FIELD;
s_signup.email_box.generic.ownerdraw = Rankings_DrawText;
s_signup.email_box.generic.name = "";
s_signup.email_box.generic.flags = 0;
s_signup.email_box.generic.x = 330;
s_signup.email_box.generic.y = y;
s_signup.email_box.field.widthInChars = 16;
s_signup.email_box.field.maxchars = MAX_EDIT_LINE;
y += 40;
s_signup.signup.generic.type = MTYPE_PTEXT;
s_signup.signup.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
s_signup.signup.generic.id = ID_SIGNUP;
s_signup.signup.generic.callback = Signup_MenuEvent;
s_signup.signup.generic.x = 310;
s_signup.signup.generic.y = y;
s_signup.signup.string = "SIGN UP";
s_signup.signup.style = UI_RIGHT|UI_SMALLFONT;
s_signup.signup.color = colorRed;
s_signup.cancel.generic.type = MTYPE_PTEXT;
s_signup.cancel.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_signup.cancel.generic.id = ID_CANCEL;
s_signup.cancel.generic.callback = Signup_MenuEvent;
s_signup.cancel.generic.x = 330;
s_signup.cancel.generic.y = y;
s_signup.cancel.string = "CANCEL";
s_signup.cancel.style = UI_LEFT|UI_SMALLFONT;
s_signup.cancel.color = colorRed;
y += 20;
status = (grank_status_t)_UI_trap_Cvar_VariableValue("client_status");
if( (status != QGR_STATUS_NEW) && (status != QGR_STATUS_SPECTATOR) )
{
s_signup.name_box.generic.flags |= QMF_INACTIVE;
s_signup.password_box.generic.flags |= QMF_INACTIVE;
s_signup.again_box.generic.flags |= QMF_INACTIVE;
s_signup.email_box.generic.flags |= QMF_INACTIVE;
s_signup.signup.generic.flags |= QMF_INACTIVE;
s_signup.signup.color = colorMdGrey;
}
Menu_AddItem( &s_signup.menu, (void*) &s_signup.frame );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.name );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.name_box );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.password );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.password_box );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.again );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.again_box );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.email );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.email_box );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.signup );
Menu_AddItem( &s_signup.menu, (void*) &s_signup.cancel );
}
示例8: UI_Mods_MenuInit
/*
===============
UI_Mods_MenuInit
===============
*/
static void UI_Mods_MenuInit( void ) {
UI_ModsMenu_Cache();
memset( &s_mods, 0 ,sizeof(mods_t) );
s_mods.menu.wrapAround = qtrue;
s_mods.menu.fullscreen = qtrue;
s_mods.banner.generic.type = MTYPE_BTEXT;
s_mods.banner.generic.x = 320;
s_mods.banner.generic.y = 16;
s_mods.banner.string = "MODS";
s_mods.banner.color = color_white;
s_mods.banner.style = UI_CENTER;
s_mods.framel.generic.type = MTYPE_BITMAP;
s_mods.framel.generic.name = ART_FRAMEL;
s_mods.framel.generic.flags = QMF_INACTIVE;
s_mods.framel.generic.x = 0;
s_mods.framel.generic.y = 78;
s_mods.framel.width = 256;
s_mods.framel.height = 329;
s_mods.framer.generic.type = MTYPE_BITMAP;
s_mods.framer.generic.name = ART_FRAMER;
s_mods.framer.generic.flags = QMF_INACTIVE;
s_mods.framer.generic.x = 376;
s_mods.framer.generic.y = 76;
s_mods.framer.width = 256;
s_mods.framer.height = 334;
s_mods.back.generic.type = MTYPE_BITMAP;
s_mods.back.generic.name = ART_BACK0;
s_mods.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_mods.back.generic.id = ID_BACK;
s_mods.back.generic.callback = UI_Mods_MenuEvent;
s_mods.back.generic.x = 0;
s_mods.back.generic.y = 480-64;
s_mods.back.width = 128;
s_mods.back.height = 64;
s_mods.back.focuspic = ART_BACK1;
s_mods.go.generic.type = MTYPE_BITMAP;
s_mods.go.generic.name = ART_FIGHT0;
s_mods.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
s_mods.go.generic.id = ID_GO;
s_mods.go.generic.callback = UI_Mods_MenuEvent;
s_mods.go.generic.x = 640;
s_mods.go.generic.y = 480-64;
s_mods.go.width = 128;
s_mods.go.height = 64;
s_mods.go.focuspic = ART_FIGHT1;
// scan for mods
s_mods.list.generic.type = MTYPE_SCROLLLIST;
s_mods.list.generic.flags = QMF_PULSEIFFOCUS|QMF_CENTER_JUSTIFY;
s_mods.list.generic.callback = UI_Mods_MenuEvent;
s_mods.list.generic.id = ID_LIST;
s_mods.list.generic.x = 320;
s_mods.list.generic.y = 130;
s_mods.list.width = 48;
s_mods.list.height = 14;
UI_Mods_LoadMods();
Menu_AddItem( &s_mods.menu, &s_mods.banner );
Menu_AddItem( &s_mods.menu, &s_mods.framel );
Menu_AddItem( &s_mods.menu, &s_mods.framer );
Menu_AddItem( &s_mods.menu, &s_mods.list );
Menu_AddItem( &s_mods.menu, &s_mods.back );
Menu_AddItem( &s_mods.menu, &s_mods.go );
}
示例9: UI_SetupMenu_Init
//.........这里部分代码省略.........
setupMenuInfo.setupcontrols.string = "CONTROLS";
setupMenuInfo.setupcontrols.color = color_blue;
setupMenuInfo.setupcontrols.style = UI_CENTER;
y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.setupsystem.generic.type = MTYPE_PTEXT;
setupMenuInfo.setupsystem.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.setupsystem.generic.x = 320;
setupMenuInfo.setupsystem.generic.y = y;
setupMenuInfo.setupsystem.generic.id = ID_SYSTEMCONFIG;
setupMenuInfo.setupsystem.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.setupsystem.string = "SYSTEM";
setupMenuInfo.setupsystem.color = color_blue;
setupMenuInfo.setupsystem.style = UI_CENTER;
y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.game.generic.type = MTYPE_PTEXT;
setupMenuInfo.game.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.game.generic.x = 320;
setupMenuInfo.game.generic.y = y;
setupMenuInfo.game.generic.id = ID_GAME;
setupMenuInfo.game.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.game.string = "GAME OPTIONS";
setupMenuInfo.game.color = color_blue;
setupMenuInfo.game.style = UI_CENTER;
y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.cdkey.generic.type = MTYPE_PTEXT;
setupMenuInfo.cdkey.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.cdkey.generic.x = 320;
setupMenuInfo.cdkey.generic.y = y;
setupMenuInfo.cdkey.generic.id = ID_CDKEY;
setupMenuInfo.cdkey.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.cdkey.string = "CD Key";
setupMenuInfo.cdkey.color = color_blue;
setupMenuInfo.cdkey.style = UI_CENTER;
if( !trap_Cvar_VariableValue( "cl_paused" ) ) {
#if 0
y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.load.generic.type = MTYPE_PTEXT;
setupMenuInfo.load.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.load.generic.x = 320;
setupMenuInfo.load.generic.y = y;
setupMenuInfo.load.generic.id = ID_LOAD;
setupMenuInfo.load.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.load.string = "LOAD";
setupMenuInfo.load.color = color_blue;
setupMenuInfo.load.style = UI_CENTER;
y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.save.generic.type = MTYPE_PTEXT;
setupMenuInfo.save.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.save.generic.x = 320;
setupMenuInfo.save.generic.y = y;
setupMenuInfo.save.generic.id = ID_SAVE;
setupMenuInfo.save.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.save.string = "SAVE";
setupMenuInfo.save.color = color_blue;
setupMenuInfo.save.style = UI_CENTER;
#endif
y += SETUP_MENU_VERTICAL_SPACING;
setupMenuInfo.defaults.generic.type = MTYPE_PTEXT;
setupMenuInfo.defaults.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.defaults.generic.x = 320;
setupMenuInfo.defaults.generic.y = y;
setupMenuInfo.defaults.generic.id = ID_DEFAULTS;
setupMenuInfo.defaults.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.defaults.string = "DEFAULTS";
setupMenuInfo.defaults.color = color_blue;
setupMenuInfo.defaults.style = UI_CENTER;
}
setupMenuInfo.back.generic.type = MTYPE_BITMAP;
setupMenuInfo.back.generic.name = ART_BACK0;
setupMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
setupMenuInfo.back.generic.id = ID_BACK;
setupMenuInfo.back.generic.callback = UI_SetupMenu_Event;
setupMenuInfo.back.generic.x = 0;
setupMenuInfo.back.generic.y = 480-64;
setupMenuInfo.back.width = 128;
setupMenuInfo.back.height = 64;
setupMenuInfo.back.focuspic = ART_BACK1;
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.banner );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.framel );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.framer );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupplayer );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupcontrols );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.setupsystem );
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.game );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.cdkey );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.load );
// Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.save );
if( !trap_Cvar_VariableValue( "cl_paused" ) ) {
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.defaults );
}
Menu_AddItem( &setupMenuInfo.menu, &setupMenuInfo.back );
}
示例10: PlayerSettings_MenuInit
//.........这里部分代码省略.........
s_playersettings.menu.fullscreen = qtrue;
s_playersettings.menu.showlogo = LOGO_AFTERWARDS;
s_playersettings.banner.generic.type = MTYPE_BTEXT;
s_playersettings.banner.generic.x = 320;
s_playersettings.banner.generic.y = 16;
s_playersettings.banner.string = "PLAYER SETTINGS";
s_playersettings.banner.color = color_white;
s_playersettings.banner.style = UI_CENTER;
y = 144;
s_playersettings.name.generic.type = MTYPE_FIELD;
s_playersettings.name.generic.flags = QMF_NODEFAULTINIT;
s_playersettings.name.generic.ownerdraw = PlayerSettings_DrawName;
s_playersettings.name.field.widthInChars = MAX_NAMELENGTH;
s_playersettings.name.field.maxchars = MAX_NAMELENGTH;
s_playersettings.name.generic.x = 192;
s_playersettings.name.generic.y = y;
s_playersettings.name.generic.left = 192 - 8;
s_playersettings.name.generic.top = y - 8;
s_playersettings.name.generic.right = 192 + 200;
s_playersettings.name.generic.bottom = y + 2 * PROP_HEIGHT;
y += 3 * PROP_HEIGHT;
s_playersettings.handicap.generic.type = MTYPE_SPINCONTROL;
s_playersettings.handicap.generic.flags = QMF_NODEFAULTINIT;
s_playersettings.handicap.generic.id = ID_HANDICAP;
s_playersettings.handicap.generic.ownerdraw = PlayerSettings_DrawHandicap;
s_playersettings.handicap.generic.x = 192;
s_playersettings.handicap.generic.y = y;
s_playersettings.handicap.generic.left = 192 - 8;
s_playersettings.handicap.generic.top = y - 8;
s_playersettings.handicap.generic.right = 192 + 200;
s_playersettings.handicap.generic.bottom = y + 2 * PROP_HEIGHT;
s_playersettings.handicap.numitems = 10;
y += 3 * PROP_HEIGHT;
s_playersettings.effects.generic.type = MTYPE_SPINCONTROL;
s_playersettings.effects.generic.flags = QMF_NODEFAULTINIT;
s_playersettings.effects.generic.id = ID_EFFECTS;
s_playersettings.effects.generic.ownerdraw = PlayerSettings_DrawEffects;
s_playersettings.effects.generic.x = 192;
s_playersettings.effects.generic.y = y;
s_playersettings.effects.generic.left = 192 - 8;
s_playersettings.effects.generic.top = y - 8;
s_playersettings.effects.generic.right = 192 + 200;
s_playersettings.effects.generic.bottom = y + 2* PROP_HEIGHT;
s_playersettings.effects.numitems = 7;
s_playersettings.model.generic.type = MTYPE_BITMAP;
s_playersettings.model.generic.name = ART_MODEL0;
s_playersettings.model.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
s_playersettings.model.generic.id = ID_MODEL;
s_playersettings.model.generic.callback = PlayerSettings_MenuEvent;
s_playersettings.model.generic.x = 640;
s_playersettings.model.generic.y = 480-64;
s_playersettings.model.width = 128;
s_playersettings.model.height = 64;
s_playersettings.model.focuspic = ART_MODEL1;
s_playersettings.player.generic.type = MTYPE_BITMAP;
s_playersettings.player.generic.flags = QMF_INACTIVE;
s_playersettings.player.generic.ownerdraw = PlayerSettings_DrawPlayer;
s_playersettings.player.generic.x = 400;
s_playersettings.player.generic.y = -40;
s_playersettings.player.width = 32*10;
s_playersettings.player.height = 56*10;
s_playersettings.back.generic.type = MTYPE_BITMAP;
s_playersettings.back.generic.name = ART_BACK0;
s_playersettings.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_playersettings.back.generic.id = ID_BACK;
s_playersettings.back.generic.callback = PlayerSettings_MenuEvent;
s_playersettings.back.generic.x = 0;
s_playersettings.back.generic.y = 480-64;
s_playersettings.back.width = 128;
s_playersettings.back.height = 64;
s_playersettings.back.focuspic = ART_BACK1;
s_playersettings.item_null.generic.type = MTYPE_BITMAP;
s_playersettings.item_null.generic.flags = QMF_LEFT_JUSTIFY|QMF_MOUSEONLY|QMF_SILENT;
s_playersettings.item_null.generic.x = 0;
s_playersettings.item_null.generic.y = 0;
s_playersettings.item_null.width = 640;
s_playersettings.item_null.height = 480;
Menu_AddItem( &s_playersettings.menu, &s_playersettings.banner );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.name );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.handicap );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.effects );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.model );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.back );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.player );
Menu_AddItem( &s_playersettings.menu, &s_playersettings.item_null );
PlayerSettings_SetMenuItems();
}
示例11: Demos_MenuInit
//.........这里部分代码省略.........
s_demos.framer.width = 256;
s_demos.framer.height = 334;
s_demos.arrows.generic.type = MTYPE_BITMAP;
s_demos.arrows.generic.name = ART_ARROWS;
s_demos.arrows.generic.flags = QMF_INACTIVE;
s_demos.arrows.generic.x = 320-ARROWS_WIDTH/2;
s_demos.arrows.generic.y = 400;
s_demos.arrows.width = ARROWS_WIDTH;
s_demos.arrows.height = ARROWS_HEIGHT;
s_demos.left.generic.type = MTYPE_BITMAP;
s_demos.left.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY;
s_demos.left.generic.x = 320-ARROWS_WIDTH/2;
s_demos.left.generic.y = 400;
s_demos.left.generic.id = ID_LEFT;
s_demos.left.generic.callback = Demos_MenuEvent;
s_demos.left.width = ARROWS_WIDTH/2;
s_demos.left.height = ARROWS_HEIGHT;
s_demos.left.focuspic = ART_ARROWLEFT;
s_demos.right.generic.type = MTYPE_BITMAP;
s_demos.right.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_MOUSEONLY;
s_demos.right.generic.x = 320;
s_demos.right.generic.y = 400;
s_demos.right.generic.id = ID_RIGHT;
s_demos.right.generic.callback = Demos_MenuEvent;
s_demos.right.width = ARROWS_WIDTH/2;
s_demos.right.height = ARROWS_HEIGHT;
s_demos.right.focuspic = ART_ARROWRIGHT;
s_demos.back.generic.type = MTYPE_BITMAP;
s_demos.back.generic.name = ART_BACK0;
s_demos.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_demos.back.generic.id = ID_BACK;
s_demos.back.generic.callback = Demos_MenuEvent;
s_demos.back.generic.x = 0;
s_demos.back.generic.y = 480-64;
s_demos.back.width = 128;
s_demos.back.height = 64;
s_demos.back.focuspic = ART_BACK1;
s_demos.go.generic.type = MTYPE_BITMAP;
s_demos.go.generic.name = ART_GO0;
s_demos.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
s_demos.go.generic.id = ID_GO;
s_demos.go.generic.callback = Demos_MenuEvent;
s_demos.go.generic.x = 640;
s_demos.go.generic.y = 480-64;
s_demos.go.width = 128;
s_demos.go.height = 64;
s_demos.go.focuspic = ART_GO1;
s_demos.list.generic.type = MTYPE_SCROLLLIST;
s_demos.list.generic.flags = QMF_PULSEIFFOCUS;
s_demos.list.generic.callback = Demos_MenuEvent;
s_demos.list.generic.id = ID_LIST;
s_demos.list.generic.x = 118;
s_demos.list.generic.y = 130;
s_demos.list.width = 16;
s_demos.list.height = 14;
Com_sprintf(extension, sizeof(extension), "dm_%d", (int)UI_trap_Cvar_VariableValue( "protocol" ) );
s_demos.list.numitems = UI_trap_FS_GetFileList( "demos", extension, s_demos.names, NAMEBUFSIZE );
s_demos.list.itemnames = (const char **)s_demos.demolist;
s_demos.list.columns = 3;
if (!s_demos.list.numitems) {
strcpy( s_demos.names, "No Demos Found." );
s_demos.list.numitems = 1;
//degenerate case, not selectable
s_demos.go.generic.flags |= (QMF_INACTIVE|QMF_HIDDEN);
}
else if (s_demos.list.numitems > MAX_DEMOS)
s_demos.list.numitems = MAX_DEMOS;
demoname = s_demos.names;
for ( i = 0; i < s_demos.list.numitems; i++ ) {
s_demos.list.itemnames[i] = demoname;
// strip extension
len = strlen( demoname );
if (!Q_stricmp(demoname + len - 4,".dm3"))
demoname[len-4] = '\0';
Q_strupr(demoname);
demoname += len + 1;
}
Menu_AddItem( &s_demos.menu, &s_demos.banner );
Menu_AddItem( &s_demos.menu, &s_demos.framel );
Menu_AddItem( &s_demos.menu, &s_demos.framer );
Menu_AddItem( &s_demos.menu, &s_demos.list );
Menu_AddItem( &s_demos.menu, &s_demos.arrows );
Menu_AddItem( &s_demos.menu, &s_demos.left );
Menu_AddItem( &s_demos.menu, &s_demos.right );
Menu_AddItem( &s_demos.menu, &s_demos.back );
Menu_AddItem( &s_demos.menu, &s_demos.go );
}
示例12: UI_SPLevelMenu_Init
//.........这里部分代码省略.........
levelMenuInfo.item_awards[count].generic.name = ui_medalPicNames[n];
levelMenuInfo.item_awards[count].generic.flags = QMF_LEFT_JUSTIFY|QMF_SILENT|QMF_MOUSEONLY;
levelMenuInfo.item_awards[count].generic.x = x;
levelMenuInfo.item_awards[count].generic.y = y;
levelMenuInfo.item_awards[count].generic.id = ID_AWARD1 + n;
levelMenuInfo.item_awards[count].generic.callback = UI_SPLevelMenu_AwardEvent;
levelMenuInfo.item_awards[count].width = 48;
levelMenuInfo.item_awards[count].height = 48;
count++;
}
}
levelMenuInfo.item_back.generic.type = MTYPE_BITMAP;
levelMenuInfo.item_back.generic.name = ART_BACK0;
levelMenuInfo.item_back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
levelMenuInfo.item_back.generic.x = 0;
levelMenuInfo.item_back.generic.y = 480-64;
levelMenuInfo.item_back.generic.callback = UI_SPLevelMenu_BackEvent;
levelMenuInfo.item_back.generic.id = ID_BACK;
levelMenuInfo.item_back.width = 128;
levelMenuInfo.item_back.height = 64;
levelMenuInfo.item_back.focuspic = ART_BACK1;
levelMenuInfo.item_reset.generic.type = MTYPE_BITMAP;
levelMenuInfo.item_reset.generic.name = ART_RESET0;
levelMenuInfo.item_reset.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
levelMenuInfo.item_reset.generic.x = 170;
levelMenuInfo.item_reset.generic.y = 480-64;
levelMenuInfo.item_reset.generic.callback = UI_SPLevelMenu_ResetEvent;
levelMenuInfo.item_reset.generic.id = ID_RESET;
levelMenuInfo.item_reset.width = 128;
levelMenuInfo.item_reset.height = 64;
levelMenuInfo.item_reset.focuspic = ART_RESET1;
levelMenuInfo.item_custom.generic.type = MTYPE_BITMAP;
levelMenuInfo.item_custom.generic.name = ART_CUSTOM0;
levelMenuInfo.item_custom.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
levelMenuInfo.item_custom.generic.x = 342;
levelMenuInfo.item_custom.generic.y = 480-64;
levelMenuInfo.item_custom.generic.callback = UI_SPLevelMenu_CustomEvent;
levelMenuInfo.item_custom.generic.id = ID_CUSTOM;
levelMenuInfo.item_custom.width = 128;
levelMenuInfo.item_custom.height = 64;
levelMenuInfo.item_custom.focuspic = ART_CUSTOM1;
levelMenuInfo.item_next.generic.type = MTYPE_BITMAP;
levelMenuInfo.item_next.generic.name = ART_FIGHT0;
levelMenuInfo.item_next.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
levelMenuInfo.item_next.generic.x = 640;
levelMenuInfo.item_next.generic.y = 480-64;
levelMenuInfo.item_next.generic.callback = UI_SPLevelMenu_NextEvent;
levelMenuInfo.item_next.generic.id = ID_NEXT;
levelMenuInfo.item_next.width = 128;
levelMenuInfo.item_next.height = 64;
levelMenuInfo.item_next.focuspic = ART_FIGHT1;
levelMenuInfo.item_null.generic.type = MTYPE_BITMAP;
levelMenuInfo.item_null.generic.flags = QMF_LEFT_JUSTIFY|QMF_MOUSEONLY|QMF_SILENT;
levelMenuInfo.item_null.generic.x = 0;
levelMenuInfo.item_null.generic.y = 0;
levelMenuInfo.item_null.width = 640;
levelMenuInfo.item_null.height = 480;
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_banner );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_leftarrow );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_maps[0] );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_maps[1] );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_maps[2] );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_maps[3] );
levelMenuInfo.item_maps[0].generic.bottom += 18;
levelMenuInfo.item_maps[1].generic.bottom += 18;
levelMenuInfo.item_maps[2].generic.bottom += 18;
levelMenuInfo.item_maps[3].generic.bottom += 18;
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_rightarrow );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_player );
for( n = 0; n < count; n++ ) {
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_awards[n] );
}
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_back );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_reset );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_custom );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_next );
Menu_AddItem( &levelMenuInfo.menu, &levelMenuInfo.item_null );
trap_Cvar_VariableStringBuffer( "ui_spSelection", buf, sizeof(buf) );
if( *buf ) {
n = atoi( buf );
selectedArenaSet = n / ARENAS_PER_TIER;
selectedArena = n % ARENAS_PER_TIER;
}
else {
selectedArenaSet = currentSet;
selectedArena = currentGame;
}
UI_SPLevelMenu_SetMenuItems();
}
示例13: ArenaServers_MenuInit
//.........这里部分代码省略.........
g_arenaservers.refresh.width = 128;
g_arenaservers.refresh.height = 64;
g_arenaservers.refresh.focuspic = ART_REFRESH1;
g_arenaservers.create.generic.type = MTYPE_BITMAP;
g_arenaservers.create.generic.name = ART_CREATE0;
g_arenaservers.create.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
g_arenaservers.create.generic.callback = ArenaServers_Event;
g_arenaservers.create.generic.id = ID_CREATE;
g_arenaservers.create.generic.x = 384;
g_arenaservers.create.generic.y = 480-64;
g_arenaservers.create.width = 128;
g_arenaservers.create.height = 64;
g_arenaservers.create.focuspic = ART_CREATE1;
g_arenaservers.go.generic.type = MTYPE_BITMAP;
g_arenaservers.go.generic.name = ART_CONNECT0;
g_arenaservers.go.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
g_arenaservers.go.generic.callback = ArenaServers_Event;
g_arenaservers.go.generic.id = ID_CONNECT;
g_arenaservers.go.generic.x = 640;
g_arenaservers.go.generic.y = 480-64;
g_arenaservers.go.width = 128;
g_arenaservers.go.height = 64;
g_arenaservers.go.focuspic = ART_CONNECT1;
g_arenaservers.punkbuster.generic.type = MTYPE_SPINCONTROL;
g_arenaservers.punkbuster.generic.name = "Punkbuster:";
g_arenaservers.punkbuster.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
g_arenaservers.punkbuster.generic.callback = ArenaServers_Event;
g_arenaservers.punkbuster.generic.id = ID_PUNKBUSTER;
g_arenaservers.punkbuster.generic.x = 480+32;
g_arenaservers.punkbuster.generic.y = 144;
g_arenaservers.punkbuster.itemnames = punkbuster_items;
g_arenaservers.pblogo.generic.type = MTYPE_BITMAP;
g_arenaservers.pblogo.generic.name = ART_PUNKBUSTER;
g_arenaservers.pblogo.generic.flags = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
g_arenaservers.pblogo.generic.x = 526;
g_arenaservers.pblogo.generic.y = 176;
g_arenaservers.pblogo.width = 32;
g_arenaservers.pblogo.height = 16;
g_arenaservers.pblogo.errorpic = ART_UNKNOWNMAP;
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.banner );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.master );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.gametype );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.sortkey );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.showfull);
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.showempty );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.mappic );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.list );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.status );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.statusbar );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.arrows );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.up );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.down );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.remove );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.back );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.specify );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.refresh );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.create );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.go );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.punkbuster );
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.pblogo );
ArenaServers_LoadFavorites();
g_servertype = Com_Clamp( 0, 3, ui_browserMaster.integer );
// hack to get rid of MPlayer stuff
value = g_servertype;
if (value >= 1)
value--;
g_arenaservers.master.curvalue = value;
g_gametype = Com_Clamp( 0, 4, ui_browserGameType.integer );
g_arenaservers.gametype.curvalue = g_gametype;
g_sortkey = Com_Clamp( 0, 4, ui_browserSortKey.integer );
g_arenaservers.sortkey.curvalue = g_sortkey;
g_fullservers = Com_Clamp( 0, 1, ui_browserShowFull.integer );
g_arenaservers.showfull.curvalue = g_fullservers;
g_emptyservers = Com_Clamp( 0, 1, ui_browserShowEmpty.integer );
g_arenaservers.showempty.curvalue = g_emptyservers;
g_arenaservers.punkbuster.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "cl_punkbuster" ) );
// force to initial state and refresh
type = g_servertype;
g_servertype = -1;
ArenaServers_SetType( type );
trap_Cvar_Register(NULL, "debug_protocol", "", 0 );
}
示例14: UI_DisplayOptionsMenu_Init
//.........这里部分代码省略.........
displayOptionsInfo.framel.height = 329;
displayOptionsInfo.framer.generic.type = MTYPE_BITMAP;
displayOptionsInfo.framer.generic.name = ART_FRAMER;
displayOptionsInfo.framer.generic.flags = QMF_INACTIVE;
displayOptionsInfo.framer.generic.x = 376;
displayOptionsInfo.framer.generic.y = 76;
displayOptionsInfo.framer.width = 256;
displayOptionsInfo.framer.height = 334;
displayOptionsInfo.graphics.generic.type = MTYPE_PTEXT;
displayOptionsInfo.graphics.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
displayOptionsInfo.graphics.generic.id = ID_GRAPHICS;
displayOptionsInfo.graphics.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.graphics.generic.x = 216;
displayOptionsInfo.graphics.generic.y = 240 - 2 * PROP_HEIGHT;
displayOptionsInfo.graphics.string = "GRAPHICS";
displayOptionsInfo.graphics.style = UI_RIGHT;
displayOptionsInfo.graphics.color = color_red;
displayOptionsInfo.display.generic.type = MTYPE_PTEXT;
displayOptionsInfo.display.generic.flags = QMF_RIGHT_JUSTIFY;
displayOptionsInfo.display.generic.id = ID_DISPLAY;
displayOptionsInfo.display.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.display.generic.x = 216;
displayOptionsInfo.display.generic.y = 240 - PROP_HEIGHT;
displayOptionsInfo.display.string = "DISPLAY";
displayOptionsInfo.display.style = UI_RIGHT;
displayOptionsInfo.display.color = color_red;
displayOptionsInfo.sound.generic.type = MTYPE_PTEXT;
displayOptionsInfo.sound.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
displayOptionsInfo.sound.generic.id = ID_SOUND;
displayOptionsInfo.sound.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.sound.generic.x = 216;
displayOptionsInfo.sound.generic.y = 240;
displayOptionsInfo.sound.string = "SOUND";
displayOptionsInfo.sound.style = UI_RIGHT;
displayOptionsInfo.sound.color = color_red;
displayOptionsInfo.network.generic.type = MTYPE_PTEXT;
displayOptionsInfo.network.generic.flags = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS;
displayOptionsInfo.network.generic.id = ID_NETWORK;
displayOptionsInfo.network.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.network.generic.x = 216;
displayOptionsInfo.network.generic.y = 240 + PROP_HEIGHT;
displayOptionsInfo.network.string = "NETWORK";
displayOptionsInfo.network.style = UI_RIGHT;
displayOptionsInfo.network.color = color_red;
y = 240 - 1 * (BIGCHAR_HEIGHT+2);
displayOptionsInfo.brightness.generic.type = MTYPE_SLIDER;
displayOptionsInfo.brightness.generic.name = "Brightness:";
displayOptionsInfo.brightness.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
displayOptionsInfo.brightness.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.brightness.generic.id = ID_BRIGHTNESS;
displayOptionsInfo.brightness.generic.x = 400;
displayOptionsInfo.brightness.generic.y = y;
displayOptionsInfo.brightness.minvalue = 5;
displayOptionsInfo.brightness.maxvalue = 20;
if( !uis.glconfig.deviceSupportsGamma ) {
displayOptionsInfo.brightness.generic.flags |= QMF_GRAYED;
}
y += BIGCHAR_HEIGHT+2;
displayOptionsInfo.screensize.generic.type = MTYPE_SLIDER;
displayOptionsInfo.screensize.generic.name = "Screen Size:";
displayOptionsInfo.screensize.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
displayOptionsInfo.screensize.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.screensize.generic.id = ID_SCREENSIZE;
displayOptionsInfo.screensize.generic.x = 400;
displayOptionsInfo.screensize.generic.y = y;
displayOptionsInfo.screensize.minvalue = 3;
displayOptionsInfo.screensize.maxvalue = 10;
displayOptionsInfo.back.generic.type = MTYPE_BITMAP;
displayOptionsInfo.back.generic.name = ART_BACK0;
displayOptionsInfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
displayOptionsInfo.back.generic.callback = UI_DisplayOptionsMenu_Event;
displayOptionsInfo.back.generic.id = ID_BACK;
displayOptionsInfo.back.generic.x = 0;
displayOptionsInfo.back.generic.y = 480-64;
displayOptionsInfo.back.width = 128;
displayOptionsInfo.back.height = 64;
displayOptionsInfo.back.focuspic = ART_BACK1;
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.banner );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.framel );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.framer );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.graphics );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.display );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.sound );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.network );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.brightness );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.screensize );
Menu_AddItem( &displayOptionsInfo.menu, ( void * ) &displayOptionsInfo.back );
displayOptionsInfo.brightness.curvalue = trap_Cvar_VariableValue("r_gamma") * 10;
displayOptionsInfo.screensize.curvalue = trap_Cvar_VariableValue( "cg_viewsize")/10;
}
示例15: UI_DriverInfo_Menu
/*
=================
UI_DriverInfo_Menu
=================
*/
static void UI_DriverInfo_Menu( void )
{
char* eptr;
int i;
int len;
// zero set all our globals
memset( &s_driverinfo, 0 ,sizeof(driverinfo_t) );
DriverInfo_Cache();
s_driverinfo.menu.fullscreen = qtrue;
s_driverinfo.menu.draw = DriverInfo_MenuDraw;
s_driverinfo.banner.generic.type = MTYPE_BTEXT;
s_driverinfo.banner.generic.x = 320;
s_driverinfo.banner.generic.y = 16;
s_driverinfo.banner.string = "DRIVER INFO";
s_driverinfo.banner.color = color_white;
s_driverinfo.banner.style = UI_CENTER;
s_driverinfo.framel.generic.type = MTYPE_BITMAP;
s_driverinfo.framel.generic.name = DRIVERINFO_FRAMEL;
s_driverinfo.framel.generic.flags = QMF_INACTIVE;
s_driverinfo.framel.generic.x = 0;
s_driverinfo.framel.generic.y = 78;
s_driverinfo.framel.width = 256;
s_driverinfo.framel.height = 329;
s_driverinfo.framer.generic.type = MTYPE_BITMAP;
s_driverinfo.framer.generic.name = DRIVERINFO_FRAMER;
s_driverinfo.framer.generic.flags = QMF_INACTIVE;
s_driverinfo.framer.generic.x = 376;
s_driverinfo.framer.generic.y = 76;
s_driverinfo.framer.width = 256;
s_driverinfo.framer.height = 334;
s_driverinfo.back.generic.type = MTYPE_BITMAP;
s_driverinfo.back.generic.name = DRIVERINFO_BACK0;
s_driverinfo.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_driverinfo.back.generic.callback = DriverInfo_Event;
s_driverinfo.back.generic.id = ID_DRIVERINFOBACK;
s_driverinfo.back.generic.x = 0;
s_driverinfo.back.generic.y = 480-64;
s_driverinfo.back.width = 128;
s_driverinfo.back.height = 64;
s_driverinfo.back.focuspic = DRIVERINFO_BACK1;
// TTimo: overflow with particularly long GL extensions (such as the gf3)
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=399
// NOTE: could have pushed the size of stringbuff, but the list is already out of the screen
// (no matter what your resolution)
Q_strncpyz(s_driverinfo.stringbuff, uis.glconfig.extensions_string, 1024);
// build null terminated extension strings
eptr = s_driverinfo.stringbuff;
while ( s_driverinfo.numstrings<40 && *eptr )
{
while ( *eptr && *eptr == ' ' )
*eptr++ = '\0';
// track start of valid string
if (*eptr && *eptr != ' ')
s_driverinfo.strings[s_driverinfo.numstrings++] = eptr;
while ( *eptr && *eptr != ' ' )
eptr++;
}
// safety length strings for display
for (i=0; i<s_driverinfo.numstrings; i++) {
len = strlen(s_driverinfo.strings[i]);
if (len > 32) {
s_driverinfo.strings[i][len-1] = '>';
s_driverinfo.strings[i][len] = '\0';
}
}
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.banner );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.framel );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.framer );
Menu_AddItem( &s_driverinfo.menu, &s_driverinfo.back );
UI_PushMenu( &s_driverinfo.menu );
}