Ejemplo n.º 1
0
void initialise_combat_zone_screen (void)
{

   combat_zone_screen = create_ui_object
            (
               UI_TYPE_SCREEN,
               UI_ATTR_POSITION (0, 0),
               UI_ATTR_SIZE (640, 480),
					//UI_ATTR_GRAPHIC ( get_graphics_file_data ( GRAPHICS_UI_APACHE_CZONE_SCREEN ) ),
					UI_ATTR_FUNCTION (notify_combat_zone_screen),
               UI_ATTR_END
            );

	combat_zone_text_area = create_ui_object
            (
               UI_TYPE_AREA,
               UI_ATTR_PARENT (combat_zone_screen),
               UI_ATTR_POSITION (10, 20),
               UI_ATTR_SIZE (620, 420),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );

   create_ui_object
            (
               UI_TYPE_BUTTON,
               UI_ATTR_PARENT (combat_zone_screen),
               UI_ATTR_POSITION (10, 442),
               UI_ATTR_SIZE (120, 28),
					UI_ATTR_FUNCTION (notify_combat_zone_back_button),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_EITHER),
					//UI_ATTR_ALPHA_GRAPHIC (get_graphics_file_data (GRAPHICS_UI_APACHE_PLANNER_BACK_BUTTON_UNSELECTED)),
               UI_ATTR_END
            );
}
Ejemplo n.º 2
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 ();

	/////////////////////////////////////////////////////////////////
}
Ejemplo n.º 3
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);
}
Ejemplo n.º 4
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);
}
Ejemplo n.º 5
0
ui_object *add_to_pop_up_list (char *text, ui_object *obj, ui_object *next_item, int list_id, int font_type, rgb_colour font_colour)
{

	notify_types
		notify_on,
		highlighted_notify_on;

	ui_object
		*text_obj;

	int
		highlighted_font_type;

	float
		x_pos,
		list_x_size,
		list_y_size,
		new_position;

	rgb_colour
		highlighted_font_colour;

	//
	ASSERT (obj);
	//
/*
	if (!obj)
	{

		return NULL;
	}

*/
	//
	//
	//

	list_x_size = 1.0; //get_ui_object_x_size (obj) - 5;

	list_y_size = ui_get_font_height () / get_ui_object_y_size (obj);

	new_position = get_next_list_virtual_position (obj);

	//
	// If invalid font type specified, use the list box font type
	//
	
	if ((font_type < 0) || (font_type >= NUM_FONT_TYPES))
	{

		font_type = get_ui_object_font_type (obj);
	}

	highlighted_font_type = get_ui_object_highlighted_font_type (obj);

	//
	// If invalid font colour specified, use the list box font colour
	//

	notify_on = get_ui_object_notify_on (obj);
	highlighted_notify_on = get_ui_object_highlighted_notify_on (obj);

	highlighted_font_colour = get_ui_object_highlighted_font_colour (obj);

	x_pos = 5.0 / get_ui_object_x_size (obj);

	text_obj = create_ui_object
				(
					UI_TYPE_TEXT,
					UI_ATTR_NEXT (next_item),
					UI_ATTR_PARENT (obj),
					UI_ATTR_LIST_ITEM,
					UI_ATTR_VIRTUAL_SIZE (list_x_size, list_y_size),
					UI_ATTR_VIRTUAL_POSITION (x_pos, new_position),
					UI_ATTR_FONT_TYPE (font_type),
					UI_ATTR_FONT_COLOUR (font_colour.r, font_colour.g, font_colour.b, font_colour.a),
					UI_ATTR_HIGHLIGHTED_FONT_TYPE (highlighted_font_type),
					UI_ATTR_HIGHLIGHTED_FONT_COLOUR (highlighted_font_colour.r, highlighted_font_colour.g, highlighted_font_colour.b, highlighted_font_colour.a),
					UI_ATTR_TEXT (text),
					UI_ATTR_ITEM_NUMBER (list_id),
					UI_ATTR_ITEM_NUMBER2 (UI_LIST_NO_SELECTION),
					UI_ATTR_FUNCTION (ui_object_list_item_function),
					UI_ATTR_RIGHT_FUNCTION (ui_object_list_item_right_function),
					UI_ATTR_NOTIFY_ON (notify_on),
					UI_ATTR_HIGHLIGHTED_NOTIFY_ON (highlighted_notify_on),
					UI_ATTR_END
				);

	//
	// Set list box to redraw, and parents if its clear.
	//

	set_ui_object_redraw (obj, TRUE);

	while ((obj) && (get_ui_object_clear (obj)))
	{

		obj = get_ui_object_parent (obj);

		if (obj)
		{

			set_ui_object_redraw (obj, TRUE);
		}
	}

	return text_obj;
}
Ejemplo n.º 6
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);
}
Ejemplo n.º 7
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
				);
	}
}
Ejemplo n.º 8
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
			);
}
Ejemplo n.º 9
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);

}
Ejemplo n.º 10
0
void initialise_credits_screen (void)
{
	ui_object
		*temp;

	float
		x1,
		y1,
		x2,
		y2;

	char
		string [256];

	x2 = 1.0;
	y2 = 1.0;

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

   credits_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_TIME_LENGTH (500),
					UI_ATTR_OFFSET_TIME (0),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_DISPLAYED),
					UI_ATTR_FUNCTION (notify_credits_screen),
               UI_ATTR_END
            );

   create_ui_object
            (
               UI_TYPE_TEXT,
               UI_ATTR_PARENT (credits_screen),
					UI_ATTR_TIME_LENGTH (0),
					UI_ATTR_OFFSET_TIME (0),
               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 ("Credits")),
					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
            );

	x1 = 0.068;
	y1 = 0.298;
	x2 = 0.180;
	y2 = 0.040;


	sprintf (string, "%s>>>", get_trans ("Credits Code"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (credits_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (102, 88, 174, 0),
      UI_ATTR_FONT_COLOUR_END (102, 88, 174, 255),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_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.643;
	y1 = 0.561;
	x2 = 0.233;
	y2 = 0.040;

	sprintf (string, "<<<%s", get_trans ("Credits Graphics"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (credits_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (102, 88, 174, 0),
      UI_ATTR_FONT_COLOUR_END (102, 88, 174, 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.268;
	y1 = 0.779;
	x2 = 0.176;
	y2 = 0.040;

	sprintf (string, "%s>>>", get_trans ("Credits Music"));

   temp = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (credits_screen),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
      UI_ATTR_FONT_COLOUR_START (102, 88, 174, 0),
      UI_ATTR_FONT_COLOUR_END (102, 88, 174, 255),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_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

	create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (credits_screen),
				UI_ATTR_VIRTUAL_POSITION (OPTIONS_OK_BUTTON_POS_X, OPTIONS_OK_BUTTON_POS_Y),
				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_ITALIC_ARIAL_18),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
           	UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
           	UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
           	UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
           	UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
				UI_ATTR_HIGHLIGHTABLE (TRUE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);
			
}
Ejemplo n.º 11
0
void initialise_session_screen (void)
{

   ui_object
		*option_bdrop;

	float
		x1,
		x2,
		y1,
		y2;

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

	session_screen = create_ui_object
							(
								UI_TYPE_SCREEN,
								UI_ATTR_VIRTUAL_POSITION (x1, y1),
								UI_ATTR_VIRTUAL_SIZE (x2, y2),
								UI_ATTR_COLOUR_START (255,255,255,64),
								UI_ATTR_COLOUR_END (255,255,255,255),
								UI_ATTR_TIME_LENGTH (500),
								UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_EITHER),
								UI_ATTR_FUNCTION (notify_session_screen),
								UI_ATTR_END
							);

	// Screen title text
   create_ui_object
            (
               UI_TYPE_TEXT,
               UI_ATTR_PARENT (session_screen),
					UI_ATTR_TIME_LENGTH (0),
					UI_ATTR_OFFSET_TIME (0),
               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 ("Session")),
					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
            );

   ////////////////////////////////////////////////////////
   // session info / briefing

	x1 = 0.506;
	y1 = 0.126;
	x2 = 0.466;
	y2 = 0.372;

	session_briefing_overlay = create_ui_object
			(
				UI_TYPE_AREA,
				UI_ATTR_PARENT (session_screen),
				UI_ATTR_VIRTUAL_POSITION (x1, y1),
				UI_ATTR_VIRTUAL_SIZE (x2, y2),
				UI_ATTR_TEXTURE_GRAPHIC (text_box_graphic),
				UI_ATTR_END
			);

	x1 = 0.02;
	y1 = 0.05;
	x2 = 0.96;
	y2 = 0.9;

	session_briefing_area = create_ui_object
										(
											UI_TYPE_AREA,
											UI_ATTR_PARENT (session_briefing_overlay),
											UI_ATTR_VIRTUAL_POSITION (x1, y1),
											UI_ATTR_VIRTUAL_SIZE (x2, y2),
											UI_ATTR_VSLIDER (0, 0, ui_get_font_height ()),
											UI_ATTR_CLEAR (TRUE),
											UI_ATTR_END
										);

	////////////////////////////////////////////////
	//	Slider Graphics

	set_frontend_slider_graphics (session_briefing_area);

   session_info_list = create_ui_object
            (
               UI_TYPE_LIST_BOX,
               UI_ATTR_PARENT (session_briefing_area),
					UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
					UI_ATTR_VIRTUAL_SIZE (0.92, 1.0),
					UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_NONE),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
           );

	////////////////////////////////////////////////
	// session list
	////////////////////////////////////////////////

	x1 = 0.003;
	y1 = 0.126;
	x2 = 0.466;
	y2 = 0.677;
	

   session_list_bdrop = create_ui_object
						(
							UI_TYPE_AREA,
							UI_ATTR_PARENT (session_screen),
							UI_ATTR_VIRTUAL_POSITION (x1, y1),
							UI_ATTR_VIRTUAL_SIZE (x2, y2),
							UI_ATTR_TEXTURE_GRAPHIC (list_box_graphic),
							UI_ATTR_END
						);

	x1 = 0.02;
	y1 = 0.1;
	x2 = 0.96;
	y2 = 0.86;
	
   session_list_area = create_ui_object
						(
							UI_TYPE_AREA,
							UI_ATTR_PARENT (session_list_bdrop),
							UI_ATTR_VIRTUAL_POSITION (x1, y1),
							UI_ATTR_VIRTUAL_SIZE (x2, y2),
							UI_ATTR_VSLIDER (0, 1000, ui_get_font_height ()),
							UI_ATTR_CLEAR (TRUE),
							UI_ATTR_END
						);

	set_frontend_slider_graphics (session_list_area);

	x1 = 0.046;
	y1 = 0.0;
	x2 = 0.862;
	y2 = 1.0;
	
   session_list = create_ui_object
						(
							UI_TYPE_LIST_BOX,
							UI_ATTR_PARENT (session_list_area),
							UI_ATTR_VIRTUAL_POSITION (x1, y1),
							UI_ATTR_VIRTUAL_SIZE (x2, y2),
		            	UI_ATTR_FONT_COLOUR_START (ui_list_text_default_colour.r, ui_list_text_default_colour.g, ui_list_text_default_colour.b, 0),
   		         	UI_ATTR_FONT_COLOUR_END (ui_list_text_default_colour.r, ui_list_text_default_colour.g, ui_list_text_default_colour.b, 255),
      		      	UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_list_text_hilite_colour.r, ui_list_text_hilite_colour.g, ui_list_text_hilite_colour.b, 0),
         		   	UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_list_text_hilite_colour.r, ui_list_text_hilite_colour.g, ui_list_text_hilite_colour.b, 255),
							UI_ATTR_HIGHLIGHTABLE (TRUE),
							UI_ATTR_LIST_BOX_Y_SPACE (0),
							UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
							UI_ATTR_CLEAR (TRUE),
							UI_ATTR_FUNCTION (session_list_function),
							UI_ATTR_END
						);

	set_ui_list_spacing_proportional_to_font (session_list, -0.2);

	///////////////////////////////////////////////
	// Rename Button

	x1 = 0.05;
	y1 = 0.029;
	x2 = 0.45;
	y2 = 0.038;

   session_screen_rename_button = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (session_list_bdrop),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
     	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_TEXT (get_trans ("RENAME")),
		UI_ATTR_FUNCTION (notify_session_rename_button),
		UI_ATTR_CLEAR ( TRUE ),
		UI_ATTR_DRAWABLE (FALSE),
		UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
		UI_ATTR_END
	);

	////////////////////////////////////////////////
	//	Delete Button 

	x1 = 0.5;
	y1 = 0.029;
	x2 = 0.45;
	y2 = 0.038;

	session_screen_delete_button = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (session_list_bdrop),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
		UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
		UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_RIGHT_CENTRE),
   	UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
    	UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
     	UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
    	UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
		UI_ATTR_HIGHLIGHTABLE (TRUE),
		UI_ATTR_TEXT (get_trans ("DELETE")),
		UI_ATTR_FUNCTION (notify_session_delete_button),
		UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
		UI_ATTR_DRAWABLE (FALSE),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

	x1 = get_ui_object_virtual_x (session_list);
	y1 = get_ui_object_virtual_y (session_list);
	x2 = get_ui_object_virtual_x_size (session_list);
	y2 = get_ui_object_virtual_y_size (session_list);
	
   session_name_entry_area = create_ui_object
            (
               UI_TYPE_AREA,
               UI_ATTR_PARENT (session_list_area),
					UI_ATTR_VIRTUAL_POSITION (x1, y1),
					UI_ATTR_VIRTUAL_SIZE (x2, y2),
					UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_18),
					UI_ATTR_CLEAR (TRUE),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_NONE),
               UI_ATTR_END
            );

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

   session_name_input = create_ui_object
            (
               UI_TYPE_INPUT,
               UI_ATTR_PARENT (session_name_entry_area),
					UI_ATTR_VIRTUAL_POSITION (x1, y1),
					UI_ATTR_VIRTUAL_SIZE (x2, y2),
					UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_18),
            	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_FUNCTION (session_name_input_function),
					UI_ATTR_CLEAR (FALSE),
               UI_ATTR_END
            );



	/////////////////////////////////////////////////////////////////
	// Ok Button

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

	session_screen_next_button = create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (session_screen),
				UI_ATTR_VIRTUAL_POSITION (OPTIONS_OK_BUTTON_POS_X, OPTIONS_OK_BUTTON_POS_Y),
				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_session_next_button),
				UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
				UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
            UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
            UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
				UI_ATTR_HIGHLIGHTABLE (TRUE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);
			
	set_text_option_backdrop_object (session_screen_next_bdrop, session_screen_next_button);

