Exemplo n.º 1
0
void send_pilot_joined_message (entity *en)
{
	int
		player_count;

	char
		text [200];

	//
	// Client now joined in..... send system message to other players
	//

	player_count = get_session_pilot_count ();

	if (player_count == 1)
	{
		sprintf (text, "%s %s - 1 %s",
							get_local_entity_string (en, STRING_TYPE_PILOTS_NAME),
							get_trans ("joined"),
							get_trans ("player connected"));
	}
	else
	{
		sprintf (text, "%s %s - %d %s",
							get_local_entity_string (en, STRING_TYPE_PILOTS_NAME),
							get_trans ("joined"),
							player_count,
							get_trans ("players connected"));
	}

	send_text_message (en, NULL, MESSAGE_TEXT_SYSTEM_NEW_PILOT, text);
	
	server_log (text); // Jabberwock Server log
}
Exemplo n.º 2
0
void notify_modem_answer_function ( ui_object *obj, void *arg )
{
	char
		text_buffer [256];

	ghost_ui_objects_for_modem (obj, TRUE);

	switch ( modem_state )
	{

		case MODEM_NOT_CONNECTED:
		{

			char
				*modem;

			modem = current_modem->name;

			if ( modem )
			{

				//
				// Have to call create session to get the phone to answer
				//

				if ( direct_play_answer_modem ( modem, GAME_TYPE_INVALID ) )
				{

					direct_play_session_capabilities ();

					direct_play_create_group ();

					direct_play_create_player ();

					set_server_id (direct_play_get_player_id ());

					//
					// Turn off the back button while we connect
					//

//					set_ui_object_drawable ( multi_player_back_button, UI_OBJECT_STATE_OFF );

					sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_WAITING_FOR_CALL"));

					set_ui_object_text (modem_status_text, text_buffer);

					modem_state = MODEM_ANSWERING;

					ui_set_user_function ( multiplayer_modem_answer_update_function );
				}
			}

			break;
		}
	}

	// don't leave text selected

	set_toggle_button_off (obj);
}
Exemplo n.º 3
0
std::wstring get_exp(const node* p)
{
	if (!p) return L"";
	if (p->t == nt_num)
	{
		std::wostringstream oss;
		oss << p->num;
		return get_trans(p, oss.str());
	}
	std::wstring lexp = get_exp(p->l_child);
	std::wstring rexp = get_exp(p->r_child);
	
	if (p->l_child->t == nt_op && get_pred(p->l_child->op) < get_pred(p->op))
	{
		lexp = std::wstring(L"(") + lexp + L")";
	}
	if (p->r_child->t == nt_op && !(get_pred(p->op) < get_pred(p->r_child->op)))
	{
		rexp = std::wstring(L"(") + rexp + L")";
	}
	
	std::wstring e;
	if (p->op == L'_') 
		e = lexp + rexp;
	else 
		e = lexp + L" " + p->op + L" " + rexp;
	return get_trans(p, e);
}
Exemplo n.º 4
0
char *get_pilot_rank_short_name (int rank)
{
	ASSERT ((rank > PILOT_RANK_NONE) && (rank < NUM_PILOT_RANKS));

	switch ( rank )
	{

		case PILOT_RANK_LIEUTENANT:
		{

			return (get_trans ("Lt."));

			break;
		}

		case PILOT_RANK_CAPTAIN:
		{

			return (get_trans ("Capt."));

			break;
		}

		case PILOT_RANK_MAJOR:
		{

			return (get_trans ("Maj."));

			break;
		}

		case PILOT_RANK_LT_COLONEL:
		{

			return (get_trans ("Lt. Col."));

			break;
		}

		case PILOT_RANK_COLONEL:
		{

			return (get_trans ("Col."));

			break;
		}
	}

	return ( NULL );
}
Exemplo n.º 5
0
void send_pilot_quit_message (entity *en)
{
	int
		player_count;

	char
		text [200];

	//
	// Client now joined in..... send system message to other players
	//

	player_count = get_session_pilot_count () - 1;

	if (player_count == 1)
	{
		sprintf (text, "%s %s - 1 %s",
							get_local_entity_string (en, STRING_TYPE_PILOTS_NAME),
							get_trans ("quit"),
							get_trans ("player connected"));
	}
	else
	{
		sprintf (text, "%s %s - %d %s",
							get_local_entity_string (en, STRING_TYPE_PILOTS_NAME),
							get_trans ("quit"),
							player_count,
							get_trans ("players connected"));
	}

	send_text_message (en, NULL, MESSAGE_TEXT_SYSTEM_NEW_PILOT, text);
	
	server_log (text); // Jabberwock Server log
	
	if ((command_line_pause_server) && (player_count <= 1)) // 040220 Jabberwock Pause server, changed to <=1 by Werewolf
	{
		force_pause_acceleration();
		server_log ("Server paused");
	}
}	
Exemplo n.º 6
0
int
main()
{
	int	value;
	Trans	*transaction;

	/*
	** Establish the point at which we want to resume execution
	** after a call to longjmp.
	*/
	value = setjmp( restart );

	/*
	** Figure out what to do after a return from setjmp.
	*/
	switch( value ){
	default:
		/*
		** longjmp was called -- fatal error
		*/
		fputs( "Fatal error.\n", stderr );
		break;

	case 1:
		/*
		** longjmp was called -- minor error
		*/
		fputs( "Invalid transaction.\n", stderr );
		/* FALL THROUGH and continue processing */

	case 0:
		/*
		** Original return from setjmp: perform normal
		** processing.
		*/
		while( (transaction = get_trans()) != NULL )
			process_trans( transaction );

	}

	/*
	** Save data and exit the program
	*/
	write_data_to_file();

	return value == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
Exemplo n.º 7
0
/*
 * call-seq:
 * string.transliterate(transform_string) -> string
 *
 * Transliterates string using transform.
 *
 */
static VALUE unicode_transliterate(int argc, VALUE *argv, VALUE string) {
    UChar str[BUF_SIZE];
    int32_t slen = 0;
    UErrorCode status = U_ZERO_ERROR;
    UTransliterator *trans;
    VALUE transform;

    rb_scan_args(argc, argv, "01", &transform);
    if (NIL_P(transform)) transform = rb_str_new2("Latin; Lower; NFD; [^[:letter:] [:space:] [0-9] [:punctuation:]] Remove; NFC");

    to_utf16(string, str, &slen);

    trans = get_trans(transform);
    utrans_transUChars(trans, str, &slen, BUF_SIZE, 0, &slen, &status);

    to_utf8(str, slen);
}
Exemplo n.º 8
0
void draw_special_restart_text (void)
{
	char
		buffer [64];

	int
		string_length;
	
	float
		x;

	//
	// display game name
	//

	if (current_game_session)
	{
		sprintf (buffer, "%s", current_game_session->title);
		string_length = ui_get_string_length ( buffer );

		x = get_integer_screen_x_mid () - (string_length / 2);

		ui_display_text (buffer, x, 73 + iy_640_480);
	}

	//
	// display flashing message
	//

	if (flash_timer < 0.666)
	{
		set_ui_font_type (UI_FONT_ARIAL_14);

		set_ui_font_colour (ui_colour_yellow);

		sprintf ( buffer, get_trans ("PRESS SPACE") );

		string_length = ui_get_string_length (buffer);

		ui_display_text (buffer, get_integer_screen_x_mid () - (string_length / 2), 420 + iy_640_480);
	}
}
Exemplo n.º 9
0
void initialise_loading_screen (void)
{
	float
		x1,
		y1,
		x2,
		y2;

	loading_screen = create_ui_object
		(
			UI_TYPE_SCREEN,
			UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
			UI_ATTR_VIRTUAL_SIZE (1.0, 1.0),
			//UI_ATTR_GRAPHIC (get_graphics_file_data (GRAPHICS_UI_APACHE_LOADING_SCREEN)),
			UI_ATTR_FUNCTION (loading_function),
			UI_ATTR_END
		);

	x1 = 0.620;
	y1 = 0.138;
	x2 = 0.2;
	y2 = 0.0625;
	
	loading_text = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (loading_screen),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2, y2),
			UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22),
			UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_CENTRE),
	      UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
	      UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
			UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
			UI_ATTR_TEXT (get_trans ("Loading")),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);

}
Exemplo n.º 10
0
void trace_arrow (double slon,double slat,double dxp,double dyp,double scale,double *x1,double *y1,double *x2,double *y2)

     /* convert a vector arrow (delx,dely) arrow from (lat,lon) */

     /* Kurt Feigl, from code by T. Herring */                                       
                                                                                    
     /* INPUT */                                                                    
     /*   slat        - latitude, in degrees of arrow tail */
     /*   slon        - longitude in degrees of arrow tail */
     /*   dxp         - x component of arrow */
     /*   dyp         - y component of arrow */
     /*   scale       - scaling for arrow    */
                                                                                    
     /* OUTPUT (returned) */                                                        
     /*   x1,y1       - paper coordinates of arrow tail */
     /*   x2,y2       - paper coordinates of arrow head */

     {                          

     /* local */
     double t11,t12,t21,t22,xt,yt;

     /* determine local transformation between (lon,lat) and (x,y) */
     /* return this in the 2 x 2 matrix t */
     get_trans (slon,slat,&t11,&t12,&t21,&t22);

     /* map start of arrow from lat,lon to x,y */
     GMT_geo_to_xy (slon, slat, &xt, &yt);

     /* perform the transformation */
     transform_local (xt,yt,dxp,dyp,scale,t11,t12,t21,t22,x2,y2);

     /* return values */

     *x1 = xt;
     *y1 = yt;

	   }
