From ebb360f48c5d1d587bb1a20461c51c6048e48eca Mon Sep 17 00:00:00 2001 From: terkhen Date: Tue, 4 Jan 2011 20:54:36 +0000 Subject: (svn r21716) -Add: Tooltip for the industry legend at the smallmap. --- src/lang/english.txt | 1 + src/smallmap_gui.cpp | 5 +++++ 2 files changed, 6 insertions(+) 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(SM_WIDGET_SELECTINDUSTRIES)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY); + this->GetWidget(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(SM_WIDGET_SELECTINDUSTRIES)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY); + this->GetWidget(SM_WIDGET_LEGEND)->SetDataTip(STR_NULL, + (this->map_type == SMT_INDUSTRY) ? STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION : STR_NULL); + this->SetDirty(); } -- cgit v1.2.3-54-g00ecf