static void window_scenarioselect_mousedown(int widgetIndex, rct_window*w, rct_widget* widget)
{
	if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB5) {
		w->selected_tab = widgetIndex - 4;
		w->var_494 = 0;
		window_invalidate(w);
		window_event_resize_call(w);
		window_event_invalidate_call(w);
		window_init_scroll_widgets(w);
		window_invalidate(w);
	}
}
Beispiel #2
0
static void window_scenarioselect_mousedown(int widgetIndex, rct_window*w, rct_widget* widget)
{
	if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB8) {
		w->selected_tab = widgetIndex - 4;
		w->highlighted_scenario = NULL;
		initialise_list_items(w);
		window_invalidate(w);
		window_event_resize_call(w);
		window_event_invalidate_call(w);
		window_init_scroll_widgets(w);
		window_invalidate(w);
	}
}
Beispiel #3
0
/**
 * Used to invalidate flat button widgets when the mouse leaves and enters them. This should be generalised so that all widgets
 * can use this in the future.
 */
static void input_widget_over_flatbutton_invalidate()
{
	rct_window *w = window_find_by_number(gHoverWidget.window_classification, gHoverWidget.window_number);
	if (w != NULL) {
		window_event_invalidate_call(w);
		if (w->widgets[gHoverWidget.widget_index].type == WWT_FLATBTN) {
			widget_invalidate_by_number(
				gHoverWidget.window_classification,
				gHoverWidget.window_number,
				gHoverWidget.widget_index
			);
		}
	}
}
Beispiel #4
0
static void window_player_set_page(rct_window* w, int page)
{
	int originalPage = w->page;

	w->page = page;
	w->frame_no = 0;
	w->no_list_items = 0;
	w->selected_list_item = -1;

	w->enabled_widgets = window_player_page_enabled_widgets[page];
	w->hold_down_widgets = 0;
	w->event_handlers = window_player_page_events[page];
	w->pressed_widgets = 0;
	w->widgets = window_player_page_widgets[page];
	window_invalidate(w);
	window_event_resize_call(w);
	window_event_invalidate_call(w);
	window_init_scroll_widgets(w);
	window_invalidate(w);

	if (page == WINDOW_PLAYER_PAGE_OVERVIEW) {
		if (w->viewport == NULL) {
			viewport_create(w, w->x, w->y, w->width, w->height, 0, 128 * 32, 128 * 32, 0, 1, -1);
			w->flags |= WF_NO_SCROLLING;
			window_event_invalidate_call(w);
			window_player_update_viewport(w, false);
		} else if (originalPage != page) {
			window_event_invalidate_call(w);
			window_player_update_viewport(w, false);
		}
	} else {
		if (w->viewport != NULL) {
			w->viewport->width = 0;
			w->viewport = NULL;
		}
	}
}
/**
 *
 *  rct2: 0x00685392
 */
static void window_editor_inventions_list_update(rct_window* w)
{
    w->frame_no++;
    window_event_invalidate_call(w);
    widget_invalidate(w, WIDX_TAB_1);

    if (_editorInventionsListDraggedItem == nullptr)
        return;

    if (window_find_by_class(WC_EDITOR_INVENTION_LIST_DRAG) != nullptr)
        return;

    _editorInventionsListDraggedItem = nullptr;
    window_invalidate(w);
}
/**
 *
 *  rct2: 0x00668496
 */
static void window_editor_scenario_options_set_page(rct_window *w, int page)
{
	if (w->page == page)
		return;

	w->page = page;
	w->frame_no = 0;
	w->var_492 = 0;
	w->enabled_widgets = window_editor_scenario_options_page_enabled_widgets[page];
	w->hold_down_widgets = window_editor_scenario_options_page_hold_down_widgets[page];
	w->event_handlers = window_editor_scenario_options_page_events[page];
	w->widgets = window_editor_scenario_options_widgets[page];
	window_invalidate(w);
	window_event_resize_call(w);
	window_event_invalidate_call(w);
	window_init_scroll_widgets(w);
	window_invalidate(w);
}
Beispiel #7
0
static void window_multiplayer_set_page(rct_window* w, sint32 page)
{
	_windowInformationSizeDirty = true;

	w->page = page;
	w->frame_no = 0;
	w->no_list_items = 0;
	w->selected_list_item = -1;

	w->enabled_widgets = window_multiplayer_page_enabled_widgets[page];
	w->hold_down_widgets = 0;
	w->event_handlers = window_multiplayer_page_events[page];
	w->pressed_widgets = 0;
	w->widgets = window_multiplayer_page_widgets[page];

	window_event_resize_call(w);
	window_event_invalidate_call(w);
	window_init_scroll_widgets(w);
	window_invalidate(w);
}
Beispiel #8
0
/**
 *
 *  rct2: 0x006EA10D
 */
void window_tooltip_open(rct_window *widgetWindow, int widgetIndex, int x, int y)
{
	rct_widget *widget;

	if (widgetWindow == NULL || widgetIndex == -1)
		return;

	widget = &widgetWindow->widgets[widgetIndex];
	window_event_invalidate_call(widgetWindow);
	if (widget->tooltip == 0xFFFF)
		return;

	RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_CLASS, rct_windowclass) = widgetWindow->classification;
	RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_NUMBER, rct_windownumber) = widgetWindow->number;
	RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WIDGET_INDEX, uint16) = widgetIndex;

	if (window_event_tooltip_call(widgetWindow, widgetIndex) == (rct_string_id)STR_NONE)
		return;

	window_tooltip_show(widget->tooltip, x, y);
}
Beispiel #9
0
/**
 *
 *  rct2: 0x006EA10D
 */
void window_tooltip_open(rct_window* widgetWindow, rct_widgetindex widgetIndex, int32_t x, int32_t y)
{
    rct_widget* widget;

    if (widgetWindow == nullptr || widgetIndex == -1)
        return;

    widget = &widgetWindow->widgets[widgetIndex];
    window_event_invalidate_call(widgetWindow);
    if (widget->tooltip == 0xFFFF)
        return;

    gTooltipWidget.window_classification = widgetWindow->classification;
    gTooltipWidget.window_number = widgetWindow->number;
    gTooltipWidget.widget_index = widgetIndex;

    if (window_event_tooltip_call(widgetWindow, widgetIndex) == STR_NONE)
        return;

    window_tooltip_show(widget->tooltip, x, y);
}
/**
 *
 *  rct2: 0x00670C3F
 */
static void window_editor_scenario_options_guests_update(rct_window *w)
{
	w->frame_no++;
	window_event_invalidate_call(w);
	widget_invalidate(w, WIDX_TAB_2);
}