当前位置: 首页>>代码示例>>C++>>正文


C++ HUD函数代码示例

本文整理汇总了C++中HUD函数的典型用法代码示例。如果您正苦于以下问题:C++ HUD函数的具体用法?C++ HUD怎么用?C++ HUD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了HUD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HUD

void CActor::PickupInfoDraw(CObject* object)
{
	LPCSTR draw_str = NULL;
	
	CInventoryItem* item = smart_cast<CInventoryItem*>(object);
//.	CInventoryOwner* inventory_owner = smart_cast<CInventoryOwner*>(object);
//.	VERIFY(item || inventory_owner);
	if(!item)		return;

	Fmatrix			res;
	res.mul			(Device.mFullTransform,object->XFORM());
	Fvector4		v_res;
	Fvector			shift;

	draw_str = item->Name/*Complex*/();
	shift.set(0,0,0);

	res.transform(v_res,shift);

	if (v_res.z < 0 || v_res.w < 0)	return;
	if (v_res.x < -1.f || v_res.x > 1.f || v_res.y<-1.f || v_res.y>1.f) return;

	float x = (1.f + v_res.x)/2.f * (Device.dwWidth);
	float y = (1.f - v_res.y)/2.f * (Device.dwHeight);

	HUD().Font().pFontLetterica16Russian->SetAligment	(CGameFont::alCenter);
	HUD().Font().pFontLetterica16Russian->SetColor		(PICKUP_INFO_COLOR);
	HUD().Font().pFontLetterica16Russian->Out			(x,y,draw_str);
}
开发者ID:Karlan88,项目名称:xray,代码行数:29,代码来源:Actor_Feel.cpp

示例2: operator

		void operator () (const char* s, int num_siblings)
		{
			if ( s_params.offs )
			{
				s_params.offs--;
				return;
			}

			// dont use multicolumns
// 			if ( s_params.cur_row && s_params.cur_row + 1 > s_params.max_rows )
// 			{
// 				s_params.cur_row = 0;
// 				s_params.ori_x  += s_params.column_size;
// 			}

			if ( !s_params.cur_row )
			{
				HUD().Font().pFontStat->OutSet((float)s_params.ori_x, (float)s_params.ori_y);
			}			

			if ( s_params.cur_row % 2 )
			{
				HUD().Font().pFontStat->SetColor(s_params.color1);
			}
			else
			{
				HUD().Font().pFontStat->SetColor(s_params.color2);
			}
			
			HUD().Font().pFontStat->OutNext(s);
			s_params.cur_row++;
		}
开发者ID:2asoft,项目名称:xray,代码行数:32,代码来源:debug_text_tree.cpp

示例3: HUD

