summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpnda <43609023+spnda@users.noreply.github.com>2019-04-29 19:42:00 +0200
committerPeterN <peter1138@openttd.org>2019-04-29 18:42:00 +0100
commit8cc6ee60eddd2585140a8ad7eba512e87b1fc894 (patch)
tree44e0e339e21b4c394ad358e0447936d46536550b /src
parent63a7df027df0aa5655cabf32e88fe2ee44422c1d (diff)
downloadopenttd-8cc6ee60eddd2585140a8ad7eba512e87b1fc894.tar.xz
Add: Icons on air/water/landscape construction menus (#7485)
Diffstat (limited to 'src')
-rw-r--r--src/toolbar_gui.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index bd7472ecd..8b5f79df2 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -930,7 +930,9 @@ static CallBackFunction MenuClickBuildRoad(int index)
static CallBackFunction ToolbarBuildWaterClick(Window *w)
{
- PopupMainToolbMenu(w, WID_TN_WATER, STR_WATERWAYS_MENU_WATERWAYS_CONSTRUCTION, 1);
+ DropDownList list;
+ list.emplace_back(new DropDownListIconItem(SPR_IMG_BUILD_CANAL, PAL_NONE, STR_WATERWAYS_MENU_WATERWAYS_CONSTRUCTION, 0, false));
+ ShowDropDownList(w, std::move(list), 0, WID_TN_WATER, 140, true, true);
return CBF_NONE;
}
@@ -950,7 +952,9 @@ static CallBackFunction MenuClickBuildWater(int index)
static CallBackFunction ToolbarBuildAirClick(Window *w)
{
- PopupMainToolbMenu(w, WID_TN_AIR, STR_AIRCRAFT_MENU_AIRPORT_CONSTRUCTION, 1);
+ DropDownList list;
+ list.emplace_back(new DropDownListIconItem(SPR_IMG_AIRPORT, PAL_NONE, STR_AIRCRAFT_MENU_AIRPORT_CONSTRUCTION, 0, false));
+ ShowDropDownList(w, std::move(list), 0, WID_TN_AIR, 140, true, true);
return CBF_NONE;
}
@@ -970,7 +974,11 @@ static CallBackFunction MenuClickBuildAir(int index)
static CallBackFunction ToolbarForestClick(Window *w)
{
- PopupMainToolbMenu(w, WID_TN_LANDSCAPE, STR_LANDSCAPING_MENU_LANDSCAPING, 3);
+ DropDownList list;
+ list.emplace_back(new DropDownListIconItem(SPR_IMG_LANDSCAPING, PAL_NONE, STR_LANDSCAPING_MENU_LANDSCAPING, 0, false));
+ list.emplace_back(new DropDownListIconItem(SPR_IMG_PLANTTREES, PAL_NONE, STR_LANDSCAPING_MENU_PLANT_TREES, 1, false));
+ list.emplace_back(new DropDownListIconItem(SPR_IMG_SIGN, PAL_NONE, STR_LANDSCAPING_MENU_PLACE_SIGN, 2, false));
+ ShowDropDownList(w, std::move(list), 0, WID_TN_LANDSCAPE, 100, true, true);
return CBF_NONE;
}