summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-07-30 12:15:22 +0000
committerrubidium <rubidium@openttd.org>2010-07-30 12:15:22 +0000
commitab47c9dea71ea6a6e145955686d472ce7459ac03 (patch)
treeee68c09740628bc3fe5bb6b0040909c24c28d21c /src
parent2dd77d0ef941c7ba67c16b41b9da2eca66290669 (diff)
downloadopenttd-ab47c9dea71ea6a6e145955686d472ce7459ac03.tar.xz
(svn r20242) -Change: remove the need for "{WHITE}" control codes in some of the railtype NewGRF strings
-Fix: make it possible to properly assess the length of the rail toolbar caption
Diffstat (limited to 'src')
-rw-r--r--src/build_vehicle_gui.cpp2
-rw-r--r--src/rail_gui.cpp12
2 files changed, 9 insertions, 5 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 8abd204d8..cfeec04e2 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -59,7 +59,7 @@ enum BuildVehicleWidgets {
static const NWidgetPart _nested_build_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
- NWidget(WWT_CAPTION, COLOUR_GREY, BUILD_VEHICLE_WIDGET_CAPTION), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_CAPTION, COLOUR_GREY, BUILD_VEHICLE_WIDGET_CAPTION), SetDataTip(STR_WHITE_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_GREY),
NWidget(WWT_STICKYBOX, COLOUR_GREY),
EndContainer(),
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 0821f2487..48c113210 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -644,7 +644,6 @@ struct BuildRailToolbarWindow : Window {
const RailtypeInfo *rti = GetRailTypeInfo(railtype);
assert(railtype < RAILTYPE_END);
- this->GetWidget<NWidgetCore>(RTW_CAPTION)->widget_data = rti->max_speed > 0 ? STR_TOOLBAR_RAILTYPE_VELOCITY : STR_JUST_STRING;
this->GetWidget<NWidgetCore>(RTW_BUILD_NS)->widget_data = rti->gui_sprites.build_ns_rail;
this->GetWidget<NWidgetCore>(RTW_BUILD_X)->widget_data = rti->gui_sprites.build_x_rail;
this->GetWidget<NWidgetCore>(RTW_BUILD_EW)->widget_data = rti->gui_sprites.build_ew_rail;
@@ -698,8 +697,13 @@ struct BuildRailToolbarWindow : Window {
{
if (widget == RTW_CAPTION) {
const RailtypeInfo *rti = GetRailTypeInfo(this->railtype);
- SetDParam(0, rti->strings.toolbar_caption);
- SetDParam(1, rti->max_speed);
+ if (rti->max_speed > 0) {
+ SetDParam(0, STR_TOOLBAR_RAILTYPE_VELOCITY);
+ SetDParam(1, rti->strings.toolbar_caption);
+ SetDParam(2, rti->max_speed);
+ } else {
+ SetDParam(0, rti->strings.toolbar_caption);
+ }
}
}
@@ -846,7 +850,7 @@ Hotkey<BuildRailToolbarWindow> *_railtoolbar_hotkeys = BuildRailToolbarWindow::r
static const NWidgetPart _nested_build_rail_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
- NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, RTW_CAPTION), SetDataTip(STR_RAIL_TOOLBAR_RAILROAD_CONSTRUCTION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, RTW_CAPTION), SetDataTip(STR_WHITE_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
EndContainer(),
NWidget(NWID_HORIZONTAL),