mirror of https://github.com/OpenRCT2/OpenRCT2.git
Ride locate now uses standard scroll_to_viewport.Fix #705
This commit is contained in:
parent
1e911a28fd
commit
e7a0b31884
|
@ -1007,7 +1007,7 @@ rct_window *window_get_main()
|
|||
|
||||
/**
|
||||
* Based on
|
||||
* rct2: 0x696ee9 & 0x66842F
|
||||
* rct2: 0x696ee9 & 0x66842F & 0x006AF3B3
|
||||
*
|
||||
*/
|
||||
void window_scroll_to_viewport(rct_window *w)
|
||||
|
|
|
@ -1552,39 +1552,6 @@ static void window_ride_rename(rct_window *w)
|
|||
window_text_input_open(w, WIDX_RENAME, STR_RIDE_ATTRACTION_NAME, STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION, ride->name, ride->name_arguments, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AF3B3
|
||||
*/
|
||||
static void window_ride_locate(rct_window *w)
|
||||
{
|
||||
rct_window *mainWindow;
|
||||
int xy, x, y, z;
|
||||
|
||||
if (w->viewport->width == 0)
|
||||
return;
|
||||
|
||||
xy = w->ride.var_482;
|
||||
z = w->ride.var_486;
|
||||
if (xy == -1)
|
||||
return;
|
||||
|
||||
if (xy & 0x80000000) {
|
||||
rct_sprite *sprite = &g_sprite_list[xy & 0xFFFF];
|
||||
x = sprite->unknown.x;
|
||||
y = sprite->unknown.y;
|
||||
z = sprite->unknown.z;
|
||||
} else {
|
||||
x = (xy & ~0xC0000000) & 0xFFFF;
|
||||
y = (xy & ~0xC0000000) >> 16;
|
||||
z = z >> 16;
|
||||
}
|
||||
|
||||
mainWindow = window_get_main();
|
||||
if (mainWindow != NULL)
|
||||
window_scroll_to_location(mainWindow, x, y, z);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AF17E
|
||||
|
@ -1619,7 +1586,7 @@ static void window_ride_main_mouseup()
|
|||
window_ride_rename(w);
|
||||
break;
|
||||
case WIDX_LOCATE:
|
||||
window_ride_locate(w);
|
||||
window_scroll_to_viewport(w);
|
||||
break;
|
||||
case WIDX_DEMOLISH:
|
||||
window_ride_demolish_prompt_open(w->number);
|
||||
|
|
Loading…
Reference in New Issue