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 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.º 8
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.º 9
0
void initialise_main_screen (void)
{
	ui_object
		*option_bdrop,
		*change_obj,
		*registered_to_message;

	float
		x1,
		y1,
		x2,
		y2;

	int
		i;

	/////////////////////////////////////////////////////////////////
	// option area & button texture objects

	if (options_box_small)
	{
		destroy_texture_graphic (options_box_small);

		options_box_small = NULL;
	}

	options_box_small = create_texture_graphic ( "graphics//ui//cohokum//boxsmall.psd" );

	if (options_box_medium)
	{
		destroy_texture_graphic (options_box_medium);

		options_box_medium = NULL;
	}

	options_box_medium = create_texture_graphic ( "graphics//ui//cohokum//boxmed.psd" );

	if (options_box_large)
	{
		destroy_texture_graphic (options_box_large);

		options_box_large = NULL;
	}

	options_box_large = create_texture_graphic ( "graphics//ui//cohokum//boxlarge.psd" );

	if (options_box_extra_large)
	{
		destroy_texture_graphic (options_box_extra_large);

		options_box_extra_large = NULL;
	}

	options_box_extra_large = create_texture_graphic ( "graphics//ui//cohokum//boxexlrg.psd" );

	if (text_box_graphic)
	{
		destroy_texture_graphic (text_box_graphic);

		text_box_graphic = NULL;
	}

	text_box_graphic = create_texture_graphic ( "graphics//ui//cohokum//boxtext.psd" );

	if (text_option_bdrop)
	{
		destroy_texture_graphic (text_option_bdrop);

		text_option_bdrop = NULL;
	}

	text_option_bdrop = create_texture_graphic ( "graphics//ui//cohokum//bstripe.psd" );

	/////////////////////////////////////////////////////////////////
	// List box graphics

	if (list_box_graphic)
	{

		destroy_texture_graphic (list_box_graphic);

		list_box_graphic = NULL;
	}

	list_box_graphic = create_texture_graphic ( "graphics//ui//cohokum//boxlist.psd" );

	// initialise slider graphics
	frontend_slider_bdrop_graphic					= create_texture_graphic ( "graphics//ui//cohokum//map//sbcklist.psd" );

	frontend_slider_bar_graphic 					= create_texture_graphic ( "graphics//ui//cohokum//map//scrolblu.psd" );
	frontend_slider_bar_highlighted_graphic 	= create_texture_graphic ( "graphics//ui//cohokum//map//scrolwht.psd" );
	frontend_slider_bar_selected_graphic 		= create_texture_graphic ( "graphics//ui//cohokum//map//scrolyel.psd" );

	frontend_slider_up_graphic 					= create_texture_graphic ( "graphics//ui//cohokum//map//arrupblu.psd" );
	frontend_slider_up_highlighted_graphic 	= create_texture_graphic ( "graphics//ui//cohokum//map//arrupwht.psd" );
	frontend_slider_up_selected_graphic 		= create_texture_graphic ( "graphics//ui//cohokum//map//arrupyel.psd" );

	frontend_slider_down_graphic 					= create_texture_graphic ( "graphics//ui//cohokum//map//arrdwblu.psd" );
	frontend_slider_down_highlighted_graphic 	= create_texture_graphic ( "graphics//ui//cohokum//map//arrdwwht.psd" );
	frontend_slider_down_selected_graphic 		= create_texture_graphic ( "graphics//ui//cohokum//map//arrdwyel.psd" );


	/////////////////////////////////////////////////////////////////
	// Main Screen & title text

   main_screen = create_ui_object
            (
               UI_TYPE_SCREEN,
               UI_ATTR_VIRTUAL_POSITION (0, 0),
               UI_ATTR_VIRTUAL_SIZE (1.0, 1.0),
               UI_ATTR_COLOUR_START (255,255,255,64),
               UI_ATTR_COLOUR_END (255,255,255,255),
					UI_ATTR_OFFSET_TIME (0),
					UI_ATTR_TIME_LENGTH (500),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_EITHER),
					UI_ATTR_FUNCTION (notify_main_screen),
               UI_ATTR_END
            );

   create_ui_object
            (
               UI_TYPE_TEXT,
               UI_ATTR_PARENT (main_screen),
					UI_ATTR_OFFSET_TIME (0),
					UI_ATTR_TIME_LENGTH (500),
               UI_ATTR_VIRTUAL_POSITION (TITLE_TEXT_POSITION_X, TITLE_TEXT_POSITION_Y),
					UI_ATTR_VIRTUAL_SIZE (TITLE_TEXT_WIDTH, TITLE_TEXT_HEIGHT),
					UI_ATTR_TEXT (get_trans ("Main Screen")),
					UI_ATTR_FONT_TYPE (UI_FONT_IMPACT_22),
					UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_BOTTOM),
               UI_ATTR_FONT_COLOUR_START (ui_screen_title_text_colour.r, ui_screen_title_text_colour.g, ui_screen_title_text_colour.b, 0),
               UI_ATTR_FONT_COLOUR_END (ui_screen_title_text_colour.r, ui_screen_title_text_colour.g, ui_screen_title_text_colour.b, 255),
					UI_ATTR_HIGHLIGHTABLE (FALSE),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );


	/////////////////////////////////////////////////////////////////
	// Security Message - text to be inserted is ideally  <= 81 chars

	registered_to_message = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (main_screen),
			UI_ATTR_VIRTUAL_POSITION (0.05, 0.4),
			UI_ATTR_VIRTUAL_SIZE (0.9, 0.3),
			UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
         UI_ATTR_FONT_COLOUR_END (ui_screen_title_text_colour.r, ui_screen_title_text_colour.g, ui_screen_title_text_colour.b, 255),
			UI_ATTR_DRAWABLE (FALSE),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);


	/////////////////////////////////////////////////////////////////
	// Buttons

	// Combat

	i = 0;

	option_bdrop = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (main_screen),
		UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
		UI_ATTR_VIRTUAL_SIZE (TEXT_OPTION_BDROP_WIDTH, TEXT_OPTION_BDROP_HEIGHT),
		UI_ATTR_COLOUR_START (0, 0, 0, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_OFFSET_TIME (0),
		UI_ATTR_TIME_LENGTH (500),
		UI_ATTR_TEXTURE_GRAPHIC (text_option_bdrop),
		UI_ATTR_END
	);

   change_obj = create_ui_object
            (
               UI_TYPE_BUTTON,
               UI_ATTR_PARENT (main_screen),
					UI_ATTR_POSITION_START (0.0, 0.329),
					UI_ATTR_POSITION_END (0.663, 0.329),
					UI_ATTR_VIRTUAL_SIZE (0.196, 0.033),
					UI_ATTR_TEXT (get_trans ("UI_COMBAT")),
					UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_22),
					UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
					UI_ATTR_FUNCTION (notify_main_combat_missions_button),
            	UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
            	UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
            	UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
  		         UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
					UI_ATTR_HIGHLIGHTABLE (TRUE),
					UI_ATTR_CLEAR (TRUE),
					UI_ATTR_TIME_LENGTH (200),
					UI_ATTR_OFFSET_TIME (500),
               UI_ATTR_END
            );

	preprocess_translation_object_size (change_obj, NULL, NULL, 0, RESIZE_OPTION_FIXED_BUTTON);

	set_text_option_backdrop_object (option_bdrop, change_obj);

	// Pilots

	i++;

	option_bdrop = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (main_screen),
		UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
		UI_ATTR_VIRTUAL_SIZE (TEXT_OPTION_BDROP_WIDTH, TEXT_OPTION_BDROP_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_OFFSET_TIME (0),
		UI_ATTR_TIME_LENGTH (500),
		UI_ATTR_TEXTURE_GRAPHIC (text_option_bdrop),
		UI_ATTR_END
	);

   pilots_button = create_ui_object
            (
               UI_TYPE_BUTTON,
               UI_ATTR_PARENT (main_screen),
					UI_ATTR_POSITION_START (0, 0.435),
					UI_ATTR_POSITION_END (0.785, 0.435),
					UI_ATTR_TIME_LENGTH (200),
					UI_ATTR_OFFSET_TIME (600),
					UI_ATTR_VIRTUAL_SIZE (0.155, 0.033),
               UI_ATTR_GRAPHIC (get_graphics_file_data (GRAPHICS_UI_APACHE_MAIN_SCREEN_PLAYER_BUTTON)),
					UI_ATTR_TEXT (get_trans ("UI_PILOTS")),
					UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_22),
					UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
         	   UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
         	   UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
         	   UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
         	   UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
					UI_ATTR_FUNCTION (notify_main_select_player_button),
					UI_ATTR_HIGHLIGHTABLE (TRUE),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );

	preprocess_translation_object_size (pilots_button, NULL, NULL, 0, RESIZE_OPTION_FIXED_BUTTON);

	set_text_option_backdrop_object (option_bdrop, pilots_button);

	// ghost pilots button

	x1 = get_ui_object_virtual_x (pilots_button);
	x2 = get_ui_object_virtual_x_size (pilots_button);

	y1 = 0.435;
	y2 = 0.033;

	ghost_pilots_button = create_ui_object
									(
										UI_TYPE_AREA,
										UI_ATTR_PARENT (main_screen),
										UI_ATTR_VIRTUAL_POSITION (x1, y1),
										UI_ATTR_VIRTUAL_SIZE (x2, y2),
										UI_ATTR_CLEAR (TRUE),
										UI_ATTR_DRAWABLE (FALSE),
										UI_ATTR_END
									);


	// Options

	i++;

	option_bdrop = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (main_screen),
		UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
		UI_ATTR_VIRTUAL_SIZE (TEXT_OPTION_BDROP_WIDTH, TEXT_OPTION_BDROP_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXTURE_GRAPHIC (text_option_bdrop),
		UI_ATTR_OFFSET_TIME (0),
		UI_ATTR_TIME_LENGTH (500),
		UI_ATTR_END
	);

   change_obj = create_ui_object
            (
               UI_TYPE_BUTTON,
               UI_ATTR_PARENT (main_screen),
					UI_ATTR_POSITION_START (0, 0.595),
					UI_ATTR_POSITION_END (0.735, 0.595),
					UI_ATTR_TIME_LENGTH (200),
					UI_ATTR_OFFSET_TIME (700),
					UI_ATTR_VIRTUAL_SIZE (0.185, 0.042),
					UI_ATTR_TEXT (get_trans ("Options Screen")),
					UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_22),
					UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
					UI_ATTR_FUNCTION (notify_common_main_options_button),
      	      UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
   	         UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
	            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
	            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
					UI_ATTR_HIGHLIGHTABLE (TRUE),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );

	preprocess_translation_object_size (change_obj, NULL, NULL, 0, RESIZE_OPTION_FIXED_BUTTON);

	set_text_option_backdrop_object (option_bdrop, change_obj);


	// Credits

	i++;

	option_bdrop = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (main_screen),
		UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
		UI_ATTR_VIRTUAL_SIZE (TEXT_OPTION_BDROP_WIDTH, TEXT_OPTION_BDROP_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_OFFSET_TIME (0),
		UI_ATTR_TIME_LENGTH (500),
		UI_ATTR_TEXTURE_GRAPHIC (text_option_bdrop),
		UI_ATTR_END
	);

   credits_button = create_ui_object
            (
               UI_TYPE_BUTTON,
               UI_ATTR_PARENT (main_screen),
					UI_ATTR_POSITION_START (0, 0.704),
					UI_ATTR_POSITION_END (0.637, 0.704),
					UI_ATTR_TIME_LENGTH (200),
					UI_ATTR_OFFSET_TIME (700),
					UI_ATTR_VIRTUAL_SIZE (0.185, 0.042),
					UI_ATTR_TEXT (get_trans ("Credits")),
					UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_22),
					UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
					UI_ATTR_FUNCTION (notify_main_credits_button),
      	      UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
   	         UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
	            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
	            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
					UI_ATTR_HIGHLIGHTABLE (TRUE),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );

	preprocess_translation_object_size (credits_button, NULL, NULL, 0, RESIZE_OPTION_FIXED_BUTTON);

	set_text_option_backdrop_object (option_bdrop, credits_button);

	// ghost credits button

	x1 = get_ui_object_virtual_x (credits_button);
	x2 = get_ui_object_virtual_x_size (credits_button);

	y1 = 0.704;
	y2 = 0.042;

	ghost_credits_button = create_ui_object
									(
										UI_TYPE_AREA,
										UI_ATTR_PARENT (main_screen),
										UI_ATTR_VIRTUAL_POSITION (x1, y1),
										UI_ATTR_VIRTUAL_SIZE (x2, y2),
										UI_ATTR_CLEAR (TRUE),
										UI_ATTR_DRAWABLE (FALSE),
										UI_ATTR_END
									);


	/////////////////////////////////////////////////////////////////
	// Exit Button

	option_bdrop = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (main_screen),
		UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
		UI_ATTR_VIRTUAL_SIZE (TEXT_OPTION_BDROP_WIDTH, TEXT_OPTION_BDROP_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_OFFSET_TIME (0),
		UI_ATTR_TIME_LENGTH (500),
		UI_ATTR_TEXTURE_GRAPHIC (text_option_bdrop),
		UI_ATTR_END
	);

	change_obj = create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (main_screen),
				UI_ATTR_VIRTUAL_POSITION (OPTIONS_CANCEL_BUTTON_POS_X, OPTIONS_CANCEL_BUTTON_POS_Y),
				UI_ATTR_VIRTUAL_SIZE (OPTIONS_EXIT_BUTTON_X, OPTIONS_EXIT_BUTTON_Y),
				UI_ATTR_TEXT (get_trans("UI_EXIT")),
				UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
				UI_ATTR_FUNCTION (notify_main_screen_exit_button),
				UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
				UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
            UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
            UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
				UI_ATTR_HIGHLIGHTABLE (TRUE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	set_text_option_backdrop_object (option_bdrop, change_obj);


#ifndef COMMERCIAL

	if (check_cdrom_file_exists ("CONFIG.BIN"))
	{
		set_ui_object_text (registered_to_message, get_security_message ()),

		set_ui_object_drawable (registered_to_message, TRUE);
	}
	else
	{

		#ifdef INSTALL_FROM_CDROM

		debug_fatal ("Security Protection Failed");

		#endif
	}

#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
}