From a8223010025fc6ca8ce99e7d05bc3e2c77522409 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Tue, 14 Apr 2015 18:35:26 +0100 Subject: [PATCH 1/4] Fix vehicle tab from failing to reload new variables --- src/windows/ride.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/windows/ride.c b/src/windows/ride.c index 51584a8f6d..9605d7e745 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -1408,6 +1408,12 @@ static void window_ride_set_page(rct_window *w, int page) w->page = page; w->frame_no = 0; w->var_492 = 0; + + if (page == WINDOW_RIDE_PAGE_VEHICLE){ + // Reload the vehicle settings + RCT2_CALLPROC_X(0x006DD57D, 0, 0, 0, w->number, 0, 0, 0); + } + if (w->viewport != NULL) { w->viewport->width = 0; w->viewport = NULL; From 869142bc891367e489d38ed20b53e577adcea714 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Tue, 14 Apr 2015 18:40:41 +0100 Subject: [PATCH 2/4] Set options window to always be ontop --- src/windows/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/windows/options.c b/src/windows/options.c index 782939dbb5..27cbdf50d2 100644 --- a/src/windows/options.c +++ b/src/windows/options.c @@ -221,7 +221,7 @@ void window_options_open() if (w != NULL) return; - w = window_create_centred(WW, WH, (uint32*)window_options_events, WC_OPTIONS, 0); + w = window_create_centred(WW, WH, (uint32*)window_options_events, WC_OPTIONS, WF_STICK_TO_FRONT); w->widgets = window_options_widgets; w->enabled_widgets = (1ULL << WIDX_CLOSE) | From 9d8983a5c73a6aba2c80ba28b4cff21232435a61 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Tue, 14 Apr 2015 19:00:29 +0100 Subject: [PATCH 3/4] Fix ride graphs and negative lengths --- src/localisation/localisation.c | 2 +- src/windows/ride.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/localisation/localisation.c b/src/localisation/localisation.c index 4819fdaeed..ca431f2d2c 100644 --- a/src/localisation/localisation.c +++ b/src/localisation/localisation.c @@ -351,7 +351,7 @@ void format_date(char **dest, uint16 value) (*dest)--; } -void format_length(char **dest, uint16 value) +void format_length(char **dest, sint16 value) { rct_string_id stringId = 2733; diff --git a/src/windows/ride.c b/src/windows/ride.c index 9605d7e745..03e02001a7 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -5262,11 +5262,12 @@ static void window_ride_graphs_scrollpaint() gfx_fill_rect(dpi, dpi->x, y, dpi->x + dpi->width - 1, y, colour); + sint16 scaled_yUnit = yUnit; // Scale modifier if (ax == 1420) - yUnit /= 2; + scaled_yUnit /= 2; - gfx_draw_string_left(dpi, ax, &yUnit, 0, w->scrolls[0].h_left + 1, y - 4); + gfx_draw_string_left(dpi, ax, &scaled_yUnit, 0, w->scrolls[0].h_left + 1, y - 4); } // Time marks From f40555f88b59dffc0519686afdbef1d08145bce5 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Wed, 15 Apr 2015 18:02:04 +0100 Subject: [PATCH 4/4] Revert options window stick to front. Changed scenarioselect to not stick to front. Object selection now correctly changed to not stick to front. --- src/windows/editor_object_selection.c | 2 +- src/windows/options.c | 2 +- src/windows/title_scenarioselect.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/windows/editor_object_selection.c b/src/windows/editor_object_selection.c index ebd4dfa96c..2b53a55c57 100644 --- a/src/windows/editor_object_selection.c +++ b/src/windows/editor_object_selection.c @@ -214,7 +214,7 @@ void window_editor_object_selection_open() 400, (uint32*)window_editor_object_selection_events, WC_EDITOR_OBJECT_SELECTION, - WF_STICK_TO_FRONT + WF_10 ); window->widgets = window_editor_object_selection_widgets; diff --git a/src/windows/options.c b/src/windows/options.c index 27cbdf50d2..782939dbb5 100644 --- a/src/windows/options.c +++ b/src/windows/options.c @@ -221,7 +221,7 @@ void window_options_open() if (w != NULL) return; - w = window_create_centred(WW, WH, (uint32*)window_options_events, WC_OPTIONS, WF_STICK_TO_FRONT); + w = window_create_centred(WW, WH, (uint32*)window_options_events, WC_OPTIONS, 0); w->widgets = window_options_widgets; w->enabled_widgets = (1ULL << WIDX_CLOSE) | diff --git a/src/windows/title_scenarioselect.c b/src/windows/title_scenarioselect.c index c527d9950a..3ad4edef4d 100644 --- a/src/windows/title_scenarioselect.c +++ b/src/windows/title_scenarioselect.c @@ -116,7 +116,7 @@ void window_scenarioselect_open() 334, (uint32*)window_scenarioselect_events, WC_SCENARIO_SELECT, - WF_STICK_TO_FRONT | WF_10 + WF_10 ); window->widgets = window_scenarioselect_widgets;