Exemple #1
0
void debug_input(void)
{
		// screenshot always works
		
	if (input_action_get_state_single(nc_debug_screenshot)) {
		debug_screenshot();
		return;
	}
	
		// others require debug mode to be on
		
	if (!hud.debug) return;
	
	if (input_action_get_state_single(nc_debug_status)) {
		debug_dump();
		return;
	}
	
	if (input_action_get_state_single(nc_debug_game)) {
		debug_game();
		return;
	}
	
	if (input_action_get_state_single(nc_debug_map)) {
		map_pick_trigger_set();
		return;
	}
}
Exemple #2
0
void file_input(void)
{
	char		err_str[256];
	
	if (input_action_get_state_single(nc_save)) {
		file_setup(TRUE);
		server.next_state=gs_file;
		return;
	}
	
	if (input_action_get_state_single(nc_load)) {
		file_setup(FALSE);
		server.next_state=gs_file;
		return;
	}
	
	if (input_action_get_state_single(nc_quick_save)) {
		if (!game_file_save(FALSE,FALSE,err_str)) console_add_error(err_str);
		return;
	}
}
Exemple #3
0
void score_limit_run(void)
{
	int			tick;
	
		// we are paused so use regular ticks
		
	tick=time_get();
	
		// draw score limit

	gl_frame_start(NULL);
	gui_draw_background(1.0f);
	network_draw(tick);
	gl_frame_end();
	
		// pump events since we aren't calling
		// the regular gui routines
		
	input_event_pump();
	
		// if we are hosting, we can exit early
		// and send the reset message to clients
		
	if (net_setup.host.hosting) {
		
			// check for time exit or escape exit
			
		if ((tick>(score_limit_start_tick+(SCORE_LIMIT_SECOND_PAUSE*1000))) || (input_action_get_state_single(nc_menu))) {
			game_reset();
			score_limit_close();
		}
		
		return;
	}
	
		// clients can't exit, but if they don't
		// get an update in the time + 10 seconds,
		// they auto-quit the game
		
	if (tick>(score_limit_start_tick+((SCORE_LIMIT_SECOND_PAUSE+10)*1000))) {
		score_limit_close();
		remote_host_exit();
	}
}
Exemple #4
0
void player_movement_fpp_xz_input(obj_type *obj)
{
	bool			key_forward,key_backward,joy_ok;

		// forward or backwards movement keys

	joy_ok=(input_check_joystick_ok()) && (setup.joystick_mode==joystick_mode_turn_move);

	key_backward=FALSE;
	key_forward=input_action_get_state(nc_move_forward);
	if (joy_ok) key_forward=input_get_joystick_move_forward();

	if (!key_forward) {
		key_backward=input_action_get_state(nc_move_backward);
		if (joy_ok) key_backward=input_get_joystick_move_backward();
	}

		// no quick reverse locks

	if (!obj->quick_reverse) {
		if (key_forward) {
			if ((obj->forward_move.reverse) && (obj->forward_move.speed!=0)) key_forward=FALSE;
		}

		if (key_backward) {
			if ((!obj->forward_move.reverse) && (obj->forward_move.speed!=0)) key_backward=FALSE;
		}
	}

		// forward movement

	if (key_forward) {
		obj->forward_move.moving=TRUE;
		if (obj->forward_move.reverse) {
			obj->forward_move.speed=0;
		}
		obj->forward_move.reverse=FALSE;
	}

	if (key_backward) {
		obj->forward_move.moving=TRUE;
		if (!obj->forward_move.reverse) {
			obj->forward_move.speed=0;
		}
		obj->forward_move.reverse=TRUE;
	}

		// run, walk
	
	if (obj->single_speed) {
		obj->forward_move.running=FALSE;
	}
	else {
	
		if (!setup.toggle_run) {
			toggle_run_state=input_action_get_state(nc_run);
		}
		else {
			if (input_action_get_state_single(nc_run)) toggle_run_state=!toggle_run_state;
		}
		
		if (setup.always_run) {
			obj->forward_move.running=!toggle_run_state;
		}
		else {
			obj->forward_move.running=toggle_run_state;
		}
	}

		// side movement
	
	if (input_action_get_state(nc_sidestep_left)) {
		obj->side_move.moving=TRUE;
		if (obj->side_move.reverse) {
			obj->side_move.speed=0;
		}
		obj->side_move.reverse=FALSE;
	}
	else {
		if (input_action_get_state(nc_sidestep_right)) {
			obj->side_move.moving=TRUE;
			if (!obj->side_move.reverse) {
				obj->side_move.speed=0;
			}
			obj->side_move.reverse=TRUE;
		}
	}
}