Exemplo n.º 11
0
void build_chat_target_list (void)
{
	ui_object
		*new_item;

	entity
		*force,
		*pilot,
		*current_target;

	static char
		s [128];

	current_target = get_local_entity_safe_ptr (get_ui_object_item_number (chat_send_button));

	ui_object_destroy_list_items (chat_target_list);

	sprintf (s, "%s", get_trans ("Side"));

	new_item = add_to_pop_up_list (s, chat_target_list, NULL, ENTITY_INDEX_DONT_CARE, UI_FONT_ARIAL_16, ui_ingame_dead_text_colour);

	//
	// All 
	//

	ASSERT (get_session_entity ());

	sprintf (s, "%s", get_trans ("CHAT_TARGET_ALL"));

	new_item = add_to_pop_up_list (s, chat_target_list, NULL, get_local_entity_safe_index (get_session_entity ()), UI_FONT_ARIAL_16, ui_ingame_live_text_colour);

	set_ingame_ui_object_mouse_over_properties (new_item);

	if (get_session_entity () == current_target)
	{
		set_ui_object_state (new_item, UI_OBJECT_STATE_ON);
	}

	//
	// Sides
	//

	force = get_local_entity_first_child (get_session_entity (), LIST_TYPE_FORCE);

	while (force)
	{
		sprintf (s, "%s", get_local_entity_string (force, STRING_TYPE_FORCE_NAME));

		new_item = add_to_pop_up_list (s, chat_target_list, NULL, get_local_entity_safe_index (force), UI_FONT_ARIAL_16, ui_ingame_live_text_colour);

		set_ingame_ui_object_mouse_over_properties (new_item);

		if (force == current_target)
		{
			set_ui_object_state (new_item, UI_OBJECT_STATE_ON);
		}

		force = get_local_entity_child_succ (force, LIST_TYPE_FORCE);
	}

	//
	// Sides
	//

	sprintf (s, "%s", get_trans ("UI_PILOTS"));

	new_item = add_to_pop_up_list (s, chat_target_list, NULL, ENTITY_INDEX_DONT_CARE, UI_FONT_ARIAL_16, ui_ingame_dead_text_colour);

	force = get_local_entity_first_child (get_session_entity (), LIST_TYPE_FORCE);

	while (force)
	{
		pilot = get_local_entity_first_child (force, LIST_TYPE_PILOT);

		while (pilot)
		{
			if (pilot != get_pilot_entity ())
			{
				sprintf (s, "%s", get_local_entity_string (pilot, STRING_TYPE_PILOTS_NAME));
	
				new_item = add_to_pop_up_list (s, chat_target_list, NULL, get_local_entity_safe_index (pilot), UI_FONT_ARIAL_16, ui_ingame_live_text_colour);
	
				set_ingame_ui_object_mouse_over_properties (new_item);
	
				if (pilot == current_target)
				{
					set_ui_object_state (new_item, UI_OBJECT_STATE_ON);
				}
			}
			
			pilot = get_local_entity_child_succ (pilot, LIST_TYPE_PILOT);
		}

		force = get_local_entity_child_succ (force, LIST_TYPE_FORCE);
	}
}
Exemplo n.º 12
0
void initialise_free_flight_screen (void)
{
	float
		x1, x2,
		y1, y2,
		x_size,
		y_size;

	char
		string [256];

	x_size = 1.0;
	y_size = 1.0;

	/////////////////////////////////////////////////////////////////

   free_flight_screen = create_ui_object
            (
               UI_TYPE_SCREEN,
               UI_ATTR_VIRTUAL_POSITION (0, 0),
               UI_ATTR_VIRTUAL_SIZE (x_size, y_size),
					UI_ATTR_FUNCTION (notify_free_flight_screen_entered),
					UI_ATTR_DRAW_FUNCTION (free_flight_screen_draw_function),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );

	define_free_flight_screen_map_page_objects ();

	define_free_flight_screen_info_objects ();

	define_free_flight_screen_selection_objects ();

	/////////////////////////////////////////////////////////////////

	x1 = 0.0;
	y1 = 0.0;
	x2 = 1.0;
	y2 = 1.0;

	free_flight_dialog_area = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (free_flight_screen),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_TEXTURE_GRAPHIC (common_grey_alpha_mask),
			UI_ATTR_END
		);

	/////////////////////////////////////////////////////////////////
	//
	// Quit Free Flight
	//
	/////////////////////////////////////////////////////////////////

	x1 = 0.257;
	y1 = 0.303;
	x2 = 0.74;
	y2 = 0.612;

	free_flight_quit_campaign_area = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (free_flight_dialog_area),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics//ui//cohokum//map//quitcamp.psd")),
			UI_ATTR_END
		);

	x1 = 0.1;
	y1 = 0.65;
	x2 = 0.6;
	y2 = 1.0;

	sprintf (string, "%s?", get_trans ("Quit Free Flight"));

	create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (free_flight_quit_campaign_area),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_TEXT (string),
			UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
			UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
			UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);

	x1 = 0.6;
	y1 = 0.65;
	x2 = 0.8;
	y2 = 1.0;

	create_ui_object
		(
			UI_TYPE_BUTTON,
			UI_ATTR_PARENT (free_flight_quit_campaign_area),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_TEXT (get_trans ("Yes")),
			UI_ATTR_FUNCTION (notify_free_flight_accept_quit_campaign_button),
			UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
			UI_ATTR_FONT_COLOUR (ui_ingame_live_text_colour.r, ui_ingame_live_text_colour.g, ui_ingame_live_text_colour.b, ui_ingame_live_text_colour.a),
			UI_ATTR_HIGHLIGHTED_FONT_COLOUR (ui_ingame_highlight_text_colour.r, ui_ingame_highlight_text_colour.g, ui_ingame_highlight_text_colour.b, ui_ingame_highlight_text_colour.a),
			UI_ATTR_SELECTED_FONT_COLOUR (ui_ingame_selected_text_colour.r, ui_ingame_selected_text_colour.g, ui_ingame_selected_text_colour.b, ui_ingame_selected_text_colour.a),
			UI_ATTR_HIGHLIGHTABLE (TRUE),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);

	x1 = 0.8;
	y1 = 0.65;
	x2 = 1.0;
	y2 = 1.0;

	create_ui_object
		(
			UI_TYPE_BUTTON,
			UI_ATTR_PARENT (free_flight_quit_campaign_area),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_TEXT (get_trans ("No")),
			UI_ATTR_FUNCTION (notify_free_flight_cancel_quit_campaign_button),
			UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
			UI_ATTR_FONT_COLOUR (ui_ingame_live_text_colour.r, ui_ingame_live_text_colour.g, ui_ingame_live_text_colour.b, ui_ingame_live_text_colour.a),
			UI_ATTR_HIGHLIGHTED_FONT_COLOUR (ui_ingame_highlight_text_colour.r, ui_ingame_highlight_text_colour.g, ui_ingame_highlight_text_colour.b, ui_ingame_highlight_text_colour.a),
			UI_ATTR_SELECTED_FONT_COLOUR (ui_ingame_selected_text_colour.r, ui_ingame_selected_text_colour.g, ui_ingame_selected_text_colour.b, ui_ingame_selected_text_colour.a),
			UI_ATTR_HIGHLIGHTABLE (TRUE),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);
}
Exemplo n.º 13
0
void multiplayer_modem_dial_update_function ( void )
{

	char
		text_buffer [256];

	int
		game_update_time;

	static int
		update_ticks = 0;

	game_update_time = TIME_1_SECOND;

	if ( update_ticks < get_system_time () )
	{

		session_table_type
			*this_session;

		connection_data_type
			*this_connection;

		unsigned int
			connection_code;

		connection_code = direct_play_dial_modem_status ();

		if ( connection_code == DP_OK )
		{

			//
			// Need to do the final enumeration
			//

			sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_FINDING_GAMES"));

			if ( direct_play_enumerate_sessions () )
			{

				set_comms_model ( COMMS_MODEL_CLIENT );

				this_session = direct_play_get_session_table ();

				if ( this_session )
				{

					int
						baudrate;

					this_connection = direct_play_get_connection_data ();

					this_connection->this_session.session = this_session->session;

					sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_JOINING_GAMES"));

					direct_play_join_session ();

					direct_play_session_capabilities ();

					if (!direct_play_enumerate_groups ())
					{

						debug_fatal ("SESSION: Client can't enumerate any groups - but connected someway");
					}

					this_connection->this_group = direct_play_get_group_table ();

					direct_play_create_player ();

					direct_play_join_group ();

					baudrate = direct_play_get_connection_baudrate ();

					sprintf (text_buffer, "%s: %s %d", get_trans ("MP_STATUS"), get_trans ("MP_CONNECTED_AT"), baudrate * 100);

					set_ui_object_text (modem_status_text, text_buffer);

//					set_ui_object_drawable ( multi_player_back_button, UI_OBJECT_STATE_ON );

					ghost_ui_objects_for_modem (NULL, FALSE);

					modem_state = MODEM_DIALLED_CONNECTED;

					ui_set_user_function ( multiplayer_modem_connection_update_function );
				}
			}
		}
		else
		{

			if ( connection_code == DPERR_CONNECTING )
			{


				sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_CONNECTING"));

				set_ui_object_text ( modem_status_text, text_buffer );
			}
			else
			{

				sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_UNCONNECTED"));

				set_ui_object_text ( modem_status_text, text_buffer );

				modem_state = MODEM_NOT_CONNECTED;

//				set_ui_object_drawable ( multi_player_back_button, UI_OBJECT_STATE_ON );

				ghost_ui_objects_for_modem (NULL, FALSE);

				ui_set_user_function ( NULL );
			}
		}

		update_ticks = get_system_time () + game_update_time;

		set_delta_time ();
	}
}
Exemplo n.º 14
0
static void update_base_page_objects (ui_object *obj, void *arg)
{
    char
    s [128];

    entity
    *base;

    entity_sub_types
    sub_type;

    base = get_local_entity_safe_ptr (get_ui_object_item_number (campaign_page [CAMPAIGN_PAGE_BASE]));

    ASSERT (base);

    sub_type = get_local_entity_int_value (base, INT_TYPE_ENTITY_SUB_TYPE);

    //
    // STATUS
    //

    {
        int status;


        status = get_local_entity_int_value (base, INT_TYPE_KEYSITE_USABLE_STATE);

        set_ui_object_text (base_page_status_box, get_trans ((char*) keysite_usable_state_names [status]));

        switch (status)
        {
        case KEYSITE_STATE_UNUSABLE:
        {
            set_ui_object_font_colour (base_page_status_box, ui_colour_red.r, ui_colour_red.g, ui_colour_red.b, ui_colour_red.a);

            break;
        }

        case KEYSITE_STATE_REPAIRING:
        {
            set_ui_object_font_colour (base_page_status_box, ui_colour_yellow.r, ui_colour_yellow.g, ui_colour_yellow.b, ui_colour_yellow.a);

            break;
        }

        default:
        {
            set_ui_object_font_colour (base_page_status_box, ui_colour_yellow.r, ui_colour_yellow.g, ui_colour_yellow.b, ui_colour_yellow.a);

            break;
        }
        }
    }

    //
    // Efficiency
    //

    {
        float
        efficiency;

        if (get_local_entity_float_value (base, FLOAT_TYPE_KEYSITE_MAXIMUM_STRENGTH) > 0.0)
        {
            efficiency = get_local_entity_float_value (base, FLOAT_TYPE_EFFICIENCY) * 100.0;

            sprintf (s, "%.0f%%", efficiency);
        }
        else
        {
            sprintf (s, "N/A", efficiency);
        }

        set_ui_object_text (base_page_efficiency_box, s);
    }

    //
    // Supplies
    //

    {
        float
        supplies;

        if (keysite_database [sub_type].report_ammo_level)
        {
            supplies = get_local_entity_float_value (base, FLOAT_TYPE_AMMO_SUPPLY_LEVEL);

            sprintf (s, "%.0f%%", supplies);

            set_ui_object_text (base_page_ammo_box, s);
        }
        else
        {
            set_ui_object_text (base_page_ammo_box, "");
        }

        if (keysite_database [sub_type].report_fuel_level)
        {
            supplies = get_local_entity_float_value (base, FLOAT_TYPE_FUEL_SUPPLY_LEVEL);

            sprintf (s, "%.0f%%", supplies);

            set_ui_object_text (base_page_fuel_box, s);
        }
        else
        {
            set_ui_object_text (base_page_fuel_box, "");
        }
    }

    //
    // Back Button
    //

    set_ui_object_drawable (page_back_button, get_campaign_history_valid ());
}
Exemplo n.º 15
0
void initialise_options_screen (void)
{
	float
		x_size,
		y_size;

	x_size = 1.0;
	y_size = 1.0;

	/////////////////////////////////////////////////////////////////

   options_screen = create_ui_object
            (
               UI_TYPE_SCREEN,
					UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
					UI_ATTR_VIRTUAL_SIZE (x_size, y_size),
					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_NOTIFY_ON (NOTIFY_TYPE_DISPLAYED),
					UI_ATTR_FUNCTION (notify_options_screen),
               UI_ATTR_END
            );

   create_ui_object
            (
               UI_TYPE_TEXT,
               UI_ATTR_PARENT (options_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 ("Options 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
            );

	/////////////////////////////////////////////////////////////////

	define_options_screen_controller_page_objects ();

	/////////////////////////////////////////////////////////////////

	define_options_screen_dynamics_page_objects ();

	/////////////////////////////////////////////////////////////////

	define_options_screen_graphics_page_objects ();

	/////////////////////////////////////////////////////////////////

	define_options_screen_realism_page_objects ();

	/////////////////////////////////////////////////////////////////

	define_options_screen_sound_page_objects ();

	define_options_screen_ingame_sound_page_objects ();

	/////////////////////////////////////////////////////////////////

	define_multi_player_setup_objects ();

	options_page [OPTIONS_PAGE_MULTIPLAYER] = multi_player_setup_area;

	/////////////////////////////////////////////////////////////////

	define_options_screen_common_objects ();

	/////////////////////////////////////////////////////////////////
}
Exemplo n.º 16
0
void define_campaign_screen_weapon_loading_page_objects (void)
{
	float
		x1,
		y1,
		x2,
		y2;

	char
		string [256];

	int
		loop,
		gunship,
		hardpoint;

	ui_object
		*page,
		*gunship_page;

	bar_graphic = create_texture_graphic ("graphics//ui//cohokum//map//fuelrep.psd");

	/////////////////////////////////////////////////////////////////
	// Main Page Area
	/////////////////////////////////////////////////////////////////

	x1 = CAMPAIGN_INSET_PAGE_X1;
	y1 = CAMPAIGN_INSET_PAGE_Y1;
	x2 = CAMPAIGN_INSET_PAGE_X2;
	y2 = CAMPAIGN_INSET_PAGE_Y2;

	campaign_page [CAMPAIGN_PAGE_WEAPON_LOADING] = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (campaign_screen),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_DRAWABLE (FALSE),
			UI_ATTR_DRAW_FUNCTION (update_weapon_loading_page_objects),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);

	page = campaign_page [CAMPAIGN_PAGE_WEAPON_LOADING];

	//
	// Clear buttons
	//

	for (gunship = 0; gunship < NUM_GUNSHIP_TYPES; gunship ++)
	{
		for (hardpoint = 0; hardpoint < NUM_WEAPON_LOADING_HARDPOINT_TYPES; hardpoint ++)
		{
			weapon_loading_button_list [gunship][hardpoint].valid = FALSE;
			weapon_loading_button_list [gunship][hardpoint].button_ptr = NULL;
		}
	}

	/////////////////////////////////////////////////////////////////
	// Gunship Pages

	x1 = 0.4;
	y1 = 0.0;
	x2 = 1.0;
	y2 = 1.0;

	for (loop = 0; loop < NUM_GUNSHIP_TYPES; loop ++)
	{
		weapon_loading_page [loop] = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (page),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_DRAWABLE (FALSE),
			UI_ATTR_DRAW_FUNCTION (update_weapon_loading_gunship_page),
			UI_ATTR_END
		);
	}

	/////////////////////////////////////////////////////////////////
	// APACHE PAGE
	/////////////////////////////////////////////////////////////////

	gunship = GUNSHIP_TYPE_APACHE;

	gunship_page = weapon_loading_page [gunship];

	set_ui_object_texture_graphic (gunship_page, create_texture_graphic ("graphics//ui//cohokum//map//payapa.psd"));

	define_weapon_loading_button_object (gunship_page, 0.5, 0.705, gunship, WEAPON_LOADING_HARDPOINT_GUN1);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.818, gunship, WEAPON_LOADING_HARDPOINT_INNER);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.888, gunship, WEAPON_LOADING_HARDPOINT_OUTER);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.959, gunship, WEAPON_LOADING_HARDPOINT_WINGTIP);

	/////////////////////////////////////////////////////////////////
	// HAVOC PAGE
	/////////////////////////////////////////////////////////////////

	gunship = GUNSHIP_TYPE_HAVOC;

	gunship_page = weapon_loading_page [gunship];

	set_ui_object_texture_graphic (gunship_page, create_texture_graphic ("graphics//ui//cohokum//map//payhav.psd"));

	define_weapon_loading_button_object (gunship_page, 0.5, 0.664, gunship, WEAPON_LOADING_HARDPOINT_GUN1);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.714, gunship, WEAPON_LOADING_HARDPOINT_GUN2);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.816, gunship, WEAPON_LOADING_HARDPOINT_INNER);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.887, gunship, WEAPON_LOADING_HARDPOINT_OUTER);

	/////////////////////////////////////////////////////////////////
	// COMANCHE PAGE
	/////////////////////////////////////////////////////////////////

	gunship = GUNSHIP_TYPE_COMANCHE;

	gunship_page = weapon_loading_page [gunship];

	set_ui_object_texture_graphic (gunship_page, create_texture_graphic ("graphics//ui//cohokum//map//paycom.psd"));

	define_weapon_loading_button_object (gunship_page, 0.5, 0.599, gunship, WEAPON_LOADING_HARDPOINT_GUN1);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.724, gunship, WEAPON_LOADING_HARDPOINT_INNER);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.795, gunship, WEAPON_LOADING_HARDPOINT_MID);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.866, gunship, WEAPON_LOADING_HARDPOINT_OUTER);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.938, gunship, WEAPON_LOADING_HARDPOINT_WINGTIP);

	/////////////////////////////////////////////////////////////////
	// HOKUM PAGE
	/////////////////////////////////////////////////////////////////

	gunship = GUNSHIP_TYPE_HOKUM;

	gunship_page = weapon_loading_page [gunship];

	set_ui_object_texture_graphic (gunship_page, create_texture_graphic ("graphics//ui//cohokum//map//payhok.psd"));

	define_weapon_loading_button_object (gunship_page, 0.5, 0.650, gunship, WEAPON_LOADING_HARDPOINT_GUN1);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.699, gunship, WEAPON_LOADING_HARDPOINT_GUN2);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.814, gunship, WEAPON_LOADING_HARDPOINT_INNER);

	define_weapon_loading_button_object (gunship_page, 0.5, 0.888, gunship, WEAPON_LOADING_HARDPOINT_OUTER);

	/////////////////////////////////////////////////////////////////
	// Member List Box

	x1 = 0.045;
	y1 = 0.026;
	x2 = 0.405;
	y2 = 0.176;

	sprintf (string, "%s:", get_trans ("Gunship"));

	create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXT (string),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	x1 = 0.048;
	y1 = 0.125;
	x2 = 0.500;
	y2 = 0.368;

	page_member_area = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_VSLIDER (0, 300, 12),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	set_common_slider_graphics (page_member_area);

	x1 = 0.0;
	y1 = 0.0;
	x2 = 0.9;
	y2 = 1.0;

	page_member_list = create_ui_object
			(
				UI_TYPE_LIST_BOX,
				UI_ATTR_PARENT (page_member_area),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_FUNCTION (notify_member_list),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_14),
				UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_DOWN),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// Default load-outs buttons

	x1 = 0.044;
	y1 = 0.347;
	x2 = 0.38;
	y2 = 0.404;

	sprintf (string, "%s:", get_trans ("Default Payload"));

	create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXT (string),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	x1 = 0.048;
	y1 = 0.417;
	x2 = 0.38;
	y2 = 0.576;

	page_default_payload_list = create_ui_object
			(
				UI_TYPE_LIST_BOX,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_FUNCTION (notify_default_payload_list),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_14),
				UI_ATTR_ITEM_NUMBER (ENTITY_INDEX_DONT_CARE),
				UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_DOWN),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// Current Gunship Mass

	x1 = 0.056;
	y1 = 0.897;
	x2 = 0.358;
	y2 = 0.928;

	page_auw_text = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_14),
				UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// Fuel Gauge

	x1 = 0.044;
	y1 = 0.615;
	x2 = 0.348;
	y2 = 0.652;

	sprintf (string, "%s:", get_trans ("Fuel"));

	page_fuel_text = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
				UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_TEXT (string),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	x1 = 0.054;
	y1 = 0.662;
	x2 = 0.358;
	y2 = 0.711;

	page_fuel_gauge = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics//ui//cohokum//map//smallbar.psd")),
				UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// Repairing Gauge

	x1 = 0.044;
	y1 = 0.757;
	x2 = 0.348;
	y2 = 0.800;

	sprintf (string, "%s:", get_trans ("Repairing"));

	page_repairing_text = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
				UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_TEXT (string),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	x1 = 0.054;
	y1 = 0.801;
	x2 = 0.358;
	y2 = 0.850;

	page_repairing_gauge = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics//ui//cohokum//map//smallbar.psd")),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
				UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// "Divider" graphics

	x1 = 0.021;
	y1 = 0.035;
	x2 = 0.389;
	y2 = 0.058;

	create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (common_divider_graphic),
				UI_ATTR_END
			);

	////////////////////////////////////

	x1 = 0.021;
	y1 = 0.321;
	x2 = 0.389;
	y2 = 0.344;

	create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (common_divider_graphic),
				UI_ATTR_END
			);

	////////////////////////////////////

	x1 = 0.021;
	y1 = 0.576;
	x2 = 0.389;
	y2 = 0.599;

	create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (common_divider_graphic),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// BACK button

	define_campaign_page_back_button (page, &page_back_button);
}
Exemplo n.º 17
0
static void update_weapon_loading_gunship_page (ui_object *obj, void *arg)
{
	entity
		*en;

	gunship_types
		gunship;

	weapon_loading_hardpoint_types
		hardpoint;

	int
		count,
		fixed,
		auw,
		weapon_type;

	float
		mass;

	ui_object
		*button_object;

	rgb_colour
		*col;

	ASSERT (obj);

	en = get_local_entity_safe_ptr (get_ui_object_item_number (obj));

	ASSERT (en);

	gunship = get_local_entity_int_value (en, INT_TYPE_GUNSHIP_TYPE);

	ASSERT (gunship < NUM_GUNSHIP_TYPES);

	if (get_helicopter_allowed_to_rearm (en))
	{
		fixed = FALSE;
	}
	else
	{
		fixed = TRUE;
	}

	//
	// Set button text
	//

	for (hardpoint = 0; hardpoint < NUM_WEAPON_LOADING_HARDPOINT_TYPES; hardpoint ++)
	{
		if (weapon_loading_button_list [gunship][hardpoint].valid)
		{
			button_object = weapon_loading_button_list [gunship][hardpoint].button_ptr;

			weapon_type = weapon_loading_get_current_hardpoint_weapon (gunship, hardpoint);

			//
			// Set Text
			//

			if (weapon_type != ENTITY_SUB_TYPE_WEAPON_NO_WEAPON)
			{
				count = get_weapon_loading_hardpoint_weapon_count (en, hardpoint, weapon_type);

				sprintf (buffer, "%dx %s", count, weapon_database [weapon_type].weapon_loading_list_name);
			}
			else
			{
				sprintf (buffer, "%s", weapon_database [weapon_type].weapon_loading_list_name);
			}

			set_ui_object_text (button_object, buffer);

			//
			// Set Button Attributes
			//

			if ((fixed) || (weapon_loading_get_valid_weapon_count (en, hardpoint) < 2))
			{
				set_ui_object_notify_on (button_object, NOTIFY_TYPE_NONE);

				set_ui_object_highlightable (button_object, FALSE);

				col = &ui_ingame_dead_text_colour;

				set_ui_object_font_colour (button_object, col->r, col->g, col->b, col->a);
			}
			else
			{
				set_ui_object_notify_on (button_object, NOTIFY_TYPE_BUTTON_DOWN);

				set_ingame_ui_object_mouse_over_properties (button_object);
			}
		}
	}

	//
	// All-Up-Weight (player only)
	//

	if (en == get_gunship_entity ())
	{
		mass = set_flight_dynamics_mass ();

		convert_float_to_int (mass, &auw);

		sprintf (buffer, "%s: %dkg", get_trans ("All Up Weight"), auw);

		set_ui_object_text (page_auw_text, buffer);
	}
	else
	{
		set_ui_object_text (page_auw_text, "");
	}

	//
	// Fuel Page (player only)
	//

	if (en == get_gunship_entity ())
	{
		sprintf (buffer, " %.0fkg", get_current_flight_dynamics_fuel_weight ());

		set_ui_object_text (page_fuel_gauge, buffer);

		set_ui_object_drawable (page_fuel_text, TRUE);

		set_ui_object_drawable (page_fuel_gauge, TRUE);

		draw_weapon_loading_gauge (page_fuel_gauge, get_dynamics_normalised_fuel_value ());
	}
	else
	{
		set_ui_object_drawable (page_fuel_text, FALSE);

		set_ui_object_drawable (page_fuel_gauge, FALSE);
	}

	//
	// Damage Page (player only)
	//

	set_ui_object_drawable (page_repairing_text, FALSE);

	set_ui_object_drawable (page_repairing_gauge, FALSE);

	if (en == get_gunship_entity ())
	{
		int
			repair_index;

		float
			level,
			repair_time;

		if (current_flight_dynamics->repairing_damage != DYNAMICS_DAMAGE_NONE)
		{
			repair_index = get_dynamics_damage_currently_repairing_type ();

			repair_time = dynamics_damage_database [repair_index].repair_time;

			if (repair_time == 0.0)
			{
				level = 1.0;
			}
			else
			{
				level = 1.0 - (current_flight_dynamics->damage_repair_time / repair_time);

				level = bound (level, 0.0, 1.0);
			}

			sprintf (buffer, " %s", get_trans (dynamics_damage_database [repair_index].name));

			set_ui_object_text (page_repairing_gauge, buffer);

			set_ui_object_drawable (page_repairing_text, TRUE);

			set_ui_object_drawable (page_repairing_gauge, TRUE);

			draw_weapon_loading_gauge (page_repairing_gauge, level);
		}
	}
}
Exemplo n.º 18
0
static void draw_chat_send_button (ui_object *obj, void *arg)
{
	entity
		*current_target;

	rgb_colour
		*col;
		
	static const char
		*text;
	static char
		s [256];

	sprintf (s, "%s: ", get_trans ("SEND TO"));

	current_target = get_local_entity_safe_ptr (get_ui_object_item_number (obj));

	if (current_target)
	{
		switch (get_local_entity_type (current_target))
		{
			case ENTITY_TYPE_SESSION:
			{
				strcat (s, get_trans ("CHAT_TARGET_ALL"));

				break;
			}
			case ENTITY_TYPE_FORCE:
			{
				strcat (s, get_local_entity_string (current_target, STRING_TYPE_FORCE_NAME));

				break;
			}
			case ENTITY_TYPE_PILOT:
			{
				strcat (s, get_local_entity_string (current_target, STRING_TYPE_PILOTS_NAME));

				break;
			}
			default:
			{
				current_target = NULL;
			
				build_chat_target_list ();

				break;
			}
		}
	}

	set_ui_object_text (obj, s);

	if (current_target)
	{
		text = get_ui_object_text (chat_current_text);

		if (text)
		{
			if (strlen (text) > 0)
			{
				set_ingame_ui_object_mouse_over_properties (obj);

				set_ui_object_notify_on (obj, NOTIFY_TYPE_BUTTON_DOWN);

				return;
			}
		}
	}

	set_ui_object_notify_on (obj, NOTIFY_TYPE_NONE);

	set_ui_object_highlightable (obj, FALSE);

	col = &ui_ingame_dead_text_colour;

	set_ui_object_font_colour (obj, col->r, col->g, col->b, col->a);
}
Exemplo n.º 19
0
void initialise_advert_screen (void)
{
//	ui_object
//		*temp;

	float
		x1,
		y1,
		x2,
		y2;

//	unsigned char
//		string [256];

	x1 = 0.0;
	y1 = 0.0;
	x2 = 1.0;
	y2 = 1.0;

	/////////////////////////////////////////////////////////////////

   advert_screen = create_ui_object
            (
               UI_TYPE_SCREEN,
					UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
					UI_ATTR_VIRTUAL_SIZE (x2, y2),
					UI_ATTR_COLOUR_START (255, 255, 255, 0),
					UI_ATTR_COLOUR_END (255, 255, 255, 255),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_DISPLAYED),
					UI_ATTR_FUNCTION (notify_advert_screen),
               UI_ATTR_END
            );
