Exemple #1
0
void notify_medals_screen_exit_button (ui_object *obj, void *arg)
{

	obj;
	arg;

	if ((int) arg == BUTTON_STATE_DOWN)
	{

		set_ui_object_graphic (obj, (unsigned short int *) get_graphics_file_data (GRAPHICS_UI_APACHE_PLANNER_BACK_BUTTON_SELECTED));
	}
	else if ((int) arg == BUTTON_STATE_UP)
	{

		set_ui_object_graphic (obj, (unsigned short int *) get_graphics_file_data (GRAPHICS_UI_APACHE_PLANNER_BACK_BUTTON_UNSELECTED));

		set_ui_object_redraw (player_medals_screen, TRUE);

		pop_ui_screen (SCREEN_POP_ACTUAL);
	}
	else
	{

		set_ui_object_graphic (obj, (unsigned short int *) get_graphics_file_data (GRAPHICS_UI_APACHE_PLANNER_BACK_BUTTON_UNSELECTED));

		set_ui_object_redraw (player_medals_screen, TRUE);
	}

	set_ui_object_graphic_type (obj, UI_OBJECT_ALPHA_GRAPHIC);
}
Exemple #2
0
void notify_clear_options_screen(void)
{

	store_multiplayer_options ();

	// Save the global options data

	save_global_options_data ();

	// if the graphics display adapter has changed, boot the player out
	{

		int
			flag;

		flag = FALSE;

		if (old_graphics_card_automatic_selection != get_global_graphics_device_selection_automatic ())
		{
			flag = TRUE;
		}
		else
		{
			flag = FALSE;
		}

		if (!old_graphics_card_automatic_selection)
		{
			if (old_graphics_card_selection != get_card_selection_device ())
			{
				flag = TRUE;
			}
			else
			{
				flag = FALSE;
			}
		}

		if (flag)
		{
			push_ui_screen (exit_screen);
		}
		else
		{
			pop_ui_screen (SCREEN_POP_ACTUAL);
		}
	}

	#if DEBUG_MODULE

	debug_filtered_log("Inside clear_options_screen");

	#endif
}
Exemple #3
0
void notify_select_player_exit_button (ui_object *obj, void *arg)
{
	if ((int) arg == BUTTON_STATE_UP)
	{
		set_ui_object_redraw (credits_screen, TRUE);

		pop_ui_screen (SCREEN_POP_ACTUAL);
	}
	else 
	{
		set_ui_object_redraw (credits_screen, TRUE);
	}

	set_ui_object_graphic_type (obj, UI_OBJECT_ALPHA_GRAPHIC);
}
Exemple #4
0
void push_ui_screen (ui_object *this_screen)
{

	void
		((*function) (ui_object *obj, void *arg));

	ui_object
		*stack_search;

	screen_ui_object
		*screen;

	// check if already on stack

	stack_search = screen_stack_head;

	current_screen = this_screen;

	while (stack_search)
	{

		// screen found on stack

		if (stack_search == this_screen)
		{

			// pop all down to this screen

			stack_search = screen_stack_head;

			while (stack_search != this_screen)
			{

				pop_ui_screen (SCREEN_POP_STACK_MAINTANANCE);

				stack_search = stack_search->stack_next;
			}

			function = get_ui_object_function (this_screen);

			if (function)
			{

				function (this_screen, &screen->screen_id);
			}

			return;
		}

		stack_search = stack_search->stack_next;
	}

	// add new screen

	this_screen->stack_next = screen_stack_head;

	// first screen on stack

	if (!screen_stack_head)
	{

		screen_stack_head = this_screen;

		screen_stack_tail = this_screen;

		this_screen->stack_prev = NULL;

		this_screen->stack_next = NULL;

		screen = (screen_ui_object *) this_screen->data;

		screen_stack_head->stack_id = screen_stack_size ++;

		function = get_ui_object_function (this_screen);

		if (function)
		{

			if ((get_ui_object_notify_on (this_screen) == NOTIFY_TYPE_DISPLAYED) || (get_ui_object_notify_on (this_screen) == NOTIFY_TYPE_BUTTON_EITHER))
			{

				function (this_screen, &screen->screen_id);
			}
		}
	}
	else
	{

		// add screen to head of stack

		screen = (screen_ui_object *) screen_stack_head->data;

		set_ui_object_drawable (screen_stack_head, FALSE);

		// call the previous screen's function if it has one

		function = get_ui_object_function (screen_stack_head);

		if (function)
		{

			if ((get_ui_object_notify_on (screen_stack_head) == NOTIFY_TYPE_REMOVED) || (get_ui_object_notify_on (screen_stack_head) == NOTIFY_TYPE_BUTTON_EITHER))
			{

				function (screen_stack_head, &screen->screen_id);
			}
		}

		//

		screen_stack_head->stack_prev = this_screen;

		screen_stack_head = this_screen;

		screen = (screen_ui_object *) screen_stack_head->data;

		screen_stack_head->stack_id = screen_stack_size ++;

		set_ui_object_drawable (screen_stack_head, TRUE);

		this_screen->stack_prev = NULL;

		function = get_ui_object_function (this_screen);

		if (function)
		{

			if ((get_ui_object_notify_on (this_screen) == NOTIFY_TYPE_DISPLAYED) || (get_ui_object_notify_on (this_screen) == NOTIFY_TYPE_BUTTON_EITHER))
			{

				function (this_screen, &screen->screen_id);
			}
		}
	}
}