예제 #1
0
void SetBullsEye(C_Window *win)
{
	C_Text *txt;
	long brg,dist;
	_TCHAR buffer[40];

	if(!win)
		return;

	txt=(C_Text*)win->FindControl(BULLSEYE);
	if(txt)
	{
		txt->Refresh();
		brg=TheCampaign.BearingToBullseyeDeg(Recon.PosX,Recon.PosY);

	//MI Bullseye bearing fix
#if 0
		while(brg < 0)
			brg+=360;
		while(brg > 360)
			brg-=360;
#else
		brg += 180;
#endif
		dist=FloatToInt32(TheCampaign.RangeToBullseyeFt(Recon.PosX,Recon.PosY)*FT_TO_NM);

		_stprintf(buffer,"%03d  %1ld %s",brg,dist,gStringMgr->GetString(TXT_NM));

		txt->SetText(buffer);
		txt->Refresh();
	}
}
예제 #2
0
void SetSlantRange(C_Window *win)
{
	C_Text *txt;
	_TCHAR buffer[15];

	if(!win)
		return;

	txt=(C_Text*)win->FindControl(SLANT_RANGE);
	if(txt)
	{
		txt->Refresh();
		_stprintf(buffer,"%1ld ft",(long)Recon.Distance);
		txt->SetText(buffer);
		txt->Refresh();
	}
}
예제 #3
0
void SetHeading(C_Window *win)
{
	C_Text *txt;
	_TCHAR buffer[5];

	if(!win)
		return;

	txt=(C_Text*)win->FindControl(RECON_HEADING);
	if(txt)
	{
		txt->Refresh();
		_stprintf(buffer,"%03ld",(long)Recon.Heading);
		txt->SetText(buffer);
		txt->Refresh();
	}
}
예제 #4
0
static void SetToolbarDirections(long textid)
{
	C_Window *win;
	C_Text *txt;

	win=gMainHandler->FindWindow(TAC_FULLMAP_WIN);
	if(win)
	{
		txt=(C_Text*)win->FindControl(HELP_MESSAGE);
		if(txt)
		{
			txt->Refresh();
			txt->SetText(textid);
			txt->Refresh();
		}
	}

	win=gMainHandler->FindWindow(TAC_EDIT_WIN);
	if(win)
	{
		txt=(C_Text*)win->FindControl(HELP_MESSAGE);
		if(txt)
		{
			txt->Refresh();
			txt->SetText(textid);
			txt->Refresh();
		}
	}
	win=gMainHandler->FindWindow(TAC_VC_WIN);
	if(win)
	{
		txt=(C_Text*)win->FindControl(VC_HELP_MESSAGE);
		if(txt)
		{
			txt->Refresh();
			txt->SetText(textid);
			txt->Refresh();
		}
	}
}