// notify the popup that a player has left
void multi_pinfo_notify_drop(net_player *np)
{
	net_player *reset;

	// if we're no active, bail
	if(!Multi_pinfo_popup_running){
		return;
	}

	// if this is not the player we're currently displaying, bail
	if(np != Multi_pinfo_popup_player){
		return;
	}

	// otherwise we need to switch to someone else
	reset = multi_pinfo_get_prev_player(np);
	if(reset != NULL){
		multi_pinfo_reset_player(reset);
		return;
	}
	reset = multi_pinfo_get_next_player(np);
	if(reset != NULL){
		multi_pinfo_reset_player(reset);
		return;
	}

	// bail, since there's no one else
	Int3();
	Multi_pinfo_popup_done = 1;
}
Beispiel #2
0
// act on a button press
void multi_pinfo_popup_button_pressed(int n)
{
	net_player* swap;

	switch (n)
	{
	case MPI_EXIT:
		Multi_pinfo_popup_done = 1;
		break;

	case MPI_MEDALS:
		gamesnd_play_iface(SND_USER_SELECT);
		multi_pinfo_do_medals();
		break;

	case MPI_SCROLL_STATS_UP:
		swap = multi_pinfo_get_prev_player(Multi_pinfo_popup_player);
		if (swap != NULL)
		{
			gamesnd_play_iface(SND_USER_SELECT);
			multi_pinfo_reset_player(swap);
		}
		else
		{
			gamesnd_play_iface(SND_GENERAL_FAIL);
		}
		break;

	case MPI_SCROLL_STATS_DOWN:
		swap = multi_pinfo_get_next_player(Multi_pinfo_popup_player);
		if (swap != NULL)
		{
			gamesnd_play_iface(SND_USER_SELECT);
			multi_pinfo_reset_player(swap);
		}
		else
		{
			gamesnd_play_iface(SND_GENERAL_FAIL);
		}
		break;

	default :
		gamesnd_play_iface(SND_GENERAL_FAIL);
		break;
	}
}