/*
	// combat

	x1 = 0.030;
	y1 = 0.050;
	x2 = 0.180;
	y2 = 0.040;


	sprintf (string, "%s", get_trans ("advert combat title"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (advert_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_IMPACT_22),
      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_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (string),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

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

	x1 = 0.066;
	y1 += ADVERT_TEXT_Y_OFFSET;
	x2 = 0.180;
	y2 = 0.040;

	sprintf (string, "%s", get_trans ("advert combat text 1"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (advert_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (255, 255, 255, 0),
      UI_ATTR_FONT_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (string),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

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

	// missions

	x1 = 0.438;
	y1 = 0.268;
	x2 = 0.180;
	y2 = 0.040;


	sprintf (string, "%s", get_trans ("advert missions title"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (advert_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_IMPACT_22),
      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_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (string),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

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

	x1 = 0.474;
	y1 += ADVERT_TEXT_Y_OFFSET;
	x2 = 0.180;
	y2 = 0.040;

	sprintf (string, "%s", get_trans ("advert missions text 1"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (advert_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (255, 255, 255, 0),
      UI_ATTR_FONT_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (string),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

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

	// campaigns

	x1 = 0.084;
	y1 = 0.480;
	x2 = 0.180;
	y2 = 0.040;


	sprintf (string, "%s", get_trans ("advert campaigns title"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (advert_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_IMPACT_22),
      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_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (string),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

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

	x1 = 0.120;
	y1 += ADVERT_TEXT_Y_OFFSET;
	x2 = 0.180;
	y2 = 0.040;

	sprintf (string, "%s", get_trans ("advert campaigns text 1"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (advert_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (255, 255, 255, 0),
      UI_ATTR_FONT_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (string),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

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

	// multiplayer

	x1 = 0.541;
	y1 = 0.687;
	x2 = 0.180;
	y2 = 0.040;


	sprintf (string, "%s", get_trans ("advert multiplayer title"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (advert_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_IMPACT_22),
      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_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (string),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

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

	x1 = 0.577;
	y1 += ADVERT_TEXT_Y_OFFSET;
	x2 = 0.180;
	y2 = 0.040;

	sprintf (string, "%s", get_trans ("advert multiplayer text 1"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (advert_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (255, 255, 255, 0),
      UI_ATTR_FONT_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (string),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

	preprocess_translation_object_size (temp, NULL, NULL, 0, RESIZE_OPTION_FIXED_BUTTON);
*/
	/////////////////////////////////////////////////////////////////
	// Ok Button

	advert_ok_button = create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (advert_screen),
				UI_ATTR_VIRTUAL_POSITION (0.021, 0.915),
				UI_ATTR_VIRTUAL_SIZE (OPTIONS_OK_BUTTON_X, OPTIONS_OK_BUTTON_Y),
				UI_ATTR_TEXT (get_trans("UI_OK")),
				UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
				UI_ATTR_FUNCTION (notify_select_player_exit_button),
				UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_22),
				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_DRAWABLE (FALSE),
				UI_ATTR_END
			);
}
Exemplo n.º 20
0
void define_options_screen_controller_page_objects (void)
{
	int
		i = 0;

	float
		x1,
		y1,
		x2,
		y2;

	ui_object
		*page;

	ui_object
		*title_change_array [6],
		*check_array [6],
		*change_array [6];

	/////////////////////////////////////////////////////////////////
	// Initialise Button Strings

	option_joystick_text [0] = get_trans ("UI_KEYBOARD");
	option_joystick_text [1] = get_trans ("UI_JOYSTICK");

	option_throttle_text [0] = get_trans ("UI_KEYBOARD");
	option_throttle_text [1] = get_trans ("Throttle");

	option_pedal_text [0] = get_trans ("UI_KEYBOARD");
	option_pedal_text [1] = get_trans ("Rudder Pedals");

	no_joystick_text = get_trans ("UI_NONE_AVAILABLE");

	option_boolean_text [0] = get_trans ("Off");
	option_boolean_text [1] = get_trans ("On");

	/////////////////////////////////////////////////////////////////
	// Controller Area

	x1 = 0.0;
	y1 = 0.0;
	x2 = 1.0;
	y2 = 1.0;

	options_page [OPTIONS_PAGE_CONTROLLER] = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (options_screen),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2, y2),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_DRAWABLE (FALSE),
				UI_ATTR_FUNCTION (NOTIFY_TYPE_NONE),
				UI_ATTR_END
			);

	page = options_page [OPTIONS_PAGE_CONTROLLER];

	// areas and titles

	// cyclic

	x1 = 0.0;
	y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

   cyclic_area = create_ui_object
									(
										UI_TYPE_AREA,
										UI_ATTR_PARENT (page),
										UI_ATTR_VIRTUAL_POSITION (x1, y1),
										UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
										UI_ATTR_CLEAR (TRUE),
										UI_ATTR_END
									);

	x1 = OPTION_TITLE_OFFSET_X;
	y1 = 0.0;

	title_change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (cyclic_area),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_END
	);

   check_array[i] = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (title_change_array [i]),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
      UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
		UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
		UI_ATTR_TEXT (get_trans ("UI_CYCLIC")),
		UI_ATTR_END
	);

	preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

	// collective

	i++;
	x1 = 0.0;
	y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

   collective_area = create_ui_object
								(
									UI_TYPE_AREA,
									UI_ATTR_PARENT ( page ),
									UI_ATTR_VIRTUAL_POSITION (x1, y1),
									UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
									UI_ATTR_CLEAR (TRUE),
									UI_ATTR_END
								);

	x1 = OPTION_TITLE_OFFSET_X;
	y1 = 0.0;

	title_change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (collective_area),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_END
	);

   check_array[i] = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (title_change_array [i]),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
      UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
		UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
		UI_ATTR_TEXT (get_trans ("UI_COLLECTIVE")),
		UI_ATTR_END
	);

	preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

	// pedal area

	i++;
	x1 = 0.0;
	y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

   pedal_area = create_ui_object
								(
									UI_TYPE_AREA,
									UI_ATTR_PARENT ( page ),
									UI_ATTR_VIRTUAL_POSITION (x1, y1),
									UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
									UI_ATTR_CLEAR (TRUE),
									UI_ATTR_END
								);

	x1 = OPTION_TITLE_OFFSET_X;
	y1 = 0.0;

	title_change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (pedal_area),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_END
	);

   check_array[i] = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (title_change_array [i]),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
      UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
		UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
		UI_ATTR_TEXT (get_trans ("UI_PEDAL")),
		UI_ATTR_END
	);

	preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

	//device area

	i++;
	x1 = 0.0;
	y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

   device_area = create_ui_object
										(
											UI_TYPE_AREA,
											UI_ATTR_PARENT (page),
											UI_ATTR_VIRTUAL_POSITION (x1, y1),
											UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
											UI_ATTR_CLEAR (TRUE),
											UI_ATTR_END
										);

	x1 = OPTION_TITLE_OFFSET_X;
	y1 = 0.0;

	title_change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (device_area),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_END
	);

   check_array[i] = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (title_change_array [i]),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
      UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
		UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
		UI_ATTR_TEXT (get_trans ("UI_DEVICE")),
		UI_ATTR_END
	);

	preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

	//reverse throttle area

	i++;
	x1 = 0.0;
	y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

   reverse_throttle_area = create_ui_object
										(
											UI_TYPE_AREA,
											UI_ATTR_PARENT (page),
											UI_ATTR_VIRTUAL_POSITION (x1, y1),
											UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
											UI_ATTR_CLEAR (TRUE),
											UI_ATTR_END
										);

	x1 = OPTION_TITLE_OFFSET_X;
	y1 = 0.0;

	title_change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (reverse_throttle_area),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_END
	);

   check_array[i] = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (title_change_array [i]),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
      UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
		UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
		UI_ATTR_TEXT (get_trans ("Reverse Throttle")),
		UI_ATTR_END
	);

	preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

	//keyboard_assist area

	i++;
	x1 = 0.0;
	y1 = OPTION_TITLE_OFFSET_Y + OPTION_AREA_OFFSET_Y * i;

   keyboard_assist_area = create_ui_object
								(
									UI_TYPE_AREA,
									UI_ATTR_PARENT ( page ),
									UI_ATTR_VIRTUAL_POSITION (x1, y1),
									UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
									UI_ATTR_CLEAR (TRUE),
									UI_ATTR_END
								);

	x1 = OPTION_TITLE_OFFSET_X;
	y1 = 0.0;

	title_change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (keyboard_assist_area),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
		UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
		UI_ATTR_END
	);

   check_array[i] = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (title_change_array[i]),
		UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
      UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
		UI_ATTR_TEXT (get_trans ("Keyboard Assist")),
		UI_ATTR_END
	);

	preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);


	/////////////////////////////////////////////////////////////////
	// buttons

	i = 0;

	// cyclic

	change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (cyclic_area),
		UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_MEDIUM_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_medium),
		UI_ATTR_END
	);

	cyclic_option_button = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (cyclic_area),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
		UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
		UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (""),
      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_STATE (UI_OBJECT_STATE_OFF),
		UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
		UI_ATTR_FUNCTION (notify_cyclic_option_button),
		UI_ATTR_END
	);

	preprocess_translation_object_size (change_array [i], cyclic_option_button, option_joystick_text, 2, RESIZE_OPTION_CYCLE_BUTTON);

	// collective

	i++;

	change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (collective_area),
		UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_MEDIUM_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_medium),
		UI_ATTR_END
	);

   collective_option_button = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (collective_area),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
		UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
		UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (""),
      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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
		UI_ATTR_FUNCTION (notify_collective_option_button),
		UI_ATTR_END
	);

	preprocess_translation_object_size (change_array [i], collective_option_button, option_throttle_text, 2, RESIZE_OPTION_CYCLE_BUTTON);

	// pedal button

	i++;

	change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (pedal_area),
		UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_LARGE_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
		UI_ATTR_END
	);

   pedal_option_button = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (pedal_area),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
		UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
		UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (""),
      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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
		UI_ATTR_FUNCTION (notify_pedal_option_button),
		UI_ATTR_END
	);

	preprocess_translation_object_size (change_array [i], pedal_option_button, option_pedal_text, 2, RESIZE_OPTION_CYCLE_BUTTON);

	//device button

	i++;

	change_array[i] = device_graphic_area = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (device_area),
		UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_LARGE_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
		UI_ATTR_END
	);

   device_option_button = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (device_area),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
		UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
		UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (""),
      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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
		UI_ATTR_FUNCTION (notify_device_option_button),
		UI_ATTR_END
	);

	//reverse throttle button

	i++;

	change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (reverse_throttle_area),
		UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_SMALL_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 0),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_small),
		UI_ATTR_END
	);

   reverse_throttle_button = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (reverse_throttle_area),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
		UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
		UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (""),
      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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
		UI_ATTR_FUNCTION (notify_reverse_throttle_option_button),
		UI_ATTR_END
	);

	preprocess_translation_object_size (change_array [i], reverse_throttle_button, option_boolean_text, 2, RESIZE_OPTION_CYCLE_BUTTON);

	// keyboard_assist

	i++;

	change_array[i] = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (keyboard_assist_area),
		UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
		UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_SMALL_WIDTH, OPTION_BOX_HEIGHT),
		UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
		UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
		UI_ATTR_TEXTURE_GRAPHIC (options_box_small),
		UI_ATTR_END
	);

   keyboard_assist_option_button = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (keyboard_assist_area),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
		UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
		UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		UI_ATTR_TEXT (""),
      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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
		UI_ATTR_FUNCTION (notify_keyboard_assist_option_button),
		UI_ATTR_END
	);

	preprocess_translation_object_size (change_array [i], keyboard_assist_option_button, option_boolean_text, 2, RESIZE_OPTION_CYCLE_BUTTON);

	recursively_set_object_time (page, OPTIONS_BUTTON_AREA_FADE_TIME, OPTIONS_BUTTON_AREA_OFFSET_TIME);

}
Exemplo n.º 21
0
void define_campaign_screen_chat_page_objects (void)
{
	float
		x1,
		y1,
		x2,
		y2;

	ui_object
		*page;

	char
		string [256];

	/////////////////////////////////////////////////////////////////
	// Main Page Area
	/////////////////////////////////////////////////////////////////

	x1 = CAMPAIGN_INSET_PAGE_X1;
	y1 = CAMPAIGN_INSET_PAGE_Y1;
	x2 = CAMPAIGN_INSET_PAGE_X2;
	y2 = CAMPAIGN_INSET_PAGE_Y2;

	campaign_page [CAMPAIGN_PAGE_CHAT] = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (campaign_screen),
			UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_CENTRE_TOP),
			UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_14),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_DRAWABLE (FALSE),
			UI_ATTR_DRAW_FUNCTION (update_chat_page_objects),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);

	page = campaign_page [CAMPAIGN_PAGE_CHAT];

	/////////////////////////////////////////////////////////////////
	// Chat Target/Message Window

	x1 = 0.0;
	y1 = 0.068;
	x2 = 0.502;
	y2 = 0.109;

	chat_window_mode_area = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics\\ui\\cohokum\\map\\chattabs.psd")),
				UI_ATTR_END
			);

	x1 = 0.0;
	y1 = 0.0;
	x2 = 0.5;
	y2 = 1.0;

	chat_window_destination_button = create_ui_object
			(
				UI_TYPE_RADIO,
				UI_ATTR_PARENT (chat_window_mode_area),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_TEXT (get_trans ("Destination")),
				UI_ATTR_FUNCTION (notify_show_destinations),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	set_ingame_ui_object_mouse_over_properties (chat_window_destination_button);

	x1 = 0.5;
	y1 = 0.0;
	x2 = 1.0;
	y2 = 1.0;

	chat_window_message_button = create_ui_object
			(
				UI_TYPE_RADIO,
				UI_ATTR_PARENT (chat_window_mode_area),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_TEXT (get_trans ("Messages")),
				UI_ATTR_FUNCTION (notify_show_messages),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	set_ingame_ui_object_mouse_over_properties (chat_window_message_button);

	x1 = 0.057;
	y1 = 0.152;
	x2 = 0.931;
	y2 = 0.625;

	chat_window_area = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// Target List Area

	x1 = 0.0;
	y1 = 0.0;
	x2 = 1.0;
	y2 = 1.0;

	chat_target_list_area = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (chat_window_area),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_VSLIDER (0, 300, 12),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	set_common_slider_graphics (chat_target_list_area);

	// List Box

	x1 = 0.0;
	y1 = 0.0;
	x2 = 0.95;
	y2 = 1.0;

	chat_target_list = create_ui_object
				(
					UI_TYPE_LIST_BOX,
					UI_ATTR_PARENT (chat_target_list_area),
					UI_ATTR_VIRTUAL_POSITION (x1, y1),
					UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
					UI_ATTR_CLEAR (TRUE),
					UI_ATTR_FUNCTION (notify_target_list),
					UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
					UI_ATTR_ITEM_NUMBER (ENTITY_INDEX_DONT_CARE),
					UI_ATTR_END
				);

	/////////////////////////////////////////////////////////////////
	// Message list

	x1 = 0.0;
	y1 = 0.0;
	x2 = 1.0;
	y2 = 1.0;

	chat_message_list_area = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (chat_window_area),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_VSLIDER (0, 300, 12),
			UI_ATTR_END
		);

	set_common_slider_graphics (chat_message_list_area);

	x1 = 0.0;
	y1 = 0.0;
	x2 = 0.95;
	y2 = 1.0;

	chat_message_list = create_ui_object
			(
				UI_TYPE_LIST_BOX,
				UI_ATTR_PARENT (chat_message_list_area),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_NONE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// Chat Text area

	x1 = 0.100;
	y1 = 0.720;
	x2 = 0.876;
	y2 = 0.756;

	sprintf (string, "%s:", get_trans ("Enter Message"));

	create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
				UI_ATTR_TEXT (string),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	x1 = 0.123;
	y1 = 0.762;
	x2 = 0.876;
	y2 = 0.834;

	chat_text_area = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics\\ui\\cohokum\\map\\msgbar.psd")),
				UI_ATTR_FUNCTION (chat_enter_message_function),
				UI_ATTR_END
			);

	// Chat Input

	x1 = 0.04;
	y1 = 0.25;
	x2 = 1.0;
	y2 = 1.0;

   chat_input = create_ui_object
            (
               UI_TYPE_INPUT,
               UI_ATTR_PARENT (chat_text_area),
					UI_ATTR_VIRTUAL_POSITION (x1, y1),
					UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
					UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
					UI_ATTR_FONT_COLOUR (ui_ingame_selected_text_colour.r, ui_ingame_selected_text_colour.g, ui_ingame_selected_text_colour.b, ui_ingame_selected_text_colour.a),
					UI_ATTR_FUNCTION (chat_input_function),
					UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
					UI_ATTR_TEXT (""),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );

	// Chat Output

	x1 = 0.04;
	y1 = 0.16;
	x2 = 1.0;
	y2 = 1.0;

   chat_current_text = create_ui_object
            (
               UI_TYPE_AREA,
               UI_ATTR_PARENT (chat_text_area),
					UI_ATTR_VIRTUAL_POSITION (x1, y1),
					UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
					UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
					UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
					UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
					UI_ATTR_TEXT (""),
					UI_ATTR_FUNCTION (chat_enter_message_function),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );

	/////////////////////////////////////////////////////////////////
	// Send Button

	x1 = 0.235;
	y1 = 0.834;
	x2 = 0.763;
	y2 = 0.884;

	chat_send_button = create_ui_object
			(
				UI_TYPE_BUTTON,
            UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_TEXT (get_trans ("UI_SEND")),
				UI_ATTR_FUNCTION (notify_send_message),
				UI_ATTR_DRAW_FUNCTION (draw_chat_send_button),
				UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics\\ui\\cohokum\\map\\sendbtn.psd")),
				UI_ATTR_END
			);

	set_ingame_ui_object_mouse_over_properties (chat_send_button);

	/////////////////////////////////////////////////////////////////
	// "Divider" graphics

	x1 = 0.022;
	y1 = 0.109;
	x2 = 0.971;
	y2 = 0.133;

	create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (common_divider_graphic),
				UI_ATTR_END
			);

	x1 = 0.022;
	y1 = 0.644;
	x2 = 0.971;
	y2 = 0.667;

	create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (page),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_TEXTURE_GRAPHIC (common_divider_graphic),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// BACK button

	define_campaign_page_back_button (page, &page_back_button);
}
Exemplo n.º 22
0
void initialise_dedicated_server_screen (void)
{
	float
		x, y;

	dedicated_server_screen = create_ui_object
		(
			UI_TYPE_SCREEN,
			UI_ATTR_POSITION (0, 0),
			UI_ATTR_VIRTUAL_SIZE (1.0, 1.0),
			UI_ATTR_FUNCTION (dedicated_server_function),
			UI_ATTR_DRAW_FUNCTION (dedicated_screen_update_function),
			UI_ATTR_END
		);

	create_ui_object
			(
				UI_TYPE_TEXT,
				UI_ATTR_PARENT (dedicated_server_screen),
				UI_ATTR_VIRTUAL_POSITION (0.66, 0.141666),
				UI_ATTR_TEXT ("Dedicated Server"),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22),
				UI_ATTR_END
			);

	x = 0.125;
	y = 0.62;

	dedicated_server_title_text = create_ui_object
			(
				UI_TYPE_TEXT,
				UI_ATTR_PARENT (dedicated_server_screen),
				UI_ATTR_VIRTUAL_POSITION (x, y),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22),
				UI_ATTR_END
			);

	x = 0.125;
	y += 0.0625;

	dedicated_server_map_text = create_ui_object
			(
				UI_TYPE_TEXT,
				UI_ATTR_PARENT (dedicated_server_screen),
				UI_ATTR_VIRTUAL_POSITION (x, y),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22),
				UI_ATTR_END
			);

	x = 0.125;
	y += 0.0625;

	dedicated_server_game_text = create_ui_object
			(
				UI_TYPE_TEXT,
				UI_ATTR_PARENT (dedicated_server_screen),
				UI_ATTR_VIRTUAL_POSITION (x, y),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22),
				UI_ATTR_END
			);

	x = 0.125;
	y += 0.0625;

	dedicated_server_time_text = create_ui_object
			(
				UI_TYPE_TEXT,
				UI_ATTR_PARENT (dedicated_server_screen),
				UI_ATTR_VIRTUAL_POSITION (x, y),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22),
				UI_ATTR_END
			);

	dedicated_server_quit_button = create_ui_object
								(
									UI_TYPE_BUTTON,
									UI_ATTR_PARENT (dedicated_server_screen),
									UI_ATTR_VIRTUAL_POSITION (0.0, 0.89583),
									UI_ATTR_VIRTUAL_SIZE (0.125, 0.0625),
									UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22),
									UI_ATTR_TEXT (get_trans("UI_EXIT")),
									UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_EITHER),
									UI_ATTR_FUNCTION (notify_dedicated_server_quit_button),
									UI_ATTR_HIGHLIGHTABLE (TRUE),
									UI_ATTR_CLEAR (TRUE),
									UI_ATTR_END
								);

	/////////////////////////////////////////////////////////////////
	// List of players

	{
		float
			x1, y1,
			x2, y2;
			
		x1 = 0.125;
		y1 = 0.175;
		x2 = 0.6;
		y2 = 0.6;

		player_list_area = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (dedicated_server_screen),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
				UI_ATTR_VSLIDER (0, 300, 12),
				UI_ATTR_TEXTURE_GRAPHIC (list_box_graphic),
				UI_ATTR_END
			);

		set_frontend_slider_graphics (player_list_area);

		// List Box

		x1 = 0.05;
		y1 = 0.05;
		x2 = 0.95;
		y2 = 0.95;

		player_list = create_ui_object
				(
					UI_TYPE_LIST_BOX,
					UI_ATTR_PARENT (player_list_area),
					UI_ATTR_VIRTUAL_POSITION (x1, y1),
					UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
					UI_ATTR_CLEAR (TRUE),
					UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_NONE),
					UI_ATTR_END
				);
	}
}
Exemplo n.º 23
0
void rebuild_default_payload_list (entity *en)
{
	int
		fixed;

	ui_object
		*new_item;

	ASSERT (en);

	ui_object_destroy_list_items (page_default_payload_list);

	if (get_local_entity_int_value (en, INT_TYPE_GUNSHIP_TYPE) < NUM_GUNSHIP_TYPES)
	{
		fixed = (!get_helicopter_allowed_to_rearm (en));
	}
	else
	{
		fixed = TRUE;
	}

	//

	sprintf (buffer, "%s", get_trans ("Air to Ground"));

	new_item = add_to_pop_up_list (buffer, page_default_payload_list, NULL, INT_TYPE_AIR_TO_SURFACE_WEAPON_CONFIG_TYPE, UI_FONT_ARIAL_14, ui_ingame_dead_text_colour);

	if (!fixed)
	{
		set_ingame_ui_object_mouse_over_properties (new_item);

		set_ui_object_notify_on (new_item, NOTIFY_TYPE_BUTTON_DOWN);
	}
	else
	{
		set_ui_object_notify_on (new_item, NOTIFY_TYPE_NONE);
	}

	//

	sprintf (buffer, "%s", get_trans ("Air to Air"));

	new_item = add_to_pop_up_list (buffer, page_default_payload_list, NULL, INT_TYPE_AIR_TO_AIR_WEAPON_CONFIG_TYPE, UI_FONT_ARIAL_14, ui_ingame_dead_text_colour);

	if (!fixed)
	{
		set_ingame_ui_object_mouse_over_properties (new_item);

		set_ui_object_notify_on (new_item, NOTIFY_TYPE_BUTTON_DOWN);
	}
	else
	{
		set_ui_object_notify_on (new_item, NOTIFY_TYPE_NONE);
	}

	//

	sprintf (buffer, "%s", get_trans ("Scout"));

	new_item = add_to_pop_up_list (buffer, page_default_payload_list, NULL, INT_TYPE_SCOUT_WEAPON_CONFIG_TYPE, UI_FONT_ARIAL_14, ui_ingame_dead_text_colour);

	if (!fixed)
	{
		set_ingame_ui_object_mouse_over_properties (new_item);

		set_ui_object_notify_on (new_item, NOTIFY_TYPE_BUTTON_DOWN);
	}
	else
	{
		set_ui_object_notify_on (new_item, NOTIFY_TYPE_NONE);
	}
}
Exemplo n.º 24
0
void set_camera_mode (camera *raw, camera_modes mode, int auto_edit)
{
	ASSERT (raw);

/*
	if ((mode >= 0) && (mode < NUM_CAMERA_MODES))
	{
		debug_log ("Setting camera mode to %s", camera_mode_names[mode]);
	}*/

	// Jabberwock 031009 - Satellite view - only satellite view for sites
	if (get_local_entity_type (raw->external_view_entity) == ENTITY_TYPE_KEYSITE)
	{ 
		mode = CAMERA_MODE_SATELLITE;
		auto_edit = 0;
	}
	// Jabberwock 031009 ends
	
	
	if (auto_edit)
	{
		if (!raw->auto_edit)
		{
			set_status_message (get_trans ("Auto-action camera"), STATUS_MESSAGE_TYPE_CAMERA);
		}
	}
	else
	{
		const char
			*s;

		s = get_camera_mode_name (mode);

		if (s)
		{
			set_status_message (get_trans (s), STATUS_MESSAGE_TYPE_CAMERA);
		}
	}
	
	switch (mode)
	{
		////////////////////////////////////////
		case CAMERA_MODE_CHASE:
		////////////////////////////////////////
		{
			reset_chase_camera (raw);

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_END_OF_MISSION:
		////////////////////////////////////////
		{
			reset_end_of_mission_camera (raw);

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_DROP:
		////////////////////////////////////////
		{
			reset_drop_camera (raw);

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_STATIC:
		////////////////////////////////////////
		{
			reset_static_camera (raw);

			break;
		}
		
		// Jabberwock 031009 Satellite view
		case CAMERA_MODE_SATELLITE:
		////////////////////////////////////////
		{
			reset_satellite_camera (raw);

			break;
		}
		
		// Jabberwock 031009 ends
		
		////////////////////////////////////////
		case CAMERA_MODE_EJECT:
		////////////////////////////////////////
		{
			reset_eject_camera (raw);

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_FLY_BY:
		////////////////////////////////////////
		{
			reset_fly_by_camera (raw);

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_CINEMATIC:
		////////////////////////////////////////
		{
			reset_cinematic_camera (raw);

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_BUILDING:
		////////////////////////////////////////
		{
			reset_building_camera (raw);

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_WEAPON:
		////////////////////////////////////////
		{
			if (weapon_camera_valid (raw))
			{
				reset_weapon_camera (raw);
			}
			else
			{
				mode = CAMERA_MODE_CHASE;

				reset_chase_camera (raw);
			}

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_WEAPON_EXPLOSION:
		////////////////////////////////////////
		{
			reset_weapon_explosion_camera (raw);

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_DEBRIEFING:
		////////////////////////////////////////
		{
			if (debriefing_camera_valid (raw))
			{
				reset_debriefing_camera (raw);
			}
			else
			{
				mode = CAMERA_MODE_CHASE;

				reset_chase_camera (raw);
			}

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_RECOGNITION_GUIDE_TOP_VIEW:
		////////////////////////////////////////
		{
			if (recognition_guide_top_view_camera_valid (raw))
			{
				reset_recognition_guide_top_view_camera (raw);
			}
			else
			{
				mode = CAMERA_MODE_CHASE;

				reset_chase_camera (raw);
			}

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_RECOGNITION_GUIDE_SIDE_VIEW:
		////////////////////////////////////////
		{
			if (recognition_guide_side_view_camera_valid (raw))
			{
				reset_recognition_guide_side_view_camera (raw);
			}
			else
			{
				mode = CAMERA_MODE_CHASE;

				reset_chase_camera (raw);
			}

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_RECOGNITION_GUIDE_FRONT_VIEW:
		////////////////////////////////////////
		{
			if (recognition_guide_front_view_camera_valid (raw))
			{
				reset_recognition_guide_front_view_camera (raw);
			}
			else
			{
				mode = CAMERA_MODE_CHASE;

				reset_chase_camera (raw);
			}

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_RECOGNITION_GUIDE_3D_VIEW:
		////////////////////////////////////////
		{
			if (recognition_guide_3d_view_camera_valid (raw))
			{
				reset_recognition_guide_3d_view_camera (raw);
			}
			else
			{
				mode = CAMERA_MODE_CHASE;

				reset_chase_camera (raw);
			}

			break;
		}
		////////////////////////////////////////
		case CAMERA_MODE_FREE:
		////////////////////////////////////////
		{
			{
				mode = CAMERA_MODE_FREE;

				reset_free_camera (raw);
			}

			break;
		}
		////////////////////////////////////////
		default:
		////////////////////////////////////////
		{
			debug_fatal ("Invalid camera mode = %d", mode);

			break;
		}
	}

	raw->camera_mode = mode;

	raw->auto_edit = auto_edit;
}
Exemplo n.º 25
0
void define_options_screen_realism_page_objects (void)
{
    int
    i = 0;

    float
    x1,
    y1,
    x2,
    y2;

    ui_object
    *page;

    ui_object
    *title_change_array [5],
    *check_array [5],
    *change_array [5];

    /////////////////////////////////////////////////////////////////
    // Initialise Button Strings

    option_boolean_text [0] = get_trans ("Off");
    option_boolean_text [1] = get_trans ("On");

    option_cpg_text [0] = get_trans ("Off");
    option_cpg_text [1] = get_trans ("Novice");
    option_cpg_text [2] = get_trans ("Realistic");

    option_avionics_text [0] = get_trans ("Realistic");
    option_avionics_text [1] = get_trans ("Novice");

    option_difficulty_text [0] = get_trans ("Hard");
    option_difficulty_text [1] = get_trans ("Medium");
    option_difficulty_text [2] = get_trans ("Easy");

    option_cpg_report_targets_text[0] = get_trans ("Off");
    option_cpg_report_targets_text[1] = get_trans ("On");

    /////////////////////////////////////////////////////////////////
    // realism Area

    x1 = 0.0;
    y1 = 0.0;
    x2 = 1.0;
    y2 = 1.0;

    options_page [OPTIONS_PAGE_REALISM] = create_ui_object
                                          (
                                                  UI_TYPE_AREA,
                                                  UI_ATTR_PARENT (options_screen),
                                                  UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                                  UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                                                  UI_ATTR_CLEAR (TRUE),
                                                  UI_ATTR_DRAWABLE (FALSE),
                                                  UI_ATTR_FUNCTION (NOTIFY_TYPE_NONE),
                                                  UI_ATTR_END
                                          );

    page = options_page [OPTIONS_PAGE_REALISM];

    // areas and titles

    // co_pilot_target_area

    x1 = 0.0;
    y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

    co_pilot_target_area = create_ui_object
                           (
                               UI_TYPE_AREA,
                               UI_ATTR_PARENT (page),
                               UI_ATTR_VIRTUAL_POSITION (x1, y1),
                               UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
                               UI_ATTR_CLEAR (TRUE),
                               UI_ATTR_END
                           );

    x1 = OPTION_TITLE_OFFSET_X;
    y1 = 0.0;

    title_change_array[i] = create_ui_object
                            (
                                UI_TYPE_AREA,
                                UI_ATTR_PARENT (co_pilot_target_area),
                                UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
                                UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                                UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                                UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
                                UI_ATTR_END
                            );

    check_array[i] = create_ui_object
                     (
                         UI_TYPE_TEXT,
                         UI_ATTR_PARENT (title_change_array [i]),
                         UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
                         UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
                         UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
                         UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                         UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
                         UI_ATTR_TEXT (get_trans ("Co-Pilot Target ID")),
                         UI_ATTR_END
                     );

    preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

    //co_pilot_ecm area

    i++;
    x1 = 0.0;
    y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

    co_pilot_ecm_area = create_ui_object
                        (
                            UI_TYPE_AREA,
                            UI_ATTR_PARENT ( page ),
                            UI_ATTR_VIRTUAL_POSITION (x1, y1),
                            UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
                            UI_ATTR_CLEAR (TRUE),
                            UI_ATTR_END
                        );

    x1 = OPTION_TITLE_OFFSET_X;
    y1 = 0.0;

    title_change_array[i] = create_ui_object
                            (
                                UI_TYPE_AREA,
                                UI_ATTR_PARENT (co_pilot_ecm_area),
                                UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
                                UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                                UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                                UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
                                UI_ATTR_END
                            );

    check_array[i] = create_ui_object
                     (
                         UI_TYPE_TEXT,
                         UI_ATTR_PARENT (title_change_array [i]),
                         UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
                         UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
                         UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
                         UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                         UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
                         UI_ATTR_TEXT (get_trans ("Co-Pilot ECM")),
                         UI_ATTR_END
                     );

    preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

    //avionics area

    i++;
    x1 = 0.0;
    y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

    avionics_area = create_ui_object
                    (
                        UI_TYPE_AREA,
                        UI_ATTR_PARENT (page),
                        UI_ATTR_VIRTUAL_POSITION (x1, y1),
                        UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
                        UI_ATTR_CLEAR (TRUE),
                        UI_ATTR_END
                    );

    x1 = OPTION_TITLE_OFFSET_X;
    y1 = 0.0;

    title_change_array[i] = create_ui_object
                            (
                                UI_TYPE_AREA,
                                UI_ATTR_PARENT (avionics_area),
                                UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
                                UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                                UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                                UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
                                UI_ATTR_END
                            );

    check_array[i] = create_ui_object
                     (
                         UI_TYPE_TEXT,
                         UI_ATTR_PARENT (title_change_array [i]),
                         UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
                         UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
                         UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
                         UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                         UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
                         UI_ATTR_TEXT (get_trans ("Avionics")),
                         UI_ATTR_END
                     );

    preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

    //difficulty area

    i++;
    x1 = 0.0;
    y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

    difficulty_area = create_ui_object
                      (
                          UI_TYPE_AREA,
                          UI_ATTR_PARENT (page),
                          UI_ATTR_VIRTUAL_POSITION (x1, y1),
                          UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
                          UI_ATTR_CLEAR (TRUE),
                          UI_ATTR_END
                      );

    x1 = OPTION_TITLE_OFFSET_X;
    y1 = 0.0;

    title_change_array[i] = create_ui_object
                            (
                                UI_TYPE_AREA,
                                UI_ATTR_PARENT (difficulty_area),
                                UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
                                UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                                UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                                UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
                                UI_ATTR_END
                            );

    check_array[i] = create_ui_object
                     (
                         UI_TYPE_TEXT,
                         UI_ATTR_PARENT (title_change_array [i]),
                         UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
                         UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
                         UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
                         UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                         UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
                         UI_ATTR_TEXT (get_trans ("Difficulty")),
                         UI_ATTR_END
                     );

    preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);

    //cpg report targets area

    i++;
    x1 = 0.0;
    y1 = OPTION_TITLE_OFFSET_Y + (OPTION_AREA_OFFSET_Y * i);

    cpg_report_targets_area = create_ui_object
                              (
                                  UI_TYPE_AREA,
                                  UI_ATTR_PARENT (page),
                                  UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                  UI_ATTR_VIRTUAL_SIZE (OPTION_AREA_WIDTH, OPTION_AREA_HEIGHT),
                                  UI_ATTR_CLEAR (TRUE),
                                  UI_ATTR_END
                              );

    x1 = OPTION_TITLE_OFFSET_X;
    y1 = 0.0;

    title_change_array[i] = create_ui_object
                            (
                                UI_TYPE_AREA,
                                UI_ATTR_PARENT (cpg_report_targets_area),
                                UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_WIDTH, OPTION_BOX_HEIGHT),
                                UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                                UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                                UI_ATTR_TEXTURE_GRAPHIC (options_box_large),
                                UI_ATTR_END
                            );

    check_array[i] = create_ui_object
                     (
                         UI_TYPE_TEXT,
                         UI_ATTR_PARENT (title_change_array [i]),
                         UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_18),
                         UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0),
                         UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255),
                         UI_ATTR_VIRTUAL_POSITION (OPTION_BOX_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                         UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
                         UI_ATTR_TEXT (get_trans ("Co-Pilot report targets")),
                         UI_ATTR_END
                     );

    preprocess_translation_object_size (title_change_array [i], check_array [i], NULL, 0, RESIZE_OPTION_BOX_TITLE);


    /////////////////////////////////////////////////////////////////
    // buttons

    i = 0;

    //Co-Pilot target ID

    change_array[i] = create_ui_object
                      (
                          UI_TYPE_AREA,
                          UI_ATTR_PARENT (co_pilot_target_area),
                          UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
                          UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_MEDIUM_WIDTH, OPTION_BOX_HEIGHT),
                          UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                          UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                          UI_ATTR_TEXTURE_GRAPHIC (options_box_medium),
                          UI_ATTR_END
                      );

    // hack for russian
    if (get_global_current_language () == LANGUAGE_RUSSIAN)
    {
        set_ui_object_virtual_x_size (change_array [i], OPTION_BOX_LARGE_WIDTH);
        set_ui_object_texture_graphic (change_array [i], options_box_large);
    }

    co_pilot_target_option_button = create_ui_object
                                    (
                                        UI_TYPE_TEXT,
                                        UI_ATTR_PARENT (co_pilot_target_area),
                                        UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
                                        UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
                                        UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                                        UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                                        UI_ATTR_TEXT (""),
                                        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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
                                        UI_ATTR_FUNCTION (notify_co_pilot_target_option_button),
                                        UI_ATTR_END
                                    );

    preprocess_translation_object_size (change_array [i], co_pilot_target_option_button, option_cpg_text, 2, RESIZE_OPTION_CYCLE_BUTTON);

    // co_pilot_ecm

    i++;

    change_array[i] = create_ui_object
                      (
                          UI_TYPE_AREA,
                          UI_ATTR_PARENT (co_pilot_ecm_area),
                          UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
                          UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_SMALL_WIDTH, OPTION_BOX_HEIGHT),
                          UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                          UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                          UI_ATTR_TEXTURE_GRAPHIC (options_box_small),
                          UI_ATTR_END
                      );

    co_pilot_ecm_option_button = create_ui_object
                                 (
                                     UI_TYPE_TEXT,
                                     UI_ATTR_PARENT (co_pilot_ecm_area),
                                     UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
                                     UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
                                     UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                                     UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                                     UI_ATTR_TEXT (""),
                                     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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
                                     UI_ATTR_FUNCTION (notify_co_pilot_ecm_option_button),
                                     UI_ATTR_END
                                 );

    preprocess_translation_object_size (change_array [i], co_pilot_ecm_option_button, option_boolean_text, 2, RESIZE_OPTION_CYCLE_BUTTON);

    // avionics

    i++;

    change_array[i] = create_ui_object
                      (
                          UI_TYPE_AREA,
                          UI_ATTR_PARENT (avionics_area),
                          UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
                          UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_MEDIUM_WIDTH, OPTION_BOX_HEIGHT),
                          UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                          UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                          UI_ATTR_TEXTURE_GRAPHIC (options_box_medium),
                          UI_ATTR_END
                      );

    avionics_option_button = create_ui_object
                             (
                                 UI_TYPE_TEXT,
                                 UI_ATTR_PARENT (avionics_area),
                                 UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
                                 UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
                                 UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                                 UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                                 UI_ATTR_TEXT (""),
                                 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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
                                 UI_ATTR_FUNCTION (notify_avionics_option_button),
                                 UI_ATTR_END
                             );

    preprocess_translation_object_size (change_array [i], avionics_option_button, option_avionics_text, 2, RESIZE_OPTION_CYCLE_BUTTON);

    // difficulty setting

    i++;

    change_array[i] = create_ui_object
                      (
                          UI_TYPE_AREA,
                          UI_ATTR_PARENT (difficulty_area),
                          UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
                          UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_MEDIUM_WIDTH, OPTION_BOX_HEIGHT),
                          UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                          UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                          UI_ATTR_TEXTURE_GRAPHIC (options_box_medium),
                          UI_ATTR_END
                      );

    difficulty_option_button = create_ui_object
                               (
                                   UI_TYPE_TEXT,
                                   UI_ATTR_PARENT (difficulty_area),
                                   UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
                                   UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
                                   UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                                   UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                                   UI_ATTR_TEXT (""),
                                   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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
                                   UI_ATTR_FUNCTION (notify_difficulty_option_button),
                                   UI_ATTR_END
                               );

    preprocess_translation_object_size (change_array [i], difficulty_option_button, option_difficulty_text, 3, RESIZE_OPTION_CYCLE_BUTTON);

    // cpg report target setting

    i++;

    change_array[i] = create_ui_object
                      (
                          UI_TYPE_AREA,
                          UI_ATTR_PARENT (cpg_report_targets_area),
                          UI_ATTR_VIRTUAL_POSITION ((get_ui_object_x_end (title_change_array [i]) + get_ui_object_x_size_end (title_change_array [i]) + OPTION_BOX_GAP_WIDTH), 0.0),
                          UI_ATTR_VIRTUAL_SIZE (OPTION_BOX_MEDIUM_WIDTH, OPTION_BOX_HEIGHT),
                          UI_ATTR_COLOUR_START ( 255, 255, 255, 0 ),
                          UI_ATTR_COLOUR_END ( 255, 255, 255, 255 ),
                          UI_ATTR_TEXTURE_GRAPHIC (options_box_medium),
                          UI_ATTR_END
                      );

    cpg_report_targets_button = create_ui_object
                                (
                                    UI_TYPE_TEXT,
                                    UI_ATTR_PARENT (cpg_report_targets_area),
                                    UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
                                    UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
                                    UI_ATTR_VIRTUAL_POSITION (get_ui_object_x_end (change_array [i]) + OPTION_BUTTON_TEXT_OFFSET_X, OPTION_BOX_TEXT_OFFSET_Y),
                                    UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                                    UI_ATTR_TEXT (""),
                                    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_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
                                    UI_ATTR_FUNCTION (notify_cpg_report_targets_option_button),
                                    UI_ATTR_END
                                );

    preprocess_translation_object_size (change_array [i], cpg_report_targets_area, option_cpg_report_targets_text, 4, RESIZE_OPTION_CYCLE_BUTTON);

    recursively_set_object_time (page, OPTIONS_BUTTON_AREA_FADE_TIME, OPTIONS_BUTTON_AREA_OFFSET_TIME);
}
Exemplo n.º 26
0
void set_serial_connection_status ( void )
{

	char
		text_buffer [256];

	connection_data_type
		*this_connection;

	this_connection = direct_play_get_connection_data ();
#ifdef _WIN32
	if ( ( this_connection ) && ( this_connection->service_provider.guid ) )
	{

		if ( memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_SERIAL, sizeof ( GUID ) ) == TRUE )
		{

			set_direct_play_serial_address ( get_global_comms_port (), get_global_baud_rate (), get_global_stop_bits (), get_global_parity (), get_global_flow () );

			if ( direct_play_create_session ( 0 ) )
			{

				sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_CONNECTED"));

				set_ui_object_text (serial_status_text, text_buffer);

				direct_play_close_session ();

				this_connection->is_initialised = TRUE;
			}
			else
			{

				sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_INVALID_PROPERTIES"));

				set_ui_object_text (serial_status_text, text_buffer);

				this_connection->is_initialised = FALSE;
			}
		}
	}
#elif defined __unix__
if ( ( this_connection ) && ( this_connection->service_provider.guid ) )
	{

		if (1)//ö memncmp ( ( char * ) this_connection->service_provider.guid, ( char * ) &DPSPGUID_SERIAL, sizeof ( GUID ) ) == TRUE )
		{

			set_direct_play_serial_address ( get_global_comms_port (), get_global_baud_rate (), get_global_stop_bits (), get_global_parity (), get_global_flow () );

			if ( direct_play_create_session ( 0 ) )
			{

				sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_CONNECTED"));

				set_ui_object_text (serial_status_text, text_buffer);

				direct_play_close_session ();

				this_connection->is_initialised = TRUE;
			}
			else
			{

				sprintf (text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans ("MP_INVALID_PROPERTIES"));

				set_ui_object_text (serial_status_text, text_buffer);

				this_connection->is_initialised = FALSE;
			}
		}
	}
}
Exemplo n.º 27
0
void show_base_page (entity *base, int force_update)
{
    entity
    *previous;

    vec3d
    *pos;

    int
    x, z;

    char
    s [128];

    ASSERT (base);

    ASSERT (get_local_entity_type (base) == ENTITY_TYPE_KEYSITE);

    if (force_update)
    {
        previous = NULL;
    }
    else
    {
        previous = get_local_entity_safe_ptr (get_ui_object_item_number (campaign_page [CAMPAIGN_PAGE_BASE]));
    }

    pos = get_local_entity_vec3d_ptr (base, VEC3D_TYPE_POSITION);

    ASSERT (pos);

    //
    // NAME
    //

    set_ui_object_text (base_page_title, get_local_entity_string (base, STRING_TYPE_KEYSITE_NAME));

    //
    // TYPE
    //

    set_ui_object_text (base_page_type_box, get_trans (get_local_entity_string (base, STRING_TYPE_FULL_NAME)));

    //
    // LOCATION
    //

    get_x_sector (x, pos->x);
    get_z_sector (z, pos->z);

    sprintf (s, "[%03d, %03d]", x, z);

    set_ui_object_text (base_page_sector_box, s);

    //
    // 3D WINDOW
    //

    set_ui_object_item_number (page_3d_area, get_local_entity_index (base));

    if (base != previous)
    {
        page_3d_heading = 0.0;
        page_3d_pitch = (PI * 0.25);
        page_3d_distance = max (50.0, get_local_entity_float_value (base, FLOAT_TYPE_RECON_DISTANCE));
    }

    //
    // 2D MAP
    //

    set_ui_object_item_number (page_map_area, get_local_entity_index (base));

    if (base != previous)
    {
        page_map_dimensions.x = pos->x;
        page_map_dimensions.z = pos->z;

        page_map_dimensions.subject_entity = base;
    }

    //

    display_campaign_page (CAMPAIGN_PAGE_BASE, get_local_entity_index (base), TRUE);
}
Exemplo n.º 28
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);
}
Exemplo n.º 29
0
void define_campaign_screen_base_page_objects (void)
{
    float
    x1,
    y1,
    x2,
    y2,
    ysize;

    ui_object
    *page;

    char
    output [128];

    /////////////////////////////////////////////////////////////////
    // Main Page Area
    /////////////////////////////////////////////////////////////////

    x1 = CAMPAIGN_INSET_PAGE_X1;
    y1 = CAMPAIGN_INSET_PAGE_Y1;
    x2 = CAMPAIGN_INSET_PAGE_X2;
    y2 = CAMPAIGN_INSET_PAGE_Y2;

    campaign_page [CAMPAIGN_PAGE_BASE] = create_ui_object
                                         (
                                                 UI_TYPE_AREA,
                                                 UI_ATTR_PARENT (campaign_screen),
                                                 UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_CENTRE_TOP),
                                                 UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                                 UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                                                 UI_ATTR_DRAW_FUNCTION (update_base_page_objects),
                                                 UI_ATTR_DRAWABLE (FALSE),
                                                 UI_ATTR_CLEAR (TRUE),
                                                 UI_ATTR_END
                                         );

    page = campaign_page [CAMPAIGN_PAGE_BASE];

    /////////////////////////////////////////////////////////////////
    // Title

    x1 = 0.044;
    y1 = 0.089;

    base_page_title = create_ui_object
                      (
                          UI_TYPE_TEXT,
                          UI_ATTR_PARENT (page),
                          UI_ATTR_VIRTUAL_POSITION (x1, y1),
                          UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_18),
                          UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
                          UI_ATTR_END
                      );

    ysize = 0.06;

    y1 = 0.237;
    y2 = 0.31;

    /////////////////////////////////////////////////////////////////
    // Base Type Box

    x1 = 0.18;
    x2 = 0.2;

    sprintf (output, "%s :", get_trans ("Type"));

    create_ui_object
    (
        UI_TYPE_TEXT,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXT (output),
        UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
        UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
        UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
        UI_ATTR_END
    );

    x1 = 0.2;
    x2 = 0.5;

    base_page_type_box = create_ui_object
                         (
                             UI_TYPE_TEXT,
                             UI_ATTR_PARENT (page),
                             UI_ATTR_VIRTUAL_POSITION (x1, y1),
                             UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                             UI_ATTR_TEXT (""),
                             UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                             UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
                             UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
                             UI_ATTR_END
                         );

    /////////////////////////////////////////////////////////////////
    // Base Sector Box

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

    sprintf (output, "%s :", get_trans ("Sector"));

    create_ui_object
    (
        UI_TYPE_TEXT,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXT (output),
        UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
        UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
        UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
        UI_ATTR_END
    );

    x1 = 0.2;
    x2 = 0.5;

    base_page_sector_box = create_ui_object
                           (
                               UI_TYPE_TEXT,
                               UI_ATTR_PARENT (page),
                               UI_ATTR_VIRTUAL_POSITION (x1, y1),
                               UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                               UI_ATTR_TEXT (""),
                               UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                               UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
                               UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
                               UI_ATTR_END
                           );

    /////////////////////////////////////////////////////////////////
    // Status Box

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

    sprintf (output, "%s :", get_trans ("Status"));

    create_ui_object
    (
        UI_TYPE_TEXT,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXT (output),
        UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
        UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
        UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
        UI_ATTR_END
    );

    x1 = 0.2;
    x2 = 0.5;

    base_page_status_box = create_ui_object
                           (
                               UI_TYPE_TEXT,
                               UI_ATTR_PARENT (page),
                               UI_ATTR_VIRTUAL_POSITION (x1, y1),
                               UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                               UI_ATTR_TEXT (""),
                               UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                               UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
                               UI_ATTR_END
                           );

    /////////////////////////////////////////////////////////////////
    // Efficiency Box

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

    sprintf (output, "%s :", get_trans ("Efficiency"));

    create_ui_object
    (
        UI_TYPE_TEXT,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXT (output),
        UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
        UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
        UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
        UI_ATTR_END
    );

    x1 = 0.2;
    x2 = 0.5;

    base_page_efficiency_box = create_ui_object
                               (
                                   UI_TYPE_TEXT,
                                   UI_ATTR_PARENT (page),
                                   UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                   UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                                   UI_ATTR_TEXT (""),
                                   UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                                   UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
                                   UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
                                   UI_ATTR_END
                               );

    /////////////////////////////////////////////////////////////////
    // Ammo Box

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

    sprintf (output, "%s :", get_trans ("Ammo"));

    create_ui_object
    (
        UI_TYPE_TEXT,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXT (output),
        UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
        UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
        UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
        UI_ATTR_END
    );

    x1 = 0.2;
    x2 = 0.5;

    base_page_ammo_box = create_ui_object
                         (
                             UI_TYPE_TEXT,
                             UI_ATTR_PARENT (page),
                             UI_ATTR_VIRTUAL_POSITION (x1, y1),
                             UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                             UI_ATTR_TEXT (""),
                             UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                             UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
                             UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
                             UI_ATTR_END
                         );

    /////////////////////////////////////////////////////////////////
    // Fuel Box

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

    sprintf (output, "%s :", get_trans ("Fuel"));

    create_ui_object
    (
        UI_TYPE_TEXT,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXT (output),
        UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
        UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
        UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
        UI_ATTR_END
    );

    x1 = 0.2;
    x2 = 0.5;

    base_page_fuel_box = create_ui_object
                         (
                             UI_TYPE_TEXT,
                             UI_ATTR_PARENT (page),
                             UI_ATTR_VIRTUAL_POSITION (x1, y1),
                             UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                             UI_ATTR_TEXT (""),
                             UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
                             UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
                             UI_ATTR_FONT_COLOUR (ui_ingame_dead_text_colour.r, ui_ingame_dead_text_colour.g, ui_ingame_dead_text_colour.b, ui_ingame_dead_text_colour.a),
                             UI_ATTR_END
                         );

    /////////////////////////////////////////////////////////////////
    // 2D MAP / 3D VIEW toggles

    x1 = 0.5;
    y1 = 0.0;
    x2 = 1.0;
    y2 = 0.67;

    page_map_view_area = create_ui_object
                         (
                             UI_TYPE_AREA,
                             UI_ATTR_PARENT (page),
                             UI_ATTR_VIRTUAL_POSITION (x1, y1),
                             UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                             UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics//ui//cohokum//map//blockprp.psd")),
                             UI_ATTR_END
                         );

    /////////////////////////////////////////////////////////////////
    // 2D MAP / 3D VIEW toggles

    x1 = 0.5;
    y1 = 0.67;
    x2 = 1.0;
    y2 = 0.71;

    page_map_view_mode_area = create_ui_object
                              (
                                  UI_TYPE_AREA,
                                  UI_ATTR_PARENT (page),
                                  UI_ATTR_VIRTUAL_POSITION (x1, y1),
                                  UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                                  UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics//ui//cohokum//map//maptabs.psd")),
                                  UI_ATTR_END
                              );

    // 2d map toggle

    x1 = 0.0;
    y1 = 0.0;
    x2 = 0.33;
    y2 = 1.0;

    page_map_toggle = create_ui_object
                      (
                          UI_TYPE_RADIO,
                          UI_ATTR_PARENT (page_map_view_mode_area),
                          UI_ATTR_VIRTUAL_POSITION (x1, y1),
                          UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                          UI_ATTR_TEXT (get_trans ("Map")),
                          UI_ATTR_FUNCTION (notify_page_show_map),
                          UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
                          UI_ATTR_FONT_COLOUR (ui_ingame_live_text_colour.r, ui_ingame_live_text_colour.g, ui_ingame_live_text_colour.b, ui_ingame_live_text_colour.a),
                          UI_ATTR_HIGHLIGHTED_FONT_COLOUR (ui_ingame_highlight_text_colour.r, ui_ingame_highlight_text_colour.g, ui_ingame_highlight_text_colour.b, ui_ingame_highlight_text_colour.a),
                          UI_ATTR_SELECTED_FONT_COLOUR (ui_ingame_selected_text_colour.r, ui_ingame_selected_text_colour.g, ui_ingame_selected_text_colour.b, ui_ingame_selected_text_colour.a),
                          UI_ATTR_HIGHLIGHTABLE (TRUE),
                          UI_ATTR_CLEAR (TRUE),
                          UI_ATTR_END
                      );

    // 3d view toggle

    x1 = 0.33;
    y1 = 0.0;
    x2 = 0.66;
    y2 = 1.0;

    page_3d_toggle = create_ui_object
                     (
                         UI_TYPE_RADIO,
                         UI_ATTR_PARENT (page_map_view_mode_area),
                         UI_ATTR_VIRTUAL_POSITION (x1, y1),
                         UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                         UI_ATTR_TEXT (get_trans ("View")),
                         UI_ATTR_FUNCTION (notify_page_show_3d),
                         UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
                         UI_ATTR_FONT_COLOUR (ui_ingame_live_text_colour.r, ui_ingame_live_text_colour.g, ui_ingame_live_text_colour.b, ui_ingame_live_text_colour.a),
                         UI_ATTR_HIGHLIGHTED_FONT_COLOUR (ui_ingame_highlight_text_colour.r, ui_ingame_highlight_text_colour.g, ui_ingame_highlight_text_colour.b, ui_ingame_highlight_text_colour.a),
                         UI_ATTR_SELECTED_FONT_COLOUR (ui_ingame_selected_text_colour.r, ui_ingame_selected_text_colour.g, ui_ingame_selected_text_colour.b, ui_ingame_selected_text_colour.a),
                         UI_ATTR_HIGHLIGHTABLE (TRUE),
                         UI_ATTR_CLEAR (TRUE),
                         UI_ATTR_END
                     );

    /////////////////////////////////////////////////////////////////
    // 3d Preview Area

    x1 = 0.01;
    y1 = 0.0;
    x2 = 1.0;
    y2 = 0.99;

    page_3d_area = create_ui_object
                   (
                       UI_TYPE_AREA,
                       UI_ATTR_PARENT (page_map_view_area),
                       UI_ATTR_VIRTUAL_POSITION (x1, y1),
                       UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                       UI_ATTR_DRAW_FUNCTION (draw_page_3d_scene),
                       UI_ATTR_CLEAR (TRUE),
                       UI_ATTR_END
                   );

    /////////////////////////////////////////////////////////////////
    // Map Area

    x1 = 0.01;
    y1 = 0.0;
    x2 = 1.0;
    y2 = 0.99;

    page_map_area = create_ui_object
                    (
                        UI_TYPE_AREA,
                        UI_ATTR_PARENT (page_map_view_area),
                        UI_ATTR_VIRTUAL_POSITION (x1, y1),
                        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
                        UI_ATTR_END
                    );

#ifdef DEBUG

    x1 = 0.1;
    y1 = 0.8;
    x2 = 0.4;
    y2 = 0.9;

    create_ui_object
    (
        UI_TYPE_BUTTON,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXT ("Destroy\nCapture"),
        UI_ATTR_FUNCTION (notify_base_destroy_button),
        UI_ATTR_END
    );

#endif

    /////////////////////////////////////////////////////////////////
    // "Divider" graphics

    x1 = 0.022;
    y1 = 0.206;
    x2 = 0.475;
    y2 = 0.229;

    create_ui_object
    (
        UI_TYPE_AREA,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXTURE_GRAPHIC (common_divider_graphic),
        UI_ATTR_END
    );

    ////////////////////////////////////

    x1 = 0.022;
    y1 = 0.649;
    x2 = 0.475;
    y2 = 0.672;

    create_ui_object
    (
        UI_TYPE_AREA,
        UI_ATTR_PARENT (page),
        UI_ATTR_VIRTUAL_POSITION (x1, y1),
        UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
        UI_ATTR_TEXTURE_GRAPHIC (common_divider_graphic),
        UI_ATTR_END
    );

    /////////////////////////////////////////////////////////////////
    // BACK button

    define_campaign_page_back_button (page, &page_back_button);

    /////////////////////////////////////////////////////////////////
    // Map Objects

    define_map_objects (page_map_area, &page_map_dimensions, draw_page_map, campaign_map_left_click_function, map_centralise_function, &campaign_screen_full_screen_map);
}
Exemplo n.º 30
0
void break_modem_connection ( void )
{

	char
		text_buffer [256];

	connection_data_type
		*this_connection;

	ui_set_user_function ( NULL );

	switch ( modem_state )
	{

		case MODEM_DIALING:
		case MODEM_DIALLED_CONNECTED:
		{

			//
			// We can't destroy groups, or sessions.
			//

			direct_play_leave_group ();

			direct_play_destroy_player ();

			direct_play_close_session ();

			break;
		}

		case MODEM_ANSWERING:
		case MODEM_ANSWERED_CONNECTED:
		{

			direct_play_leave_group ();

			direct_play_destroy_player ();

			direct_play_destroy_group ();

			direct_play_close_session ();

			break;
		}
	}

	sprintf ( text_buffer, "%s: %s", get_trans ("MP_STATUS"), get_trans("MP_UNCONNECTED"));

	set_ui_object_text (modem_status_text, text_buffer);

//	set_ui_object_drawable ( multi_player_back_button, UI_OBJECT_STATE_ON );

	direct_play_destroy_modem ();

	this_connection = direct_play_get_connection_data ();

	if ( this_connection )
	{

		this_connection->one_way_hosting_setup = TRUE;
		this_connection->is_initialised = FALSE;
		this_connection->is_hosting = FALSE;
	}

	modem_state = MODEM_NOT_CONNECTED;
}