Ejemplo n.º 1
0
void notify_advert_screen (ui_object *obj, void *arg)
{
/*	time_t
		start_time,
		end_time;

	float
		elapsed_time;
*/

	if ( get_ui_object_drawable ( obj ) )
	{

		//
		// Setup screen graphics
		//

		blit_front_buffer_to_render_buffer ();

		if (advert_screen_graphic)
		{

			destroy_texture_graphic (advert_screen_graphic);

			advert_screen_graphic = NULL;
		}

		advert_screen_graphic = create_texture_graphic ("graphics\\ui\\cohokum\\advert.psd");

		set_ui_object_texture_graphic (advert_screen, advert_screen_graphic);

		reset_time_values (advert_screen);
	}
	else
	{

		if (advert_screen_graphic)
		{

			destroy_texture_graphic (advert_screen_graphic);

			advert_screen_graphic = NULL;
		}
	}

	set_mouse_off ();

	set_ui_object_redraw (advert_screen, TRUE);

	ui_force_update ();

	Sleep (5000);

	set_mouse_on ();

//	push_ui_screen (main_screen);

	set_ui_object_drawable (advert_ok_button, TRUE);
}
Ejemplo n.º 2
0
void dedicated_server_function (ui_object *obj, void *arg)
{

	char
		buffer [256];

	set_mouse_on ();

	set_mouse_graphic_on ();

	ASSERT (current_game_session);

	//

	if ( get_ui_object_drawable ( obj ) )
	{

		if ( main_screen_texture )
		{
	
			destroy_texture_graphic (dedicated_server_screen_texture);

			dedicated_server_screen_texture = NULL;
		}
	
		dedicated_server_screen_texture = create_texture_graphic ( "graphics\\ui\\cohokum\\demoload.psd" );
	
		set_ui_object_texture_graphic (dedicated_server_screen, dedicated_server_screen_texture);
	
		blit_front_buffer_to_render_buffer ();
	
		ui_set_user_function (NULL);
	}
	else
	{
		if (main_screen_texture)
		{
	
			destroy_texture_graphic (dedicated_server_screen_texture);

			dedicated_server_screen_texture = NULL;
		}
	}
	//

	sprintf (buffer, "Title : %s", current_game_session->title);

	set_ui_object_text (dedicated_server_title_text, buffer);

	sprintf (buffer, "Map : %s", current_game_session->data_path);

	set_ui_object_text (dedicated_server_map_text, buffer);

	sprintf (buffer, "Game : %s", current_game_session->campaign_filename);

	set_ui_object_text (dedicated_server_game_text, buffer);
}
Ejemplo n.º 3
0
void notify_exit_screen (ui_object *obj, void *arg)
{

	if ( get_ui_object_drawable ( obj ) )
	{

		//
		// Setup screen graphics
		//

		blit_front_buffer_to_render_buffer ();

		if (exit_screen_graphic)
		{

			destroy_texture_graphic (exit_screen_graphic);

			exit_screen_graphic = NULL;
		}

		exit_screen_graphic = create_texture_graphic ("graphics//ui//cohokum//exit.psd");

		set_ui_object_texture_graphic (exit_screen, exit_screen_graphic);

		reset_time_values (exit_screen);

		set_exit_ui (TRUE);
	}
	else
	{

		if (exit_screen_graphic)
		{

			destroy_texture_graphic (exit_screen_graphic);

			exit_screen_graphic = NULL;
		}
	}
}
Ejemplo n.º 4
0
void notify_credits_screen (ui_object *obj, void *arg)
{

	if ( get_ui_object_drawable ( obj ) )
	{
		
		//
		// Setup screen graphics
		//
	
		blit_front_buffer_to_render_buffer ();
	
		if (credits_screen_graphic)
		{
		
			destroy_texture_graphic (credits_screen_graphic);
	
			credits_screen_graphic = NULL;
		}
		
		credits_screen_graphic = create_texture_graphic ("graphics\\ui\\cohokum\\credits.psd");
		
		set_ui_object_texture_graphic (credits_screen, credits_screen_graphic);
		
		reset_time_values (credits_screen);
	}
	else
	{

		if (credits_screen_graphic)
		{
	
			destroy_texture_graphic (credits_screen_graphic);

			credits_screen_graphic = NULL;
		}
	}
}
Ejemplo n.º 5
0
void initialise_demoload_graphic (ui_object *obj)
{
	if ( get_ui_object_drawable ( obj ) )
	{
		
		//
		// Setup screen graphics
		//
	
		blit_front_buffer_to_render_buffer ();
	
		if (demoload_screen_graphic)
		{
		
			destroy_texture_graphic (demoload_screen_graphic);
	
			demoload_screen_graphic = NULL;
		}
		
		demoload_screen_graphic = create_texture_graphic ("graphics\\ui\\cohokum\\demoload.psd");
		
		set_ui_object_texture_graphic (loading_screen, demoload_screen_graphic);
		
		reset_time_values (loading_screen);
	}
	else
	{

		if (demoload_screen_graphic)
		{
	
			destroy_texture_graphic (demoload_screen_graphic);

			demoload_screen_graphic = NULL;
		}
	}
}
Ejemplo n.º 6
0
void notify_options_screen (ui_object *obj, void *arg)
{

	if ( get_ui_object_drawable ( obj ) )
	{

		//
		// Setup screen graphics
		//

		blit_front_buffer_to_render_buffer ();

		if (options_screen_graphic)
		{

			destroy_texture_graphic (options_screen_graphic);

			options_screen_graphic = NULL;
		}

		options_screen_graphic = create_texture_graphic ("graphics//ui//cohokum//setup.psd");

		set_ui_object_texture_graphic (options_screen, options_screen_graphic);

//		reset_time_values (options_screen);

		// if called from within game - hide certain options
		if (get_current_game_session())
		{
			set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], FALSE);

			set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

			set_ui_object_drawable (ghost_multiplayer_option_button, TRUE);

			if (current_options_page == OPTIONS_PAGE_MULTIPLAYER)
			{
				current_options_page = OPTIONS_PAGE_GRAPHICS;
			}

			#if INGAME_SOUND_OPTIONS

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_SOUND], FALSE);

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_INGAME_SOUND], TRUE);

			if (current_options_page == OPTIONS_PAGE_SOUND)
			{
				current_options_page = OPTIONS_PAGE_INGAME_SOUND;
			}

			#else

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_INGAME_SOUND], FALSE);

			set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_SOUND], FALSE);

			set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_SOUND], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

			set_ui_object_drawable (ghost_sound_option_button, TRUE);

			if (current_options_page == OPTIONS_PAGE_SOUND)
			{
				current_options_page = OPTIONS_PAGE_GRAPHICS;
			}

			#endif
		}
		else
		{
			set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], TRUE);

			set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255);

			set_ui_object_drawable (ghost_multiplayer_option_button, FALSE);

			#if INGAME_SOUND_OPTIONS

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_SOUND], TRUE);

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_INGAME_SOUND], FALSE);

			if (current_options_page == OPTIONS_PAGE_INGAME_SOUND)
			{
				current_options_page = OPTIONS_PAGE_SOUND;
			}

			#else

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_INGAME_SOUND], FALSE);

			set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_SOUND], TRUE);

			set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_SOUND], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255);

			set_ui_object_drawable (ghost_sound_option_button, FALSE);

			#endif
		}

		#if DEMO_VERSION

		set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], FALSE);

		set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

		set_ui_object_drawable (ghost_multiplayer_option_button, TRUE);

		#endif

		//initialise the joystick devices

		initialise_joystick_selection ();

		//call most recently entered options page

		notify_options_page (current_options_page);

		// get pointer to current graphics card

		old_graphics_card_selection = get_card_selection_device ();

		old_graphics_card_automatic_selection = get_global_graphics_device_selection_automatic ();
	}
	else
	{

		if (options_screen_graphic)
		{

			destroy_texture_graphic (options_screen_graphic);

			options_screen_graphic = NULL;
		}
	}
}
Ejemplo n.º 7
0
void notify_multi_player_setup (void)
{

	connection_data_type
		*this_connection;

	char
		text [10];

//	if ( get_ui_object_drawable ( obj ) )
//	{

		this_connection = direct_play_get_connection_data ();

		blit_front_buffer_to_render_buffer ();


		// Setup the service provider cycle button
#ifdef _WIN32
		if ( this_connection->service_provider.name )
		{
			if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_TCPIP, sizeof ( GUID ) ) == TRUE )
			{
				set_ui_object_text (connection_type_button, get_trans("MP_INTERNET"));
			}
			else if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_SERIAL, sizeof ( GUID ) ) == TRUE )
			{
				set_ui_object_text (connection_type_button, get_trans("MP_SERIAL"));
			}
			else if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_MODEM, sizeof ( GUID ) ) == TRUE )
			{
				set_ui_object_text (connection_type_button, get_trans("MP_MODEM"));
			}
			else if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_IPX, sizeof ( GUID ) ) == TRUE )
			{
				set_ui_object_text (connection_type_button, get_trans("MP_IPX"));
			}
        }
		else
		{
			set_ui_object_text (connection_type_button, get_trans ("MP_NO_SERVICE_PROVIDER"));
		}
