Make add bots menu use standard menu drawing

Made add bots menu draw banner and background like remove bots menu.
This commit is contained in:
Zack Middleton 2015-09-16 01:43:28 -05:00
parent b85935d30c
commit 3001cacf89

View file

@ -59,10 +59,16 @@ ADD BOTS MENU
typedef struct {
menuframework_s menu;
menutext_s banner;
menubitmap_s background;
menubitmap_s arrows;
menubitmap_s up;
menubitmap_s down;
menutext_s bots[7];
menulist_s skill;
menulist_s team;
menubitmap_s go;
@ -215,21 +221,6 @@ static void UI_AddBotsMenu_GetSortedBotNums( void ) {
qsort( addBotsMenuInfo.sortedBotNums, addBotsMenuInfo.numBots, sizeof(addBotsMenuInfo.sortedBotNums[0]), UI_AddBotsMenu_SortCompare );
}
/*
=================
UI_AddBotsMenu_Draw
=================
*/
static void UI_AddBotsMenu_Draw( void ) {
UI_DrawBannerString( 320, 16, "ADD BOTS", UI_CENTER, color_white );
UI_DrawNamedPic( 320-233, 240-166, 466, 332, ART_BACKGROUND );
// standard menu drawing
Menu_Draw( &addBotsMenuInfo.menu );
}
/*
=================
UI_AddBotsMenu_Init
@ -266,7 +257,6 @@ static void UI_AddBotsMenu_Init( void ) {
gametype = atoi( Info_ValueForKey( info,"g_gametype" ) );
memset( &addBotsMenuInfo, 0 ,sizeof(addBotsMenuInfo) );
addBotsMenuInfo.menu.draw = UI_AddBotsMenu_Draw;
addBotsMenuInfo.menu.fullscreen = qfalse;
addBotsMenuInfo.menu.wrapAround = qtrue;
addBotsMenuInfo.delay = 1000;
@ -276,6 +266,21 @@ static void UI_AddBotsMenu_Init( void ) {
addBotsMenuInfo.numBots = UI_GetNumBots();
count = addBotsMenuInfo.numBots < 7 ? addBotsMenuInfo.numBots : 7;
addBotsMenuInfo.banner.generic.type = MTYPE_BTEXT;
addBotsMenuInfo.banner.generic.x = 320;
addBotsMenuInfo.banner.generic.y = 16;
addBotsMenuInfo.banner.string = "ADD BOTS";
addBotsMenuInfo.banner.color = color_white;
addBotsMenuInfo.banner.style = UI_CENTER;
addBotsMenuInfo.background.generic.type = MTYPE_BITMAP;
addBotsMenuInfo.background.generic.name = ART_BACKGROUND;
addBotsMenuInfo.background.generic.flags = QMF_INACTIVE;
addBotsMenuInfo.background.generic.x = 320-233;
addBotsMenuInfo.background.generic.y = 240-166;
addBotsMenuInfo.background.width = 466;
addBotsMenuInfo.background.height = 332;
addBotsMenuInfo.arrows.generic.type = MTYPE_BITMAP;
addBotsMenuInfo.arrows.generic.name = ART_ARROWS;
addBotsMenuInfo.arrows.generic.flags = QMF_INACTIVE;
@ -370,8 +375,9 @@ static void UI_AddBotsMenu_Init( void ) {
UI_AddBotsMenu_GetSortedBotNums();
UI_AddBotsMenu_SetBotNames();
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.background );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.banner );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.arrows );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.up );
Menu_AddItem( &addBotsMenuInfo.menu, &addBotsMenuInfo.down );
for( n = 0; n < count; n++ ) {