int MPLoadMap::handleMessage( unsigned long message, unsigned long who) { status = who; end(); exitAnim.begin(); enterAnim.end(); if ( status == YES ) { } if ( RUNNING == status ) { switch ( who ) { case FIRST_BUTTON_ID+2: { getButton( FIRST_BUTTON_ID+2 )->press( 0 ); connectionType = 0; buttons[indexOfButtonWithID(FIRST_BUTTON_ID+2)].press(!((1 == connectionType) || (2 == connectionType) || (3 == connectionType))); buttons[indexOfButtonWithID(FIRST_BUTTON_ID+3)].press(1 == connectionType); buttons[indexOfButtonWithID(FIRST_BUTTON_ID+4)].press(2 == connectionType); buttons[indexOfButtonWithID(FIRST_BUTTON_ID+5)].press(3 == connectionType); return 1; } break; } } return 0; }
void MPConnectionType::init(FitIniFile* file) { LogisticsScreen::init( *file, "Static", "Text", "Rect", "Button" ); if ( buttonCount ) { for ( int i = 0; i < buttonCount; i++ ) { buttons[i].setMessageOnRelease(); if (buttons[i].getID() == 0) { buttons[i].setID(FIRST_BUTTON_ID + i); } if ( buttons[i].getID() != MB_MSG_MAINMENU ) { buttons[i].setPressFX( LOG_VIDEOBUTTONS ); buttons[i].setHighlightFX( LOG_DIGITALHIGHLIGHT ); buttons[i].setDisabledFX( LOG_WRONGBUTTON ); } } } { char path[256]; strcpy( path, artPath ); strcat( path, "mcl_mp_contype_zone.fit" ); FitIniFile PNfile; if ( NO_ERR != PNfile.open( path ) ) { char error[256]; sprintf( error, "couldn't open file %s", path ); Assert( 0, 0, error ); return; } zonePanel.init(&PNfile, this); } { char path[256]; strcpy( path, artPath ); strcat( path, "mcl_mp_contype_lan.fit" ); FitIniFile PNfile; if ( NO_ERR != PNfile.open( path ) ) { char error[256]; sprintf( error, "couldn't open file %s", path ); Assert( 0, 0, error ); return; } lanPanel.init(&PNfile); } { char path[256]; strcpy( path, artPath ); strcat( path, "mcl_mp_contype_tcpip.fit" ); FitIniFile PNfile; if ( NO_ERR != PNfile.open( path ) ) { char error[256]; sprintf( error, "couldn't open file %s", path ); Assert( 0, 0, error ); return; } tcpipPanel.init(&PNfile); } connectionType = 0; buttons[indexOfButtonWithID(FIRST_BUTTON_ID+1)].press(!((1 == connectionType) || (2 == connectionType) || (3 == connectionType))); buttons[indexOfButtonWithID(FIRST_BUTTON_ID+2)].press(1 == connectionType); buttons[indexOfButtonWithID(FIRST_BUTTON_ID+3)].press(2 == connectionType); switch (connectionType) { case 1: pPanel = &lanPanel; break; case 2: pPanel = &tcpipPanel; break; default: pPanel = &zonePanel; break; } hostDlg.init(); }
int MPConnectionType::handleMessage( unsigned long message, unsigned long who) { if ( RUNNING == status ) { switch ( who ) { case 57/*MB_MSG_MAINMENU*/: { getButton( 57/*MB_MSG_MAINMENU*/ )->press( 0 ); status = MAINMENU; } break; case 51/*MB_MSG_PREV*/: { getButton( 51/*MB_MSG_PREV*/ )->press( 0 ); status = UP; } break; case 50/*MB_MSG_NEXT*/: { switch (connectionType) { case 0/*internet*/: { (*ppConnectionScreen) = pLocalBrowserScreen; } break; case 1/*local browser*/: { (*ppConnectionScreen) = pLocalBrowserScreen; } break; case 2/*direct tcp/ip*/: { (*ppConnectionScreen) = pDirectTcpipScreen; } break; case 3/*modem2modem*/: { (*ppConnectionScreen) = pLocalBrowserScreen; } break; } getButton( 50/*MB_MSG_NEXT*/ )->press( 0 ); status = NEXT; } break; case FIRST_BUTTON_ID+1: { connectionType = 0; pPanel = &zonePanel; } break; case FIRST_BUTTON_ID+2: { connectionType = 1; pPanel = &lanPanel; } break; case FIRST_BUTTON_ID+3: { connectionType = 2; pPanel = &tcpipPanel; } break; case LAN_PANEL_FIRST_BUTTON_ID: { (*ppConnectionScreen) = pLocalBrowserScreen; status = NEXT; } break; case LAN_PANEL_FIRST_BUTTON_ID + 1: { bHosting = true; hostDlg.begin(); } break; case TCPIP_PANEL_FIRST_BUTTON_ID: { (*ppConnectionScreen) = pMPPlaceHolderScreen; // now I need to pop a connecting dialog... status = NEXT; } break; case TCPIP_PANEL_FIRST_BUTTON_ID + 1: { bHosting = true; hostDlg.begin(); } break; case ZONE_PANEL_FIRST_BUTTON_ID: { MPlayer->launchBrowser( NULL ); (*ppConnectionScreen) = pMPPlaceHolderScreen; // now I need to pop a connecting dialog... status = NEXT; quitGame = true; } break; } switch ( who ) { case FIRST_BUTTON_ID+1: case FIRST_BUTTON_ID+2: case FIRST_BUTTON_ID+3: buttons[indexOfButtonWithID(FIRST_BUTTON_ID+1)].press(!((1 == connectionType) || (2 == connectionType) || (3 == connectionType))); buttons[indexOfButtonWithID(FIRST_BUTTON_ID+2)].press(1 == connectionType); buttons[indexOfButtonWithID(FIRST_BUTTON_ID+3)].press(2 == connectionType); return 1; break; } } return 0; }