#elif defined __unix__
if ( this_connection->service_provider.name )
		{
/*ö			if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_TCPIP, sizeof ( int ) ) == TRUE )
			{
				set_ui_object_text (connection_type_button, get_trans("MP_INTERNET"));
			}
			else if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_SERIAL, sizeof ( int ) ) == TRUE )
			{
				set_ui_object_text (connection_type_button, get_trans("MP_SERIAL"));
			}
			else if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_MODEM, sizeof ( int ) ) == TRUE )
			{
				set_ui_object_text (connection_type_button, get_trans("MP_MODEM"));
			}
			else if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_IPX, sizeof ( int ) ) == TRUE )
			{
				set_ui_object_text (connection_type_button, get_trans("MP_IPX"));
			}*/
        }
		else
		{
			set_ui_object_text (connection_type_button, get_trans ("MP_NO_SERVICE_PROVIDER"));
		}
#endif
		preprocess_translation_object_size (connection_type_bdrop, connection_type_button, NULL, 0, RESIZE_OPTION_BOX_TITLE);

		// initialise modem to first in list (? Shouldn't we store the current modem elsewhere - ie globally ?)

		current_modem = modem_name_list;

		if (!current_modem)
		{
			set_ui_object_text (modem_type_button, "No Modem Installed");
		}
		else
		{
			set_ui_object_text (modem_type_button, current_modem->name);
		}

		// Com port button

		sprintf (text, "%d", get_global_comms_port ());

		set_ui_object_text (com_port_button, text);

		// Baud rate

		set_ui_object_text (baud_rate_button, baud_rate_text [get_global_baud_rate () - 1]);

		// Stop bits

		set_ui_object_text (stop_bits_button, stop_bits_text [get_global_stop_bits () - 1]);

		// Parity

		set_ui_object_text (parity_button, parity_text [get_global_parity () - 1]);

		// Flow

		set_ui_object_text (flow_button, flow_text [get_global_flow () - 1]);

		// Phone Number

		set_ui_object_text (phone_number_text_obj, global_options.phone_number);

		// IP Address

		set_ui_object_text (ip_address_text_obj, global_options.ip_address);


		// Now setup the connection type areas

		set_multiplayer_options_display ();


		// Lastly load in the stuff for the screen
