diff --git a/data/language/english_uk.txt b/data/language/english_uk.txt index d6f429f0f6..e0ef7cf386 100644 --- a/data/language/english_uk.txt +++ b/data/language/english_uk.txt @@ -4087,6 +4087,8 @@ STR_5779 :Income: {CURRENCY2DP} per hour STR_5780 :Running cost: {CURRENCY2DP} per hour STR_5781 :Running cost: Unknown STR_5782 :You are now connected. Press '{STRING}' to chat. +STR_5783 :{WINDOW_COLOUR_2}Scenario Locked +STR_5784 :{BLACK}Complete earlier scenarios to unlock this scenario. ############# # Scenarios # diff --git a/src/localisation/string_ids.h b/src/localisation/string_ids.h index ed133747ac..58163d8211 100644 --- a/src/localisation/string_ids.h +++ b/src/localisation/string_ids.h @@ -2399,6 +2399,9 @@ enum { STR_MULTIPLAYER_CONNECTED_CHAT_HINT = 5782, + STR_SCENARIO_LOCKED = 5783, + STR_SCENARIO_LOCKED_DESC = 5784, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working STR_COUNT = 32768 }; diff --git a/src/windows/title_scenarioselect.c b/src/windows/title_scenarioselect.c index 0bbe014f1c..d266a1bd86 100644 --- a/src/windows/title_scenarioselect.c +++ b/src/windows/title_scenarioselect.c @@ -136,6 +136,7 @@ static bool is_scenario_visible(rct_window *w, scenario_index_entry *scenario); static bool is_locking_enabled(rct_window *w); static scenarioselect_callback _callback; +static bool _showLockedInformation = false; /** * @@ -295,6 +296,8 @@ static void window_scenarioselect_scrollmousedown(rct_window *w, int scrollIndex */ static void window_scenarioselect_scrollmouseover(rct_window *w, int scrollIndex, int x, int y) { + bool originalShowLockedInformation = _showLockedInformation; + _showLockedInformation = false; scenario_index_entry *selected = NULL; for (sc_list_item *listItem = _listItems; listItem->type != LIST_ITEM_TYPE_END; listItem++) { switch (listItem->type) { @@ -303,8 +306,12 @@ static void window_scenarioselect_scrollmouseover(rct_window *w, int scrollIndex break; case LIST_ITEM_TYPE_SCENARIO: y -= 24; - if (y < 0 && !listItem->scenario.is_locked) { - selected = listItem->scenario.scenario; + if (y < 0) { + if (listItem->scenario.is_locked) { + _showLockedInformation = true; + } else { + selected = listItem->scenario.scenario; + } } break; } @@ -316,6 +323,8 @@ static void window_scenarioselect_scrollmouseover(rct_window *w, int scrollIndex if (w->highlighted_scenario != selected) { w->highlighted_scenario = selected; window_invalidate(w); + } else if (_showLockedInformation != originalShowLockedInformation) { + window_invalidate(w); } } @@ -375,6 +384,14 @@ static void window_scenarioselect_paint(rct_window *w, rct_drawpixelinfo *dpi) // Return if no scenario highlighted scenario = w->highlighted_scenario; if (scenario == NULL) { + if (_showLockedInformation) { + // Show locked information + x = w->x + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4; + y = w->y + window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5; + gfx_draw_string_centred_clipped(dpi, STR_SCENARIO_LOCKED, NULL, 0, x + 85, y, 170); + y += 15; + y += gfx_draw_string_left_wrapped(dpi, NULL, x, y, 170, STR_SCENARIO_LOCKED_DESC, 0) + 5; + } return; }