Ejemplo n.º 1
0
void LogisticsSaveDialog::updateCampaignMissionInfo()
{

	FitIniFile file;
	FullPathFileName path;
	path.init( campaignPath, selectedName, ".fit" );
	if ( NO_ERR != file.open( path ) )
	{
		Assert( 0, 0, "coudln't find the campaign file\n" );
	}

	char fileName[256];

	if ( NO_ERR == file.seekBlock( "Group0Mission0" ) )
	{
		if ( NO_ERR != file.readIdString( "FileName", fileName, 1023 ) )
		{				
			setMission( "" );
		}		
		else
		{
			setMission( fileName );
		}
	}	
	else
		setMission( "" );

}
int MissionSelectionScreen::handleMessage( unsigned long msg, unsigned long who )
{
	if ( who >= MSG_FIRST_MISSION && who < MSG_FIRST_MISSION + MAX_MISSIONS_IN_GROUP )
	{
		setMission( who - MSG_FIRST_MISSION );
	}
	
	switch( who )
	{
	case MB_MSG_NEXT:
		status = NEXT;
		break;

	case MB_MSG_PREV:
		status = PREVIOUS;
		break;

	case MN_MSG_PLAY:
		if ( bMovie )
			bMovie->restart();
		getButton( MN_MSG_STOP )->press( 0 );
		getButton( MN_MSG_PAUSE )->press( 0 );
		break;
	case MN_MSG_STOP:
		if ( bMovie )
			bMovie->stop();
		bStop = true;
		break;

	case MN_MSG_PAUSE:
		if ( !getButton( who )->isPressed() )
		{
			if ( bMovie )
				bMovie->pause(0);
			getButton( who )->press(false);
		}
		else
		{
			if ( bMovie )
				bMovie->pause(1);
			getButton( who )->press(true);
		}


		break;

	case MB_MSG_MAINMENU:
		status = MAINMENU;
		break;
	}

	return 0;

}