// Jabberwock 031118 Server side settings
	/////////////////////////////////////////////////////////////////
	// Ok Button no. 2

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

	session_screen_continue_button = create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (session_screen),
				UI_ATTR_VIRTUAL_POSITION (OPTIONS_OK_BUTTON_POS_X, OPTIONS_OK_BUTTON_POS_Y),
				UI_ATTR_VIRTUAL_SIZE (OPTIONS_OK_BUTTON_X, OPTIONS_OK_BUTTON_Y),
				UI_ATTR_TEXT (get_trans("PROCEED")),
				UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
				UI_ATTR_FUNCTION (notify_session_continue_button),
				UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
				UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
            UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
            UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
				UI_ATTR_HIGHLIGHTABLE (TRUE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);
			
	set_text_option_backdrop_object (session_screen_continue_bdrop, session_screen_continue_button);


	/////////////////////////////////////////////////////////////////
	// Cancel Button

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

	session_screen_back_button = create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (session_screen),
				UI_ATTR_VIRTUAL_POSITION (OPTIONS_CANCEL_BUTTON_POS_X, OPTIONS_CANCEL_BUTTON_POS_Y),
				UI_ATTR_VIRTUAL_SIZE (OPTIONS_CANCEL_BUTTON_X, OPTIONS_CANCEL_BUTTON_Y),
				UI_ATTR_TEXT (get_trans("UI_CANCEL")),
				UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
				UI_ATTR_FUNCTION (notify_session_back_button),
				UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
				UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
            UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
            UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
				UI_ATTR_HIGHLIGHTABLE (TRUE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);
			
	set_text_option_backdrop_object (option_bdrop, session_screen_back_button);

	//
	// Create the briefing
	//

   ////////////////////////////////////////////////////////
   // setup parameter objects

	define_session_parameter_objects ();

}
Ejemplo n.º 12
0
void initialise_main_screen (void)
{
	ui_object
		*option_bdrop,
		*change_obj,
		*registered_to_message;

	float
		x1,
		y1,
		x2,
		y2;

	int
		i;

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

	if (options_box_small)
	{
		destroy_texture_graphic (options_box_small);

		options_box_small = NULL;
	}

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

	if (options_box_medium)
	{
		destroy_texture_graphic (options_box_medium);

		options_box_medium = NULL;
	}

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

	if (options_box_large)
	{
		destroy_texture_graphic (options_box_large);

		options_box_large = NULL;
	}

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

	if (options_box_extra_large)
	{
		destroy_texture_graphic (options_box_extra_large);

		options_box_extra_large = NULL;
	}

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

	if (text_box_graphic)
	{
		destroy_texture_graphic (text_box_graphic);

		text_box_graphic = NULL;
	}

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

	if (text_option_bdrop)
	{
		destroy_texture_graphic (text_option_bdrop);

		text_option_bdrop = NULL;
	}

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

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

	if (list_box_graphic)
	{

		destroy_texture_graphic (list_box_graphic);

		list_box_graphic = NULL;
	}

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

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

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

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

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


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

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

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


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

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


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

	// Combat

	i = 0;

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

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

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

	set_text_option_backdrop_object (option_bdrop, change_obj);

	// Pilots

	i++;

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

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

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

	set_text_option_backdrop_object (option_bdrop, pilots_button);

	// ghost pilots button

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

	y1 = 0.435;
	y2 = 0.033;

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


	// Options

	i++;

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

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

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

	set_text_option_backdrop_object (option_bdrop, change_obj);


	// Credits

	i++;

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

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

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

	set_text_option_backdrop_object (option_bdrop, credits_button);

	// ghost credits button

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

	y1 = 0.704;
	y2 = 0.042;

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


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

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

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

	set_text_option_backdrop_object (option_bdrop, change_obj);


#ifndef COMMERCIAL

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

		set_ui_object_drawable (registered_to_message, TRUE);
	}
	else
	{

		#ifdef INSTALL_FROM_CDROM

		debug_fatal ("Security Protection Failed");

		#endif
	}

