diff --git a/src/lang/extra/english.txt b/src/lang/extra/english.txt index e98acd2cd30..2d04e7854d5 100644 --- a/src/lang/extra/english.txt +++ b/src/lang/extra/english.txt @@ -2167,5 +2167,11 @@ STR_CONFIG_SETTING_STATION_RATING_TOOLTIP_MODE_OFF :Off STR_CONFIG_SETTING_STATION_RATING_TOOLTIP_MODE_SIMPLE :Simple STR_CONFIG_SETTING_STATION_RATING_TOOLTIP_MODE_DETAILED :Detailed +STR_CONFIG_SETTING_CITY_IN_LABEL :Show city in town name label: {STRING2} +STR_CONFIG_SETTING_CITY_IN_LABEL_HELPTEXT :Display if a town is also a city in their label on the map + +###length 4 STR_VIEWPORT_TOWN_COLOUR :{1:SET_COLOUR}{0:TOWN} STR_VIEWPORT_TOWN_COLOUR_POP :{WHITE}{TOWN} {SET_COLOUR}({COMMA}) +STR_VIEWPORT_TOWN_COLOUR_CITY :{1:SET_COLOUR}{0:TOWN} (City) +STR_VIEWPORT_TOWN_COLOUR_CITY_POP :{WHITE}{TOWN} {SET_COLOUR}(City, {COMMA}) diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 1266029c4ee..a3d81092bcc 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2039,6 +2039,7 @@ static SettingsContainer &GetSettingsTree() viewports->Add(new SettingEntry("gui.right_mouse_btn_emulation")); #endif viewports->Add(new SettingEntry("gui.population_in_label")); + viewports->Add(new SettingEntry("gui.city_in_label")); viewports->Add(new SettingEntry("gui.liveries")); viewports->Add(new SettingEntry("gui.measure_tooltip")); viewports->Add(new SettingEntry("gui.loading_indicators")); diff --git a/src/settings_type.h b/src/settings_type.h index bedfc3f1bd6..faedde97d88 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -181,6 +181,7 @@ struct GUISettings : public TimeSettings { byte max_num_lt_autosaves; ///< controls how many long-term autosavegames are made before the game starts to overwrite (names them 0 to max_num_lt_autosaves - 1) uint8 savegame_overwrite_confirm; ///< Mode for when to warn about overwriting an existing savegame bool population_in_label; ///< show the population of a town in its label? + bool city_in_label; ///< show cities in label? uint8 right_mouse_btn_emulation; ///< should we emulate right mouse clicking? uint8 scrollwheel_scrolling; ///< scrolling using the scroll wheel? uint8 scrollwheel_multiplier; ///< how much 'wheel' per incoming event from the OS? diff --git a/src/strings.cpp b/src/strings.cpp index 6d4c3c43f0d..a860a1d0739 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1938,9 +1938,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg bool tiny = (b == SCC_VIEWPORT_TOWN_LABEL2); StringID string_id = STR_VIEWPORT_TOWN_COLOUR; - if (!tiny && HasBit(data, 40)) { - string_id = STR_VIEWPORT_TOWN_COLOUR_POP; - } + if (!tiny) string_id += GB(data, 40, 2); int64 args_array[] = {t, GB(data, 32, 8), GB(data, 0, 32)}; StringParameters tmp_params(args_array); buff = GetStringWithArgs(buff, string_id, &tmp_params, last); diff --git a/src/table/settings/settings.ini b/src/table/settings/settings.ini index 12f08965960..954f495839e 100644 --- a/src/table/settings/settings.ini +++ b/src/table/settings/settings.ini @@ -4762,6 +4762,14 @@ str = STR_CONFIG_SETTING_POPULATION_IN_LABEL strhelp = STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT post_cb = [](auto) { UpdateAllTownVirtCoords(); } +[SDTC_BOOL] +var = gui.city_in_label +flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC +def = false +str = STR_CONFIG_SETTING_CITY_IN_LABEL +strhelp = STR_CONFIG_SETTING_CITY_IN_LABEL_HELPTEXT +post_cb = [](auto) { UpdateAllTownVirtCoords(); } + [SDTC_BOOL] var = gui.link_terraform_toolbar flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 960568189b2..35417a85ab8 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -244,6 +244,7 @@ uint64 Town::LabelParam2() const SB(value, 32, 8, TC_WHITE); } if (_settings_client.gui.population_in_label) SetBit(value, 40); + if (_settings_client.gui.city_in_label && this->larger_town) SetBit(value, 41); return value; }