mirror of https://github.com/OpenRCT2/OpenRCT2.git
clear up window_new_ride a bit
This commit is contained in:
parent
b4e72cf960
commit
25a31b9875
|
@ -248,7 +248,7 @@ const int window_new_ride_tab_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 };
|
|||
|
||||
static void window_new_ride_refresh_widget_sizing(rct_window *w);
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w, int x, int y);
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width, int unk);
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width);
|
||||
static void window_new_ride_select(rct_window *w);
|
||||
|
||||
static ride_list_item _lastTrackDesignCountRideType;
|
||||
|
@ -588,7 +588,7 @@ static void window_new_ride_mousedown(int widgetIndex, rct_window *w, rct_widget
|
|||
|
||||
window_new_ride_refresh_widget_sizing(w);
|
||||
window_invalidate(w);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B7220);
|
||||
window_new_ride_scroll_to_focused_ride(w);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -741,7 +741,7 @@ static void window_new_ride_paint()
|
|||
if (item.type == 255 && item.entry_index == 255)
|
||||
return;
|
||||
|
||||
window_new_ride_paint_ride_information(w, dpi, item, w->x + 3, w->y + w->height - 52, w->width - 6, 256);
|
||||
window_new_ride_paint_ride_information(w, dpi, item, w->x + 3, w->y + w->height - 52, w->width - 6);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -814,10 +814,46 @@ static void window_new_ride_scrollpaint()
|
|||
{
|
||||
rct_window *w;
|
||||
rct_drawpixelinfo *dpi;
|
||||
uint8 **rideEntries = (uint8**)0x009ACFA4;
|
||||
|
||||
window_paint_get_registers(w, dpi);
|
||||
|
||||
RCT2_CALLPROC_X(0x006B6ABF, 0, 0, 0, 0, (int)w, (int)dpi, 0);
|
||||
if (_window_new_ride_current_tab == WINDOW_NEW_RIDE_PAGE_RESEARCH)
|
||||
return;
|
||||
|
||||
gfx_clear(dpi, RCT2_GLOBAL(0x0141FC48 + (w->colours[1] * 8), uint8) * 0x1010101);
|
||||
|
||||
int x = 1;
|
||||
int y = 1;
|
||||
ride_list_item *listItem = (ride_list_item*)0x00F43523;
|
||||
while (listItem->type != 255 || listItem->entry_index != 255) {
|
||||
// Draw flat button rectangle
|
||||
int flags = 0;
|
||||
if (w->var_480 == *((sint16*)listItem))
|
||||
flags |= 0x20;
|
||||
if (w->var_482 == *((sint16*)listItem) || flags != 0)
|
||||
gfx_fill_rect_inset(dpi, x, y, x + 115, y + 115, w->colours[1], 0x80 | flags);
|
||||
|
||||
// Draw ride image
|
||||
uint8 *rideEntry = rideEntries[listItem->entry_index];
|
||||
int unk = RCT2_GLOBAL(rideEntry + 4, uint32);
|
||||
if (listItem->type != RCT2_GLOBAL(rideEntry + 12, uint8)) {
|
||||
unk++;
|
||||
if (listItem->type != RCT2_GLOBAL(rideEntry + 13, uint8))
|
||||
unk++;
|
||||
}
|
||||
RCT2_CALLPROC_X(0x00681DE2, 0, 29013, x + 2, y + 2, 0xA0, (int)dpi, unk);
|
||||
|
||||
// Next position
|
||||
x += 116;
|
||||
if (x >= 116 * 5 + 1) {
|
||||
x = 1;
|
||||
y += 116;
|
||||
}
|
||||
|
||||
// Next item
|
||||
listItem++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -867,25 +903,9 @@ static int get_num_track_designs(ride_list_item item)
|
|||
*
|
||||
* rct2: 0x006B701C
|
||||
*/
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width, int unk)
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width)
|
||||
{
|
||||
uint8 **rideEntries = (uint8**)0x009ACFA4;
|
||||
|
||||
if (unk & 1) {
|
||||
if (unk & 6)
|
||||
gfx_fill_rect_inset(dpi, x, y, x + 115, y + 115, w->colours[1], 0x20);
|
||||
|
||||
uint8 *rideEntry = rideEntries[item.entry_index];
|
||||
int ebp = RCT2_GLOBAL(rideEntry + 4, uint32);
|
||||
if (item.type != RCT2_GLOBAL(rideEntry + 12, uint32))
|
||||
ebp++;
|
||||
if (item.type != RCT2_GLOBAL(rideEntry + 13, uint32))
|
||||
ebp++;
|
||||
|
||||
RCT2_CALLPROC_X(0x00681DE2, 0, 29013, x + 2, y + 2, (int)w, (int)dpi, ebp);
|
||||
}
|
||||
|
||||
if (unk & 0x100) {
|
||||
uint8 *rideEntry = rideEntries[item.entry_index];
|
||||
|
||||
// Ride name and description
|
||||
|
@ -943,7 +963,6 @@ static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixeli
|
|||
gfx_draw_string_right(dpi, stringId, &price, 0, x + width, y + 40);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue