mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-19 15:25:39 +00:00
(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
This commit is contained in:
parent
061f9ee5d5
commit
fd2b3d3e14
12
main_gui.c
12
main_gui.c
@ -46,7 +46,7 @@ static int _rename_what;
|
|||||||
|
|
||||||
static byte _terraform_size = 1;
|
static byte _terraform_size = 1;
|
||||||
static RailType _last_built_railtype;
|
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 void GenerateIndustries(void);
|
||||||
extern bool GenerateTowns(void);
|
extern bool GenerateTowns(void);
|
||||||
@ -1388,7 +1388,7 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WE_CREATE:
|
case WE_CREATE:
|
||||||
LowerWindowWidget(w, _scengen_town_size + 7);
|
LowerWindowWidget(w, (_scengen_town_size - 1)+ 7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WE_CLICK:
|
case WE_CLICK:
|
||||||
@ -1422,9 +1422,9 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case 7: case 8: case 9:
|
case 7: case 8: case 9:
|
||||||
RaiseWindowWidget(w, _scengen_town_size + 7);
|
RaiseWindowWidget(w, (_scengen_town_size - 1) + 7);
|
||||||
_scengen_town_size = e->we.click.widget - 7;
|
_scengen_town_size = (e->we.click.widget - 7) + 1;
|
||||||
LowerWindowWidget(w, _scengen_town_size + 7);
|
LowerWindowWidget(w, (_scengen_town_size - 1) + 7);
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1440,7 +1440,7 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
|
|||||||
break;
|
break;
|
||||||
case WE_ABORT_PLACE_OBJ:
|
case WE_ABORT_PLACE_OBJ:
|
||||||
RaiseWindowButtons(w);
|
RaiseWindowButtons(w);
|
||||||
LowerWindowWidget(w, _scengen_town_size + 7);
|
LowerWindowWidget(w, (_scengen_town_size - 1) + 7);
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1003,7 +1003,7 @@ static Town *AllocateTown(void)
|
|||||||
* This obviously only works in the scenario editor. Function not removed
|
* This obviously only works in the scenario editor. Function not removed
|
||||||
* as it might be possible in the future to fund your own town :)
|
* as it might be possible in the future to fund your own town :)
|
||||||
* @param tile coordinates where town is built
|
* @param tile coordinates where town is built
|
||||||
* @param p1 size of the town (1 = small, 2 = medium, 3 = large)
|
* @param p1 size of the town (0 = random, 1 = small, 2 = medium, 3 = large)
|
||||||
* @param p2 unused
|
* @param p2 unused
|
||||||
*/
|
*/
|
||||||
int32 CmdBuildTown(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
int32 CmdBuildTown(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
|
Loading…
Reference in New Issue
Block a user