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); }
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); }
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_dedicated_server_screen (void) { float x, y; dedicated_server_screen = create_ui_object ( UI_TYPE_SCREEN, UI_ATTR_POSITION (0, 0), UI_ATTR_VIRTUAL_SIZE (1.0, 1.0), UI_ATTR_FUNCTION (dedicated_server_function), UI_ATTR_DRAW_FUNCTION (dedicated_screen_update_function), UI_ATTR_END ); create_ui_object ( UI_TYPE_TEXT, UI_ATTR_PARENT (dedicated_server_screen), UI_ATTR_VIRTUAL_POSITION (0.66, 0.141666), UI_ATTR_TEXT ("Dedicated Server"), UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22), UI_ATTR_END ); x = 0.125; y = 0.62; dedicated_server_title_text = create_ui_object ( UI_TYPE_TEXT, UI_ATTR_PARENT (dedicated_server_screen), UI_ATTR_VIRTUAL_POSITION (x, y), UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22), UI_ATTR_END ); x = 0.125; y += 0.0625; dedicated_server_map_text = create_ui_object ( UI_TYPE_TEXT, UI_ATTR_PARENT (dedicated_server_screen), UI_ATTR_VIRTUAL_POSITION (x, y), UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22), UI_ATTR_END ); x = 0.125; y += 0.0625; dedicated_server_game_text = create_ui_object ( UI_TYPE_TEXT, UI_ATTR_PARENT (dedicated_server_screen), UI_ATTR_VIRTUAL_POSITION (x, y), UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22), UI_ATTR_END ); x = 0.125; y += 0.0625; dedicated_server_time_text = create_ui_object ( UI_TYPE_TEXT, UI_ATTR_PARENT (dedicated_server_screen), UI_ATTR_VIRTUAL_POSITION (x, y), UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22), UI_ATTR_END ); dedicated_server_quit_button = create_ui_object ( UI_TYPE_BUTTON, UI_ATTR_PARENT (dedicated_server_screen), UI_ATTR_VIRTUAL_POSITION (0.0, 0.89583), UI_ATTR_VIRTUAL_SIZE (0.125, 0.0625), UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_22), UI_ATTR_TEXT (get_trans("UI_EXIT")), UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_BUTTON_EITHER), UI_ATTR_FUNCTION (notify_dedicated_server_quit_button), UI_ATTR_HIGHLIGHTABLE (TRUE), UI_ATTR_CLEAR (TRUE), UI_ATTR_END ); ///////////////////////////////////////////////////////////////// // List of players { float x1, y1, x2, y2; x1 = 0.125; y1 = 0.175; x2 = 0.6; y2 = 0.6; player_list_area = create_ui_object ( UI_TYPE_AREA, UI_ATTR_PARENT (dedicated_server_screen), UI_ATTR_VIRTUAL_POSITION (x1, y1), UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1), UI_ATTR_VSLIDER (0, 300, 12), UI_ATTR_TEXTURE_GRAPHIC (list_box_graphic), UI_ATTR_END ); set_frontend_slider_graphics (player_list_area); // List Box x1 = 0.05; y1 = 0.05; x2 = 0.95; y2 = 0.95; player_list = create_ui_object ( UI_TYPE_LIST_BOX, UI_ATTR_PARENT (player_list_area), UI_ATTR_VIRTUAL_POSITION (x1, y1), UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1), UI_ATTR_CLEAR (TRUE), UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16), UI_ATTR_NOTIFY_ON (NOTIFY_TYPE_NONE), UI_ATTR_END ); } }
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); }