/** * * rct2: 0x006BD785 */ void window_themes_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32 scrollIndex) { sint32 y; if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS || _selected_tab == WINDOW_THEMES_TAB_FEATURES) return; if ((w->colours[1] & 0x80) == 0) //gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light); gfx_clear(dpi, ColourMapA[w->colours[1]].mid_light); y = 0; for (sint32 i = 0; i < get_colour_scheme_tab_count(); i++) { if (y > dpi->y + dpi->height) { break; } if (y + _row_height >= dpi->y) { if (i + 1 < get_colour_scheme_tab_count()) { sint32 colour = w->colours[1]; if (colour & COLOUR_FLAG_TRANSLUCENT) { translucent_window_palette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)]; gfx_filter_rect(dpi, 0, y + _row_height - 2, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 2, windowPalette.highlight); gfx_filter_rect(dpi, 0, y + _row_height - 1, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 1, windowPalette.shadow); } else { colour = ColourMapA[w->colours[1]].mid_dark; gfx_fill_rect(dpi, 0, y + _row_height - 2, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 2, colour); colour = ColourMapA[w->colours[1]].lightest; gfx_fill_rect(dpi, 0, y + _row_height - 1, window_themes_widgets[WIDX_THEMES_LIST].right, y + _row_height - 1, colour); } } rct_windowclass wc = get_window_class_tab_index(i); sint32 numColours = theme_desc_get_num_colours(wc); for (uint8 j = 0; j < numColours; j++) { gfx_draw_string_left(dpi, theme_desc_get_name(wc), NULL, w->colours[1], 2, y + 4); uint8 colour = theme_get_colour(wc, j); uint32 image = ((colour & ~COLOUR_FLAG_TRANSLUCENT) << 19) | 0x60000000 | SPR_PALETTE_BTN; if (i == _colour_index_1 && j == _colour_index_2) { image = ((colour & ~COLOUR_FLAG_TRANSLUCENT) << 19) | 0x60000000 | SPR_PALETTE_BTN_PRESSED; } gfx_draw_sprite(dpi, image, _button_offset_x + 12 * j, y + _button_offset_y, 0); gfx_fill_rect_inset(dpi, _button_offset_x + 12 * j, y + _check_offset_y, _button_offset_x + 12 * j + 9, y + _check_offset_y + 10, w->colours[1], INSET_RECT_F_E0); if (colour & COLOUR_FLAG_TRANSLUCENT) { gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM_DARK; gfx_draw_string(dpi, (char*)CheckBoxMarkString, w->colours[1] & 0x7F, _button_offset_x + 12 * j, y + _check_offset_y); } } } y += _row_height; } }
static void window_dropdown_paint(rct_window* w, rct_drawpixelinfo* dpi) { int32_t cell_x, cell_y, l, t, r, b, item, image, colour; window_draw_widgets(w, dpi); int32_t highlightedIndex = gDropdownHighlightedIndex; for (int32_t i = 0; i < gDropdownNumItems; i++) { if (_dropdown_list_vertically) { cell_x = i / _dropdown_num_rows; cell_y = i % _dropdown_num_rows; } else { cell_x = i % _dropdown_num_columns; cell_y = i / _dropdown_num_columns; } if (gDropdownItemsFormat[i] == DROPDOWN_SEPARATOR) { l = w->x + 2 + (cell_x * _dropdown_item_width); t = w->y + 2 + (cell_y * _dropdown_item_height); r = l + _dropdown_item_width - 1; t += (_dropdown_item_height / 2); b = t; if (w->colours[0] & COLOUR_FLAG_TRANSLUCENT) { translucent_window_palette palette = TranslucentWindowPalettes[BASE_COLOUR(w->colours[0])]; gfx_filter_rect(dpi, l, t, r, b, palette.highlight); gfx_filter_rect(dpi, l, t + 1, r, b + 1, palette.shadow); } else { gfx_fill_rect(dpi, l, t, r, b, ColourMapA[w->colours[0]].mid_dark); gfx_fill_rect(dpi, l, t + 1, r, b + 1, ColourMapA[w->colours[0]].lightest); } } else { // if (i == highlightedIndex) { l = w->x + 2 + (cell_x * _dropdown_item_width); t = w->y + 2 + (cell_y * _dropdown_item_height); r = l + _dropdown_item_width - 1; b = t + _dropdown_item_height - 1; gfx_filter_rect(dpi, l, t, r, b, PALETTE_DARKEN_3); } item = gDropdownItemsFormat[i]; if (item == DROPDOWN_FORMAT_LAND_PICKER || item == DROPDOWN_FORMAT_COLOUR_PICKER) { // Image item image = (uint32_t)gDropdownItemsArgs[i]; if (item == DROPDOWN_FORMAT_COLOUR_PICKER && highlightedIndex == i) image++; gfx_draw_sprite( dpi, image, w->x + 2 + (cell_x * _dropdown_item_width), w->y + 2 + (cell_y * _dropdown_item_height), 0); } else { // Text item if (i < DROPDOWN_ITEMS_MAX_SIZE) { if (dropdown_is_checked(i)) { item++; } } // Calculate colour colour = NOT_TRANSLUCENT(w->colours[0]); if (i == highlightedIndex) colour = COLOUR_WHITE; if (dropdown_is_disabled(i)) if (i < DROPDOWN_ITEMS_MAX_SIZE) colour = NOT_TRANSLUCENT(w->colours[0]) | COLOUR_FLAG_INSET; // Draw item string gfx_draw_string_left_clipped( dpi, item, (void*)(&gDropdownItemsArgs[i]), colour, w->x + 2 + (cell_x * _dropdown_item_width), w->y + 2 + (cell_y * _dropdown_item_height), w->width - 5); } } } }