summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-01-04 20:54:36 +0000
committerterkhen <terkhen@openttd.org>2011-01-04 20:54:36 +0000
commitebb360f48c5d1d587bb1a20461c51c6048e48eca (patch)
tree79e6de09cfa3ad3dd8e43011ec6c7e84730407c4
parent5268d03abd7f84b842457c939a9de205145da119 (diff)
downloadopenttd-ebb360f48c5d1d587bb1a20461c51c6048e48eca.tar.xz
(svn r21716) -Add: Tooltip for the industry legend at the smallmap.
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/smallmap_gui.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 44f557598..4a053de29 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -664,6 +664,7 @@ STR_SMALLMAP_TOOLTIP_SHOW_INDUSTRIES_ON_MAP :{BLACK}Show ind
STR_SMALLMAP_TOOLTIP_SHOW_TRANSPORT_ROUTES_ON :{BLACK}Show transport routes on map
STR_SMALLMAP_TOOLTIP_SHOW_VEGETATION_ON_MAP :{BLACK}Show vegetation on map
STR_SMALLMAP_TOOLTIP_SHOW_LAND_OWNERS_ON_MAP :{BLACK}Show land owners on map
+STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION :{BLACK}Click on an industry type to toggle displaying it. Ctrl+Click disables all types except the selected one. Ctrl+Click on it again to enable all industry types
STR_SMALLMAP_LEGENDA_ROADS :{TINYFONT}{BLACK}Roads
STR_SMALLMAP_LEGENDA_RAILROADS :{TINYFONT}{BLACK}Railways
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 9ff94124f..64517ff39 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -992,6 +992,8 @@ public:
this->SetWidgetLoweredState(SM_WIDGET_TOGGLETOWNNAME, this->show_towns);
this->GetWidget<NWidgetStacked>(SM_WIDGET_SELECTINDUSTRIES)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY);
+ this->GetWidget<NWidgetCore>(SM_WIDGET_LEGEND)->SetDataTip(STR_NULL,
+ (this->map_type == SMT_INDUSTRY) ? STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION : STR_NULL);
this->SetZoomLevel(ZLC_INITIALIZE, NULL);
this->SmallMapCenterOnCurrentPos();
@@ -1153,6 +1155,9 @@ public:
/* Hide Enable all/Disable all buttons if is not industry type small map */
this->GetWidget<NWidgetStacked>(SM_WIDGET_SELECTINDUSTRIES)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY);
+ this->GetWidget<NWidgetCore>(SM_WIDGET_LEGEND)->SetDataTip(STR_NULL,
+ (this->map_type == SMT_INDUSTRY) ? STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION : STR_NULL);
+
this->SetDirty();
}