Hide all windows when building anything on the map

This commit is contained in:
Sergii Pylypenko
2016-04-04 23:04:39 +03:00
parent 595727c438
commit ad5599aed8
6 changed files with 21 additions and 3 deletions

View File

@@ -222,18 +222,22 @@ struct TerraformToolbarWindow : Window {
switch (this->last_user_action) {
case WID_TT_LOWER_LAND: // Lower land button
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LOWER_AND_LEVEL_AREA);
MoveAllWindowsOffScreen();
break;
case WID_TT_RAISE_LAND: // Raise land button
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_RAISE_AND_LEVEL_AREA);
MoveAllWindowsOffScreen();
break;
case WID_TT_LEVEL_LAND: // Level land button
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LEVEL_AREA);
MoveAllWindowsOffScreen();
break;
case WID_TT_DEMOLISH: // Demolish aka dynamite button
PlaceProc_DemolishArea(tile);
MoveAllWindowsOffScreen();
break;
case WID_TT_BUY_LAND: // Buy land button
@@ -272,11 +276,13 @@ struct TerraformToolbarWindow : Window {
GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
break;
}
MoveAllHiddenWindowsBackToScreen();
}
}
virtual void OnPlaceObjectAbort()
{
MoveAllHiddenWindowsBackToScreen();
this->RaiseButtons();
}