From a8ec43f06507b42ff7e2a290fc78bec390a74386 Mon Sep 17 00:00:00 2001 From: Robert Jordan Date: Wed, 13 May 2015 11:38:44 -0400 Subject: [PATCH] Select size strings now use args --- data/language/english_uk.txt | 8 +++----- src/interface/window.c | 2 ++ src/interface/window.h | 1 + src/windows/clear_scenery.c | 4 +++- src/windows/land.c | 2 ++ src/windows/map.c | 8 ++++++-- src/windows/text_input.c | 2 +- src/windows/water.c | 4 +++- 8 files changed, 21 insertions(+), 10 deletions(-) diff --git a/data/language/english_uk.txt b/data/language/english_uk.txt index 1003164833..1da3f3d858 100644 --- a/data/language/english_uk.txt +++ b/data/language/english_uk.txt @@ -3462,8 +3462,6 @@ STR_5125 :All destructable STR_5126 :Random title music STR_5127 :{SMALLFONT}{BLACK}Disable land elevation STR_5128 :Selection size -STR_5129 :Enter selection size between 0 and 64 -STR_5130 :Enter selection size between 1 and 64 -STR_5131 :Enter selection size between 1 and 7 -STR_5132 :Map size -STR_5133 :Enter map size between 50 and 256 +STR_5129 :Enter selection size between {COMMA16} and {COMMA16} +STR_5130 :Map size +STR_5131 :Enter map size between {COMMA16} and {COMMA16} diff --git a/src/interface/window.c b/src/interface/window.c index aacdba4538..2e39fc6305 100644 --- a/src/interface/window.c +++ b/src/interface/window.c @@ -38,6 +38,8 @@ rct_window* g_window_list = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_LIST, rct_window); +uint8 TextInputDescriptionArgs[8]; + // converted from uint16 values at 0x009A41EC - 0x009A4230 // these are percentage coordinates of the viewport to center to, if a window is obscuring a location, the next is tried float window_scroll_locations[][2] = { diff --git a/src/interface/window.h b/src/interface/window.h index 9a933caa21..459b8ddf4b 100644 --- a/src/interface/window.h +++ b/src/interface/window.h @@ -30,6 +30,7 @@ struct rct_window; union rct_window_event; +extern uint8 TextInputDescriptionArgs[8]; typedef void wndproc(struct rct_window*, union rct_window_event*); diff --git a/src/windows/clear_scenery.c b/src/windows/clear_scenery.c index baa2168dc4..549ef3b6b7 100644 --- a/src/windows/clear_scenery.c +++ b/src/windows/clear_scenery.c @@ -194,7 +194,9 @@ static void window_clear_scenery_textinput() static void window_clear_scenery_inputsize(rct_window *w) { - window_text_input_open(w, WIDX_PREVIEW, 5128, 5131, STR_NONE, STR_NONE, 3); + ((uint16*)TextInputDescriptionArgs)[0] = 1; + ((uint16*)TextInputDescriptionArgs)[1] = 7; + window_text_input_open(w, WIDX_PREVIEW, 5128, 5129, STR_NONE, STR_NONE, 3); } /** diff --git a/src/windows/land.c b/src/windows/land.c index bb27acb054..c15628eda2 100644 --- a/src/windows/land.c +++ b/src/windows/land.c @@ -340,6 +340,8 @@ static void window_land_textinput() static void window_land_inputsize(rct_window *w) { + ((uint16*)TextInputDescriptionArgs)[0] = 0; + ((uint16*)TextInputDescriptionArgs)[1] = 64; window_text_input_open(w, WIDX_PREVIEW, 5128, 5129, STR_NONE, STR_NONE, 3); } diff --git a/src/windows/map.c b/src/windows/map.c index 9003a26f27..d5eef11cad 100644 --- a/src/windows/map.c +++ b/src/windows/map.c @@ -438,12 +438,16 @@ static void window_map_textinput() static void window_map_inputsize_land(rct_window *w) { - window_text_input_open(w, WIDX_LAND_TOOL, 5128, 5130, STR_NONE, STR_NONE, 3); + ((uint16*)TextInputDescriptionArgs)[0] = 1; + ((uint16*)TextInputDescriptionArgs)[1] = 64; + window_text_input_open(w, WIDX_LAND_TOOL, 5128, 5129, STR_NONE, STR_NONE, 3); } static void window_map_inputsize_map(rct_window *w) { - window_text_input_open(w, WIDX_MAP_SIZE_SPINNER, 5132, 5133, STR_NONE, STR_NONE, 4); + ((uint16*)TextInputDescriptionArgs)[0] = 50; + ((uint16*)TextInputDescriptionArgs)[1] = 256; + window_text_input_open(w, WIDX_MAP_SIZE_SPINNER, 5130, 5131, STR_NONE, STR_NONE, 4); } /** diff --git a/src/windows/text_input.c b/src/windows/text_input.c index be8e7300fd..897b7d806f 100644 --- a/src/windows/text_input.c +++ b/src/windows/text_input.c @@ -209,7 +209,7 @@ static void window_text_input_paint(){ int font_height = 0; - gfx_draw_string_centred(dpi, input_text_description, w->x + WW / 2, y, w->colours[1], 0); + gfx_draw_string_centred(dpi, input_text_description, w->x + WW / 2, y, w->colours[1], &TextInputDescriptionArgs); y += 25; diff --git a/src/windows/water.c b/src/windows/water.c index 31a3ea44fc..dc0034a5d2 100644 --- a/src/windows/water.c +++ b/src/windows/water.c @@ -195,7 +195,9 @@ static void window_water_textinput() static void window_water_inputsize(rct_window *w) { - window_text_input_open(w, WIDX_PREVIEW, 5128, 5130, STR_NONE, STR_NONE, 3); + ((uint16*)TextInputDescriptionArgs)[0] = 1; + ((uint16*)TextInputDescriptionArgs)[1] = 64; + window_text_input_open(w, WIDX_PREVIEW, 5128, 5129, STR_NONE, STR_NONE, 3); } /**