int32_t LogisticsSaveDialog::init(FitIniFile& file)
{
	if (!s_instance)
	{
		s_instance = new LogisticsSaveDialog();
		((LogisticsScreen*)s_instance)->init(file, "Static", "Text", "Rect", "Button");
		file.seekBlock("InAnim");
		s_instance->enterAnim.init(&file, "");
		file.seekBlock("OutAnim");
		s_instance->exitAnim.init(&file, "");
		s_instance->gameListBox.init(s_instance->rects[1].globalX(), s_instance->rects[1].globalY(),
			s_instance->rects[1].width(), s_instance->rects[1].height());
		s_instance->gameListBox.setTopSkip(3);
		s_instance->gameListBox.setOrange(true);
		for (size_t i = 0; i < s_instance->buttonCount; i++)
			s_instance->buttons[i].setMessageOnRelease();
		s_instance->templateItem.init(&file, "AnimText");
		s_instance->templateItem.resize(
			s_instance->gameListBox.width() - 30, s_instance->templateItem.height());
		for (i = 0; i < s_instance->editCount; i++)
		{
			s_instance->edits[i].allowWierdChars(0);
		}
	}
	s_instance->getButton(YES)->setPressFX(LOG_NEXTBACKBUTTONS);
	return 0;
}
예제 #2
0
int LogisticsVariantDialog::init( FitIniFile& file )
{
	LogisticsScreen::init( file, "Static", "Text", "Rect", "Button", "Edit");

		file.seekBlock( "InAnim" );
		enterAnim.init( &file, "" );
		file.seekBlock( "OutAnim" );
		exitAnim.init( &file, "" );

		gameListBox.init( rects[1].globalX(), 
			rects[1].globalY(), 
			rects[1].width(),
			rects[1].height() );

		gameListBox.setOrange(true);

		for ( int i = 0; i < buttonCount; i++ )
			buttons[i].setMessageOnRelease();

	edits[0].limitEntry( 14 );

	templateItem.init( file, "AnimText" );

	for ( i = 0; i < editCount; i++ )
	{
		edits[i].allowWierdChars( 0 );
	}
	return 0;		
}
예제 #3
0
bool CCampaignData::Read(CString pathName) {
	FitIniFile fitFile;
	int result = fitFile.open(pathName.GetBuffer(0));
	if (NO_ERR != result) { assert(false); return false; }

	result = fitFile.seekBlock("Campaign");
	if (NO_ERR != result) { assert(false); }
	result = sReadIdString(fitFile, "CampaignName", m_Name);
	if (NO_ERR == result) { m_NameUseResourceString = false; }
	result = sReadIdInteger(fitFile, "NameID", m_NameResourceStringID);
	if (NO_ERR == result) { m_NameUseResourceString = true; }
	result = sReadIdBoolean(fitFile, "NameUseResourceString", m_NameUseResourceString);
	result = sReadIdInteger(fitFile, "CBills", m_CBills);
	result = sReadIdString(fitFile, "FinalVideo", m_FinalVideo);
	int groupCount = 0;
	result = sReadIdInteger(fitFile, "GroupCount", groupCount);
	if (NO_ERR != result) { return false; }

	int index;
	for (index = 0; groupCount > index; index+=1) {
		ECharString blockName;
		blockName.Format("Group%d", index);
		result = fitFile.seekBlock(blockName.Data());
		if (NO_ERR != result) { assert(false); continue; }
		CGroupData groupData;
		bool bresult = groupData.Read(fitFile, blockName.Data());
		if (true != bresult) { assert(false); continue; }
		m_GroupList.Append(groupData);
	}

	fitFile.close();
	return true;
}
int32_t LogisticsLegalDialog::init(FitIniFile& file)
{
	if (!s_instance)
	{
		s_instance = new LogisticsLegalDialog;
		((LogisticsScreen*)s_instance)->init(file, "Static", "Text", "Rect", "Button", "Edit");
		file.seekBlock("EnterAnim");
		s_instance->enterAnim.init(&file, "");
		file.seekBlock("LeaveAnim");
		s_instance->exitAnim.init(&file, "");
		for (size_t i = 0; i < s_instance->buttonCount; i++)
			s_instance->buttons[i].setMessageOnRelease();
	}
	return 0;
}
예제 #5
0
void CMissionDialog::OnMiPurchaseFileBrowseButton() {
	UpdateData(TRUE);
	while (true) {
		CFileDialog selectFileDialog(TRUE,_T("FIT"),_T("*.FIT"),
						 OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_NOCHANGEDIR,
						 _T("FIT File (*.FIT)|*.FIT|"));
		selectFileDialog.m_ofn.lpstrInitialDir = missionPath;
		if( selectFileDialog.DoModal()==IDOK ) {
			CString purchasePath = selectFileDialog.GetPathName();
			FitIniFile file;
			long result = 0;
			result = file.open( (char*)(const char*)purchasePath );
			if (NO_ERR != result) {
				AfxMessageBox(IDS_COULDNT_OPEN_PURCHASE_FILE);
			} else {
				long result = 0;
				result = file.seekBlock("Mechs");
				if (NO_ERR != result)
				{
					AfxMessageBox(IDS_NOT_A_VALID_PURCHASE_FILE);
				}
				file.close();
			}
			m_PurchaseFileEdit = selectFileDialog.GetFileTitle();
			break;
		} else {
			break;
		}
	}
	UpdateData(FALSE);
}
예제 #6
0
void aAnimButton::init( FitIniFile& file, const char* headerName, HGOSFONT3D font )
{
	if ( NO_ERR != file.seekBlock( headerName ) )
	{
		char errorStr[256];
		sprintf( errorStr, "couldn't find block %s in file %s", headerName, file.getFilename() );
		Assert( 0, 0, errorStr );
		animateBmp = 0;
		animateText = 0;
		return;
	}
	aButton::init( file, headerName, font );
	normalData.init( &file, "Normal" );
	pressedData.init( &file, "Pressed" );
	highlightData.init( &file, "Highlight" );
	disabledData.init( &file, "Disabled" );
	normalData.begin();

	if ( NO_ERR != file.readIdBoolean( "AnimateBmp", animateBmp ) )
		animateBmp = 1;
	if ( NO_ERR != file.readIdBoolean( "AnimateText", animateText ) )
		animateText = 1;

	bool bTmp = 0;
	if ( NO_ERR == file.readIdBoolean( "AnimateChildren", bTmp  ) )
	{
		bAnimateChildren = bTmp;
	}
	
}
예제 #7
0
bool LogisticsSaveDialog::isCorrectVersionSaveGame( char* fileName )
{
	FullPathFileName path;
	path.init( savePath, fileName, ".fit" );

	FitIniFile file;

	if ( NO_ERR != file.open( (char*)(const char*)path ) )
	{
		char errorStr[256];
		sprintf( errorStr, "couldn't open file %s", path );
		STOP((errorStr));
	}

	
	long result = file.seekBlock( "Version" );
	if (result != NO_ERR)
		return false;

	long testVersionNum = 0;
	result = file.readIdLong( "VersionNumber", testVersionNum );
	if ( (result == NO_ERR) && (testVersionNum == SaveGameVersionNumber))
		return true;

	return false;
}
int32_t LogisticsAcceptVariantDialog::init(FitIniFile& file)
{
	LogisticsScreen::init(file, "Static", "Text", "Rect", "Button", "Edit");
	file.seekBlock("InAnim");
	enterAnim.init(&file, "");
	file.seekBlock("OutAnim");
	exitAnim.init(&file, "");
	for (size_t i = 0; i < buttonCount; i++)
		buttons[i].setMessageOnRelease();
	edits[0].limitEntry(14);
	for (i = 0; i < editCount; i++)
	{
		edits[i].allowWierdChars(0);
	}
	return 0;
}
예제 #9
0
bool CGroupData::Read(FitIniFile &fitFile, const char *groupName) {
	int result;
	result = sReadIdString(fitFile, "Label", m_Label);
	result = sReadIdInteger(fitFile, "NumberToComplete", m_NumMissionsToComplete);
	result = sReadIdString(fitFile, "OperationFile", m_OperationFile);
	result = sReadIdString(fitFile, "Video", m_VideoFile);
	result = sReadIdString(fitFile, "PreVideo", m_PreVideoFile);
	result = sReadIdInteger(fitFile, "Tune", m_TuneNumber);
	result = sReadIdString(fitFile, "ABLScript", m_ABLScript);
	int missionCount = 0;
	result = sReadIdInteger(fitFile, "MissionCount", missionCount);
	if (NO_ERR != result) { return false; }

	int index;
	for (index = 0; missionCount > index; index+=1) {
		ECharString blockName;
		blockName.Format("%sMission%d", groupName, index);
		result = fitFile.seekBlock(blockName.Data());
		if (NO_ERR != result) { assert(false); continue; }
		CMissionData missionData;
		bool bresult = missionData.Read(fitFile);
		if (true != bresult) { assert(false); continue; }
		m_MissionList.Append(missionData);
	}

	return true;
}
예제 #10
0
long LightType::init (FilePtr objFile, unsigned long fileSize) {

	long result = 0;
	
	FitIniFile explFile;
	result = explFile.open(objFile,fileSize);
	if (result != NO_ERR)
		return(result);

	result = explFile.seekBlock("LightData");
	if (result != NO_ERR)
		return result;

	result = explFile.readIdBoolean("OneShotFlag",oneShotFlag);
	if (result != NO_ERR)
		return result;

	result = explFile.readIdFloat("AltitudeOffset",altitudeOffset);
	if (result != NO_ERR)
		return result;

	//------------------------------------------------------------------
	// Initialize the base object Type from the current file.
	result = ObjectType::init(&explFile);
	return(result);
}
예제 #11
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( "" );

}
예제 #12
0
void LogisticsSaveDialog::readCampaignNameFromFile( char* fileName, char* resultName, long len )
{
	FullPathFileName path;
	path.init( campaignPath, fileName, ".fit" );

	FitIniFile file;

	if ( NO_ERR != file.open( (char*)(const char*)path ) )
	{
		char errorStr[256];
		sprintf( errorStr, "couldn't open file %s", path );
		Assert( 0, 0, errorStr );
	}

	
	long result = file.seekBlock( "Campaign" );
	Assert( result == NO_ERR, 0, "Coudln't find the mission settings block in the mission file" );

	resultName[0] = 0;
	long lName = 0;

	result = file.readIdLong( "NameID", lName );
	if ( result == NO_ERR )
	{
		cLoadString( lName, resultName, len );
	}
	else
	{
		result = file.readIdString( "CampaignName", resultName, len );
		Assert( result == NO_ERR, 0, "couldn't find the missionName" );
	}
}
예제 #13
0
long mcScrollBar::init ( long xPos, long yPos, long w, long h  )	
{

	FitIniFile file; 
	char path[256];
	strcpy( path, artPath );
	strcat( path, "scrollbar.fit" );
	if ( NO_ERR != file.open( path ) )
	{
		char error[256];
		sprintf( error, "couldn't open file %s", path );
		Assert( 0, 0, error );
	}

	setColor( 0, 0 ); // black background

	color = 0xff002F55; // outline color

	topButton.init( file, "ScrollButton0" );
	
	
	bottomButton.init( file, "ScrollButton1" );
	bottomButton.moveTo( bottomButton.x(), h - bottomButton.height() - 2 );
	
	
	scrollTab.init( file, "ScrollButton2" );
	scrollTab.moveTo( scrollTab.x(), topButton.bottom() + 1 );

	file.seekBlock( "Orange" );
	orangeInfo[0].init( &file, "Normal" );
	orangeInfo[1].init( &file, "Highlight" );
	orangeInfo[2].init( &file, "Pressed" );
	orangeInfo[3].init( &file, "Disabled" );
	
	file.seekBlock( "Green" );
	greenInfo[0].init( &file, "Normal" );
	greenInfo[1].init( &file, "Highlight" );
	greenInfo[2].init( &file, "Pressed" );
	greenInfo[3].init( &file, "Disabled" );
	
	aScrollBar::init( xPos, yPos, w, h );

	scrollTab.setTexture( (unsigned long)0 );

	return 0;

}
예제 #14
0
//----------------------------------------------------------------------------------
void initColorTables (void)
{
	FullPathFileName colorPath;
	colorPath.init(cameraPath,"colors",".fit");

	FitIniFile colorFile;
	long result = colorFile.open(colorPath);
	gosASSERT(result == NO_ERR);

	result = colorFile.seekBlock("Main");
	gosASSERT(result == NO_ERR);

	result = colorFile.readIdLong("NumTables",numColorRGBTables);
	gosASSERT(result == NO_ERR);

	colorRGBLookup = (DWORD **)systemHeap->Malloc(sizeof(DWORD *) * numColorRGBTables);
	gosASSERT(colorRGBLookup != NULL);

	memset(colorRGBLookup,0,sizeof(DWORD *) * numColorRGBTables);

	for (long i=0;i<numColorRGBTables;i++)
	{
		char tableBlock[256];
		sprintf(tableBlock,"Table%d",i);

		result = colorFile.seekBlock(tableBlock);
		gosASSERT(result == NO_ERR);

		colorRGBLookup[i] = (DWORD *)systemHeap->Malloc(sizeof(DWORD) * MAX_COLOR_ENTRIES);
		gosASSERT(colorRGBLookup[i] != NULL);

		DWORD *table = colorRGBLookup[i];

		for (long j=0;j<MAX_COLOR_ENTRIES;j++)
		{
			char colorBlock[256];
			sprintf(colorBlock,"Color%d",j);

			result = colorFile.readIdULong(colorBlock,table[j]);
			gosASSERT(result == NO_ERR);
		}
	}

	colorFile.close();
}	
예제 #15
0
int32_t LogisticsMapInfoDialog::init()
{
	FitIniFile file;
	FullPathFileName path;
	path.init(artPath, "mcl_mp_mapinfo", ".fit");
	if (NO_ERROR != file.open(path))
	{
		char buffer2[512];
		sprintf(buffer2, "couldn't open file %s", (PSTR)path);
		Assert(0, 0, buffer2);
		return false;
	}
	LogisticsScreen::init(file, "Static", "Text", "Rect", "Button", "Edit");
	file.seekBlock("InAnim");
	enterAnim.init(&file, "");
	file.seekBlock("OutAnim");
	exitAnim.init(&file, "");
	return 1;
}
예제 #16
0
void MechListBoxItem::init( FitIniFile& file )
{
	if ( !s_templateItem )
	{
		s_templateItem = new MechListBoxItem( NULL, 0 );
		file.seekBlock( "MainBox" );

		long width, height;

		file.readIdLong( "Width", width );
		file.readIdLong( "Height", height );

		((aObject*)s_templateItem)->init( 0, 0, width, height );

		memset( s_templateItem->animationIDs, 0, sizeof(long) * 9  );

		// rects
		s_templateItem->line.init( &file, "Rect1" );
		s_templateItem->outline.init( &file, "Rect0" );

		long curAnim = 0;
		// statics
		s_templateItem->weightIcon.init( &file, "Static0" );
		assignAnimation( file, curAnim );
	
		s_templateItem->mechIcon.init( &file, "Static1" );
		assignAnimation( file, curAnim );
		s_templateItem->costIcon.init( &file, "Static2" );
		assignAnimation( file, curAnim );

		// texts
		s_templateItem->chassisName.init( &file, "Text0" );
		assignAnimation( file, curAnim );
		s_templateItem->weightText.init( &file, "Text1" );
		assignAnimation( file, curAnim );
		s_templateItem->countText.init( &file, "Text2" );
		assignAnimation( file, curAnim );
		s_templateItem->variantName.init( &file, "Text3" );
		assignAnimation( file, curAnim );
		s_templateItem->costText.init( &file, "Text4" );
		assignAnimation( file, curAnim );

		char blockName[64];
		for ( int i = 0; i < 4; i++ )
		{
			sprintf( blockName, "OrangeAnimation%ld", i );
			s_templateItem->animations[1][i].init( &file, blockName );
			sprintf( blockName, "Animation%ld", i );
			s_templateItem->animations[0][i].init( &file, blockName );
		}
		
	}

}
예제 #17
0
void MPGameBrowser::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);
				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_lanbrowsercombobox0.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;
		}
		
		PNfile.seekBlock("GameList"); /*for some reason aListBox::init(...) doesn't do the seekBlock itself*/
		gameList.init(&PNfile, "GameList");

		gameList.SelectItem(0);
		gameList.init( rects[0].left(), rects[0].top(), rects[0].width(), rects[0].height() );
		gameList.setOrange( true );

		templateItem.init(&PNfile, "GameListItem");

		for ( int i = 0; i < 256; i++ )
		{
			items[i] = templateItem;
		}

	}


	hostDlg.init();
}
예제 #18
0
int LogisticsOneButtonDialog::init( FitIniFile& file )
{
	if ( !s_instance )
	{
		s_instance = new LogisticsOneButtonDialog;
		((LogisticsScreen*)s_instance)->init( file, "Static", "Text", "Rect", "Button", "Edit" );		

		file.seekBlock( "EnterAnim" );
		s_instance->enterAnim.init( &file, "" );
		file.seekBlock( "LeaveAnim" );
		s_instance->exitAnim.init( &file, "" );

		for ( int i = 0; i < s_instance->buttonCount; i++ )
			s_instance->buttons[i].setMessageOnRelease();

		s_instance->oldFont = s_instance->textObjects[0].font.getFontID();

	}

	return 0;
}
예제 #19
0
void LogisticsSaveDialog::setMission( const char* fileName)
{
	if ( strlen( fileName ) )
	{

		long textureHandle = MissionBriefingScreen::getMissionTGA( fileName );

		statics[MAP_STATIC].setTexture( textureHandle );
		statics[MAP_STATIC].setUVs( 0, 127, 127, 0);
		statics[MAP_STATIC].setColor( 0xffffffff );

		FullPathFileName path;
		FitIniFile file;

		path.init( missionPath, fileName, ".fit" );

		if ( NO_ERR == file.open( path ) )
		{
			char missionName[256];
			missionName[0] = 0;
			bool bRes = 0;

			file.seekBlock( "MissionSettings" );
			file.readIdBoolean( "MissionNameUseResourceString", bRes );
			if ( bRes )
			{
				unsigned long lRes;
				file.readIdULong( "MissionNameResourceStringID", lRes );
				cLoadString(lRes, missionName, 255);
			}
			else
			{
				file.readIdString("MissionName", missionName, 255);
			}

			textObjects[2].setText(missionName);

		}
		else
		{
			textObjects[2].setText( "" );
		}

	}
	else
	{
		statics[MAP_STATIC].setColor( 0 );
		textObjects[2].setText( "" );

	}

}
예제 #20
0
void LogisticsVehicle::init(FitIniFile& file)
{
	componentCount = 0;
	file.seekBlock("ObjectType");
	char tmp[256];
	file.readIdString("AppearanceName", tmp, 255);
	fileName = tmp;
	file.seekBlock("General");
	file.readIdLong("DescIndex", chassisNameID);
	file.readIdFloat("CurTonnage", maxWeight);
	char tmpWeightClass[256];
	cLoadString(IDS_VEHICLE_CLASS, tmpWeightClass, 256);
	mechClass = tmpWeightClass;
	if(NO_ERROR != file.readIdLong("HouseID", houseID))
	{
		houseID = -1;
	}
	if(NO_ERROR != file.readIdLong("EncyclopediaID", encyclopediaID))
	{
		encyclopediaID = IDS_VEHICLE_DESCRIPTION_0;
	}
	file.seekBlock("VehicleDynamics");
	file.readIdFloat("MaxVelocity", speed);
	PSTR parts[5] = { "Front", "Left", "Right", "Rear", "Turret" };
	baseArmor = 0;
	uint8_t pts;
	int32_t i;
	for(i = 0; i < 5; i++)
	{
		file.seekBlock(parts[i]);
		file.readIdUChar("MaxArmorPoints", pts);
		baseArmor += pts;
		file.readIdUChar("CurInternalStructure", pts);
		baseArmor += pts;
	}
	file.seekBlock("InventoryInfo");
	file.readIdUChar("NumWeapons", pts);
	char blockName[256];
	for(i = 4; i < 4 + pts; i++)
	{
		sprintf(blockName, "Item:%ld", i);
		if(NO_ERROR == file.seekBlock(blockName))
		{
			uint8_t fitID;
			file.readIdUChar("MasterID", fitID);
			LogisticsComponent* pComponent = LogisticsData::instance->getComponent(fitID);
			if(pComponent)
			{
				components[componentCount].component = pComponent;
				components[componentCount].xCoord = 0;
				components[componentCount].yCoord = 0;
				componentCount++;
			}
		}
	}
}
void PilotPromotionArea::init( FitIniFile& file )
{


	areaLeft.init( file, "PromoteGadgetLeftStatic", "PromoteGadgetLeftText",
		"PromoteGadgetLeftRect", NULL );

	areaRight.init( file, "PromoteGadgetRightStatic", "PromoteGadgetRightText",
		"PromoteGadgetRightRect", "PromoteGadgetRightButton" );

	file.seekBlock( "PromoteGadgetLeftEnterAnimation" );
	leftInfo.init( &file, "" );
	file.seekBlock( "PromoteGadgetRightEnterAnimation" );
	rightInfo.init( &file, "" );

	file.seekBlock( "PromoteGadgetLeftExitAnimation");
	leftExitInfo.init( &file, "" );
	file.seekBlock( "PromoteGadgetRightExitAnimation" );
	rightExitInfo.init( &file, "" );

	SpecialtyListItem::init( &file );

	char buffer[32];
	for ( int i = 0; i < 4; i++ )
	{
		sprintf( buffer, "PromoteGadgetLeftSkillMeter%ld", i );
		attributeMeters[i].init( &file, buffer );
		attributeMeters[i].setAddedColorMax( 0xffffffff );
		attributeMeters[i].setAddedColorMin( 0xffffffff );
	}

	file.seekBlock( "SkillSelectionAnimation" );
	selSkillAnim.init(&file, "" );

	pilot = NULL;
}
예제 #22
0
void aTextListItem::init( FitIniFile& file, const char* blockName )
{
	file.seekBlock( blockName );

	long x, y, width, height;

	file.readIdLong( "XLocation", x );
	file.readIdLong( "YLocation", y );
	file.readIdLong( "Width", width );
	file.readIdLong( "Height", height );

	aObject::init( x, y, width, height );

	long color;
	file.readIdLong( "Color", color );
	setColor( color );
}
예제 #23
0
void MPLoadMap::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);
			}
		}
	}

	file->seekBlock( "EnterAnim" );
	enterAnim.init( file, "" );
	file->seekBlock( "LeaveAnim" );
	exitAnim.init( file, "" );



	{
		char path[256];
		strcpy( path, artPath );
		strcat( path, "mcl_mp_loadmap_list0.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;
		}
		PNfile.seekBlock("MapList"); /*for some reason aListBox::init(...) doesn't do the seekBlock itself*/
		mapList.init(&PNfile, "MapList");
		templateItem.init( &PNfile, "Text0" );
	
	}

	mapList.setOrange( true );
}
예제 #24
0
void ForceGroupBar::init( FitIniFile& file, StaticInfo* pCoverIcon )
{

	if ( NO_ERR != file.seekBlock( "Fonts" ) )
		Assert( 0, 0, "couldn't find the font block" );

	if ( !ForceGroupIcon::gosFontHandle )
		ForceGroupIcon::gosFontHandle = new aFont;

	long fontID;
	file.readIdLong( "IconFont", fontID );
	ForceGroupIcon::gosFontHandle->init( fontID );

	
	swapResolutions();

	for ( int i = 0; i < 16; i++ )
		ForceGroupIcon::init( file, i );

	s_coverIcon = pCoverIcon;
}
예제 #25
0
void aAnimTextListItem::init( FitIniFile& file, const char* blockName )
{
	file.seekBlock( blockName );

	long x, y, width, height;

	file.readIdLong( "XLocation", x );
	file.readIdLong( "YLocation", y );
	file.readIdLong( "Width", width );
	file.readIdLong( "Height", height );

	aObject::init( x, y, width, height );

	long color;
	file.readIdLong( "Color", color );
	setColor( color );

	// I could read the font here

	char animationSt[256];
	if ( NO_ERR == file.readIdString( "Animation", animationSt, 255 ) )
		animInfo.init( &file, animationSt );
}
예제 #26
0
void MPLoadMap::getMapNameFromFile( const char* pFileName, char* missionName, long bufferLength )
{
	FullPathFileName path;
	path.init( missionPath, pFileName, ".fit" );

	FitIniFile file;

	if ( NO_ERR != file.open( (char*)(const char*)path ) )
	{
		char errorStr[256];
		sprintf( errorStr, "couldn't open file %s", path );
		Assert( 0, 0, errorStr );
	}

	
	long result = file.seekBlock( "MissionSettings" );
	Assert( result == NO_ERR, 0, "Coudln't find the mission settings block in the mission file" );

	missionName[0] = 0;
	bool bRes = 0;

	result = file.readIdBoolean( "MissionNameUseResourceString", bRes );
	//Assert( result == NO_ERR, 0, "couldn't find the MissionNameUseResourceString" );
	if ( bRes )
	{
		unsigned long lRes;
		result = file.readIdULong( "MissionNameResourceStringID", lRes );
		Assert( result == NO_ERR, 0, "couldn't find the MissionNameResourceStringID" );
		cLoadString( lRes, missionName, bufferLength );
	}
	else
	{
		result = file.readIdString( "MissionName", missionName, bufferLength );
		Assert( result == NO_ERR, 0, "couldn't find the missionName" );
	}
}
예제 #27
0
//---------------------------------------------------------------------------
long SoundSystem::init (char *soundFileName)
{
	if (useSound)
	{
		FullPathFileName soundName;
		soundName.init(soundPath,soundFileName,".snd");
		
		FitIniFile soundFile;
		long result = soundFile.open(soundName);
		gosASSERT(result == NO_ERR);

		result = soundFile.seekBlock("SoundSetup");
		gosASSERT(result == NO_ERR);

		result = soundFile.readIdULong("soundHeapSize",soundHeapSize);
		gosASSERT(result == NO_ERR);
		
		result = soundFile.readIdFloat("MaxSoundDistance",maxSoundDistance);
		gosASSERT(result == NO_ERR);

		soundHeap = new UserHeap;
		gosASSERT(soundHeap != NULL);

		result = soundHeap->init(soundHeapSize,"SOUND");
		gosASSERT(result == NO_ERR);

		//-----------------------------------------------------------------------
		// Startup the Sound packet File with the sound Blocks in it.
		// This works by sound ID.  The sound ID is the packet number.
		// When ordered to play a sample, the sound system check to see if that
		// sound ID is in the cache.  If not, it is loaded.  If there is no more
		// room, any idle sounds are flushed in order of priority.
		soundDataFile = new PacketFile;
		gosASSERT(soundDataFile != NULL);
		
		FullPathFileName soundDataPath;
		soundDataPath.init(CDsoundPath,soundFileName,".pak");
		
		result = soundDataFile->open(soundDataPath);
		gosASSERT(result == NO_ERR);
		
		bettyDataFile = new PacketFile;
		gosASSERT(bettyDataFile != NULL);
		
		FullPathFileName bettyDataPath;
		bettyDataPath.init(CDsoundPath,"Betty",".pak");
		
		result = bettyDataFile->open(bettyDataPath);
		gosASSERT(result == NO_ERR);

		numBettySamples = bettyDataFile->getNumPackets();
		
		supportDataFile = new PacketFile;
		gosASSERT(supportDataFile != NULL);
		
		FullPathFileName supportDataPath;
		supportDataPath.init(CDsoundPath,"support",".pak");
		
		result = supportDataFile->open(supportDataPath);
		gosASSERT(result == NO_ERR);

		numSupportSamples = supportDataFile->getNumPackets();
 		//-----------------------------------------------------------------------
		// Load all of the sound Bite data.  Do not load actual packet unless
		// preload field is TRUE.
		result = soundFile.seekBlock("SoundBites");
		gosASSERT(result == NO_ERR);

		result = soundFile.readIdULong("numBites",numSoundBites);
		gosASSERT(result == NO_ERR);

		//-----------------------------------------------------------------------
		// Preallocate SoundBites
		sounds = (SoundBite *)soundHeap->Malloc(sizeof(SoundBite) * numSoundBites);
		gosASSERT(sounds != NULL);
		memset(sounds,0,sizeof(SoundBite) * numSoundBites);
		
		for (long i=0;i<(long)numSoundBites;i++)
		{
			char biteBlock[20];
			sprintf(biteBlock,"SoundBite%d",i);
			
			result = soundFile.seekBlock(biteBlock);
			gosASSERT(result == NO_ERR);
			
			result = soundFile.readIdULong("priority",sounds[i].priority);
			gosASSERT(result == NO_ERR);
			
			result = soundFile.readIdULong("cache",sounds[i].cacheStatus);
			gosASSERT(result == NO_ERR);
			
			result = soundFile.readIdULong("soundId",sounds[i].soundId);
			gosASSERT(result == NO_ERR);
			
			preloadSoundBite(i);		//ALWAYS Preload!!!!!!!!!!!!!

			result = soundFile.readIdFloat("volume",sounds[i].volume);
			gosASSERT(result == NO_ERR);
		}		

		//---------------------------------------------------------------
		// Load the digital Music Data Strings
		result = soundFile.seekBlock("DigitalMusic");
		gosASSERT(result == NO_ERR);
			
		result = soundFile.readIdLong("NumDMS",numDMS);
		gosASSERT(result == NO_ERR);

		result = soundFile.readIdFloat("StreamFadeDownTime",streamFadeDownTime);
		gosASSERT(result == NO_ERR);

		result = soundFile.readIdULong("StreamBitDepth",digitalStreamBitDepth);
		gosASSERT(result == NO_ERR);
			
		result = soundFile.readIdULong("StreamChannels",digitalStreamChannels);
		gosASSERT(result == NO_ERR);

		digitalMusicIds = (char **)soundHeap->Malloc(sizeof(char *) * numDMS);
		gosASSERT(digitalMusicIds != NULL);
			
		digitalMusicLoopFlags = (bool *)soundHeap->Malloc(sizeof(bool)*numDMS);
		gosASSERT(digitalMusicLoopFlags != NULL);

		digitalMusicVolume = (float *)soundHeap->Malloc(sizeof(float) * numDMS);
			
		for (i=0;i<numDMS;i++)
		{
			char digitalMSId[20];
			sprintf(digitalMSId,"DMS%d",i);
			
			char digitalMSBId[20];
			sprintf(digitalMSBId,"DMSLoop%d",i);

			char digitalMSVId[25];
			sprintf(digitalMSVId,"DMSVolume%d",i);
			
			digitalMusicIds[i] = (char *)soundHeap->Malloc(30);
			result = soundFile.readIdString(digitalMSId,digitalMusicIds[i],29);
			gosASSERT(result == NO_ERR);
			
			result = soundFile.readIdBoolean(digitalMSBId,digitalMusicLoopFlags[i]);
			gosASSERT(result == NO_ERR);

			result = soundFile.readIdFloat(digitalMSVId,digitalMusicVolume[i]);
			if (result != NO_ERR)
				digitalMusicVolume[i] = 1.0f;
		}	
		
		soundFile.close();
		
		for (i=0;i<MAX_DIGITAL_SAMPLES+4;i++)
		{
			gosAudio_AllocateChannelSliders(i,gosAudio_Volume | gosAudio_Panning);
		}
	}
	
	digitalMasterVolume = float(DigitalMasterVolume) / 256.0f;
	SFXVolume = float(sfxVolume) / 256.0f;
	musicVolume = float(MusicVolume) / 256.0f;
	radioVolume = float(RadioVolume) / 256.0f;
	bettyVolume = float(BettyVolume) / 256.0f;

	stream1Id = stream2Id = 0;

	return(NO_ERR);
}
예제 #28
0
//-----------------------------
int32_t convertASE2TGL(PSTR file)
{
	//---------------------------------------------------
	// Get all of the .ASE files in the tgl directory.
	char findString[1024];
	char armFileName[1024];
	if (file[0] == '\0')
	{
		sprintf(findString, "%s*.ini", tglPath);
	}
	else
	{
		strcpy(findString, tglPath);
		strcat(findString, file);
	}
	int32_t count = 0;
	WIN32_FIND_DATA findResult;
	HANDLE searchHandle = FindFirstFile(findString, &findResult);
	do
	{
		if ((findResult.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
		{
			//-----------------------------------
			// Search for TGLData
			FullPathFileName iniName;
			iniName.init(tglPath, findResult.cFileName, "");
			FitIniFile iniFile;
			int32_t result = iniFile.open(iniName);
			if (result != NO_ERROR)
				return result;
			// ARM
			IProviderAssetPtr iniAsset =
				armProvider->OpenAsset((PSTR)iniName, AssetType_Physical, ProviderType_Primary);
			iniAsset->AddProperty("Type", "Object Definition");
			iniAsset->AddProperty("Version", "1.0");
			TG_TypeMultiShape* shape = nullptr;
			result					 = iniFile.seekBlock("TGLData");
			if (result == NO_ERROR)
			{
				char fileName[1024];
				result = iniFile.readIdString("FileName", fileName, 1023);
				if (result != NO_ERROR)
				{
					//---------------------------------------------
					// We have LODs -- handle differently
					// We will get animation from LAST LOD loaded
					int32_t i = 0;
					char fileCheck[1024];
					sprintf(fileCheck, "FileName%d", i);
					result = iniFile.readIdString(fileCheck, fileName, 1023);
					while (result == NO_ERROR)
					{
						if (shape)
						{
							delete shape;
							shape = nullptr;
						}
						char aseName[1024];
						sprintf(aseName, "%s%s%s", tglPath, fileName, ".ase");
						//---------------------------------------------------------------------------------------------
						// Load Base Shape or LOD 0 Shape.
						shape = new TG_TypeMultiShape;
						gosASSERT(shape != nullptr);
						printf("Processing Main Shape %s\n", aseName);
						char lodID[4];
						sprintf(lodID, "%02d", count);
						IProviderRelationshipPtr armLink =
							iniAsset->AddRelationship("LOD Shape", aseName);
						armLink->AddProperty("LOD", lodID);
						shape->LoadTGMultiShapeFromASE(aseName, true, armProvider);
						i++;
						sprintf(fileCheck, "FileName%d", i);
						result = iniFile.readIdString(fileCheck, fileName, 1023);
					}
				}
				char aseName[1024];
				sprintf(aseName, "%s%s%s", tglPath, fileName, ".ase");
				//---------------------------------------------------------------------------------------------
				// Load Base Shape or LOD 0 Shape.
				shape = new TG_TypeMultiShape;
				gosASSERT(shape != nullptr);
				printf("Processing Main Shape %s\n", aseName);
				IProviderRelationshipPtr armLink = iniAsset->AddRelationship("Main Shape", aseName);
				shape->LoadTGMultiShapeFromASE(aseName, true, armProvider);
				//-------------------------------------------
				// Gotta make the special shadow shape now!!
				// MUST use its own shape or animation below
				// will go straight to HELL!!
				result = iniFile.readIdString("ShadowName", fileName, 1023);
				if (result == NO_ERROR)
				{
					char aseName[1024];
					sprintf(aseName, "%s%s%s", tglPath, fileName, ".ase");
					//---------------------------------------------------------------------------------------------
					// Load Base Shape or LOD 0 Shape.
					TG_TypeMultiShapePtr shadowShape = new TG_TypeMultiShape;
					gosASSERT(shadowShape != nullptr);
					printf("Processing Shadow Shape %s\n", aseName);
					IProviderRelationshipPtr armLink =
						iniAsset->AddRelationship("Shadow Shape", aseName);
					shadowShape->LoadTGMultiShapeFromASE(aseName, true, armProvider);
					delete shadowShape;
					shadowShape = nullptr;
				}
				int32_t i = 0;
				char animCheck[1024];
				sprintf(animCheck, "Animation:%d", i);
				result = iniFile.seekBlock(animCheck);
				while (result == NO_ERROR) // This thing has animations. Process them!
				{
					char fileName[1024];
					result = iniFile.readIdString("AnimationName", fileName, 1023);
					if (result == NO_ERROR)
					{
						FullPathFileName aseName;
						aseName.init(tglPath, fileName, ".ase");
						TG_AnimateShape* anim = new TG_AnimateShape;
						gosASSERT(mechAnim != nullptr);
						//-----------------------------------------------
						// Skip this one if its already a binary file.
						// Happens ALOT!
						printf("Processing Animation %s\n", aseName);
						IProviderRelationshipPtr armLink =
							iniAsset->AddRelationship("Animation", (PSTR)aseName);
						anim->LoadTGMultiShapeAnimationFromASE(aseName, shape, true);
						delete anim;
						anim = nullptr;
					}
					i++;
					sprintf(animCheck, "Animation:%d", i);
					result = iniFile.seekBlock(animCheck);
				}
				if (!i) // No Animations, BUT they may mean we are a MECH!!!
				{
					if (iniFile.seekBlock("Gestures0") == NO_ERROR)
					{
						// We ARE a mech. Load all of the animations for this
						// mech and write 'em out.
						for (size_t i = 0; i < MaxGestures; i++)
						{
							char name[MAX_PATH];
							_splitpath(findResult.cFileName, nullptr, nullptr, name, nullptr);
							char mechFileName[1024];
							sprintf(
								mechFileName, "%s%s%s.ase", tglPath, name, MechAnimationNames[i]);
							TG_AnimateShape* anim = new TG_AnimateShape;
							gosASSERT(anim != nullptr);
							//-----------------------------------------------
							// Skip this one if its already a binary file.
							// Happens ALOT!
							printf("Processing Animation %s\n", mechFileName);
							IProviderRelationshipPtr armLink =
								iniAsset->AddRelationship("Animation", mechFileName);
							anim->LoadTGMultiShapeAnimationFromASE(mechFileName, shape, true);
							delete anim;
							anim = nullptr;
						}
					}
				}
				if (!i) // No Animations, BUT they may mean we are a MECH!!!
				{
					if (iniFile.seekBlock("Gestures0") == NO_ERROR)
					{
						// We ARE a mech. Load all of the destroyed shapes for
						// this mech and write 'em out.
						for (size_t i = MaxGestures; i < MaxGestures + 2; i++)
						{
							char name[MAX_PATH];
							_splitpath(findResult.cFileName, nullptr, nullptr, name, nullptr);
							char mechFileName[1024];
							sprintf(
								mechFileName, "%s%s%s.ase", tglPath, name, MechAnimationNames[i]);
							//-----------------------------------------------
							shape = new TG_TypeMultiShape;
							gosASSERT(shape != nullptr);
							printf("Processing Animation %s\n", mechFileName);
							IProviderRelationshipPtr armLink =
								iniAsset->AddRelationship("Destroyed Shape", mechFileName);
							shape->LoadTGMultiShapeFromASE(mechFileName, true, armProvider);
							delete shape;
							shape = nullptr;
						}
					}
				}
				if (iniFile.seekBlock("TGLDamage") == NO_ERROR)
				{
					char fileName[1024];
					result = iniFile.readIdString("FileName", fileName, 1023);
					if (result == NO_ERROR)
					{
						if (shape)
						{
							delete shape;
							shape = nullptr;
						}
						char aseName[1024];
						sprintf(aseName, "%s%s%s", tglPath, fileName, ".ase");
						//---------------------------------------------------------------------------------------------
						// Load Base Shape or LOD 0 Shape.
						shape = new TG_TypeMultiShape;
						gosASSERT(shape != nullptr);
						printf("Processing Damage Shape %s\n", aseName);
						IProviderRelationshipPtr armLink =
							iniAsset->AddRelationship("Damage Shape", aseName);
						shape->LoadTGMultiShapeFromASE(aseName, true, armProvider);
					}
					//-------------------------------------------
					// Gotta make the special shadow shape now!!
					// MUST use its own shape or animation below
					// will go straight to HELL!!
					result = iniFile.readIdString("ShadowName", fileName, 1023);
					if (result == NO_ERROR)
					{
						char aseName[1024];
						sprintf(aseName, "%s%s%s", tglPath, fileName, ".ase");
						//---------------------------------------------------------------------------------------------
						// Load Base Shape or LOD 0 Shape.
						TG_TypeMultiShapePtr shadowShape = new TG_TypeMultiShape;
						gosASSERT(shadowShape != nullptr);
						printf("Processing Damage Shadow Shape %s\n", aseName);
						IProviderRelationshipPtr armLink =
							iniAsset->AddRelationship("Damage Shadow Shape", aseName);
						shadowShape->LoadTGMultiShapeFromASE(aseName, true, armProvider);
						delete shadowShape;
						shadowShape = nullptr;
					}
				}
			}
			delete shape;
			shape = nullptr;
			iniAsset->Close();
		}
	} while (FindNextFile(searchHandle, &findResult) != 0);
	FindClose(searchHandle);
	return 0;
}
예제 #29
0
void MPHostGame::init()
{
	FullPathFileName path;
	FitIniFile file;
	path.init(artPath, "mcl_mp_hostgamedialog", ".fit");
	if (NO_ERROR != file.open(path))
	{
		char error[256];
		sprintf(error, "couldn't open file %s", path);
		Assert(0, 0, error);
		return;
	}
	LogisticsScreen::init(file, "Static", "Text", "Rect", "Button");
	file.seekBlock("InAnim");
	enterAnim.init(&file, "");
	file.seekBlock("OutAnim");
	exitAnim.init(&file, "");
	if (buttonCount)
	{
		for (size_t i = 0; i < buttonCount; i++)
		{
			buttons[i].setMessageOnRelease();
			if (buttons[i].getID() == 0)
			{
				buttons[i].setID(FIRST_BUTTON_ID + i);
			}
		}
	}
	edits[0].limitEntry(24);
	edits[0].allowIME(false);
	/*	int32_t tmpX, tmpY;
		file.seekBlock( "ComboBox0" );
		file.readIdLong( "XLocation", tmpX );
		file.readIdLong( "YLocation", tmpY );


		char tmpStr[256];
		file.readIdString( "FileName", tmpStr, 255 );
		{
			FullPathFileName tmpPath;
			tmpPath.init( artPath, tmpStr, ".fit" );

			FitIniFile PNfile;
			if ( NO_ERROR != PNfile.open( tmpPath ) )
			{
				char error[256];
				sprintf( error, "couldn't open file %s", (PSTR)tmpPath );
				Assert( 0, 0, error );
				return;
			}
			numPlayersDropList.init( &PNfile, "ComboBox0");

			aStyle5TextListItem *pTmp2;
			int32_t i;
			for (i = 2; i < MAX_MC_PLAYERS+1; i += 1)
			{
				pTmp2 = new aStyle5TextListItem;
				pTmp2->init(&PNfile, "Text0");
				char txt[32];
				sprintf( txt, "%ld", i );
				pTmp2->setText( txt );
				pTmp2->sizeToText();
				pTmp2->resize( numPlayersDropList.width() -
	   numPlayersDropList.ListBox().getScrollBarWidth() + 5, pTmp2->height() );
				numPlayersDropList.AddItem(pTmp2);
			}
			numPlayersDropList.SelectItem(0);
		}

		numPlayersDropList.moveTo( tmpX, tmpY );
		numPlayersDropList.ListBox().setOrange( true );
		numPlayersDropList.EditBox().limitEntry( 1 );
		numPlayersDropList.EditBox().setNumeric( 1 );
		numPlayersDropList.setReadOnly( 0 );*/
}
void MissionBriefingScreen::begin()
{
	missionListBox.removeAllItems( true );

	runTime = 0;
	bClicked = 0;

	statics[VIDEO_SCREEN].setColor( 0 );

	memset( objectiveButtons, 0, sizeof ( aObject* ) * MAX_OBJECTIVES );
	// need to set up all pertinent mission info
	EString missionName = LogisticsData::instance->getCurrentMission();


	long tmpMapTextureHandle = getMissionTGA(missionName);
	statics[MAP_INDEX].setTexture( tmpMapTextureHandle );
	statics[MAP_INDEX].setUVs( 0, 127, 127, 0 );
	statics[MAP_INDEX].setColor( 0xffffffff );


	// need to get all the objectives and stuff
	FullPathFileName fitPath;
	fitPath.init(missionPath, missionName, ".fit");
	FitIniFile fitFile;
	fitFile.open( fitPath );

	// put initial divider in list box
	addItem(IDS_MN_DIVIDER, 0xff005392, -1);

	fitFile.seekBlock( "MissionSettings" );

	long result = fitFile.seekBlock( "MissionSettings" );
	Assert( result == NO_ERR, 0, "Coudln't find the mission settings block in the mission file" );

	bool bRes;
	result = fitFile.readIdBoolean( "MissionNameUseResourceString", bRes );
	Assert( result == NO_ERR, 0, "couldn't find the MissionNameUseResourceString" );
	if ( bRes )
	{
		unsigned long ulRes;
		result = fitFile.readIdULong( "MissionNameResourceStringID", ulRes );
		Assert( result == NO_ERR, 0, "couldn't find the MissionNameResourceStringID" );
		addItem(ulRes, 0xff005392, -1);
	}
	else
	{
		char missionName[256];
		fitFile.readIdString("MissionName", missionName, 255);
		addLBItem(missionName, 0xff005392, -1);

	}

	addItem(IDS_MN_DIVIDER, 0xff005392, -1);
	addItem( IDS_MN_MISSION_OBJECTIVES, 0xff005392, -1 );
	addItem(IDS_MN_DIVIDER, 0xff005392, -1);

	// put in primary objectives
	fitFile.seekBlock( "Team0Objectives" );
	unsigned long objectiveCount;
	fitFile.readIdULong( "NumObjectives", objectiveCount );
	bool bHasSecondary = 0;
	int count = 0; 

	fitFile.seekBlock( "Terrain" );
	float terrainExtentX;
	float terrainExtentY;
	fitFile.readIdFloat( "TerrainMinX", terrainExtentX );
	if ( !terrainExtentX )
		terrainExtentX = 120 * 128;
	fitFile.readIdFloat( "TerrainMinY", terrainExtentY );
	if ( !terrainExtentY )
		terrainExtentY = 120 * 128;

	CObjectives Objectives(0/*alignment*/);
	/*Note that ObjectManager is probably NULL as these objectives are read, so it's not
	cool to call any of the Status() functions of this instance of objectives (access violation
	may ensue).*/
	Objectives.Read(&fitFile);

	gosASSERT( Objectives.Count() < MAX_OBJECTIVES );

	int buttonCount = 0;

	for ( int j = 1; j < 3; j++ )
	{
		CObjectives::EIterator it = Objectives.Begin();
		buttonCount = 0;
		for ( int i = 0; i < Objectives.Count(); i++, it++ )
		{
			CObjective *pObjective = (*it);
			if ( (!pObjective->IsHiddenTrigger()) && (pObjective->IsActive()) )
			{
				
				if ( pObjective->Priority() == j )
				{
					addObjectiveButton( pObjective->MarkerX(), pObjective->MarkerY(), buttonCount,pObjective->Priority(), fabs(terrainExtentX),
									fabs(terrainExtentY), pObjective->DisplayMarker());

					if ( j == 0 )
					{
						bHasSecondary = true;
						if ( i == 0 )
							addItem( IDS_MN_DIVIDER, 0xff005392, -1 );
					}

					addLBItem( (pObjective->LocalizedDescription()).Data(), 0xffffffff, count );

					objectiveModels[count] = (pObjective->ModelName()).Data();
					modelTypes[count] = pObjective->ModelType();

					modelColors[count][0] = pObjective->ModelBaseColor();
					modelColors[count][1] = pObjective->ModelHighlightColor();
					modelColors[count][2] = pObjective->ModelHighlightColor2();
					modelScales[count] = pObjective->ModelScale();

					count++;
					buttonCount++;
				}
			}
		}
	}
	
	addItem( IDS_MN_DIVIDER, 0xff005392, -1 );

	fitFile.seekBlock( "MissionSettings" );

	char blurb[4096];
	result = fitFile.readIdString("Blurb", blurb, 4095 );

	bool tmpBool = false;
	result = fitFile.readIdBoolean("BlurbUseResourceString", tmpBool);
	if (NO_ERR == result && tmpBool )
	{
		unsigned long tmpInt = 0;
		result = fitFile.readIdULong("BlurbResourceStringID", tmpInt);
		if (NO_ERR == result)
		{
			cLoadString( tmpInt, blurb, 2047 );
		}
	}


	addLBItem( blurb, 0xff005392, -1 );

	int RP = LogisticsData::instance->getCBills();
	char text[32];
	sprintf( text, "%ld ", RP );
	textObjects[RP_INDEX].setText( text );

	// need to find a drop zone, because our designers were never convinced to place
	// 'em explicitly, we need to do it for them
	int i = 1;
	while( true )
	{
		char blockName[32];
		sprintf( blockName, "Part%ld", i );
		i++;
		if ( NO_ERR != fitFile.seekBlock( blockName ) )
			break;
		
		bool bPlayer = 0;
		fitFile.readIdBoolean( "PlayerPart", bPlayer );

		if ( bPlayer )
		{
			float fX;
			float fY;

			fitFile.readIdFloat( "PositionX", fX );
			fitFile.readIdFloat( "PositionY", fY );

			setupDropZone( fX, fY, fabs(terrainExtentX), fabs(terrainExtentY) );
		
			break;
		}
	}

	statics[BUTTON_TEXT].showGUIWindow( 0 );
	status = RUNNING;

}