コード例 #1
0
ファイル: advert.c プロジェクト: Comanche93/eech
void notify_advert_screen (ui_object *obj, void *arg)
{
/*	time_t
		start_time,
		end_time;

	float
		elapsed_time;
*/

	if ( get_ui_object_drawable ( obj ) )
	{

		//
		// Setup screen graphics
		//

		blit_front_buffer_to_render_buffer ();

		if (advert_screen_graphic)
		{

			destroy_texture_graphic (advert_screen_graphic);

			advert_screen_graphic = NULL;
		}

		advert_screen_graphic = create_texture_graphic ("graphics\\ui\\cohokum\\advert.psd");

		set_ui_object_texture_graphic (advert_screen, advert_screen_graphic);

		reset_time_values (advert_screen);
	}
	else
	{

		if (advert_screen_graphic)
		{

			destroy_texture_graphic (advert_screen_graphic);

			advert_screen_graphic = NULL;
		}
	}

	set_mouse_off ();

	set_ui_object_redraw (advert_screen, TRUE);

	ui_force_update ();

	Sleep (5000);

	set_mouse_on ();

//	push_ui_screen (main_screen);

	set_ui_object_drawable (advert_ok_button, TRUE);
}
コード例 #2
0
ファイル: dedi_sc.c プロジェクト: Comanche93/eech
void dedicated_server_function (ui_object *obj, void *arg)
{

	char
		buffer [256];

	set_mouse_on ();

	set_mouse_graphic_on ();

	ASSERT (current_game_session);

	//

	if ( get_ui_object_drawable ( obj ) )
	{

		if ( main_screen_texture )
		{
	
			destroy_texture_graphic (dedicated_server_screen_texture);

			dedicated_server_screen_texture = NULL;
		}
	
		dedicated_server_screen_texture = create_texture_graphic ( "graphics\\ui\\cohokum\\demoload.psd" );
	
		set_ui_object_texture_graphic (dedicated_server_screen, dedicated_server_screen_texture);
	
		blit_front_buffer_to_render_buffer ();
	
		ui_set_user_function (NULL);
	}
	else
	{
		if (main_screen_texture)
		{
	
			destroy_texture_graphic (dedicated_server_screen_texture);

			dedicated_server_screen_texture = NULL;
		}
	}
	//

	sprintf (buffer, "Title : %s", current_game_session->title);

	set_ui_object_text (dedicated_server_title_text, buffer);

	sprintf (buffer, "Map : %s", current_game_session->data_path);

	set_ui_object_text (dedicated_server_map_text, buffer);

	sprintf (buffer, "Game : %s", current_game_session->campaign_filename);

	set_ui_object_text (dedicated_server_game_text, buffer);
}
コード例 #3
0
ファイル: ca_fsmap.c プロジェクト: Comanche93/eech
void define_campaign_screen_full_screen_map_objects (void)
{
	float
		x1,
		y1,
		x2,
		y2;

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

	campaign_screen_full_screen_map = 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_CLEAR (TRUE),
			UI_ATTR_END
		);

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

	info_area = 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_TEXTURE_GRAPHIC (create_texture_graphic ("graphics\\ui\\cohokum\\map\\exlogbar.psd")),
			UI_ATTR_END
		);

	set_ui_object_user_ptr (campaign_screen_full_screen_map, info_area);

	define_info_bar_objects (info_area);
}
コード例 #4
0
ファイル: exit_sc.c プロジェクト: DexterWard/comanche
void notify_exit_screen (ui_object *obj, void *arg)
{

	if ( get_ui_object_drawable ( obj ) )
	{

		//
		// Setup screen graphics
		//

		blit_front_buffer_to_render_buffer ();

		if (exit_screen_graphic)
		{

			destroy_texture_graphic (exit_screen_graphic);

			exit_screen_graphic = NULL;
		}

		exit_screen_graphic = create_texture_graphic ("graphics//ui//cohokum//exit.psd");

		set_ui_object_texture_graphic (exit_screen, exit_screen_graphic);

		reset_time_values (exit_screen);

		set_exit_ui (TRUE);
	}
	else
	{

		if (exit_screen_graphic)
		{

			destroy_texture_graphic (exit_screen_graphic);

			exit_screen_graphic = NULL;
		}
	}
}
コード例 #5
0
ファイル: credits.c プロジェクト: Comanche93/eech
void notify_credits_screen (ui_object *obj, void *arg)
{

	if ( get_ui_object_drawable ( obj ) )
	{
		
		//
		// Setup screen graphics
		//
	
		blit_front_buffer_to_render_buffer ();
	
		if (credits_screen_graphic)
		{
		
			destroy_texture_graphic (credits_screen_graphic);
	
			credits_screen_graphic = NULL;
		}
		
		credits_screen_graphic = create_texture_graphic ("graphics\\ui\\cohokum\\credits.psd");
		
		set_ui_object_texture_graphic (credits_screen, credits_screen_graphic);
		
		reset_time_values (credits_screen);
	}
	else
	{

		if (credits_screen_graphic)
		{
	
			destroy_texture_graphic (credits_screen_graphic);

			credits_screen_graphic = NULL;
		}
	}
}
コード例 #6
0
ファイル: load_sc.c プロジェクト: Comanche93/eech
void initialise_demoload_graphic (ui_object *obj)
{
	if ( get_ui_object_drawable ( obj ) )
	{
		
		//
		// Setup screen graphics
		//
	
		blit_front_buffer_to_render_buffer ();
	
		if (demoload_screen_graphic)
		{
		
			destroy_texture_graphic (demoload_screen_graphic);
	
			demoload_screen_graphic = NULL;
		}
		
		demoload_screen_graphic = create_texture_graphic ("graphics\\ui\\cohokum\\demoload.psd");
		
		set_ui_object_texture_graphic (loading_screen, demoload_screen_graphic);
		
		reset_time_values (loading_screen);
	}
	else
	{

		if (demoload_screen_graphic)
		{
	
			destroy_texture_graphic (demoload_screen_graphic);

			demoload_screen_graphic = NULL;
		}
	}
}
コード例 #7
0
ファイル: ca_wload.c プロジェクト: DexterWard/comanche
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);
}
コード例 #8
0
ファイル: ca_chat.c プロジェクト: Comanche93/eech
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);
}
コード例 #9
0
ファイル: fflight.c プロジェクト: DexterWard/comanche
void initialise_free_flight_screen (void)
{
	float
		x1, x2,
		y1, y2,
		x_size,
		y_size;

	char
		string [256];

	x_size = 1.0;
	y_size = 1.0;

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

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

	define_free_flight_screen_map_page_objects ();

	define_free_flight_screen_info_objects ();

	define_free_flight_screen_selection_objects ();

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

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

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

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

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

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

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

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

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

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

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

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

	create_ui_object
		(
			UI_TYPE_BUTTON,
			UI_ATTR_PARENT (free_flight_quit_campaign_area),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_TEXT (get_trans ("No")),
			UI_ATTR_FUNCTION (notify_free_flight_cancel_quit_campaign_button),
			UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_16),
			UI_ATTR_FONT_COLOUR (ui_ingame_live_text_colour.r, ui_ingame_live_text_colour.g, ui_ingame_live_text_colour.b, ui_ingame_live_text_colour.a),
			UI_ATTR_HIGHLIGHTED_FONT_COLOUR (ui_ingame_highlight_text_colour.r, ui_ingame_highlight_text_colour.g, ui_ingame_highlight_text_colour.b, ui_ingame_highlight_text_colour.a),
			UI_ATTR_SELECTED_FONT_COLOUR (ui_ingame_selected_text_colour.r, ui_ingame_selected_text_colour.g, ui_ingame_selected_text_colour.b, ui_ingame_selected_text_colour.a),
			UI_ATTR_HIGHLIGHTABLE (TRUE),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);
}
コード例 #10
0
ファイル: init_sc.c プロジェクト: Comanche93/eech
void init_function (ui_object *obj, void *arg)
{

	set_mouse_off ();

	if ( get_ui_object_drawable ( obj ) )
	{

		if ( main_screen_texture )
		{
	
			destroy_texture_graphic (init_screen_texture);

			init_screen_texture = NULL;
		}
	
		init_screen_texture = create_texture_graphic ( "graphics\\ui\\cohokum\\title.psd" );
	
		set_ui_object_texture_graphic (init_screen, init_screen_texture);
	
		blit_front_buffer_to_render_buffer ();
	
		ui_set_user_function (NULL);
	}
	else
	{
		if (main_screen_texture)
		{
	
			destroy_texture_graphic (init_screen_texture);

			init_screen_texture = NULL;
		}
	}
	
	ui_force_update ();

	full_initialise_game ();

	set_mouse_on ();

	switch (command_line_run_mode)
	{
/*
		case RUN_MODE_AITOOL:
		{

			initialise_aitool ();

			push_ui_screen (aitool_select_map_screen);

			break;
		}
*/
		case RUN_MODE_NORMAL:
		default:
		{

			if (command_line_comms_dedicated_server)
			{

				process_game_initialisation_phases ();
			}
			else
			{
	
				play_cd_music ( CD_MUSIC_TYPE_INTRO );

				#if DEMO_VERSION
					push_ui_screen (advert_screen);
				#else
					push_ui_screen (main_screen);
				#endif
			}

			break;
		}
	}
}
コード例 #11
0
ファイル: main_fn.c プロジェクト: DexterWard/comanche
void notify_main_screen (ui_object *obj, void *arg)
{

	obj;
	arg;

	if ( get_ui_object_drawable ( obj ) )
	{

		if ( main_screen_texture )
		{

			destroy_texture_graphic ( main_screen_texture );

			main_screen_texture = NULL;
		}

		main_screen_texture = create_texture_graphic ( "graphics//ui//cohokum//main.psd" );

		set_ui_object_texture_graphic ( main_screen, main_screen_texture );

		blit_front_buffer_to_render_buffer ();

		leave_mission ();

		ui_set_user_function (NULL);

		reset_time_values ( main_screen );
	}
	else
	{

		if ( main_screen_texture )
		{

			destroy_texture_graphic ( main_screen_texture );

			main_screen_texture = NULL;
		}
	}

	#if DEMO_VERSION

		set_ui_object_highlightable (pilots_button, FALSE);

		set_ui_object_font_colour_end (pilots_button, ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

		set_ui_object_notify_on (pilots_button, NOTIFY_TYPE_NONE);

		set_ui_object_drawable (ghost_pilots_button, TRUE);

		set_ui_object_highlightable (credits_button, FALSE);

		set_ui_object_font_colour_end (credits_button, ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

		set_ui_object_drawable (ghost_credits_button, TRUE);

		set_ui_object_notify_on (credits_button, NOTIFY_TYPE_NONE);

	#endif
}
コード例 #12
0
ファイル: play_md.c プロジェクト: DexterWard/comanche
void notify_medals_screen (ui_object *obj)
{

	int
		i;

	if ( get_ui_object_drawable (obj) )
	{

		if (medals_screen_texture)
		{
			for (i = 1; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
			{
				destroy_texture_graphic (medal_graphics [i]);

				medal_graphics [i] = NULL;
			}

			destroy_texture_graphic (medals_screen_texture);

			medals_screen_texture = NULL;
		}

		if (player_log_current_side == ENTITY_SIDE_BLUE_FORCE)
		{
			set_ui_object_text (medals_title_text, get_trans("US"));

			medals_screen_texture = create_texture_graphic ( "graphics//ui//cohokum//medalsus.psd" );

			set_ui_object_drawable (russian_area, FALSE);

			set_ui_object_drawable (us_area, TRUE);

			// create medal texture graphic objects, except MEDAL_TYPE_NONE
			for (i = 1; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
			{
				medal_graphics [i] = create_texture_graphic (us_medal_graphic_array[i].name);

				set_ui_object_texture_graphic (us_medal_objects [i], medal_graphics [i]);
			}

			medal_graphics [0] = NULL;

			// set medal states
			set_medal_states (us_medal_objects);
		}
		else
		{
			set_ui_object_text (medals_title_text, get_trans("Russian"));

			medals_screen_texture = create_texture_graphic ( "graphics//ui//cohokum//medalssv.psd" );

			set_ui_object_drawable (russian_area, TRUE);

			set_ui_object_drawable (us_area, FALSE);

			// create medal texture graphic objects, except MEDAL_TYPE_NONE
			for (i = 1; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
			{
				medal_graphics [i] = create_texture_graphic (russian_medal_graphic_array[i].name);

				set_ui_object_texture_graphic (russian_medal_objects [i], medal_graphics [i]);
			}

			medal_graphics [0] = NULL;

			// set medal states
			set_medal_states (russian_medal_objects);
		}

		set_ui_object_texture_graphic (player_medals_screen, medals_screen_texture);

		recursively_set_object_time (player_medals_screen, MEDALS_AREA_FADE_TIME, MEDALS_AREA_OFFSET_TIME);

		reset_time_values (player_medals_screen);

		blit_front_buffer_to_render_buffer ();
	}
	else
	{

		if (medals_screen_texture )
		{
			for (i = 1; i < NUMBER_OF_MEDAL_GRAPHICS; i++)
			{
				destroy_texture_graphic (medal_graphics [i]);

				medal_graphics [i] = NULL;
			}

			destroy_texture_graphic (medals_screen_texture);

			medals_screen_texture = NULL;
		}
	}

	#if DEBUG_MODULE
		debug_filtered_log("Inside show_medals_screen");
	#endif
}
コード例 #13
0
ファイル: ca_save.c プロジェクト: DexterWard/comanche
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);
}
コード例 #14
0
ファイル: main_sc.c プロジェクト: DexterWard/comanche
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
}
コード例 #15
0
ファイル: options.c プロジェクト: DexterWard/comanche
void notify_options_screen (ui_object *obj, void *arg)
{

	if ( get_ui_object_drawable ( obj ) )
	{

		//
		// Setup screen graphics
		//

		blit_front_buffer_to_render_buffer ();

		if (options_screen_graphic)
		{

			destroy_texture_graphic (options_screen_graphic);

			options_screen_graphic = NULL;
		}

		options_screen_graphic = create_texture_graphic ("graphics//ui//cohokum//setup.psd");

		set_ui_object_texture_graphic (options_screen, options_screen_graphic);

//		reset_time_values (options_screen);

		// if called from within game - hide certain options
		if (get_current_game_session())
		{
			set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], FALSE);

			set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

			set_ui_object_drawable (ghost_multiplayer_option_button, TRUE);

			if (current_options_page == OPTIONS_PAGE_MULTIPLAYER)
			{
				current_options_page = OPTIONS_PAGE_GRAPHICS;
			}

			#if INGAME_SOUND_OPTIONS

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_SOUND], FALSE);

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_INGAME_SOUND], TRUE);

			if (current_options_page == OPTIONS_PAGE_SOUND)
			{
				current_options_page = OPTIONS_PAGE_INGAME_SOUND;
			}

			#else

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_INGAME_SOUND], FALSE);

			set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_SOUND], FALSE);

			set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_SOUND], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

			set_ui_object_drawable (ghost_sound_option_button, TRUE);

			if (current_options_page == OPTIONS_PAGE_SOUND)
			{
				current_options_page = OPTIONS_PAGE_GRAPHICS;
			}

			#endif
		}
		else
		{
			set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], TRUE);

			set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255);

			set_ui_object_drawable (ghost_multiplayer_option_button, FALSE);

			#if INGAME_SOUND_OPTIONS

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_SOUND], TRUE);

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_INGAME_SOUND], FALSE);

			if (current_options_page == OPTIONS_PAGE_INGAME_SOUND)
			{
				current_options_page = OPTIONS_PAGE_SOUND;
			}

			#else

			set_ui_object_drawable (options_page_buttons[OPTIONS_PAGE_INGAME_SOUND], FALSE);

			set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_SOUND], TRUE);

			set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_SOUND], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 255);

			set_ui_object_drawable (ghost_sound_option_button, FALSE);

			#endif
		}

		#if DEMO_VERSION

		set_ui_object_highlightable (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], FALSE);

		set_ui_object_font_colour_end (options_page_buttons[OPTIONS_PAGE_MULTIPLAYER], ui_option_text_default_colour.r, ui_option_text_default_colour.g, ui_option_text_default_colour.b, 127);

		set_ui_object_drawable (ghost_multiplayer_option_button, TRUE);

		#endif

		//initialise the joystick devices

		initialise_joystick_selection ();

		//call most recently entered options page

		notify_options_page (current_options_page);

		// get pointer to current graphics card

		old_graphics_card_selection = get_card_selection_device ();

		old_graphics_card_automatic_selection = get_global_graphics_device_selection_automatic ();
	}
	else
	{

		if (options_screen_graphic)
		{

			destroy_texture_graphic (options_screen_graphic);

			options_screen_graphic = NULL;
		}
	}
}
コード例 #16
0
ファイル: ca_base.c プロジェクト: DexterWard/comanche
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);
}
コード例 #17
0
ファイル: ff_info.c プロジェクト: Comanche93/eech
void define_free_flight_screen_info_objects (void)
{
	float
		x1,
		y1,
		x2,
		y2;

	/////////////////////////////////////////////////////////////////
	// Time / Last Log Event Area
	/////////////////////////////////////////////////////////////////

	x1 = 0.152;
	y1 = 0.915;

	x2 = 0.850;
	y2 = 0.977;

	create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (free_flight_screen),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
			UI_ATTR_TEXTURE_GRAPHIC (create_texture_graphic ("graphics\\ui\\cohokum\\map\\fflogbar.psd")),
			UI_ATTR_END
		);

	x1 = 0.160;
	y1 = 0.915;
	x2 = 0.850;
	y2 = 0.977;

	info_area = create_ui_object
		(
			UI_TYPE_AREA,
			UI_ATTR_PARENT (free_flight_screen),
			UI_ATTR_VIRTUAL_POSITION (x1, y1),
			UI_ATTR_VIRTUAL_SIZE (x2 - x1, y2 - y1),
			UI_ATTR_FONT_TYPE (UI_FONT_ARIAL_10),
			UI_ATTR_CLEAR (TRUE),
			UI_ATTR_END
		);

	x1 = 0.0;
	y1 = 0.889;

	x2 = 1.0;
	y2 = 0.893;

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

	define_info_bar_objects (info_area);
}