(svn r7094) -Codechange: Get rid of the window-specific code in DoZoomInOutWindow (enable, disable

buttons depending on calling window, game-mode); handle it by broadcasting messages
 to the calling window, because that knows how and what buttons to set.
This commit is contained in:
Darkvater
2006-11-07 13:06:02 +00:00
parent e90bc1681f
commit 65e051fe93
5 changed files with 42 additions and 40 deletions

View File

@@ -260,14 +260,11 @@ void GenerateWorld(int mode, uint size_x, uint size_y)
ShowGenerateWorldProgress();
}
/* Zoom out and center on the map (is pretty ;)) */
/* Hide vital windows, because we don't allow to use them */
if (_gw.thread != NULL) HideVitalWindows();
/* Centre the view on the map */
if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) {
while (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0) ) ) {}
ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2));
}
/* Hide vital windows, because we don't allow to use them */
/* XXX -- Ideal it is done after ShowGenerateWorldProgress, but stupid
* enough, DoZoomInOutWindow _needs_ the toolbar to exist... */
if (_gw.thread != NULL) HideVitalWindows();
}