Exemplo n.º 1
0
void	QuickParameters::TargNameCombo()
{
	CRCombo* combo;

	combo=GETDLGITEM(IDC_TARGNAME);
	combo->Clear();
	combo->AddString(GetTargName(CSQuick1::quickdef.targets[targtype][0]));
	if (CSQuick1::quickdef.targets[targtype][1])
	combo->AddString(GetTargName(CSQuick1::quickdef.targets[targtype][1]));
	if (CSQuick1::quickdef.targets[targtype][2])
		combo->AddString(GetTargName(CSQuick1::quickdef.targets[targtype][2]));
	if (CSQuick1::quickdef.targets[targtype][3])
		combo->AddString(GetTargName(CSQuick1::quickdef.targets[targtype][3]));
	combo->SetIndex(targentry);
}
Exemplo n.º 2
0
BOOL CSQuick2::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	if (_DPlay.PlayerCreated)
	{
//DeadCode AMM 16Nov99 		_DPlay.SendInDebriefMessage();
//DeadCode AMM 16Nov99 		DPlay::H2H_Player[_DPlay.mySlot].status=CPS_DEBRIEF;
		_DPlay.SendStatusChange(DPlay::CPS_DEBRIEF);
	}
	Debrief_Timer=SetTimer(DPlay::TIMER_DEBRIEF,0,NULL);

	
	CRStatic*   s=GETDLGITEM(IDC_SMISSIONTITLE);
	if (CSQuick1::currquickmiss==-1)