#endif
}
Ejemplo n.º 13
0
void define_russian_medal_objects (void)
{
	int
		i;

	// don't bother with text for object MEDAL_TYPE_NONE

	russian_medal_info_array [MEDAL_LEBANON].name = get_trans ("Medal SV Lebanon");
	russian_medal_info_array [MEDAL_LEBANON].info = get_trans ("Medal Campaign");

	russian_medal_info_array [MEDAL_SAUDI].name = get_trans ("Medal SV Yemen");
	russian_medal_info_array [MEDAL_SAUDI].info = get_trans ("Medal Campaign");

	russian_medal_info_array [MEDAL_TAIWAN].name = get_trans ("Medal SV Taiwan");
	russian_medal_info_array [MEDAL_TAIWAN].info = get_trans ("Medal Campaign");

	russian_medal_info_array [MEDAL_ARMY_AVIATOR].name = get_trans ("Medal SV Army Wings");
	russian_medal_info_array [MEDAL_ARMY_AVIATOR].info = get_trans ("Medal Army Aviator");

	russian_medal_info_array [MEDAL_SENIOR_AVIATOR].name = get_trans ("Medal SV Senior Wings");
	russian_medal_info_array [MEDAL_SENIOR_AVIATOR].info = get_trans ("Medal Senior Aviator");

	russian_medal_info_array [MEDAL_MASTER_AVIATOR].name = get_trans ("Medal SV Master Wings");
	russian_medal_info_array [MEDAL_MASTER_AVIATOR].info = get_trans ("Medal Master Aviator");

	russian_medal_info_array [MEDAL_PURPLE_HEART].name = get_trans ("Medal SV Glory");
	russian_medal_info_array [MEDAL_PURPLE_HEART].info = get_trans ("Medal Injury");

	russian_medal_info_array [MEDAL_AIR_MEDAL].name = get_trans ("Medal SV Banner");
	russian_medal_info_array [MEDAL_AIR_MEDAL].info = get_trans ("Medal Valour");

	russian_medal_info_array [MEDAL_FLYING_CROSS].name = get_trans ("Medal SV Lenin");
	russian_medal_info_array [MEDAL_FLYING_CROSS].info = get_trans ("Medal Valour");

	russian_medal_info_array [MEDAL_SILVER_STAR].name = get_trans ("Medal SV Service");
	russian_medal_info_array [MEDAL_SILVER_STAR].info = get_trans ("Medal Valour");

	russian_medal_info_array [MEDAL_DISTINGUISHED_SERVICE].name = get_trans ("Medal SV Victory");
	russian_medal_info_array [MEDAL_DISTINGUISHED_SERVICE].info = get_trans ("Medal Valour");

	russian_medal_info_array [MEDAL_MEDAL_OF_HONOUR].name = get_trans ("Medal SV Star");
	russian_medal_info_array [MEDAL_MEDAL_OF_HONOUR].info = get_trans ("Medal Valour");

	/////////////////////////////////////////////////////////////////
	// Medals Areas

	russian_area = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (player_medals_screen),
			UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
			UI_ATTR_VIRTUAL_SIZE (1.0, 1.0),
			UI_ATTR_COLOUR_START (255,255,255,0),
			UI_ATTR_COLOUR_END (255,255,255,255),
			UI_ATTR_DRAWABLE (FALSE),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);

	// create basic medal ui objects
	for (i = 0; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
	{
		russian_medal_objects [i] = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (russian_area),
			UI_ATTR_VIRTUAL_POSITION (russian_medal_graphic_array[i].x1, russian_medal_graphic_array[i].y1),
			UI_ATTR_VIRTUAL_SIZE (russian_medal_graphic_array[i].x2, russian_medal_graphic_array[i].y2),
			UI_ATTR_COLOUR_START (255,255,255,0),
			UI_ATTR_COLOUR_END (255,255,255,255),
			UI_ATTR_END
		);
	}

	// create highlight areas

	for (i = MEDAL_TYPE_NONE; i < NUM_MEDAL_TYPES; i++)
	{
		create_ui_object
				(
					UI_TYPE_AREA,
					UI_ATTR_PARENT (russian_area),
					UI_ATTR_VIRTUAL_POSITION (russian_medal_info_array [i].x1, russian_medal_info_array [i].y1),
					UI_ATTR_VIRTUAL_SIZE (russian_medal_info_array [i].x2, russian_medal_info_array [i].y2),
					UI_ATTR_CLEAR (TRUE),
					UI_ATTR_HIGHLIGHTABLE (TRUE),
					UI_ATTR_ITEM_NUMBER ( i ),
					UI_ATTR_ASSOCIATION (medals_text_info),
					UI_ATTR_HIGHLIGHTED_FUNCTION (highlight_russian_medal_info),
					UI_ATTR_HIGHLIGHTED_NOTIFY_ON (NOTIFY_TYPE_BUTTON_EITHER),
#if DEBUG_MODULE
					UI_ATTR_FUNCTION (notify_award_clicked_medal),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
#endif
					UI_ATTR_END

				);
	}

}
Ejemplo n.º 14
0
void define_medals_page_objects (void)
{
	ui_object
		*temp_obj,
		*option_bdrop;

	float
		x1,
		y1,
		x2,
		y2;

	/////////////////////////////////////////////////////////////////
	// medal Log Area

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

   player_medals_screen = create_ui_object
									(
										UI_TYPE_SCREEN,
										UI_ATTR_VIRTUAL_POSITION (x1, y1),
										UI_ATTR_VIRTUAL_SIZE (x2, y2),
										UI_ATTR_COLOUR_START (255, 255, 255,0),
										UI_ATTR_COLOUR_END (255,255,255,255),
										UI_ATTR_TIME_LENGTH (500),
										UI_ATTR_OFFSET_TIME (0),
										UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_EITHER),
										UI_ATTR_FUNCTION (notify_medals_screen),
										UI_ATTR_END
									);

   medals_title_text = create_ui_object
            (
               UI_TYPE_TEXT,
               UI_ATTR_PARENT (player_medals_screen),
					UI_ATTR_TIME_LENGTH (0),
					UI_ATTR_OFFSET_TIME (0),
               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 (""),
					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
            );

	/////////////////////////////////////////////////////////////////
	// Medal Text Areas

	x1 = 0.096;
	y1 = 0.905;
