Exemplo n.º 1
0
void define_campaign_screen_base_page_objects (void)
{
    float
    x1,
    y1,
    x2,
    y2,
    ysize;

    ui_object
    *page;

    char
    output [128];

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

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

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

    page = campaign_page [CAMPAIGN_PAGE_BASE];

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

    x1 = 0.044;
    y1 = 0.089;

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

    ysize = 0.06;

    y1 = 0.237;
    y2 = 0.31;

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

    x1 = 0.18;
    x2 = 0.2;

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

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

    x1 = 0.2;
    x2 = 0.5;

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

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

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

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

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

    x1 = 0.2;
    x2 = 0.5;

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

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

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

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

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

    x1 = 0.2;
    x2 = 0.5;

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

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

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

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

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

    x1 = 0.2;
    x2 = 0.5;

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

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

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

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

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

    x1 = 0.2;
    x2 = 0.5;

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

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

    y1 += ysize;
    y2 += ysize;

    x1 = 0.18;
    x2 = 0.2;

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

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

    x1 = 0.2;
    x2 = 0.5;

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

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

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

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

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

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

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

    // 2d map toggle

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

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

    // 3d view toggle

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

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

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

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

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

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

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

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

#ifdef DEBUG

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

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

#endif

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

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

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

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

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

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

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

    define_campaign_page_back_button (page, &page_back_button);

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

    define_map_objects (page_map_area, &page_map_dimensions, draw_page_map, campaign_map_left_click_function, map_centralise_function, &campaign_screen_full_screen_map);
}
Exemplo n.º 2
0
void define_campaign_screen_chat_page_objects (void)
{
	float
		x1,
		y1,
		x2,
		y2;

	ui_object
		*page;

	char
		string [256];

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

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

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

	page = campaign_page [CAMPAIGN_PAGE_CHAT];

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

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

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

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

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

	set_ingame_ui_object_mouse_over_properties (chat_window_destination_button);

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

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

	set_ingame_ui_object_mouse_over_properties (chat_window_message_button);

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

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

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

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

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

	set_common_slider_graphics (chat_target_list_area);

	// List Box

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

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

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

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

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

	set_common_slider_graphics (chat_message_list_area);

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

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

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

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

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

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

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

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

	// Chat Input

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

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

	// Chat Output

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

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

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

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

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

	set_ingame_ui_object_mouse_over_properties (chat_send_button);

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

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

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

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

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

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

	define_campaign_page_back_button (page, &page_back_button);
}
Exemplo n.º 3
0
void define_campaign_screen_weapon_loading_page_objects (void)
{
	float
		x1,
		y1,
		x2,
		y2;

	char
		string [256];

	int
		loop,
		gunship,
		hardpoint;

	ui_object
		*page,
		*gunship_page;

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

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

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

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

	page = campaign_page [CAMPAIGN_PAGE_WEAPON_LOADING];

	//
	// Clear buttons
	//

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

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

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

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

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

	gunship = GUNSHIP_TYPE_APACHE;

	gunship_page = weapon_loading_page [gunship];

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

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

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

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

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

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

	gunship = GUNSHIP_TYPE_HAVOC;

	gunship_page = weapon_loading_page [gunship];

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

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

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

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

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

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

	gunship = GUNSHIP_TYPE_COMANCHE;

	gunship_page = weapon_loading_page [gunship];

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

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

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

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

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

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

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

	gunship = GUNSHIP_TYPE_HOKUM;

	gunship_page = weapon_loading_page [gunship];

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

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

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

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

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

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

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

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

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

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

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

	set_common_slider_graphics (page_member_area);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	define_campaign_page_back_button (page, &page_back_button);
}
Exemplo n.º 4
0
void define_campaign_screen_save_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_SAVE] = 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_save_page_objects),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);

	page = campaign_page [CAMPAIGN_PAGE_SAVE];

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

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

	save_file_list_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 (save_file_list_area);

	// List Box

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

	save_file_list = create_ui_object
				(
					UI_TYPE_LIST_BOX,
					UI_ATTR_PARENT (save_file_list_area),
					UI_ATTR_VIRTUAL_POSITION (x1, y1),
					UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
					UI_ATTR_CLEAR (TRUE),
					UI_ATTR_FUNCTION (notify_save_file_list),
					UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
					UI_ATTR_ITEM_NUMBER (ENTITY_INDEX_DONT_CARE),
					UI_ATTR_END
				);

	/////////////////////////////////////////////////////////////////
	// Save Dialog Box

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

	save_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 (save_enter_filename_function),
				UI_ATTR_END
			);

	/////////////////////////////////////////////////////////////////
	// Filename Input

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

   save_filename_input = create_ui_object
            (
               UI_TYPE_INPUT,
               UI_ATTR_PARENT (save_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 (filename_input_function),
					UI_ATTR_TEXT_JUSTIFY (TEXT_JUSTIFY_LEFT_CENTRE),
					UI_ATTR_CLEAR (TRUE),
               UI_ATTR_END
            );

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

   save_current_filename = create_ui_object
            (
               UI_TYPE_AREA,
               UI_ATTR_PARENT (save_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_CLEAR (TRUE),
					UI_ATTR_FUNCTION (save_enter_filename_function),
               UI_ATTR_END
            );

	/////////////////////////////////////////////////////////////////
	// Enter Filename Text

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

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

	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
			);

	/////////////////////////////////////////////////////////////////
	// Confirm Button

	x1 = 0.320;
	y1 = 0.834;
	x2 = 0.672;
	y2 = 0.884;

	save_game_confirm_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_TEXT (get_trans ("Save")),
				UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
				UI_ATTR_FUNCTION (save_game_function),
				UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics//ui//cohokum//map//cbtn.psd")),
				UI_ATTR_END
			);

	set_ingame_ui_object_mouse_over_properties (save_game_confirm_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);
}