//DEADCODE RDH 08/05/00 		s->SetString(RESSTRING(SINGLEPLAYER1));
		s->SetString(RESSTRING(RODS_STRINGS));
	else
		s->SetString(LoadResString(CSQuick1::quickmissions[CSQuick1::currquickmiss].missionname));
	s=GETDLGITEM(IDC_SOBJECTIVETITLE);
	s->SetString(GetTargName(CSQuick1::quickdef.target));

	//clear them out, not used										  //RDH 15/06/99
 	s=GETDLGITEM(IDC_SMISSIONRATING);
	s->SetString("");
	s=GETDLGITEM(IDC_RSTATICCTRL4);
	s->SetString("");
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 3
0
CString		GetTargName(UniqueID u)	
{
	CString	name;
	name = LoadResString(IDS_PLACENAMES_START + u);
	if (name.IsEmpty())
	{
		info_itemS* p = *Persons2::SlowConvertPtrUID(u);
		if (p)
		if (p->Status.size!=WAYPOINTSIZE)
		{
			if (p->SGT != UID_Null)
			{
				name = GetTargName(p->SGT)+": "+GetShapeName(ShapeNum(p->shape.Evaluate()));
			}else
			{
				name = GetShapeName(ShapeNum(p->shape.Evaluate()));
			}
		}
		else
		{
			name = LoadResString(IDS_WAYPOINT) + ": "; 
			name = name + LoadResString(Profile::WPType(u));
		}
	}		
//	char buff[10];
//	sprintf(buff,"targ %04x",(UWord)u);
	return (name);
}
Exemplo n.º 4
0
BOOL CQuickView::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CRStatic*   s=GETDLGITEM(IDC_CURRMISS);
	s->SetString(RESLIST(QUICK_1, CSQuick1::currquickmiss));


		targtype=0,targentry=0;
	for (int t=0;t<4;t++)
		for (int e=0;e<4;e++)
			if(CSQuick1::quickdef.targets[t][e]==CSQuick1::quickdef.target)
				targtype=t,targentry=e;
	s=GETDLGITEM(IDC_TARGTYPE);
	s->SetString(LoadResString(CSQuick1::quickdef.targtypeIDs[targtype]));

	s=GETDLGITEM(IDC_TARGNAME);
	s->SetString(GetTargName(CSQuick1::quickdef.targets[targtype][targentry]));

	s=GETDLGITEM(IDC_WEATHER);
	s->SetString(RESLIST(WEATHER_CLEAR, CSQuick1::quickdef.weather));
	s=GETDLGITEM(IDC_CLOUD);
	s->SetString(CSprintf("%i", 5000 + 1000 * CSQuick1::quickdef.cloudbaseK));
	

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 5
0
void Dossier::OnClickedPhoto() 
{
#ifndef	BOB_DEMO_VER

	if (LUF_FighterLF2BAND==Persons2::GetBandFromUID(uid) && RFullPanelDial::gameside == RFullPanelDial::SIDE_LW)
	{
// launch fighters dialog

		int i=0;
		while (Node_Data.gruppe[i].squadron != SQ_ZERO)
		{
			if (Node_Data.gruppe[i].homeairfield == uid)
			{
				if (Node_Data.gruppe[i].AcType()<PT_LW_BOMBERS)
				{
					MainToolBar().OpenACDossier(Node_Data.gruppe[i].wadernum,
						Node_Data.gruppe[i].gruppennum);

					break;
				}
			}
			i++;
		}
	}
	else	
	{
 		if (ReconnRequired())
		{
			int packnum=Todays_Packages_NewPackage(uid,MMC.directives.lw.userprofiles[Directives::LW::RECON]);
			if (packnum < 0)
				RDialog::RMessageBox(IDS_WARNING, IDS_NOAIRCRAFTAVAIL,NULL,NULL,IDS_CONTINUE);
			else
			{
				Todays_Packages[packnum].CalcRoutePositionsAndTime();
				MainToolBar().OnClickedMissionfolder();
				Todays_Packages.InvalidateRoute(&Todays_Packages[packnum],true,true);

			}
		}else
		{
	#ifndef NDEBUG
	#define PLACEMENT	CRect(0,0,512,384)
	#else
	#define	PLACEMENT	Place(POSN_CENTRE,POSN_CENTRE, 0, 0)
	#endif
	//	#define PLACEMENT	CRect(0,0,512,384)
			UniqueID targID=UniqueID(uid);
			CString tname=GetTargName(targID);
			OverLay.SetTargName((char*)LPCTSTR(tname));
			OverLay.loader_art=FIL_LOADING;									//RJS 16Aug00
			LogChild(0,MakeTopDialog(PLACEMENT,DialBox(OverLay.loader_art,new Rtestsh1(UniqueID(uid)),EDGES_NOSCROLLBARS)));
			Rtestsh1::Start3d(Rtestsh1::S3D_DONEBACK);
		}
	}
#endif
}
Exemplo n.º 6
0
BOOL SelectTarget::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CRCombo* combo;
	CRButton*	but = GETDLGITEM(IDC_RBUTTONRESET);


	combo=GETDLGITEM(IDC_RCOMBOTARGET);
	if  (	(currtab == -1)
		||	(RFullPanelDial::gameside != RFullPanelDial::SIDE_LW)
		)

	{
		but->ShowWindow(false);
		combo->ShowWindow(false);
		currindex = 0;
	}else
	{

		but->ShowWindow(true);
		combo->ShowWindow(true);
		combo->Clear();
		Profile& pk = Todays_Packages.pack[Todays_Packages.hipack];
		int ti= pk[currsquad].targetindex;
		if (ti<0) ti=0;
		TargetGroup* trg;
		trg = Node_Data[pk.packagetarget[ti].currentid];
 		combo->AddString(GetTargName(trg->uid));

		for (int i=0; i < TargetGroup::MAXSECONDARIES;i++)
		{
			if	(	(trg)	&&	(trg->secondaries[i]))
				combo->AddString(GetTargName(trg->secondaries[i]));
		}
		combo->SetIndex(0);
		currindex = 0;
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 7
0
CString		GetAreaName(info_waypoint* w)	
{	//some scope for naming the target item if near
	char buff[20];
	int u;
	if (w->target != GOT_UNDEFINED_VAL)
	{
		return(GetTargName((UniqueID)w->target.Evaluate()));
	}
	else
	{
		return (GetAreaName(&w->World));
	}
	return buff;
}
Exemplo n.º 8
0
void AirfieldDetails::OnClickedPhoto() 
{
#ifndef	BOB_DEMO_VER

 	{
#ifndef NDEBUG
#define PLACEMENT	CRect(0,0,512,384)
#else
#define	PLACEMENT	Place(POSN_CENTRE,POSN_CENTRE, 0, 0)
#endif
//	#define PLACEMENT	CRect(0,0,512,384)
		UniqueID targID=UniqueID(afuid);
		CString tname=GetTargName(targID);
		OverLay.SetTargName((char*)LPCTSTR(tname));
		OverLay.loader_art=FIL_LOADING;									//RJS 16Aug00
		LogChild(0,MakeTopDialog(PLACEMENT,DialBox(OverLay.loader_art,new Rtestsh1(UniqueID(afuid)),EDGES_NOSCROLLBARS)));
		Rtestsh1::Start3d(Rtestsh1::S3D_DONEBACK);
	}
#endif
	
}
Exemplo n.º 9
0
void GroupGeschwader::PrintAirFieldInfo(int j, int i)
{
	TargetFighterField* af;
	af = Node_Data[Airfields[j][i]];
	CString maxstring = CSprintf("%i",af->maxsquads);

	int k=0, numsq = 0;
	while (Node_Data.squadron[k].squadron != SQ_ZERO)
	{
 		if (Node_Data.squadron[k].homeairfield == Airfields[j][i])
			numsq++;
		k++;
	}


 	CString afstring = "("+CSprintf("%i", numsq) +"/"+maxstring+") " + GetTargName(Airfields[j][i]);

	CRListBox* rlistbox;
	rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1);
	rlistbox->AddString(afstring,i);

}
Exemplo n.º 10
0
void LWDiaryDetails::Refresh()
{
		CRRadio* pradio;

	pradio=GETDLGITEM(IDC_RRADIODISPLAY);
	if (quickmission)
		pradio->ShowWindow(false);
	else
		pradio->ShowWindow(true);
	pradio->AddButton(RESSTRING(VIEWSINGLE));
	pradio->AddButton(RESSTRING(ALL));
	pradio->SetCurrentSelection(0);

	CRListBox* rlistbox;
	rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1);
	rlistbox->Clear();
	rlistbox->AddColumn(60);
	rlistbox->AddColumn(80);										  //RDH 02/06/99
	rlistbox->AddColumn(60);										  //RDH 02/06/99

	rlistbox=GETDLGITEM(IDC_RLISTBOXOTHERS);
	rlistbox->Clear();
	rlistbox->AddColumn(60);
	rlistbox->AddColumn(60);										  //RDH 02/06/99
	rlistbox->AddString(RESSTRING(GRUPPE),0);
	rlistbox->AddString(RESSTRING(TASK),1);
	CRStatic*   s;


	if (		(*currentptr >= 0)
			&&	(grdtlsptr[*currentptr])
		)
	{
		Diary::RaidGroup* raidgroup;
		Diary::Gruppen*	grentry;
	 	raidgroup = Squad_Diary.GetRaidGroup(grdtlsptr[*currentptr]);

		Diary::Gruppen* othergr = Squad_Diary.GetFirstSquadron(raidgroup);
		rlistbox=GETDLGITEM(IDC_RLISTBOXOTHERS);
	

		while (othergr)
		{
			if (othergr != grdtlsptr[*currentptr] && othergr->noaclaunched)
			{
				Squadron* sq = &Node_Data[(SquadNum)othergr->squadnum];
				CString name = sq->ShortName() + "/";
				name = name + sq->SubName();

				rlistbox->AddString(name,0);

				raidgroup = Squad_Diary.GetRaidGroup(othergr);
				int cnt = (int)	raidgroup->misstype;
	 			rlistbox->AddString(RESLIST(MT_RAID, cnt),1);
 
			}
			othergr = Squad_Diary.GetNextSquadron(othergr);
		}


//DeadCode RJS 4Sep00 		raidgroup = Squad_Diary.GetRaidGroup(grdtlsptr[*currentptr]);
		
		
		raidgroup = Squad_Diary.GetRaidGroup(grdtlsptr[*currentptr]);
		if (raidgroup)
		{
			int	theTime = 0;											//RJS 4Sep00

			//raid
			s=GETDLGITEM(IDC_RSTATICDIARYDATE);
			Diary::RaidPack* raidpack = Squad_Diary.GetRaidPack(raidgroup);
			if (raidpack)
			{
				s->SetString(GetDateName(raidpack->date * SECSPERDAY, DATE_LONG));

				int strikeac = 0, attachedac = 0, detachedac = 0,myrole=0;
				TotalUpAc( strikeac, attachedac, detachedac ,myrole);
				s=GETDLGITEM(IDC_RSTATICMAIN);
				myrole&=Profile::AM_GROUPMASK;
				if (myrole==Profile::AM_LWPACKS)
					s->SetString(CSprintf("%i/%i",grdtlsptr[*currentptr]->noaclaunched,strikeac));
				else
					s->SetString(CSprintf("%i",strikeac));
				s=GETDLGITEM(IDC_RSTATICDETACHED);
				if (myrole==Profile::AM_DETACHED)
					s->SetString(CSprintf("%i/%i",grdtlsptr[*currentptr]->noaclaunched,detachedac));
				else
					s->SetString(CSprintf("%i",detachedac));
				s=GETDLGITEM(IDC_RSTATICATTACHED);
				if (myrole>=Profile::AM_ATTACHED)
					s->SetString(CSprintf("%i/%i",grdtlsptr[*currentptr]->noaclaunched,attachedac));
				else
					s->SetString(CSprintf("%i",attachedac));

				EncounteredAcType seenac[3]={{PT_BADMAX}};
				int hurrseen = 0, spitseen = 0, hurrkilled = 0, spitkilled = 0;
				TotalEncounteredAc(seenac);
				CRListBox* rlistbox;
				rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1);
				rlistbox->AddString(RESSTRING(TYPE),0);
				rlistbox->AddString(RESSTRING(ENCOUNTERED),1);
				rlistbox->AddString(RESSTRING(CLAIMS),2);
//DeadCode JIM 23Oct00 				if (seenac[2].totalkilled)
//DeadCode JIM 23Oct00 					if (seenac[0].encountered==0)
//DeadCode JIM 23Oct00 						seenac[2].localkilled = seenac[0].localkilled;
//DeadCode JIM 23Oct00 					else
//DeadCode JIM 23Oct00 						if (seenac[1].encountered==0)
//DeadCode JIM 23Oct00 							seenac[2].localkilled = seenac[1].localkilled;
				for (int i=0;i<3;i++)
					if (seenac[i].encountered)
					{	
						if (seenac[i].localkilled>seenac[i].totalkilled)
							seenac[i].localkilled=seenac[i].totalkilled;
							
						rlistbox->AddString(RESLIST(SPIT_A,seenac[i].type),0);
 						rlistbox->AddString(CSprintf("%i",seenac[i].encountered),1);
						rlistbox->AddString(CSprintf("%i/%i",seenac[i].localkilled,seenac[i].totalkilled),2);
					}
				rlistbox->AddString(RESSTRING(TOTAL),0);
				rlistbox->AddString(CSprintf("%i",
					seenac[0].encountered+seenac[1].encountered+seenac[2].encountered),1);
				rlistbox->AddString(CSprintf("%i/%i",
					seenac[0].localkilled+seenac[1].localkilled+seenac[2].localkilled,
					seenac[0].totalkilled+seenac[1].totalkilled+seenac[2].totalkilled
					),2);

				theTime = raidpack->takeofftime;						//RJS 4Sep00
			}
			else
			{
				s->SetString("");
				s=GETDLGITEM(IDC_RSTATICMAIN);
				s->SetString("");
				s=GETDLGITEM(IDC_RSTATICDETACHED);
				s->SetString("");
				s=GETDLGITEM(IDC_RSTATICATTACHED);
				s->SetString("");


			}
			s=GETDLGITEM(IDC_RSTATICPERSONNEL);
			s->SetString("");

			s=GETDLGITEM(IDC_RSTATICTARGET);
			if(!raidgroup->target)
			{
				s->SetString("");
				s=GETDLGITEM(IDC_RSTATICRESULT);
				s->SetString("");
			}
			else
			{
				s->SetString(GetTargName(raidgroup->target));

				s=GETDLGITEM(IDC_RSTATICRESULT);
//DeadCode JIM 20Oct00 			 	TargetNoDetail* trg = Node_Data[raidgroup->target];

				CString	missString;										//RJS 9Nov00

				Squad_Diary.GetMissResult(grdtlsptr[*currentptr],raidgroup,missString);

				s->SetString(missString);								//RJS 9Nov00
//DeadCode RJS 09Nov00 				s->SetString(RESLIST(MR_NULL,raidgroup->missresult));
//DeadCode JIM 13Oct00 				int j = trg->PlayerStatus();
//DeadCode JIM 13Oct00 				if	(		(j == Target::TS_FLAG_UNKNOWN))
//DeadCode JIM 13Oct00 					s->SetString(RESSTRING(TT_UNKNOWN));
//DeadCode JIM 13Oct00 				else
//DeadCode JIM 13Oct00 				{
//DeadCode JIM 13Oct00 					if		(j >= Target::TS_NEARLYDESTROYED)		j = 3;
//DeadCode JIM 13Oct00 					elseif	(j>Target::TS_BADDAMAGE)				j=2;
//DeadCode JIM 13Oct00 					elseif	(j>Target::TS_LIGHTDAMAGE)				j=1;
//DeadCode JIM 13Oct00 					else											j=0;
//DeadCode JIM 13Oct00 					s->SetString(RESLIST(UNDAMAGED, j));
//DeadCode JIM 13Oct00 				}
			}

			s=GETDLGITEM(IDC_RSTATICTASK);
			s->SetString(RESLIST(MT_RAID, raidgroup->misstype));

			s=GETDLGITEM(IDC_RSTATICTIME);

			if (raidgroup->targettime)									//RJS 4Sep00
				theTime = raidgroup->targettime;						//RJS 4Sep00
																		//RJS 4Sep00
 			theTime/=60;												//RJS 4Sep00
			s->SetString(CSprintf("%02i:%02i",theTime/60,theTime%60));	//RJS 4Sep00


			s=GETDLGITEM(IDC_RSTATICAIRCRAFT);
			Squadron* sq  = Node_Data[*grnumptr];
			s->SetString(RESLIST(SPIT_A, sq->AcType()));
		}

		s=GETDLGITEM(IDC_RSTATICDAMAGED);
		s->SetString(CSprintf("%i",grdtlsptr[*currentptr]->numacdamaged));

		s=GETDLGITEM(IDC_RSTATICDESTROYED);
		s->SetString(CSprintf("%i",grdtlsptr[*currentptr]->numlosses));
		s=GETDLGITEM(IDC_RSTATICAIRCREW);
		s->SetString(CSprintf("%i",grdtlsptr[*currentptr]->numpilotslost));

	}else
	{



		s=GETDLGITEM(IDC_RSTATICDIARYDATE);
		s->SetString("");
		s=GETDLGITEM(IDC_RSTATICTASK);
		s->SetString("");
		s=GETDLGITEM(IDC_RSTATICTIME);
		s->SetString("");

		s=GETDLGITEM(IDC_RSTATICAIRCRAFT);
		s->SetString("");
		s=GETDLGITEM(IDC_RSTATICRESULT);
		s->SetString("");
		s=GETDLGITEM(IDC_RSTATICTARGET);
		s->SetString("");

		s=GETDLGITEM(IDC_RSTATICMAIN);
		s->SetString("");
		s=GETDLGITEM(IDC_RSTATICDETACHED);
		s->SetString("");
		s=GETDLGITEM(IDC_RSTATICATTACHED);
		s->SetString("");


		s=GETDLGITEM(IDC_RSTATICPERSONNEL);
		s->SetString("");

		s=GETDLGITEM(IDC_RSTATICDAMAGED);
		s->SetString("");
		s=GETDLGITEM(IDC_RSTATICDESTROYED);
		s->SetString("");
		s=GETDLGITEM(IDC_RSTATICAIRCREW);
		s->SetString("");
	}
	RefreshButtons();
}
Exemplo n.º 11
0
BOOL AirfieldDetails::OnInitDialog() 
{
	CDialog::OnInitDialog();
	

	TargetFighterField* af;
	af = Node_Data[afuid];

	CRStatic*   s;
	s= GETDLGITEM(IDC_RSTATICSECTOROPS);
 	TargetSectorField*	sectorfield = af->getsectoraf();
	UniqueID  uid = sectorfield->primarycontrolcentre;

	TargetGroup* sector;
	sector = Node_Data[uid];
	if ((sector) && (sector->truestatus >= Target::TS_DESTROYED))
		uid = sectorfield->secondarycontrolcentre;

	s->SetString(GetTargName(uid));

	UByte damage;
	s= GETDLGITEM(IDC_RSTATICREFUEL);
	
	damage = af->subdamagelevels[TargetFighterField::SDL_FUEL];
	damage = damage/25;
	if (damage >3)
		damage = 3;
#ifndef	NDEBUG
	#define SHOWNUMDEBUG(val)	+CSprintf(" (%i%%)",val)
#else
	#define SHOWNUMDEBUG(val)
#endif

	s->SetString(RESLIST(UNDAMAGED,damage) SHOWNUMDEBUG(af->subdamagelevels[TargetFighterField::SDL_FUEL]));

	s= GETDLGITEM(IDC_RSTATICREPAIR);
	damage = af->subdamagelevels[TargetFighterField::SDL_REPAIR];
	damage = damage/25;
	if (damage >3)
		damage = 3;
	s->SetString(RESLIST(UNDAMAGED,damage) SHOWNUMDEBUG(af->subdamagelevels[TargetFighterField::SDL_REPAIR]));

	s= GETDLGITEM(IDC_RSTATICFIELD);
	damage = af->subdamagelevels[TargetFighterField::SDL_RUNWAY];
	damage = damage/25;
	if (damage >3)
		damage = 3;
	s->SetString(RESLIST(UNDAMAGED,damage) SHOWNUMDEBUG(af->subdamagelevels[TargetFighterField::SDL_RUNWAY]));


	s= GETDLGITEM(IDC_RSTATICSTAFF);
	damage = af->subdamagelevels[TargetFighterField::SDL_STAFF];
	damage = damage/25;
	if (damage >3)
		damage = 3;
	s->SetString(RESLIST(UNDAMAGED,damage) SHOWNUMDEBUG(af->subdamagelevels[TargetFighterField::SDL_STAFF]));

//DeadCode JIM 20Oct00 	int ac = 16;
	s= GETDLGITEM(IDC_RSTATICMAXSQUAD);

	s->SetString(CSprintf("%i", af->maxsquads));

	int k=0, spitsq = 0, hurrsq = 0;
	while (Node_Data.squadron[k].squadron != SQ_ZERO)
	{
 		if (Node_Data.squadron[k].homeairfield == afuid)
		{
			BritSquadron* sq = Node_Data.squadron[k];
			PlaneTypeSelect type = sq->AcType();
			if (		(type == PT_SPIT_A)
					||	(type == PT_SPIT_B)
			   )
				spitsq++;
			else
				hurrsq++;
		}
		k++;
	}


 	s= GETDLGITEM(IDC_RSTATICSPITSQUAD);
	s->SetString(CSprintf("%i", spitsq));
	s= GETDLGITEM(IDC_RSTATICHURRSQUAD);
	s->SetString(CSprintf("%i", hurrsq));
	
	CString notes="";
	for (int pack = Profile::MAX_PACKS-1,lines=3;lines>0 && pack>=0;pack--)
	{
		if (Todays_Packages.pack[pack].packagestatus!=Profile::PS_SPARE)
		{
		 	Profile *pk = &Todays_Packages.pack[pack];
			bool	packfound;
			if (pk->raidnumentries[0].raidnum)
			for(int targetnum = 0;(pk->packagetarget[targetnum].currentid);targetnum++	)
			{
				packfound=false;
				if (pk->packagetarget[targetnum].currentid == afuid)
					packfound=true;
				else
					if (pk->packagetarget[targetnum].currentid <= SagBANDEND)
					{
						int tp,ts;
						if (Todays_Packages.GetACSquadEntry(pk->packagetarget[targetnum].currentid,tp,ts))
							if (Todays_Packages[tp].SquadTarget(ts)==afuid)
								packfound=true;
					}
				if (packfound)
				{
					notes=CString("   ")+ RESLIST(AM_PATROL,pk->attackmethod)+":    "+RESLIST(PS_SPARE,pk->packagestatus)+"\n"+notes;
					lines--;
				}

			}
		}
		
	}
	s= GETDLGITEM(IDC_DOSSNOTES);
#ifndef	NDEBUG
	notes+=CSprintf("Damage Levels: True: %i%% LWIntel: %i%%\n",af->truestatus,af->knownstatus);
#endif
	if (notes!="")
		s->SetString(RESSTRING(MISSIONS)+":\n"+notes);
	else
		s->SetString(notes);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 12
0
void LWTaskFighter::Refresh()
{
		CRStatic*   s;


	PackageList::AMType*	amtype;

	switch	(attackmethod)
	{
		case	Profile::AM_DETACHED:
		{
			amtype = &Todays_Packages.taskdata.detached;
			tab = 3;
			break;
		}
		case	Profile::AM_ATTACHED:
		{
			amtype = &Todays_Packages.taskdata.attached;
			tab = 2;
			break;
		}
		case	Profile::AM_RETURNESCORT:
		{
			amtype = &Todays_Packages.taskdata.returned;
			tab = 4;
			break;
		}
		default_neverreferenced; 
		
	}



	s=GETDLGITEM(IDC_RSTATICFIGHTERSALLOCATED);
	CString string = RESSTRING(AIRCRAFT);
	int acnum;
	if (amtype->acnum == 1)
		acnum = 1;
	else if (amtype->acnum > 1)
	{
		acnum = amtype->acnum;
		string = RESSTRING(AIRCRAFT_PLURAL);
	}else
	{
		acnum = amtype->squadnum;
		if (acnum < 2)
			string = RESSTRING(STAFFEL);
		else if (acnum <3)
			string = RESSTRING(L_STAFFELN);
		else if (acnum <6)
		{
			acnum = acnum/3;
			string = RESSTRING(GRUPPE);
		}else if (acnum <18)
		{
			acnum = acnum/3;
			string = RESSTRING(GRUPPEN);
		}else
		{
			acnum = acnum/9;
			string = RESSTRING(GESCHWADER);
		}
	}
	s->SetString(CSprintf("%i %s", acnum, string));








	CRCombo* combo;
	int form = (amtype->formtype & FORMTYPE_SQUAD)>>FORMTYPE_SQUAD_SH;
	if (form > 6) form = 6;
	if (form < 0) form = 0;
	combo=GETDLGITEM(IDC_RCOMBOFORMATION);
	combo->Clear()->RESCOMBO(AUTO,1)-> SetIndex(0);

//DeadCode JIM 14Nov00 	combo->Clear()->RESCOMBO(ECHELONL,7)-> SetIndex(form);


	  	combo=GETDLGITEM(IDC_RCOMBOUNITTYPE);
	combo->Clear()->RESCOMBO(GESCHWADER,3)->
					SetIndex(unitdisplaylevel);




	CRListBox* rlistbox;
	rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1);
	rlistbox->Clear();
	rlistbox->AddColumn(120);
	rlistbox->AddColumn(TARGETFIELDWIDTH);										  //RDH 02/06/99
	rlistbox->AddColumn(80);
	rlistbox->AddString(RESSTRING(UNIT),0);
	rlistbox->AddString(RESSTRING(TARGET),1);
	rlistbox->AddString(RESSTRING(STATUS),2);

	
	if (attackmethod == Profile::AM_DETACHED)
	{
		GETDLGITEM(IDC_RSTATICCTRL00)->SetString(RESSTRING(L_CEILING));
 		GETDLGITEM(IDC_RSTATICCTRL01)->SetString(RESSTRING(LHIGH));
		GETDLGITEM(IDC_RSTATICCTRL02)->SetString(RESSTRING(FORWARDHIGH));
		GETDLGITEM(IDC_RSTATICCTRL03)->SetString(RESSTRING(FORWARD));
		GETDLGITEM(IDC_RSTATICCTRL04)->SetString(RESSTRING(FORWARDLOW));
		GETDLGITEM(IDC_RSTATICCTRL05)->SetString(RESSTRING(LATE));
	}else
	{
		GETDLGITEM(IDC_RSTATICCTRL00)->SetString(RESSTRING(BEHIND));
 		GETDLGITEM(IDC_RSTATICCTRL01)->SetString(RESSTRING(INFRONT));
		GETDLGITEM(IDC_RSTATICCTRL02)->SetString(RESSTRING(PORT));
		GETDLGITEM(IDC_RSTATICCTRL03)->SetString(RESSTRING(STARBOARD));
		GETDLGITEM(IDC_RSTATICCTRL04)->SetString(RESSTRING(ABOVE));
		GETDLGITEM(IDC_RSTATICCTRL05)->SetString(RESSTRING(BELOW));
	}

	{
		for (int i=1; i< PackageList::MAX_METHODS-1;i++)
		{
			CRButton* b = GETDLGITEM(IDC_TICK1+i-1);
			b->SetPressed(amtype->attackmethods[i]);
		}
	}


	

	
	Profile& pk = Todays_Packages.pack[Todays_Packages.hipack];

	CRButton* b = GETDLGITEM(IDC_STRAFTARGET);

//DEADCODE RDH 02/04/00 	straf = false;
//DEADCODE RDH 02/04/00 	for (int num=pk.squadlist.Max()-1;num>=0;num--)
//DEADCODE RDH 02/04/00 		if  (	((pk.squadlist[num].method&Profile::AM_GROUPMASK)==attackmethod)
//DEADCODE RDH 02/04/00 			&&	(pk.squadlist[num].submethod == Profile::SM_DOSTRAFFEGROUND)
//DEADCODE RDH 02/04/00 			)
//DEADCODE RDH 02/04/00 			straf = true;
//DEADCODE RDH 02/04/00 	b->SetPressed(straf);
//DEADCODE RDH 02/04/00 
	b->SetPressed(pk.StraffRequired(attackmethod));		

	int i=0;

//DEADCODE  15/02/00 	maxunits = 0;
//DEADCODE  15/02/00 	while (i < pk.squadlist)
//DEADCODE  15/02/00 	{
//DEADCODE  15/02/00 		int am = pk[i].method;
//DEADCODE  15/02/00 
//DEADCODE  15/02/00 		if (pk[i].method == attackmethod)
//DEADCODE  15/02/00 		{
//DEADCODE  15/02/00 			Squadron* sq = Node_Data[(SquadNum)pk[i].squadnum];
//DEADCODE  15/02/00  			CString name = sq->ShortName() + "/";
//DEADCODE  15/02/00 			name = name + sq->SubName();
//DEADCODE  15/02/00 			rlistbox->AddString(name,0);
//DEADCODE  15/02/00 			rlistbox->AddString(GetTargName(pk.packagetarget[pk[i].targetindex].currentid),1);
//DEADCODE  15/02/00 			rlistbox->AddString(RESLIST(PS_SPARE,pk.packagestatus),2);
//DEADCODE  15/02/00 			maxunits++;
//DEADCODE  15/02/00 		}
//DEADCODE  15/02/00 		i++;
//DEADCODE  15/02/00 	}

	FillList();
	if ((UnitList[0] >= 0)	&&	(maxunits > 0))
	{
		i = 0;
		UByte		gruppennum;
		Gruppen* sq = Node_Data[(SquadNum)pk[UnitList[0]].squadnum];
 		gruppennum = (SquadNum)pk[UnitList[0]].squadnum;
		int staffel = 0;

		while (i < maxunits)
		{
			Gruppen* sq = Node_Data[(SquadNum)pk[UnitList[i]].squadnum];
			CString name = sq->ShortName();
			if (unitdisplaylevel != PackageList::DISPLAY_GESCHWADER)
			{
				name =   name + "/" + sq->SubName();
			}

			if (unitdisplaylevel == PackageList::DISPLAY_STAFFEL)
			{
				if (gruppennum == (SquadNum)pk[UnitList[i]].squadnum)
					staffel++;
				else
				{
					gruppennum = (SquadNum)pk[UnitList[i]].squadnum;
					staffel =1;
				}
				name = name + CSprintf(" (%i)", staffel + (sq->gruppennum*3));
			}
			rlistbox->AddString(name,0);
			int ti=pk[UnitList[i]].targetindex;
			if (ti<0)
				ti=0;
			rlistbox->AddString(GetTargName(pk.packagetarget[ti].currentid),1);
			rlistbox->AddString(RESLIST(PS_SPARE,pk.packagestatus),2);
			i++;
		}
	}
	int maxsquad = Todays_Packages.SquadronsPlanned(NAT_LUF);
	if	(	(Todays_Packages.taskdata.attached.maxac != -1)
			||
			(
			 (maxsquad < 93)
			)
		)
		rlistbox->AddString(RESSTRING(NEXTAVAILABLE),0);

}
Exemplo n.º 13
0
void	HostilesList::RefreshList()
{
	CRListBox* rlistbox;
	rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1);

	rlistbox->Clear();
