changeset 16980:0748e16efe8f draft

(svn r21716) -Add: Tooltip for the industry legend at the smallmap.
author terkhen <terkhen@openttd.org>
date Tue, 04 Jan 2011 20:54:36 +0000
parents 133dc959b216
children a603bd561234
files src/lang/english.txt src/smallmap_gui.cpp
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -664,6 +664,7 @@
 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
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -992,6 +992,8 @@
 
 		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 @@
 		/* 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();
 	}