Ejemplo n.º 1
0
/**
 *
 *  rct2: 0x00699C55
 */
static void window_guest_list_scrollgetsize(rct_window *w, int scrollIndex, int *width, int *height)
{
	int i, y, numGuests, spriteIndex;
	rct_peep *peep;

	switch (_window_guest_list_selected_tab) {
	case PAGE_INDIVIDUAL:
		// Count the number of guests
		numGuests = 0;

		FOR_ALL_GUESTS(spriteIndex, peep) {
			if (peep->outside_of_park != 0)
				continue;
			if (_window_guest_list_selected_filter != -1)
				if (window_guest_list_is_peep_in_filter(peep))
					continue;
			if (_window_guest_list_tracking_only && !(peep->flags & PEEP_FLAGS_TRACKING))
				continue;
			numGuests++;
		}
		w->var_492 = numGuests;
		y = numGuests * 10;
		RCT2_GLOBAL(0x00F1EE09, uint32) = numGuests;
		break;
	case PAGE_SUMMARISED:
		// Find the groups
		window_guest_list_find_groups();
		w->var_492 = _window_guest_list_num_groups;
		y = _window_guest_list_num_groups * 21;
		break;
	default:
		log_error("Improper tab selected: %d, bailing out.", _window_guest_list_selected_tab);
		return;
	}

	i = _window_guest_list_selected_page;
	for (i = _window_guest_list_selected_page - 1; i >= 0; i--)
		y -= 0x7BF2;
	if (y < 0)
		y = 0;
	if (y > 0x7BF2)
		y = 0x7BF2;
	if (_window_guest_list_highlighted_index != -1) {
		_window_guest_list_highlighted_index = -1;
		window_invalidate(w);
	}

	i = y - window_guest_list_widgets[WIDX_GUEST_LIST].bottom + window_guest_list_widgets[WIDX_GUEST_LIST].top + 21;
	if (i < 0)
		i = 0;
	if (i < w->scrolls[0].v_top) {
		w->scrolls[0].v_top = i;
		window_invalidate(w);
	}

	*width = 447;
	*height = y;
}
Ejemplo n.º 2
0
void window_guest_list_refresh_list()
{
    _window_guest_list_last_find_groups_wait = 0;
    _window_guest_list_last_find_groups_tick = 0;
    window_guest_list_find_groups();
}
Ejemplo n.º 3
0
/**
 *
 *  rct2: 0x00699C55
 */
static void window_guest_list_scrollgetsize(rct_window *w, sint32 scrollIndex, sint32 *width, sint32 *height)
{
    sint32 i, y, numGuests, spriteIndex;
    rct_peep *peep;

    switch (_window_guest_list_selected_tab) {
    case PAGE_INDIVIDUAL:
        // Count the number of guests
        numGuests = 0;

        FOR_ALL_GUESTS(spriteIndex, peep) {
            if (peep->outside_of_park != 0)
                continue;
            if (_window_guest_list_selected_filter != -1)
                if (window_guest_list_is_peep_in_filter(peep))
                    continue;
            if (!guest_should_be_visible(peep))
                continue;
            numGuests++;
        }
        w->var_492 = numGuests;
        y = numGuests * SCROLLABLE_ROW_HEIGHT;
        _window_guest_list_num_pages = (sint32) ceilf((float)numGuests / 3173);
        if (_window_guest_list_num_pages == 0)
            _window_guest_list_selected_page = 0;
        else if (_window_guest_list_selected_page >= _window_guest_list_num_pages)
            _window_guest_list_selected_page = _window_guest_list_num_pages - 1;
        break;
    case PAGE_SUMMARISED:
        // Find the groups
        window_guest_list_find_groups();
        w->var_492 = _window_guest_list_num_groups;
        y = _window_guest_list_num_groups * SUMMARISED_GUEST_ROW_HEIGHT;
        break;
    default:
        log_error("Improper tab selected: %d, bailing out.", _window_guest_list_selected_tab);
        return;
    }

    i = _window_guest_list_selected_page;
    for (i = _window_guest_list_selected_page - 1; i >= 0; i--)
        y -= 0x7BF2;
    if (y < 0)
        y = 0;
    if (y > 0x7BF2)
        y = 0x7BF2;
    if (_window_guest_list_highlighted_index != -1) {
        _window_guest_list_highlighted_index = -1;
        window_invalidate(w);
    }

    i = y - window_guest_list_widgets[WIDX_GUEST_LIST].bottom + window_guest_list_widgets[WIDX_GUEST_LIST].top + 21;
    if (i < 0)
        i = 0;
    if (i < w->scrolls[0].v_top) {
        w->scrolls[0].v_top = i;
        window_invalidate(w);
    }

    *width = 447;
    *height = y;
}
Ejemplo n.º 4
0
/**
 *
 *  rct2: 0x00699C55
 */
static void window_guest_list_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
{
    int32_t i, y, numGuests, spriteIndex;
    Peep* peep;

    switch (_window_guest_list_selected_tab)
    {
        case PAGE_INDIVIDUAL:
            // Count the number of guests
            numGuests = 0;

            FOR_ALL_GUESTS (spriteIndex, peep)
            {
                if (peep->outside_of_park != 0)
                    continue;
                if (_window_guest_list_selected_filter != -1)
                    if (window_guest_list_is_peep_in_filter(peep))
                        continue;
                if (!guest_should_be_visible(peep))
                    continue;
                numGuests++;
            }
            w->var_492 = numGuests;
            y = numGuests * SCROLLABLE_ROW_HEIGHT;
            _window_guest_list_num_pages = 1 + (numGuests - 1) / GUESTS_PER_PAGE;
            if (_window_guest_list_num_pages == 0)
                _window_guest_list_selected_page = 0;
            else if (_window_guest_list_selected_page >= _window_guest_list_num_pages)
                _window_guest_list_selected_page = _window_guest_list_num_pages - 1;
            break;
        case PAGE_SUMMARISED:
            // Find the groups
            window_guest_list_find_groups();
            w->var_492 = _window_guest_list_num_groups;
            y = _window_guest_list_num_groups * SUMMARISED_GUEST_ROW_HEIGHT;
            break;
        default:
            log_error("Improper tab selected: %d, bailing out.", _window_guest_list_selected_tab);
            return;
    }

    y -= GUEST_PAGE_HEIGHT * _window_guest_list_selected_page;
    y = std::max(0, std::min(y, GUEST_PAGE_HEIGHT));

    if (_window_guest_list_highlighted_index != -1)
    {
        _window_guest_list_highlighted_index = -1;
        window_invalidate(w);
    }

    i = y - window_guest_list_widgets[WIDX_GUEST_LIST].bottom + window_guest_list_widgets[WIDX_GUEST_LIST].top + 21;
    if (i < 0)
        i = 0;
    if (i < w->scrolls[0].v_top)
    {
        w->scrolls[0].v_top = i;
        window_invalidate(w);
    }

    *width = 447;
    *height = y;
}