void UI_Main::M_Menu_Open_f( void ) { int i; if( !self ) return; if( trap::Cmd_Argc() < 2 ) return; Rocket::Core::URL url; url.SetFileName( trap::Cmd_Argv( 1 ) ); url.SetExtension( "rml" ); for( i = 2; i < trap::Cmd_Argc() - 1; i += 2 ) { url.SetParameter( trap::Cmd_Argv( i ), trap::Cmd_Argv( i+1 ) ); } Rocket::Core::String urlString = url.GetURL(); //Com_Printf( "UI_Main::M_Menu_Open_f %s\n", urlString.CString() ); NavigationStack *nav = self->getNavigator(); if( !nav ) return; nav->pushDocument( urlString.CString() ); self->showUI( true ); }
void UI_Main::M_Menu_Open_Cmd_f_( bool modal ) { int i; if( !self ) { return; } if( trap::Cmd_Argc() < 2 ) { return; } Rocket::Core::URL url; url.SetFileName( trap::Cmd_Argv( 1 ) ); url.SetExtension( "rml" ); for( i = 2; i < trap::Cmd_Argc() - 1; i += 2 ) { url.SetParameter( trap::Cmd_Argv( i ), trap::Cmd_Argv( i + 1 ) ); } Rocket::Core::String urlString = url.GetURL(); //Com_Printf( "UI_Main::M_Menu_Open_f %s\n", urlString.CString() ); NavigationStack *nav = self->navigations[UI_CONTEXT_MAIN].front(); if( !nav ) { return; } nav->pushDocument( urlString.CString(), modal ); self->showUI( true ); }
void UI_Main::M_Menu_Quick_f( void ) { int i; if( !self ) { return; } if( !( trap::IN_SupportedDevices() & ( IN_DEVICE_KEYBOARD | IN_DEVICE_TOUCHSCREEN ) ) ) { return; } NavigationStack *nav = self->navigations[UI_CONTEXT_QUICK].front(); if( !nav ) { return; } if( trap::Cmd_Argc() <= 2 ) { self->quickMenuURL = ""; nav->popAllDocuments(); return; } Rocket::Core::URL url; url.SetFileName( trap::Cmd_Argv( 1 ) ); url.SetExtension( "rml" ); for( i = 2; i < trap::Cmd_Argc() - 1; i += 2 ) { url.SetParameter( trap::Cmd_Argv( i ), trap::Cmd_Argv( i + 1 ) ); } Rocket::Core::String urlString = url.GetURL(); if( urlString == self->quickMenuURL ) { return; } if( nav->hasDocuments() ) { nav->popAllDocuments(); } nav->pushDocument( urlString.CString(), false ); self->quickMenuURL = urlString; }