void game_cl_Deathmatch::OnTeamChanged()
{
	if (!pCurBuyMenu)				return;
	if (pCurBuyMenu)				pCurBuyMenu->SetRank(local_player->rank);
	LoadDefItemsForRank				(pCurBuyMenu);
	ChangeItemsCosts				(pCurBuyMenu);
};
void				game_cl_Deathmatch::OnGameRoundStarted				()
{
	inherited::OnGameRoundStarted();
	if (pCurBuyMenu && pCurBuyMenu->IsShown())
		pCurBuyMenu->HideDialog();

	if (local_player)
	{
		if (pCurBuyMenu) 
		{
			pCurBuyMenu->IgnoreMoneyAndRank(false);
			pCurBuyMenu->SetRank(local_player->rank);
		}
		ClearBuyMenu();
		LoadDefItemsForRank(pCurBuyMenu);
		ChangeItemsCosts(pCurBuyMenu);
		if (pCurBuyMenu && pCurPresetItems)
		{
			LoadTeamDefaultPresetItems(GetTeamMenu(local_player->team), pCurBuyMenu, pCurPresetItems);
			ReInitRewardGenerator(local_player);
		}
	}
	if (pCurBuyMenu) pCurBuyMenu->ClearPreset(_preset_idx_last);
	//-----------------------------------------------------------------
	if ( m_game_ui && m_game_ui->ActorMenu().IsShown() )
	{
		m_game_ui->HideActorMenu();
	}
}
//-----------------------------------------------------------------
void game_cl_TeamDeathmatch::SetCurrentBuyMenu	()
{
	if (!local_player) return;
	if (!local_player->team || local_player->skin == -1) return;
	if (!pCurBuyMenu)
	{
		if (local_player->team == 1) 
		{
			pCurBuyMenu = InitBuyMenu(GetBaseCostSect(), 1);
			LoadTeamDefaultPresetItems(GetTeamMenu(1), pCurBuyMenu, &PresetItemsTeam1);
			pCurPresetItems = &PresetItemsTeam1;
		}
		else 
		{
			pCurBuyMenu = InitBuyMenu(GetBaseCostSect(), 2);
			LoadTeamDefaultPresetItems(GetTeamMenu(2), pCurBuyMenu, &PresetItemsTeam2);
			pCurPresetItems = &PresetItemsTeam2;
		};
		LoadDefItemsForRank(pCurBuyMenu);
	};

//	if (pCurBuyMenu) pCurBuyMenu->SetSkin(local_player->skin);
	if (!pCurBuyMenu) return;	

	//-----------------------------------
	if (m_cl_dwWarmUp_Time != 0) pCurBuyMenu->IgnoreMoneyAndRank(true);
	else pCurBuyMenu->IgnoreMoneyAndRank(false);
	//-----------------------------------
};
void				game_cl_Deathmatch::OnRankChanged			(u8 OldRank)
{
	inherited::OnRankChanged(OldRank);
	if (pCurBuyMenu) pCurBuyMenu->SetRank(local_player->rank);	
	LoadDefItemsForRank(pCurBuyMenu);
	ChangeItemsCosts(pCurBuyMenu);
	//---------------------------------------------
	PlayRankChangesSndMessage();
};
void	game_cl_Deathmatch::net_import_update		(NET_Packet& P)
{
	inherited::net_import_update(P);
	//-----------------------------------
	if (pCurBuyMenu && local_player)
	{
		if (local_player->rank != pCurBuyMenu->GetRank() && !pCurBuyMenu->IsIgnoreMoneyAndRank())
		{
			pCurBuyMenu->SetRank(local_player->rank);
			LoadDefItemsForRank(pCurBuyMenu);
			ChangeItemsCosts(pCurBuyMenu);
		}
	}
}
Beispiel #6
0
void game_cl_Deathmatch::SetCurrentBuyMenu	()	
{
	if (!pCurBuyMenu)
	{
		pCurBuyMenu	= InitBuyMenu(GetBaseCostSect(), 0);
		LoadTeamDefaultPresetItems(GetTeamMenu(0), pCurBuyMenu, &PresetItemsTeam0);
		pCurPresetItems	= &PresetItemsTeam0;
		LoadDefItemsForRank(pCurBuyMenu);
	}	
	//-----------------------------------
	if (m_cl_dwWarmUp_Time != 0) pCurBuyMenu->IgnoreMoneyAndRank(true);
	else pCurBuyMenu->IgnoreMoneyAndRank(false);
	//-----------------------------------
	if (!local_player) return;
};
Beispiel #7
0
void CUIGameCTA::ReInitPlayerDefItems()
{
    R_ASSERT					(m_pCurBuyMenu);
    LoadDefItemsForRank	();
    SetPlayerDefItemsToBuyMenu();
}