I'm trying to add an introduction menu to display when a client initially connects to a server. It does a key capture, bringing up the cursor allowing you to click on a button to join the game. I'd got the menu loading, but ran into 2 problems:
1. the action events don't work (ie: if you click on a button it does nothing) among other things such as transition events
2. it blocks the main menu from opening when pressing esc
This is using TA's ui menu script code btw. Here's the main function that is accessed through CG_Draw2D(), pretty short and simple:
Code: Select all
static qboolean CG_DrawIntro( void ) {
playerState_t *ps = &cg.predictedPlayerState;
if ( ps->persistant[PERS_TEAM] != TEAM_SPECTATOR ) return qfalse;
if ( ps->persistant[PERS_SPECTATOR] != SPECTATOR_INTRO ) return qfalse;
if ( menuIntro ) {
menuIntro->window.flags &= ~WINDOW_FORCED;
menuIntro->window.flags |= WINDOW_MOUSEOVER;
menuIntro->window.flags |= WINDOW_HASFOCUS;
}
menuIntro = Menus_FindByName( "joingame_menu" );
if ( menuIntro ) {
Menu_Paint( menuIntro, qtrue );
trap_Key_SetCatcher( KEYCATCH_UI );
}
//trap_ShowIntroMenu();
return qtrue;
}