Ejemplo n.º 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();
	}
}
Ejemplo n.º 2
0
 void C_List::AddText(const std::string& str)
 {
     C_Text* text = new C_Text();
     text->SetFont("georgia", 12);
     text->SetText(str.c_str(), C_Color(0));
     text->SetPosition(2, (int)m_Texts.size()*m_TextHeight);
     m_Texts.push_back(text);
     m_Stack.push_back(str);
 }
Ejemplo n.º 3
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();
	}
}
Ejemplo n.º 4
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();
	}
}
Ejemplo n.º 5
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();
		}
	}
}
Ejemplo n.º 6
0
int UI_Deaggregate (ObjectiveClass* objective)
{
	int						f,fid;
	VehicleID				classID;
	Falcon4EntityClassType* classPtr;
	float					x,y,z;
	FeatureClassDataType*	fc;
	ObjClassDataType*		oc;
	BSPLIST					*drawptr;
	Tpoint					objPos;
	C_Window				*win;
	C_Text					*txt;
	C_TreeList				*tree;
	TREELIST				*item,*parent,*root;
	C_Entity				*recon_ent;
	C_Feature				*feat;

	if(gUIViewer == NULL)
		return(0);

	CloseAllRenderers(RECON_WIN);
	win=gMainHandler->FindWindow(RECON_WIN);
	if(win == NULL)
		return(0);

	tree=(C_TreeList*)win->FindControl(RECON_TREE);
	if(!tree)
		return(0);

	root=tree->Find(objective->GetTeam());
	if(!root)
	{
		txt=new C_Text;
		txt->Setup(C_DONT_CARE,0);
		txt->SetFixedWidth(100);
		txt->SetFont(tree->GetFont());
		txt->SetText(TeamInfo[objective->GetTeam()]->GetName());
		txt->SetFGColor(0xc0c0c0);

		root=tree->CreateItem(objective->GetTeam(),C_TYPE_ROOT,txt);
		if(root)
			tree->AddItem(tree->GetRoot(),root);

	}
	if(!root)
		return(0);

	recon_ent=BuildObjective(objective);

	parent=tree->CreateItem(objective->GetCampID(),C_TYPE_MENU,recon_ent);
	if(parent)
		tree->AddChildItem(root,parent);

	// Set up the init data structure.
	oc = objective->GetObjectiveClassData();
	fid = oc->FirstFeature;
	for (f=0; f<oc->Features; f++,fid++)
	{
		classID = static_cast<short>(objective->GetFeatureID(f));
		if (classID)
		{
			fc = GetFeatureClassData (classID);
			if (!fc || fc->Flags & FEAT_VIRTUAL)
				continue;
			objective->GetFeatureOffset(f, &y, &x, &z);
			objPos.x=x+objective->XPos();
			objPos.y=y+objective->YPos();
			objPos.z=z;
			classPtr = &Falcon4ClassTable[fc->Index];
			if(classPtr != NULL)
			{
				drawptr=LoadFeature(objective->GetCampID() << 16 | f,classPtr->visType[objective->GetFeatureStatus(f)],&objPos,(float)FeatureEntryDataTable[fid].Facing);
				if(drawptr != NULL)
				{
//					if(objective->GetFeatureValue(f))
//					{
						((DrawableObject*)drawptr)->GetPosition(&objPos);

						feat=BuildFeature(objective,f,&objPos);
						if(feat)
						{
							item=tree->CreateItem(objective->GetCampID() << 16 | f,C_TYPE_ITEM,feat);
							if(item)
								tree->AddChildItem(parent,item);
						}
//					}
				}
			}
		}
	}
	tree->RecalcSize();
	if(tree->Parent_)
		tree->Parent_->RefreshClient(tree->GetClient());
	return(1);
}