//	x2 = 0.508;
	x2 = 0.808;
	y2 = 0.052;

   medals_text_name = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (player_medals_screen),
		UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_18),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
      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_CENTRE),
		UI_ATTR_TEXT (""),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

	x1 = 0.086;
	y1 = 0.958;
//	x2 = 0.628;
	x2 = 0.828;
	y2 = 0.034;

   medals_text_info = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (player_medals_screen),
		UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_14),
		UI_ATTR_VIRTUAL_POSITION (x1, y1),
		UI_ATTR_VIRTUAL_SIZE (x2, y2),
      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_CENTRE),
		UI_ATTR_TEXT (""),
		UI_ATTR_CLEAR (TRUE),
		UI_ATTR_END
	);

	/////////////////////////////////////////////////////////////////
	// Medals

	define_us_medal_objects ();

	define_russian_medal_objects ();

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

	/////////////////////////////////////////////////////////////////
	// Ok Button

	option_bdrop = create_ui_object
	(
		UI_TYPE_AREA,
		UI_ATTR_PARENT (player_medals_screen),
		UI_ATTR_VIRTUAL_POSITION (0.0, 0.0),
		UI_ATTR_VIRTUAL_SIZE (TEXT_OPTION_BDROP_WIDTH, TEXT_OPTION_BDROP_HEIGHT),
		UI_ATTR_COLOUR_START (255, 255, 255, 255),
		UI_ATTR_COLOUR_END (255, 255, 255, 255),
		UI_ATTR_TEXTURE_GRAPHIC (text_option_bdrop),
		UI_ATTR_END
	);

	temp_obj = create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (player_medals_screen),
				UI_ATTR_VIRTUAL_POSITION (OPTIONS_OK_BUTTON_POS_X, OPTIONS_OK_BUTTON_POS_Y),
				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_medals_screen_exit_button),
				UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
		      UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
   		   UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
      		UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
      		UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
				UI_ATTR_HIGHLIGHTABLE (TRUE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	// special case - reduce option bdrop width so it doesn't overlap the medal shadow on russian page...

	set_text_option_backdrop_object (option_bdrop, temp_obj);

	set_ui_object_x_size (option_bdrop, 0.336);

}
Ejemplo n.º 15
0
void initialise_exit_screen (void)
{
	float
		x1,
		y1,
		x2,
		y2;

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

   exit_screen = create_ui_object
            (
               UI_TYPE_SCREEN,
               UI_ATTR_VIRTUAL_POSITION (x1, y1),
               UI_ATTR_VIRTUAL_SIZE (x2, y2),
//               UI_ATTR_GRAPHIC (get_graphics_file_data (GRAPHICS_UI_APACHE_EXIT_SCREEN)),
					UI_ATTR_FUNCTION (notify_exit_screen),
					UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_DISPLAYED),
               UI_ATTR_END
            );

	x1 = 0.470;
	y1 = 0.5;

	exit_screen_text = create_ui_object
	(
		UI_TYPE_TEXT,
		UI_ATTR_PARENT (exit_screen),
      UI_ATTR_VIRTUAL_POSITION (x1, y1),
//		UI_ATTR_TEXT (get_trans ("Quitting...")),
		UI_ATTR_FONT_TYPE (UI_FONT_THICK_ARIAL_22),
		UI_ATTR_END
	);
