mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 16:24:35 +01:00
fix various bugs with ride window
This commit is contained in:
@@ -1575,13 +1575,13 @@ void RCT2_CALLPROC_WE_MOUSE_DOWN(int address, int widgetIndex, rct_window*w, rc
|
||||
}
|
||||
|
||||
/* Based on rct2: 0x6987ED and another version from window_park */
|
||||
void window_align_tabs( rct_window *w, uint8 start_tab_id, uint8 end_tab_id )
|
||||
void window_align_tabs(rct_window *w, uint8 start_tab_id, uint8 end_tab_id)
|
||||
{
|
||||
int x = w->widgets[start_tab_id].left;
|
||||
int i, x = w->widgets[start_tab_id].left;
|
||||
int tab_width = w->widgets[start_tab_id].right - w->widgets[start_tab_id].left;
|
||||
|
||||
for (int i = start_tab_id; i < end_tab_id; ++i){
|
||||
if ( !(w->disabled_widgets & (1LL << i)) ){
|
||||
for (i = start_tab_id; i <= end_tab_id; i++) {
|
||||
if (!(w->disabled_widgets & (1LL << i))) {
|
||||
w->widgets[i].left = x;
|
||||
w->widgets[i].right = x + tab_width;
|
||||
x += tab_width + 1;
|
||||
|
||||
@@ -580,7 +580,7 @@ static void window_ride_draw_tab_vehicle(rct_drawpixelinfo *dpi, rct_window *w)
|
||||
height += RCT2_GLOBAL(ebp + 0x24, sint8);
|
||||
|
||||
RCT2_GLOBAL(0x00F43480, uint32) = ride->var_1D4;
|
||||
colour = (ride->vehicle_colours[1] << 24) | (ride->vehicle_colours[0] << 19);
|
||||
colour = ((ride->vehicle_colours[0] & 0xFF00) << 16) | ((ride->vehicle_colours[0] & 0xFF) << 19);
|
||||
spriteIndex = 32;
|
||||
if (w->page == WINDOW_PARK_PAGE_VEHICLE)
|
||||
spriteIndex += w->frame_no;
|
||||
@@ -1273,12 +1273,11 @@ static void window_ride_main_invalidate()
|
||||
window_ride_set_pressed_tab(w);
|
||||
|
||||
rct_ride *ride = GET_RIDE(w->number);
|
||||
w->disabled_widgets &= 0xFFB7FFFF;
|
||||
if (ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)) {
|
||||
w->disabled_widgets |= 0x00400000;
|
||||
}
|
||||
w->disabled_widgets &= ~((1 << 22) | (1 << 19));
|
||||
if (ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK))
|
||||
w->disabled_widgets |= (1 << 22);
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_19)
|
||||
w->disabled_widgets |= 0x80000;
|
||||
w->disabled_widgets |= (1 << 19);
|
||||
|
||||
RCT2_GLOBAL(0x013CE952 + 0, uint16) = ride->name;
|
||||
RCT2_GLOBAL(0x013CE952 + 2, uint32) = ride->name_arguments;
|
||||
|
||||
Reference in New Issue
Block a user