/*
		if ( multiplayer_screen_graphic )
		{

			destroy_texture_graphic ( multiplayer_screen_graphic );

			multiplayer_screen_graphic = NULL;
		}

		multiplayer_screen_graphic = create_texture_graphic ( "graphics\\ui\\cohokum\\multi.psd" );

		set_ui_object_texture_graphic ( multi_player_setup_area, multiplayer_screen_graphic );

		blit_front_buffer_to_render_buffer ();

		reset_time_values ( options_screen );
*/
//	}
//	else
//	{
/*
		if ( multiplayer_screen_graphic )
		{

			destroy_texture_graphic ( multiplayer_screen_graphic );

			multiplayer_screen_graphic = NULL;
		}
*/
//	}

	display_options_page (OPTIONS_PAGE_MULTIPLAYER);
}
Ejemplo n.º 8
0
void init_function (ui_object *obj, void *arg)
{

	set_mouse_off ();

	if ( get_ui_object_drawable ( obj ) )
	{

		if ( main_screen_texture )
		{
	
			destroy_texture_graphic (init_screen_texture);

			init_screen_texture = NULL;
		}
	
		init_screen_texture = create_texture_graphic ( "graphics\\ui\\cohokum\\title.psd" );
	
		set_ui_object_texture_graphic (init_screen, init_screen_texture);
	
		blit_front_buffer_to_render_buffer ();
	
		ui_set_user_function (NULL);
	}
	else
	{
		if (main_screen_texture)
		{
	
			destroy_texture_graphic (init_screen_texture);

			init_screen_texture = NULL;
		}
	}
	
	ui_force_update ();

	full_initialise_game ();

	set_mouse_on ();

	switch (command_line_run_mode)
	{
/*
		case RUN_MODE_AITOOL:
		{

			initialise_aitool ();

			push_ui_screen (aitool_select_map_screen);

			break;
		}
*/
		case RUN_MODE_NORMAL:
		default:
		{

			if (command_line_comms_dedicated_server)
			{

				process_game_initialisation_phases ();
			}
			else
			{
	
				play_cd_music ( CD_MUSIC_TYPE_INTRO );

				#if DEMO_VERSION
					push_ui_screen (advert_screen);
				#else
					push_ui_screen (main_screen);
				#endif
			}

			break;
		}
	}
}
Ejemplo n.º 9
0
void notify_main_screen (ui_object *obj, void *arg)
{

	obj;
	arg;

	if ( get_ui_object_drawable ( obj ) )
	{

		if ( main_screen_texture )
		{

			destroy_texture_graphic ( main_screen_texture );

			main_screen_texture = NULL;
		}

		main_screen_texture = create_texture_graphic ( "graphics//ui//cohokum//main.psd" );

		set_ui_object_texture_graphic ( main_screen, main_screen_texture );

		blit_front_buffer_to_render_buffer ();

		leave_mission ();

		ui_set_user_function (NULL);

		reset_time_values ( main_screen );
	}
	else
	{

		if ( main_screen_texture )
		{

			destroy_texture_graphic ( main_screen_texture );

			main_screen_texture = NULL;
		}
	}

	#if DEMO_VERSION

		set_ui_object_highlightable (pilots_button, FALSE);

		set_ui_object_font_colour_end (pilots_button, ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

		set_ui_object_notify_on (pilots_button, NOTIFY_TYPE_NONE);

		set_ui_object_drawable (ghost_pilots_button, TRUE);

		set_ui_object_highlightable (credits_button, FALSE);

		set_ui_object_font_colour_end (credits_button, ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

		set_ui_object_drawable (ghost_credits_button, TRUE);

		set_ui_object_notify_on (credits_button, NOTIFY_TYPE_NONE);

	#endif
}
Ejemplo n.º 10
0
void notify_medals_screen (ui_object *obj)
{

	int
		i;

	if ( get_ui_object_drawable (obj) )
	{

		if (medals_screen_texture)
		{
			for (i = 1; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
			{
				destroy_texture_graphic (medal_graphics [i]);

				medal_graphics [i] = NULL;
			}

			destroy_texture_graphic (medals_screen_texture);

			medals_screen_texture = NULL;
		}

		if (player_log_current_side == ENTITY_SIDE_BLUE_FORCE)
		{
			set_ui_object_text (medals_title_text, get_trans("US"));

			medals_screen_texture = create_texture_graphic ( "graphics//ui//cohokum//medalsus.psd" );

			set_ui_object_drawable (russian_area, FALSE);

			set_ui_object_drawable (us_area, TRUE);

			// create medal texture graphic objects, except MEDAL_TYPE_NONE
			for (i = 1; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
			{
				medal_graphics [i] = create_texture_graphic (us_medal_graphic_array[i].name);

				set_ui_object_texture_graphic (us_medal_objects [i], medal_graphics [i]);
			}

			medal_graphics [0] = NULL;

			// set medal states
			set_medal_states (us_medal_objects);
		}
		else
		{
			set_ui_object_text (medals_title_text, get_trans("Russian"));

			medals_screen_texture = create_texture_graphic ( "graphics//ui//cohokum//medalssv.psd" );

			set_ui_object_drawable (russian_area, TRUE);

			set_ui_object_drawable (us_area, FALSE);

			// create medal texture graphic objects, except MEDAL_TYPE_NONE
			for (i = 1; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
			{
				medal_graphics [i] = create_texture_graphic (russian_medal_graphic_array[i].name);

				set_ui_object_texture_graphic (russian_medal_objects [i], medal_graphics [i]);
			}

			medal_graphics [0] = NULL;

			// set medal states
			set_medal_states (russian_medal_objects);
		}

		set_ui_object_texture_graphic (player_medals_screen, medals_screen_texture);

		recursively_set_object_time (player_medals_screen, MEDALS_AREA_FADE_TIME, MEDALS_AREA_OFFSET_TIME);

		reset_time_values (player_medals_screen);

		blit_front_buffer_to_render_buffer ();
	}
	else
	{

		if (medals_screen_texture )
		{
			for (i = 1; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
			{
				destroy_texture_graphic (medal_graphics [i]);

				medal_graphics [i] = NULL;
			}

			destroy_texture_graphic (medals_screen_texture);

			medals_screen_texture = NULL;
		}
	}

	#if DEBUG_MODULE
		debug_filtered_log("Inside show_medals_screen");
	#endif
}