//DeadCode RDH 27Oct00 	rlistbox->AddColumn(30); //46
//DeadCode RDH 27Oct00 	rlistbox->AddColumn(28);										  //RDH 02/06/99
//DeadCode RDH 27Oct00 	rlistbox->AddColumn(42);	//50										  //RDH 02/06/99
//DeadCode RDH 27Oct00 	rlistbox->AddColumn(48);		//60										  //RDH 02/06/99
//DeadCode RDH 27Oct00 	rlistbox->AddColumn(46);										  //RDH 02/06/99
//DeadCode RDH 27Oct00 	rlistbox->AddColumn(80);
//DeadCode RDH 27Oct00 	rlistbox->AddIconColumn(28);										  //RDH 02/06/99
//DeadCode RDH 27Oct00 	rlistbox->AddColumn(TARGETFIELDWIDTH);										  //RDH 02/06/99
//DeadCode RDH 27Oct00 	rlistbox->AddColumn(24);										  //RDH 02/06/99
//DeadCode JIM 11Nov00 //DeadCode RDH 31Oct00 	rlistbox->AddColumn(32);										  //RDH 02/06/99
//DeadCode JIM 11Nov00 //DeadCode RDH 31Oct00 	rlistbox->AddColumn(20);										  //RDH 02/06/99
//DeadCode JIM 11Nov00 //DeadCode RDH 31Oct00 	rlistbox->AddColumn(2);
//DEADCODE RDH 20/01/00 	rlistbox->AddColumn(50);										  //RDH 02/06/99
	rlistbox->AddString(RESSTRING(RAID),0);
	rlistbox->AddString(RESSTRING(HL_SIZE),1);
	rlistbox->AddString(RESSTRING(TYPE),2);
	rlistbox->AddString(RESSTRING(HL_ESCORT),3);
	rlistbox->AddString(RESSTRING(ALT),4);
	rlistbox->AddString(RESSTRING(HL_STATUS),5);
	rlistbox->AddString("",6);
	rlistbox->AddString(RESSTRING(HL_TARGET),7);

	rlistbox->AddString(RESSTRING(OUT),8);
	rlistbox->AddString(RESSTRING(CMBT),9);
	rlistbox->AddString(RESSTRING(IN),10);