bool	CActor::CanMove				()
{
	if( conditions().IsCantWalk() )
	{
		if(mstate_wishful&mcAnyMove)
		{
			HUD().GetUI()->AddInfoMessage("cant_walk");
		}
		return false;
	}else
	if( conditions().IsCantWalkWeight() )
	{
		if(mstate_wishful&mcAnyMove)
		{
			HUD().GetUI()->AddInfoMessage("cant_walk_weight");
		}
		return false;
	
	}

	if(IsTalking())
		return false;
	else
		return true;
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:25,代码来源:Actor_Movement.cpp

示例4: callback

bool CActor::OnReceiveInfo(shared_str info_id) const
{
	if(!CInventoryOwner::OnReceiveInfo(info_id))
		return false;

	CInfoPortion info_portion;
	info_portion.Load(info_id);

	AddEncyclopediaArticle	(&info_portion);
	AddGameTask				(&info_portion);

	callback(GameObject::eInventoryInfo)(lua_game_object(), *info_id);

	if(!HUD().GetUI())
		return false;
	//только если находимся в режиме single
	CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());
	if(!pGameSP) return false;

	if(pGameSP->TalkMenu->IsShown())
	{
		pGameSP->TalkMenu->NeedUpdateQuestions();
	}


	return true;
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:27,代码来源:actor_communication.cpp

示例5: R_ASSERT

void CDialogHolder::StopMenu (CUIDialogWnd* pDialog)
{
	R_ASSERT( pDialog->IsShown() );

	if( MainInputReceiver()==pDialog )
	{
		if(UseIndicators())
		{
			bool b					= !!m_input_receivers.back().m_flags.test(recvItem::eCrosshair);
			psHUD_Flags.set			(HUD_CROSSHAIR_RT, b);
			b						= !!m_input_receivers.back().m_flags.test(recvItem::eIndicators);
			if(b)					HUD().GetUI()->ShowGameIndicators();
			else					HUD().GetUI()->HideGameIndicators();
		}
		RemoveDialogToRender	(pDialog);
		SetMainInputReceiver	(NULL,false);
		pDialog->SetHolder		(NULL);
		pDialog->Hide			();
	}else{
		RemoveDialogToRender	(pDialog);
		SetMainInputReceiver	(pDialog, true);
		pDialog->SetHolder		(NULL);
		pDialog->Hide			();
	}

	if(!MainInputReceiver() || !MainInputReceiver()->NeedCursor() )
		GetUICursor()->Hide();
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:28,代码来源:UIDialogHolder.cpp

示例6: StartStopMenu

void game_cl_TeamDeathmatch::shedule_Update			(u32 dt)
{
	CStringTable st;
	string512	msg;

	if(!m_game_ui && HUD().GetUI() ) m_game_ui = smart_cast<CUIGameTDM*>( HUD().GetUI()->UIGame() );
	inherited::shedule_Update(dt);

	if (!m_game_ui) return;
	//---------------------------------------------------------
	if (m_game_ui->m_pUITeamSelectWnd && m_game_ui->m_pUITeamSelectWnd->IsShown() && !CanCallTeamSelectMenu())
		StartStopMenu(m_game_ui->m_pUITeamSelectWnd,true);
	//---------------------------------------------------------
	
	switch (m_phase)
	{
	case GAME_PHASE_TEAM1_SCORES:
		{
			sprintf_s(msg, /*team %s wins*/ *st.translate("mp_team_wins"), CTeamInfo::GetTeam_name(1));
			m_game_ui->SetRoundResultCaption(msg);

			SetScore();
		}break;
	case GAME_PHASE_TEAM2_SCORES:
		{
			sprintf_s(msg, /*team %s wins*/ *st.translate("mp_team_wins"), CTeamInfo::GetTeam_name(2));
			m_game_ui->SetRoundResultCaption(msg);
			
			SetScore();
			
		}break;
	case GAME_PHASE_INPROGRESS:
		{
			if (local_player && !local_player->IsSkip())
			{			
				if (Level().CurrentEntity() && Level().CurrentEntity()->CLS_ID == CLSID_SPECTATOR)
				{
					if (!(pCurBuyMenu && pCurBuyMenu->IsShown()) && 
						!(pCurSkinMenu && pCurSkinMenu->IsShown()) &&
						!(m_game_ui->m_pMapDesc && m_game_ui->m_pMapDesc->IsShown()) &&
						(HUD().GetUI() && HUD().GetUI()->GameIndicatorsShown())
						)
					{
						if (!m_bTeamSelected)
							m_game_ui->SetPressJumpMsgCaption("mp_press_jump2select_team");
					};
				};
				SetScore();
			};
		}break;
	default:
		{
		}break;
	};

}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:56,代码来源:game_cl_teamdeathmatch.cpp

示例7: GameTasks

CGameTask*	CGameTaskManager::GiveGameTaskToActor(CGameTask* t, u32 timeToComplete, bool bCheckExisting)
{
	if(bCheckExisting && HasGameTask(t->m_ID)) return NULL;
	m_flags.set					(eChanged, TRUE);

	GameTasks().push_back				(SGameTaskKey(t->m_ID) );
	GameTasks().back().game_task			= t;
	t->m_ReceiveTime				= Level().GetGameTime();
	t->m_TimeToComplete				= t->m_ReceiveTime + timeToComplete;

	
	std::sort						(GameTasks().begin(), GameTasks().end(), task_prio_pred);

	ARTICLE_VECTOR& article_vector = Actor()->encyclopedia_registry->registry().objects();


	SGameTaskObjective	*obj = NULL;
	for (u32 i = 0; i < t->m_Objectives.size(); ++i){
		obj = &t->m_Objectives[i];
		if(obj->article_id.size()){
		FindArticleByIDPred pred(obj->article_id);
		if( std::find_if(article_vector.begin(), article_vector.end(), pred) == article_vector.end() ){
			CEncyclopediaArticle article;
			article.Load(obj->article_id);
			article_vector.push_back(ARTICLE_DATA(obj->article_id, Level().GetGameTime(), article.data()->articleType));
			}
		}

		if(obj->object_id!=u16(-1) && obj->map_location.size() && obj->def_location_enabled){
			CMapLocation* ml =	Level().MapManager().AddMapLocation(obj->map_location, obj->object_id);
			if(obj->map_hint.size())	ml->SetHint(obj->map_hint);
			ml->DisablePointer			();
			ml->SetSerializable			(true);
		}
	}
	CGameTask* _at = ActiveTask();
	if	( (NULL==_at) || (_at->m_priority > t->m_priority) )
	{
		SetActiveTask(t->m_ID, 1);
	}


	//установить флажок необходимости прочтения тасков в PDA
	if(HUD().GetUI()){
		CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());
		if(pGameSP) 
			pGameSP->PdaMenu->PdaContentsChanged	(pda_section::quests);
	}
	if(true /*t->m_ID!="user_task"*/)
		t->Objective(0).ChangeStateCallback();

	return t;
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:53,代码来源:GametaskManager.cpp

示例8: VERIFY

void CActor::AddEncyclopediaArticle	 (const CInfoPortion* info_portion) const
{
	VERIFY(info_portion);
	ARTICLE_VECTOR& article_vector = encyclopedia_registry->registry().objects();

	ARTICLE_VECTOR::iterator last_end = article_vector.end();
	ARTICLE_VECTOR::iterator B = article_vector.begin();
	ARTICLE_VECTOR::iterator E = last_end;

	for(ARTICLE_ID_VECTOR::const_iterator it = info_portion->ArticlesDisable().begin();
									it != info_portion->ArticlesDisable().end(); it++)
	{
		FindArticleByIDPred pred(*it);
		last_end = std::remove_if(B, last_end, pred);
	}
	article_vector.erase(last_end, E);


	for(ARTICLE_ID_VECTOR::const_iterator it = info_portion->Articles().begin();
									it != info_portion->Articles().end(); it++)
	{
		FindArticleByIDPred pred(*it);
		if( std::find_if(article_vector.begin(), article_vector.end(), pred) != article_vector.end() ) continue;

		CEncyclopediaArticle article;

		article.Load(*it);

		article_vector.push_back(ARTICLE_DATA(*it, Level().GetGameTime(), article.data()->articleType));
		LPCSTR g,n;
		int _atype = article.data()->articleType;
		g = *(article.data()->group);
		n = *(article.data()->name);
		callback(GameObject::eArticleInfo)(lua_game_object(), g, n, _atype);

		if( HUD().GetUI() ){
			CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());
			pda_section::part p = pda_section::encyclopedia;
			switch (article.data()->articleType){
				case ARTICLE_DATA::eEncyclopediaArticle:	p = pda_section::encyclopedia;	break;
				case ARTICLE_DATA::eJournalArticle:			p = pda_section::journal;		break;
				case ARTICLE_DATA::eInfoArticle:			p = pda_section::info;			break;
				case ARTICLE_DATA::eTaskArticle:			p = pda_section::quests;		break;
				default: NODEFAULT;
			};
			pGameSP->PdaMenu->PdaContentsChanged			(p);
		}

	}

}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:51,代码来源:actor_communication.cpp

示例9: OnDisableInfo

void CActor::OnDisableInfo(shared_str info_id) const
{
	CInventoryOwner::OnDisableInfo(info_id);

	if(!HUD().GetUI())
		return;

	//только если находимся в режиме single
	CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());
	if(!pGameSP) return;

	if(pGameSP->TalkMenu->IsShown())
		pGameSP->TalkMenu->NeedUpdateQuestions();
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:14,代码来源:actor_communication.cpp

示例10: Level

void  CActor::AddGameNews			 (GAME_NEWS_DATA& news_data)
{

	GAME_NEWS_VECTOR& news_vector	= game_news_registry->registry().objects();
	news_data.receive_time			= Level().GetGameTime();
	news_vector.push_back			(news_data);

	if(HUD().GetUI()){
		HUD().GetUI()->UIMainIngameWnd->ReceiveNews(&news_data);
		CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());
		if(pGameSP) 
			pGameSP->PdaMenu->PdaContentsChanged	(pda_section::news);
	}
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:14,代码来源:actor_communication.cpp

示例11: switch

void CWeaponMagazined::OnStateSwitch	(u32 S)
{
	inherited::OnStateSwitch(S);
	switch (S)
	{
	case eIdle:
		switch2_Idle	();
		break;
	case eFire:
		switch2_Fire	();
		break;
	case eFire2:
		switch2_Fire2	();
		break;
	case eMisfire:
		if(smart_cast<CActor*>(this->H_Parent()) && (Level().CurrentViewEntity()==H_Parent()) )
			HUD().GetUI()->AddInfoMessage("gun_jammed");
		break;
	case eMagEmpty:
		switch2_Empty	();
		break;
	case eReload:
		switch2_Reload	();
		break;
	case eShowing:
		switch2_Showing	();
		break;
	case eHiding:
		switch2_Hiding	();
		break;
	case eHidden:
		switch2_Hidden	();
		break;
	}
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:35,代码来源:WeaponMagazined.cpp

示例12: contact_data

/*
void CActor::UpdateContact		(u16 contact_id)
{
	if(ID() == contact_id) return;

	TALK_CONTACT_VECTOR& contacts = contacts_registry->registry().objects();
	for(TALK_CONTACT_VECTOR_IT it = contacts.begin(); contacts.end() != it; ++it)
		if((*it).id == contact_id) break;

	if(contacts.end() == it)
	{
		TALK_CONTACT_DATA contact_data(contact_id, Level().GetGameTime());
		contacts.push_back(contact_data);
	}
	else
	{
		(*it).time = Level().GetGameTime();
	}
}
*/
void CActor::NewPdaContact		(CInventoryOwner* pInvOwner)
{	
	if(!IsGameTypeSingle()) return;

	bool b_alive = !!(smart_cast<CEntityAlive*>(pInvOwner))->g_Alive();
	HUD().GetUI()->UIMainIngameWnd->AnimateContacts(b_alive);

	Level().MapManager().AddRelationLocation		( pInvOwner );

	if( HUD().GetUI() ){
		CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());

		if(pGameSP)
			pGameSP->PdaMenu->PdaContentsChanged	(pda_section::contacts);
	}
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:36,代码来源:actor_communication.cpp

示例13: Level

void CLevelChanger::feel_touch_new	(CObject *tpObject)
{
	CActor*			l_tpActor = smart_cast<CActor*>(tpObject);
	VERIFY			(l_tpActor);
	if (!l_tpActor->g_Alive())
		return;

	if (m_bSilentMode) {
		NET_Packet	p;
		p.w_begin	(M_CHANGE_LEVEL);
		p.w			(&m_game_vertex_id,sizeof(m_game_vertex_id));
		p.w			(&m_level_vertex_id,sizeof(m_level_vertex_id));
		p.w_vec3	(m_position);
		p.w_vec3	(m_angles);
		Level().Send(p,net_flags(TRUE));
		return;
	}
	Fvector			p,r;
	bool			b = get_reject_pos(p,r);
	CUIGameSP		*pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame());
	if (pGameSP)
        pGameSP->ChangeLevel	(m_game_vertex_id,m_level_vertex_id,m_position,m_angles,p,r,b);

	m_entrance_time	= Device.fTimeGlobal;
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:25,代码来源:level_changer.cpp

示例14: HUD

void CUIActorMenu::Draw()
{
	inherited::Draw();
	HUD().GetUI()->UIMainIngameWnd->DrawZoneMap();
	m_ItemInfo->Draw();
	m_hint_wnd->Draw();
}
开发者ID:Charsi82,项目名称:xray-1.5.10-2015-,代码行数:7,代码来源:UIActorMenu.cpp

示例15: HUD

void CUIPdaWnd::PdaContentsChanged	(pda_section::part type)
{
	bool b = true;

	if(type==pda_section::encyclopedia){
		UIEncyclopediaWnd->ReloadArticles	();
	}else
	if(type==pda_section::news){
		UIDiaryWnd->AddNews					();
		UIDiaryWnd->MarkNewsAsRead			(UIDiaryWnd->IsShown());
	}else
	if(type==pda_section::quests){
		UIEventsWnd->Reload					();
	}else
	if(type==pda_section::contacts){
		UIPdaContactsWnd->Reload		();
		b = false;
	}

	if(b){
		g_pda_info_state |= type;
		HUD().GetUI()->UIMainIngameWnd->SetFlashIconState_(CUIMainIngameWnd::efiPdaTask, true);
	}

}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:25,代码来源:UIPdaWnd.cpp


注:本文中的HUD函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。