Beispiel #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);
}
Beispiel #2
0
void rotate_base_page_3d_scene_pitch (float delta_pitch)
{
    if (get_ui_object_drawable (campaign_page [CAMPAIGN_PAGE_BASE]))
    {
        page_3d_pitch += rad (delta_pitch);

        page_3d_pitch = bound (page_3d_pitch, PI * (1.0 / 12.0), PI * 0.5);
    }
}
Beispiel #3
0
void rotate_base_page_3d_scene_heading (float delta_heading)
{
    if (get_ui_object_drawable (campaign_page [CAMPAIGN_PAGE_BASE]))
    {
        page_3d_heading += rad (delta_heading);

        page_3d_heading = wrap_angle (page_3d_heading);
    }
}
Beispiel #4
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);
}
Beispiel #5
0
static int response_to_force_update (campaign_screen_messages message, entity *sender)
{
    if (get_ui_object_drawable (campaign_page [CAMPAIGN_PAGE_BASE]))
    {
        ASSERT (sender);

        show_base_page (sender, TRUE);
    }

    return TRUE;
}
Beispiel #6
0
static int response_to_player_leave_mission (campaign_screen_messages message, entity *sender)
{
	if (get_ui_object_drawable (campaign_page [CAMPAIGN_PAGE_WEAPON_LOADING]))
	{
		show_map_page ();
	}

	remove_campaign_page_from_history (CAMPAIGN_PAGE_WEAPON_LOADING);

	return TRUE;
}
Beispiel #7
0
void zoom_base_page_3d_scene (int zoom)
{
    if (get_ui_object_drawable (campaign_page [CAMPAIGN_PAGE_BASE]))
    {
        if (zoom > 0)
        {
            page_3d_distance /= BASE_3D_VIEW_MEDIUM_DISTANCE_INCREMENT;
        }
        else if (zoom < 0)
        {
            page_3d_distance *= BASE_3D_VIEW_MEDIUM_DISTANCE_INCREMENT;
        }

        page_3d_distance = bound (page_3d_distance, 20.0, 4.0 * KILOMETRE);
    }
}
Beispiel #8
0
static int response_to_base_destroyed (campaign_screen_messages message, entity *sender)
{
    if (get_local_entity_safe_index (sender) == get_ui_object_item_number (campaign_page [CAMPAIGN_PAGE_BASE]))
    {
        if (get_ui_object_drawable (campaign_page [CAMPAIGN_PAGE_BASE]))
        {
            //
            // Not sure yet.... For now display the map page
            //

            show_map_page ();
        }

        set_ui_object_item_number (campaign_page [CAMPAIGN_PAGE_BASE], ENTITY_INDEX_DONT_CARE);
    }

    return TRUE;
}
Beispiel #9
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;
		}
	}
}
Beispiel #10
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;
		}
	}
}
Beispiel #11
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;
		}
	}
}
Beispiel #12
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;
		}
	}
}
Beispiel #13
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;
		}
	}
}
Beispiel #14
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
}
Beispiel #15
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
}