/*

	/////////////////////////////////////////////////////////////////
	// Ok Button

	exit_back_button = create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (exit_screen),
				UI_ATTR_VIRTUAL_POSITION (OPTIONS_OK_BUTTON_POS_X, OPTIONS_OK_BUTTON_POS_Y),
				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_exit_yes_button),
				UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
				UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
            UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
            UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
				UI_ATTR_HIGHLIGHTABLE (TRUE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// Cancel Button

	exit_forward_button = create_ui_object
			(
				UI_TYPE_BUTTON,
				UI_ATTR_PARENT (exit_screen),
				UI_ATTR_VIRTUAL_POSITION (OPTIONS_CANCEL_BUTTON_POS_X, OPTIONS_CANCEL_BUTTON_POS_Y),
				UI_ATTR_VIRTUAL_SIZE (OPTIONS_CANCEL_BUTTON_X, OPTIONS_CANCEL_BUTTON_Y),
				UI_ATTR_TEXT (get_trans("UI_CANCEL")),
				UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_UP),
				UI_ATTR_FUNCTION (notify_exit_no_button),
				UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18),
				UI_ATTR_FONT_COLOUR (254, 124, 47, 255),
				UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
            UI_ATTR_FONT_COLOUR_START (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 0),
            UI_ATTR_FONT_COLOUR_END (ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_START (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 0),
            UI_ATTR_HIGHLIGHTED_FONT_COLOUR_END (ui_option_text_hilite_colour.r, ui_option_text_hilite_colour.g, ui_option_text_hilite_colour.b, 255),
				UI_ATTR_HIGHLIGHTABLE (TRUE),
				UI_ATTR_CLEAR (TRUE),
				UI_ATTR_END
			);
*/
}