Change: Display rail and road type speed limit text in yellow. (#15076)

This was a "convention" used by NewGRFs which exploited string colour bleeding.
This commit is contained in:
Peter Nelson
2026-02-18 09:11:46 +00:00
committed by GitHub
parent 0e25f9245c
commit 50110602aa
2 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -6021,7 +6021,8 @@ STR_LORRY :{BLACK}{LORRY}
STR_PLANE :{BLACK}{PLANE}
STR_SHIP :{BLACK}{SHIP}
STR_TOOLBAR_RAILTYPE_VELOCITY :{STRING} ({VELOCITY})
STR_TOOLBAR_RAILTYPE_VELOCITY :{STRING} {YELLOW}({VELOCITY})
STR_TOOLBAR_ROADTYPE_VELOCITY :{STRING} {YELLOW}({VELOCITY})
STR_BADGE_NAME_LIST :{STRING}: {GOLD}{RAW_STRING}
STR_BADGE_CONFIG_MENU_TOOLTIP :Open badge configuration
+3 -3
View File
@@ -445,7 +445,7 @@ struct BuildRoadToolbarWindow : Window {
if (widget == WID_ROT_CAPTION) {
const RoadTypeInfo *rti = GetRoadTypeInfo(this->roadtype);
if (rti->max_speed > 0) {
return GetString(STR_TOOLBAR_RAILTYPE_VELOCITY, rti->strings.toolbar_caption, PackVelocity(rti->max_speed / 2, VEH_ROAD));
return GetString(STR_TOOLBAR_ROADTYPE_VELOCITY, rti->strings.toolbar_caption, PackVelocity(rti->max_speed / 2, VEH_ROAD));
}
return GetString(rti->strings.toolbar_caption);
@@ -1866,7 +1866,7 @@ DropDownList GetRoadTypeDropDownList(RoadTramTypes rtts, bool for_replacement, b
list.push_back(MakeDropDownListBadgeItem(badge_class_list, rti->badges, GSF_ROADTYPES, rti->introduction_date, GetString(rti->strings.replace_text), rt, !avail_roadtypes.Test(rt)));
} else {
std::string str = rti->max_speed > 0
? GetString(STR_TOOLBAR_RAILTYPE_VELOCITY, rti->strings.menu_text, rti->max_speed / 2)
? GetString(STR_TOOLBAR_ROADTYPE_VELOCITY, rti->strings.menu_text, rti->max_speed / 2)
: GetString(rti->strings.menu_text);
list.push_back(MakeDropDownListBadgeIconItem(badge_class_list, rti->badges, GSF_ROADTYPES, rti->introduction_date, RoadBuildCost(rt), d, rti->gui_sprites.build_x_road, PAL_NONE, std::move(str), rt, !avail_roadtypes.Test(rt)));
}
@@ -1910,7 +1910,7 @@ DropDownList GetScenRoadTypeDropDownList(RoadTramTypes rtts)
const RoadTypeInfo *rti = GetRoadTypeInfo(rt);
std::string str = rti->max_speed > 0
? GetString(STR_TOOLBAR_RAILTYPE_VELOCITY, rti->strings.menu_text, rti->max_speed / 2)
? GetString(STR_TOOLBAR_ROADTYPE_VELOCITY, rti->strings.menu_text, rti->max_speed / 2)
: GetString(rti->strings.menu_text);
list.push_back(MakeDropDownListBadgeIconItem(badge_class_list, rti->badges, GSF_ROADTYPES, rti->introduction_date, RoadBuildCost(rt), d, rti->gui_sprites.build_x_road, PAL_NONE, std::move(str), rt, !avail_roadtypes.Test(rt)));
}