//DEADCODE RDH 20/01/00 	rlistbox->AddString(RESSTRING(HL_STATUS),6);
//DEADCODE RDH 20/01/00 	rlistbox->AddString(RESSTRING(HL_RESPONSE),6);
//DEADCODE RDH 20/01/00 	rlistbox->AddString(RESSTRING(HL_INTERCEPT),8);
	rlistbox->AddString(RESSTRING(HL_TALLY),11);



	int p=0;
	int t;
	while (packlist[p].pack != 65535)
	{
		Profile& pk = Todays_Packages.pack[packlist[p].pack];
		if (packlist[p].method < Profile::AM_DETACHED)
		{
//DEADCODE RDH 12/04/00 			rlistbox->AddString(CSprintf("R%03i", pk.raidnumentries[packlist[p].raidline].raidnum),0);


			char* raidletter = Todays_Packages.RaidFormatString(packlist[p].pack,packlist[p].raidline);
			rlistbox->AddString(CSprintf(raidletter, pk.raidnumentries[packlist[p].raidline].raidnum),0);




//DEADCODE RDH 12/04/00  			rlistbox->AddString(CSprintf("R%03i", packlist[p].raidline),0);
			rlistbox->AddString(CSprintf("%i", packlist[p].numofac),1);

			Squadron* sq  = Node_Data[(SquadNum)packlist[p].strikegruppe];
			rlistbox->AddString(RESLIST(SPIT_A, sq->AcType()),2);
			if (packlist[p].escortgruppe >= 0)
			{
				sq  = Node_Data[(SquadNum)packlist[p].escortgruppe];
				rlistbox->AddString(RESLIST(SPIT_A, sq->AcType()),3);
			}else
				rlistbox->AddString(RESSTRING(NONE_NOAIRCRAFT),3);

			int firstsq = pk.raidnumentries[packlist[p].raidline].squadliststart;
			ItemBasePtr item = Persons2::ConvertPtrUID(pk[firstsq].instance);
			if (item)
			{
 				int alt = item->World.Y;
				if (alt < 0 )
					alt = 0;
				alt = alt*10/Save_Data.alt.mediummm;
				alt = 100*((alt + 50)/100);
				rlistbox->AddString(CSprintf("%i%s",alt,LoadResString(Save_Data.alt.mediumabbr)),4);
			}else
				rlistbox->AddString(" ",4);
//DeadCode RJS 12Nov00 			info_airgrpPtr item = Persons2::ConvertPtrUID(pk[firstsq].instance);
//DeadCode RJS 12Nov00 			if (item)
//DeadCode RJS 12Nov00 			{
//DeadCode RJS 12Nov00  				int alt = item->knownposition.Y;
//DeadCode RJS 12Nov00 				if (alt < 0 )
//DeadCode RJS 12Nov00 					alt = 0;
//DeadCode RJS 12Nov00 				alt = alt*10/Save_Data.alt.mediummm;
//DeadCode RJS 12Nov00 				alt = 100*((alt + 50)/100);
//DeadCode RJS 12Nov00 				rlistbox->AddString(CSprintf("%i%s",alt,LoadResString(Save_Data.alt.mediumabbr)),4);
//DeadCode RJS 12Nov00 			}else
//DeadCode RJS 12Nov00 				rlistbox->AddString(" ",4);


			
			rlistbox->AddString(RESLIST(PS_SPARE,pk.packagestatus),5);
		 	TargetNoDetail* trg = NULL;
			if (packlist[p].target)
			{
				trg=Node_Data[packlist[p].target];
				rlistbox->AddString(GetTargName(packlist[p].target),7);
			}
			else
				rlistbox->AddString("",7);

			if (trg)
			{
				int j = trg->truestatus;
				if		(j >= Target::TS_NEARLYDESTROYED)		j = 3;
				elseif	(j>Target::TS_BADDAMAGE)				j=2;
				elseif	(j>Target::TS_LIGHTDAMAGE)				j=1;
				else											j=0;
//DeadCode JON 4Sep00 				if (j >= 100)
//DeadCode JON 4Sep00 					j = 3;
//DeadCode JON 4Sep00 				else
//DeadCode JON 4Sep00 				{
//DeadCode JON 4Sep00 					j = j/4;
//DeadCode JON 4Sep00 					if (j >= 3)
//DeadCode JON 4Sep00 						j =2;
//DeadCode JON 4Sep00 				}
				FileNum filenum = GetIconFileNum(packlist[p].target);
				rlistbox->AddIcon(filenum,6);

//DEADCODE RDH 21/01/00 				rlistbox->AddIcon((FileNum)ICON_AF_FIGHTER,5);
//DEADCODE RDH 20/01/00 				rlistbox->AddString(RESLIST(UNDAMAGED, j),5);
			}
			else
Exemplo n.º 14
0
void	LWRouteMain::RefreshList()
{
	CString buffer;
	CRListBox* rlistbox;
	rlistbox=GETDLGITEM(IDC_RLISTBOXCTRL1);
//DeadCode RDH 31Oct00 	rlistbox->AddString("",0);
	rlistbox->Clear();
		//rlistbox->AddColumn(160);
		//rlistbox->AddColumn(TARGETFIELDWIDTH);										  //RDH 02/06/99
		//rlistbox->AddColumn(70);										  //RDH 02/06/99
		//rlistbox->AddColumn(50);										  //RDH 02/06/99
		//rlistbox->AddColumn(50);
//DEADCODE RDH 06/01/00 	rlistbox->AddColumn(50);
//DEADCODE RDH 06/01/00 	rlistbox->AddColumn(50);
	rlistbox->AddString("",0);
	rlistbox->AddString(RESSTRING(RELTOT),4);
//DeadCode JIM 19Sep00 	if ((tab == 0) || (tab ==4))
//DeadCode JIM 19Sep00 	{
//DeadCode JIM 19Sep00 		if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW)
//DeadCode JIM 19Sep00 			rlistbox->AddString(RESSTRING(GRUPPE),1);
//DeadCode JIM 19Sep00 		else
//DeadCode JIM 19Sep00 			rlistbox->AddString(RESSTRING(SQUADRON),1);
//DeadCode JIM 19Sep00 
//DeadCode JIM 19Sep00 	}else
		rlistbox->AddString(RESSTRING(LOCATION),1);
	rlistbox->AddString(RESSTRING(ALT),2);
	rlistbox->AddString(RESSTRING(ETA),3);

//DeadCode JIM 20Oct00 	WpState wpstate = FIRST;

	FillWpList();

//DEADCODE  23/02/00 	int currhilight = -1;
//DEADCODE  23/02/00 	if (Todays_Packages.pack[Todays_Packages.hipack].packagestatus!=Profile::PS_SPARE)
//DEADCODE  23/02/00 	{
//DEADCODE  23/02/00 		Profile& pack = Todays_Packages.pack[Todays_Packages.hipack];
//DEADCODE  23/02/00 
//DEADCODE  23/02/00 		UniqueID wpuid = pack.route;
//DEADCODE  23/02/00 		int i=1;
//DEADCODE  23/02/00 		while (wpuid)
//DEADCODE  23/02/00 		{
//DEADCODE  23/02/00 			info_waypoint* wp=*Persons2::ConvertPtrUID(wpuid);
//DEADCODE  23/02/00 			wpstate = (WpState)UpdateWpType(wp, wpstate);
//DEADCODE  23/02/00 
//DEADCODE  23/02/00  			if (	(wpstate == FIRSTTAKEOFF)
//DEADCODE  23/02/00 				||	(wpstate == INGRESS)
//DEADCODE  23/02/00 				||	(wpstate == EGRESS)
//DEADCODE  23/02/00 				)
//DEADCODE  23/02/00 			{
//DEADCODE  23/02/00 				rlistbox->AddString(LoadResString(Profile::WPType(wpuid)),0);
//DEADCODE  23/02/00 //DEADCODE RDH 05/01/00 			rlistbox->AddString(RESLIST(MAIN_WP_GAP,i++),0);
//DEADCODE  23/02/00 			if (	(wp->target != GOT_UNDEFINED_VAL)
//DEADCODE  23/02/00 				&&	 (wp->target.Evaluate())
//DEADCODE  23/02/00 				)
//DEADCODE  23/02/00 				rlistbox->AddString(GetTargName((UniqueID)wp->target.Evaluate()),1);
//DEADCODE  23/02/00 
//DEADCODE  23/02/00 			int alt = (wp->World.Y*10)/Save_Data.alt.mediummm;
//DEADCODE  23/02/00 			alt = 100*((alt + 50)/100);
//DEADCODE  23/02/00 						rlistbox->AddString(CSprintf("%i%s",alt,LoadResString(Save_Data.alt.mediumabbr)),2);
//DEADCODE  23/02/00 
//DEADCODE  23/02/00 			int t=wp->etas/60;
//DEADCODE  23/02/00 			rlistbox->AddString(CSprintf("%02i:%02i",t/60,t%60),3);
//DEADCODE  23/02/00 			t=t - pack.primarytargetETA/60;
//DEADCODE  23/02/00 		    if (t>=0)
//DEADCODE  23/02/00 				rlistbox->AddString(CSprintf("%02i:%02i",+t/60,t%60),4);
//DEADCODE  23/02/00 			else
//DEADCODE  23/02/00 				rlistbox->AddString(CSprintf("-%02i:%02i",-t/60,-t%60),4);
//DEADCODE  23/02/00 		
//DEADCODE  23/02/00 
//DEADCODE  23/02/00 			if (Todays_Packages.hiwp == wpuid)
//DEADCODE  23/02/00 				currhilight = i;
//DEADCODE  23/02/00 			
//DEADCODE  23/02/00 			i++;
//DEADCODE  23/02/00 			}
//DEADCODE  23/02/00 			wpuid = wp->nextwp;
//DEADCODE  23/02/00 		}
//DEADCODE  23/02/00 
//DEADCODE  23/02/00 	}

		int i = 0;
		Profile& pack = Todays_Packages.pack[Todays_Packages.hipack];
	int currhilight = -1;

		while (WpList[i])
		{
			info_waypoint* wp=*Persons2::ConvertPtrUID(WpList[i]);
			if (wp->applygroup.Evaluate()!=ENABLE_COMPLEX_VAL)
			{
				Squadron& sq=pack[wp->applygroup.Evaluate()].Squadron();
				if (pack.attackmethod<Profile::AM_LWPACKS)
	 				rlistbox->AddString(LoadResString(Profile::WPType(WpList[i]))+" ("+sq.ShortName() + ")",0);
				else
	 				rlistbox->AddString(LoadResString(Profile::WPType(WpList[i]))+" ("+sq.ShortName() + "/"+ sq.SubName()+")",0);
			}
			else
			if (wp->applywave.Evaluate()!=ENABLE_COMPLEX_VAL && wp->applywave.Evaluate()>=0)
	 			rlistbox->AddString(CSprintf("%i: %s",wp->applywave.Evaluate(),LoadResString(Profile::WPType(WpList[i]))),0);
			else
				rlistbox->AddString(LoadResString(Profile::WPType(WpList[i])),0);

//DeadCode JIM 12Sep00 			if (tab == 0)
//DeadCode JIM 12Sep00 			{
//DeadCode JIM 12Sep00 					int k =0;
//DeadCode JIM 12Sep00 					while  (		(k < pack.squadlist) 
//DeadCode JIM 12Sep00 								&&	 (pack[k].takeoffwp != WpList[i])
//DeadCode JIM 12Sep00 							)
//DeadCode JIM 12Sep00 						k++;
//DeadCode JIM 12Sep00 					if (k < pack.squadlist)
//DeadCode JIM 12Sep00 					{
//DeadCode JIM 12Sep00 						Squadron* sq;
//DeadCode JIM 12Sep00 						sq = &Node_Data[pack[k].squadnum];
//DeadCode JIM 12Sep00 						CString name = ;
//DeadCode JIM 12Sep00 						name = name + sq->SubName();
//DeadCode JIM 12Sep00 
//DeadCode JIM 12Sep00 						rlistbox->AddString(name,1);
//DeadCode JIM 12Sep00 					}else
//DeadCode JIM 12Sep00 						rlistbox->AddString("",1);
//DeadCode JIM 12Sep00 
//DeadCode JIM 12Sep00 			}else if (tab ==4)
//DeadCode JIM 12Sep00 			{
//DeadCode JIM 12Sep00 					int k =0;
//DeadCode JIM 12Sep00 					Squadron* sq;
//DeadCode JIM 12Sep00 					while  ((k < pack.squadlist) && (pack[k].landingwp != WpList[i]) )	//RDH 29/03/00
//DeadCode JIM 12Sep00 						k++;
//DeadCode JIM 12Sep00 					if (k < pack.squadlist)
//DeadCode JIM 12Sep00 					{
//DeadCode JIM 12Sep00 						sq = &Node_Data[pack[k].squadnum];
//DeadCode JIM 12Sep00 						CString name = sq->ShortName() + "/";
//DeadCode JIM 12Sep00 						name = name + sq->SubName();
//DeadCode JIM 12Sep00 
//DeadCode JIM 12Sep00 						rlistbox->AddString(name,1);
//DeadCode JIM 12Sep00 					}else
//DeadCode JIM 12Sep00 						rlistbox->AddString("",1);
//DeadCode JIM 12Sep00 			}
//DeadCode JIM 12Sep00 			else
			{
				int& gri=wp->target.UsesGlobRef();
				if (&gri!=&EventVal::minus1)
				{
					int theref=gri;
					if (theref<=SGR_Pack_Target9 && theref>=SGR_Pack_Target)
						rlistbox->AddString(GetTargName(Todays_Packages.pack[Todays_Packages.hipack].packagetarget[theref-SGR_Pack_Target]),1);
					else
					if (theref==SGR_Pack_DogLeg)
   						rlistbox->AddString(GetTargName(Todays_Packages.pack[Todays_Packages.hipack].doglegloc),1);
					else
						rlistbox->AddString(_MsgBuffer.GetPlaceName(wp->World),1);
				}
				else
				if (	(wp->target != GOT_UNDEFINED_VAL)
					&&	 (wp->target.Evaluate())
					)
						rlistbox->AddString(GetTargName((UniqueID)wp->target.Evaluate()),1);
				else
				{
					CString name = _MsgBuffer.GetPlaceName(wp->World);	//RJS 27Mar00
					rlistbox->AddString(name,1);
				}
			}
			if (Profile::WPType(WpList[i]) == IDS_WP_TAKEOFF)
					rlistbox->AddString("",2);
			else
			{
				int alt = (wp->World.Y*10)/Save_Data.alt.mediummm;
				alt = 100*((alt + 50)/100);
				rlistbox->AddString(CSprintf("%i%s",alt,LoadResString(Save_Data.alt.mediumabbr)),2);
			}
			int t=wp->etas/60;
			rlistbox->AddString(CSprintf("%02i:%02i",t/60,t%60),3);
			t=t - pack.primarytargetETA/60;
		    if (t>=0)
				rlistbox->AddString(CSprintf("%02i:%02i",+t/60,t%60),4);
			else
				rlistbox->AddString(CSprintf("-%02i:%02i",-t/60,-t%60),4);
		
				if (Todays_Packages.hiwp == WpList[i])
					currhilight = i + 1;

			
			i++;
		}


	if (currhilight >= 0)
		rlistbox->SetHilightRow(currhilight);

}
Exemplo n.º 15
0
BOOL Dossier::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CRButton* title;
	title = GETDLGITEM(IDJ_TITLE);
	title->SetString(GetTargName(uid));

	CRButton*	authbut = GETDLGITEM(IDC_AUTHORISE);
	if (Node_Data.GotBadWeatherPeriod())
		authbut->ShowWindow(SW_HIDE);
	else
	  	if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW)
			authbut->SetString(RESSTRING(AUTHORISE));
		else
		{
			authbut->SetString(RESSTRING(PATROL));
			authbut->SetHintString(RESSTRING(HIDC_PATROL));
		}


	authbut = GETDLGITEM(IDC_PHOTO);
	if (Node_Data.GotBadWeatherPeriod())
		authbut->ShowWindow(SW_HIDE);
	else
		if (Node_Data[uid]==Target::TSS_TargetConvoy || Node_Data[uid]==NULL || Node_Data[uid].truetargtype==Target::TT_GERMAN)
			authbut->ShowWindow(SW_HIDE);
		else
		  	if (ReconnRequired())
			{
				authbut->SetString(RESSTRING(RECONN));
				authbut->SetHintString(RESSTRING(HIDC_RECONN));
			}
			else
				authbut->SetString(RESSTRING(PHOTO));
	if (LUF_FighterLF2BAND==Persons2::GetBandFromUID(uid))
	{
	 	authbut = GETDLGITEM(IDC_AUTHORISE);
		authbut->ShowWindow(SW_HIDE);

		if (RFullPanelDial::gameside == RFullPanelDial::SIDE_LW)
		{
// we now want to display a button for fighters and/or bombers if there are any
// at this LW AF

			int i=0;
			SLong fighters=-1;
			SLong bombers=-1;

			while (Node_Data.gruppe[i].squadron != SQ_ZERO)
			{
				if (Node_Data.gruppe[i].homeairfield == uid)
				{
					if (Node_Data.gruppe[i].AcType()<PT_LW_BOMBERS)
						fighters=i;
					else
						bombers=i;
				}
				i++;
			}

	// Photo button becomes fighters

			if (fighters!=-1)
			{
		 		authbut = GETDLGITEM(IDC_PHOTO);
				authbut->SetString(RESSTRING(FIGHTERS));
				authbut->SetHintString(Node_Data.gruppe[fighters].ShortName());
				authbut->ShowWindow(SW_SHOW);
			}

	// Authorise button becomes bombers

			if (bombers!=-1)
			{
		 		authbut = GETDLGITEM(IDC_AUTHORISE);
				authbut->SetString(RESSTRING(BOMBERS));
				authbut->SetHintString(Node_Data.gruppe[bombers].ShortName());
				authbut->ShowWindow(SW_SHOW);
			}
		}
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 16
0
void CDamage::DoDataExchange(CDataExchange* pDX)
{
	char*	fractionformat=":    %i/%i";
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDamage)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	DDX_Control(pDX,IDC_LIST_ELEMENTS,m_IDC_LIST_ELEMENTS);
	DDX_Control(pDX,IDC_COMBO_ELEMENTS,m_IDC_COMBO_ELEMENTS);
	//}}AFX_DATA_MAP
	int	line=0;
	int	selline=-1;
	internalUIDmax=0;
	CString	displayline;
	{														  //RDH 28/04/99
		info_itemS* p = *Persons2::SlowConvertPtrUID(UniqueID(wavenum));
		if (p->Status.size>=MOBILESIZE)
		{
			CString  str = GetShapeName(ShapeNum(p->shape.Evaluate()));
			if (str.IsEmpty() || str[0]=='_')
				str=GetTargName(UniqueID(wavenum));
			if (str.IsEmpty() || str[0]==0)
				str=RESSTRING(ASSET);
			displayline=str;//l->AddString(str,0);
			int damagelevel=Node_Data[UniqueID(wavenum)].truestatus;
			int	members=(info_grndgrpPtr(*p)->inform);
			if (damagelevel>100)
				damagelevel=100;
			damagelevel=damagelevel*(members+6)*(members+6)/100;
			int deadmembers=6;
			for (;deadmembers*deadmembers<damagelevel;deadmembers++)
			{}
			displayline=RESSTRING(DAMAGED)+CSprintf(fractionformat,deadmembers-6,members);
		}
		else
		{
			{
			CString  str = GetShapeName(ShapeNum(p->shape.Evaluate()));
			if (str.IsEmpty() || str[0]=='_')
				str=GetTargName(UniqueID(wavenum));
			displayline=str;//l->AddString(str,0);
			}
			if (damagedelements[0].loadedid==wavenum)
			{
				DeadStream::DeadBlockItterator itt(Dead_Stream.firstblock,UID_NULL);
				itt.SkipToItem(UniqueID(wavenum));
				int damagedeltc=0,totaleltc=0,damagedpoints=0;
				for (GroupItterator si(damagedelements[0].shape,&itt);si;si++)
					if (si.AnimDataMAD().itemstate>0)
					{
						if (si.DamageWeight()>IGNOREDAMAGEBELOWTHIS)
						{
							damagedeltc++;
							totaleltc++;
						}
						damagedpoints+=si.AnimDataMAD().itemstate*si.DamageWeight();
					}
					else
						if (si.DamageWeight()>IGNOREDAMAGEBELOWTHIS)
							totaleltc++;
				displayline+=CSprintf(fractionformat,damagedeltc,totaleltc);
			}
			else
			{
				int totaleltc=0;

				info_itemS* p = *Persons2::SlowConvertPtrUID(UniqueID(wavenum));
				if (p)
					for (GroupItterator si(ShapeNum(p->shape.Evaluate()));si;si++)
						if (si.DamageWeight()>IGNOREDAMAGEBELOWTHIS)
							totaleltc++;
				displayline+=CSprintf(fractionformat,0,totaleltc);

		//DEADCODE DAW 02/02/00 		l->AddString(RESSTRING(FULLY_F),1);
		//DEADCODE DAW 02/02/00 		l->AddString(RESSTRING(F_FUNCTIONAL),2);
			}
		}
	}
	internalUIDList[internalUIDmax++]=UniqueID(wavenum);
	GETDLGITEM(IDC_COMBO_ELEMENTS)->AddString(displayline);
	if (groupnum==UID_NULL || groupnum==wavenum)
		selline=line;
	line++;
	info_itemS*	p;
	UniqueIDBand band;
	for (int i=CivilianBAND;i<WorldStuff::PITEMTABLESIZE;i++)
		if (	((p=Persons2::ConvertPtrUID(UniqueID(i)))!=NULL)
			&&	(p->SGT==wavenum && p->shape.Evaluate()!=EMPTY && p->shape.Evaluate()!=EMPTY2 &&p->Status.size<MOBILESIZE)
			&&	(band=Persons2::getbandfromUID(UniqueID(i)))!=0
			&&	band!=LandscapeBAND
			)
		{
			displayline=GetShapeName(ShapeNum(p->shape.Evaluate()))+" "+GetRelativeName(p->SGT,&p->World);
			int de=numdamagedelts;
			while(de-->0)
				breakif (damagedelements[de].loadedid==i);
			if (de>=0)
			{
				UniqueID startpoint=UID_NULL;
				UniqueID findpoint=(UniqueID)wavenum;
//DEADCODE JIM 07/06/99 							if (wavenum!=groupnum)
				{
					if (!DeadStream::MainWorldBand(UniqueID(i)))
						startpoint=findpoint;
					findpoint=damagedelements[de].memberid;
				}
				DeadStream::DeadBlockItterator itt(Dead_Stream.firstblock,startpoint);
				itt.SkipToItem(findpoint);

				int damagedeltc=0,totaleltc=0,damagedpoints=0;
				for (GroupItterator si(damagedelements[de].shape,&itt);si;si++)
					if (si.AnimDataMAD().itemstate>0)
					{
						if (si.DamageWeight()>IGNOREDAMAGEBELOWTHIS)
						{
							damagedeltc++;
							totaleltc++;
						}
						damagedpoints+=si.AnimDataMAD().itemstate*si.DamageWeight();
					}
					else
						if (si.DamageWeight()>IGNOREDAMAGEBELOWTHIS)
							totaleltc++;
				displayline+=CSprintf(fractionformat,damagedeltc,totaleltc);
			}
			else
			{
				int	totaleltc=0;
				info_itemS* p = *Persons2::SlowConvertPtrUID(UniqueID(i));
				if (p)
					for (GroupItterator si(ShapeNum(p->shape.Evaluate()));si;si++)
						if (si.DamageWeight()>IGNOREDAMAGEBELOWTHIS)
							totaleltc++;
				displayline+=CSprintf(fractionformat,0,totaleltc);


			}
			internalUIDList[internalUIDmax++]=UniqueID(i);
			GETDLGITEM(IDC_COMBO_ELEMENTS)->AddString(displayline);
			if (groupnum==i)
				selline=line;
			line++;
		}
 	GETDLGITEM(IDC_COMBO_ELEMENTS)->SetIndex(selline);
	FillList();

}