summaryrefslogtreecommitdiff
path: root/src/genworld_gui.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-05-04 16:27:13 +0000
committerbelugas <belugas@openttd.org>2007-05-04 16:27:13 +0000
commitb559b8f9ff8a3fc25f4d03926022284abb9f9fa3 (patch)
treeaa52d3726c6fd14c5ac298000d0dbbfb570fcc93 /src/genworld_gui.cpp
parentcef3e9bde1b0980873c19cc8faed49e9606848d7 (diff)
downloadopenttd-b559b8f9ff8a3fc25f4d03926022284abb9f9fa3.tar.xz
(svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
Possible patterns are : No Road (not available in scenario editor) Original (for the nostalgics) Better Roads (same as original, but based on distance of 2 tiles instead of one) 2x2 grids 3x3 grids Patch by skiddl13
Diffstat (limited to 'src/genworld_gui.cpp')
-rw-r--r--src/genworld_gui.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index beb6c0b6c..4163d168a 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -199,7 +199,7 @@ void StartGeneratingLandscape(glwp_modes mode)
}
}
-static void HeightmapScaledTooMuchCallback(Window *w, bool confirmed)
+static void LandscapeGenerationCallback(Window *w, bool confirmed)
{
if (confirmed) StartGeneratingLandscape((glwp_modes)w->window_number);
}
@@ -354,14 +354,26 @@ static void GenerateLandscapeWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w);
break;
case GLAND_GENERATE_BUTTON: // Generate
- if (mode == GLWP_HEIGHTMAP && (
- _heightmap_x * 2 < (1U << _patches_newgame.map_x) || _heightmap_x / 2 > (1U << _patches_newgame.map_x) ||
- _heightmap_y * 2 < (1U << _patches_newgame.map_y) || _heightmap_y / 2 > (1U << _patches_newgame.map_y))) {
+
+ UpdatePatches();
+
+ if (_patches.town_layout == TL_NO_ROADS) {
+ ShowQuery(
+ STR_TOWN_LAYOUT_WARNING_CAPTION,
+ STR_TOWN_LAYOUT_WARNING_MESSAGE,
+ w,
+ LandscapeGenerationCallback);
+ } else if (mode == GLWP_HEIGHTMAP &&
+ (_heightmap_x * 2 < (1U << _patches_newgame.map_x) ||
+ _heightmap_x / 2 > (1U << _patches_newgame.map_x) ||
+ _heightmap_y * 2 < (1U << _patches_newgame.map_y) ||
+ _heightmap_y / 2 > (1U << _patches_newgame.map_y))) {
ShowQuery(
STR_HEIGHTMAP_SCALE_WARNING_CAPTION,
STR_HEIGHTMAP_SCALE_WARNING_MESSAGE,
w,
- HeightmapScaledTooMuchCallback);
+ LandscapeGenerationCallback);
+
} else {
StartGeneratingLandscape(mode);
}
@@ -545,6 +557,10 @@ void ShowHeightmapLoad()
void StartScenarioEditor()
{
+ if (_patches_newgame.town_layout == TL_NO_ROADS) {
+ _patches_newgame.town_layout = TL_ORIGINAL;
+ }
+
StartGeneratingLandscape(GLWP_SCENARIO);
}