summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-09 13:03:34 +0000
committerDarkvater <darkvater@openttd.org>2006-11-09 13:03:34 +0000
commitfd2b3d3e14a377983682d5c43eda6b3a621cac34 (patch)
treeea5982e4a3f26fb265c587505c09bcf2dc0b89f5 /main_gui.c
parent061f9ee5d50d1898bfbf2a8fcab7e8c0416ad536 (diff)
downloadopenttd-fd2b3d3e14a377983682d5c43eda6b3a621cac34.tar.xz
(svn r7120) -Fix (r6631): A town size of 0 in the scenario editor is a random size. So to get a size
you need it between 1 and 3 and therefore there is no one-on-one correspondence between widget-numbers and town-size. Based on a patch by Maedhros
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main_gui.c b/main_gui.c
index bf34a9330..3815c37a6 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -46,7 +46,7 @@ static int _rename_what;
static byte _terraform_size = 1;
static RailType _last_built_railtype;
-static int _scengen_town_size = 1;
+static int _scengen_town_size = 2; // depress medium-sized towns per default
extern void GenerateIndustries(void);
extern bool GenerateTowns(void);
@@ -1388,7 +1388,7 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
break;
case WE_CREATE:
- LowerWindowWidget(w, _scengen_town_size + 7);
+ LowerWindowWidget(w, (_scengen_town_size - 1)+ 7);
break;
case WE_CLICK:
@@ -1422,9 +1422,9 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
}
case 7: case 8: case 9:
- RaiseWindowWidget(w, _scengen_town_size + 7);
- _scengen_town_size = e->we.click.widget - 7;
- LowerWindowWidget(w, _scengen_town_size + 7);
+ RaiseWindowWidget(w, (_scengen_town_size - 1) + 7);
+ _scengen_town_size = (e->we.click.widget - 7) + 1;
+ LowerWindowWidget(w, (_scengen_town_size - 1) + 7);
SetWindowDirty(w);
break;
}
@@ -1440,7 +1440,7 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
break;
case WE_ABORT_PLACE_OBJ:
RaiseWindowButtons(w);
- LowerWindowWidget(w, _scengen_town_size + 7);
+ LowerWindowWidget(w, (_scengen_town_size - 1) + 7);
SetWindowDirty(w);
break;
}