void initialise_loading_screen (void) { float x1, y1, x2, y2; loading_screen = create_ui_object ( UI_TYPE_SCREEN, UI_ATTR_VIRTUAL_POSITION (0.0, 0.0), UI_ATTR_VIRTUAL_SIZE (1.0, 1.0), //UI_ATTR_GRAPHIC (get_graphics_file_data (GRAPHICS_UI_APACHE_LOADING_SCREEN)), UI_ATTR_FUNCTION (loading_function), UI_ATTR_END ); x1 = 0.620; y1 = 0.138; x2 = 0.2; y2 = 0.0625; loading_text = create_ui_object ( UI_TYPE_AREA, UI_ATTR_PARENT (loading_screen), UI_ATTR_VIRTUAL_POSITION (x1, y1), UI_ATTR_VIRTUAL_SIZE (x2, y2), UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22), UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_CENTRE), UI_ATTR_FONT_COLOUR_START (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 0), UI_ATTR_FONT_COLOUR_END (ui_option_title_text_colour.r, ui_option_title_text_colour.g, ui_option_title_text_colour.b, 255), UI_ATTR_FONT_TYPE (UI_FONT_THICK_ITALIC_ARIAL_18), UI_ATTR_TEXT (get_trans ("Loading")), UI_ATTR_CLEAR (TRUE), UI_ATTR_END ); }
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 (); ///////////////////////////////////////////////////////////////// }
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); }
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 ); }
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); }
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 ); }
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 (); }
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 }
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); }