Mercurial > hg > openttd
annotate src/genworld_gui.cpp @ 11222:d0328639d3a8 draft
(svn r15575) -Codechange: Rename GameModes to GameMode and store _game_mode as GameMode instead of as byte.
author | yexo <yexo@openttd.org> |
---|---|
date | Wed, 25 Feb 2009 00:14:46 +0000 |
parents | 3f640ecc6b09 |
children | 4928ebb36453 |
rev | line source |
---|---|
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
2 |
9111
d48433370037
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents:
8749
diff
changeset
|
3 /** @file genworld_gui.cpp GUI to configure and show progress during map generation. */ |
6179
e3e61b92574b
(svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas <belugas@openttd.org>
parents:
5901
diff
changeset
|
4 |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
5 #include "stdafx.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
6 #include "openttd.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
7 #include "heightmap.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
8 #include "gui.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
9 #include "variables.h" |
8208
ddc34919158f
(svn r11771) -Codechange: split settings.h into better separated headers.
rubidium <rubidium@openttd.org>
parents:
8157
diff
changeset
|
10 #include "settings_func.h" |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
11 #include "debug.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
12 #include "genworld.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
13 #include "network/network.h" |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
14 #include "newgrf_config.h" |
8114
2d6af5d7a142
(svn r11675) -Codechange: split the string types from the string functions.
rubidium <rubidium@openttd.org>
parents:
8108
diff
changeset
|
15 #include "strings_func.h" |
8131
e300ac8001ae
(svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h'
rubidium <rubidium@openttd.org>
parents:
8121
diff
changeset
|
16 #include "window_func.h" |
8140
fb8a05d579da
(svn r11702) -Codechange: move all date related stuff to date*.
rubidium <rubidium@openttd.org>
parents:
8131
diff
changeset
|
17 #include "date_func.h" |
8157
019833e42fda
(svn r11719) -Codechange: split sound.h in a header with types and one with functions.
rubidium <rubidium@openttd.org>
parents:
8151
diff
changeset
|
18 #include "sound_func.h" |
8151
bee108a98a39
(svn r11713) -Codechange: Move some declarations and definitions in a more logical disposition
belugas <belugas@openttd.org>
parents:
8140
diff
changeset
|
19 #include "fios.h" |
8214
6385dffc0b37
(svn r11777) -Codechange: split the string header and make do not include it when it's not necessary.
rubidium <rubidium@openttd.org>
parents:
8208
diff
changeset
|
20 #include "string_func.h" |
8224
c45446125bf0
(svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium <rubidium@openttd.org>
parents:
8214
diff
changeset
|
21 #include "gfx_func.h" |
8270
5613b863190d
(svn r11834) -Codechange: only include settings_type.h if needed.
rubidium <rubidium@openttd.org>
parents:
8264
diff
changeset
|
22 #include "settings_type.h" |
8327
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
23 #include "widgets/dropdown_type.h" |
8284
dbb7bfe0e95c
(svn r11848) -Codechange: New class-based drop down list functionality. Lists are now dynamically generated, and can include parameters, or be extended however needed.
peter1138 <peter1138@openttd.org>
parents:
8270
diff
changeset
|
24 #include "widgets/dropdown_func.h" |
8433
ecb823533681
(svn r12003) -Codechange: don't declare InteractiveRandom[Range] in multiple places.
rubidium <rubidium@openttd.org>
parents:
8424
diff
changeset
|
25 #include "core/random_func.hpp" |
9126
8c450e1754e2
(svn r12986) -Codechange: move the landscape and transport related types from openttd.h to their own headers.
rubidium <rubidium@openttd.org>
parents:
9116
diff
changeset
|
26 #include "landscape_type.h" |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
27 #include "querystring_gui.h" |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
28 |
8264
2495310e220f
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium <rubidium@openttd.org>
parents:
8254
diff
changeset
|
29 #include "table/strings.h" |
2495310e220f
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium <rubidium@openttd.org>
parents:
8254
diff
changeset
|
30 #include "table/sprites.h" |
2495310e220f
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium <rubidium@openttd.org>
parents:
8254
diff
changeset
|
31 |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
32 /** |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
33 * In what 'mode' the GenerateLandscapeWindowProc is. |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
34 */ |
6248
0789677a15a0
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents:
6247
diff
changeset
|
35 enum glwp_modes { |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
36 GLWP_GENERATE, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
37 GLWP_HEIGHTMAP, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
38 GLWP_SCENARIO, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
39 GLWP_END |
6248
0789677a15a0
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents:
6247
diff
changeset
|
40 }; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
41 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
42 extern void SwitchMode(int new_mode); |
10696
7edccbb67398
(svn r15027) -Merge: tomatos and bananas left to be, here is NoAI for all to see.
truebrain <truebrain@openttd.org>
parents:
10592
diff
changeset
|
43 extern void MakeNewgameSettingsLive(); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
44 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
45 static inline void SetNewLandscapeType(byte landscape) |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
46 { |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
47 _settings_newgame.game_creation.landscape = landscape; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
48 InvalidateWindowClasses(WC_SELECT_GAME); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
49 InvalidateWindowClasses(WC_GENERATE_LANDSCAPE); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
50 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
51 |
5901
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
52 enum GenerateLandscapeWindowWidgets { |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
53 GLAND_TEMPERATE = 3, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
54 GLAND_ARCTIC, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
55 GLAND_TROPICAL, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
56 GLAND_TOYLAND, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
57 |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
58 GLAND_MAPSIZE_X_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
59 GLAND_MAPSIZE_X_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
60 GLAND_MAPSIZE_Y_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
61 GLAND_MAPSIZE_Y_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
62 |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
63 GLAND_TOWN_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
64 GLAND_TOWN_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
65 GLAND_INDUSTRY_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
66 GLAND_INDUSTRY_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
67 |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
68 GLAND_RANDOM_TEXT, |
5901
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
69 GLAND_RANDOM_EDITBOX, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
70 GLAND_RANDOM_BUTTON, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
71 |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
72 GLAND_GENERATE_BUTTON, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
73 |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
74 GLAND_START_DATE_TEXT1, |
5901
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
75 GLAND_START_DATE_DOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
76 GLAND_START_DATE_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
77 GLAND_START_DATE_UP, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
78 |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
79 GLAND_SNOW_LEVEL_TEXT1, |
5901
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
80 GLAND_SNOW_LEVEL_DOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
81 GLAND_SNOW_LEVEL_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
82 GLAND_SNOW_LEVEL_UP, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
83 |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
84 GLAND_TREE_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
85 GLAND_TREE_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
86 GLAND_LANDSCAPE_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
87 GLAND_LANDSCAPE_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
88 GLAND_HEIGHTMAP_ROTATION_TEXT = GLAND_LANDSCAPE_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
89 GLAND_HEIGHTMAP_ROTATION_PULLDOWN = GLAND_LANDSCAPE_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
90 |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
91 GLAND_TERRAIN_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
92 GLAND_TERRAIN_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
93 GLAND_WATER_TEXT, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
94 GLAND_WATER_PULLDOWN, |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
95 GLAND_SMOOTHNESS_TEXT, |
10855
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
96 GLAND_SMOOTHNESS_PULLDOWN, |
10877
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
97 |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
98 GLAND_BORDER_TYPES, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
99 GLAND_BORDERS_RANDOM, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
100 GLAND_WATER_NW_TEXT, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
101 GLAND_WATER_NE_TEXT, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
102 GLAND_WATER_SE_TEXT, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
103 GLAND_WATER_SW_TEXT, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
104 GLAND_WATER_NW, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
105 GLAND_WATER_NE, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
106 GLAND_WATER_SE, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
107 GLAND_WATER_SW, |
5901
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
108 }; |
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
109 |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
110 static const Widget _generate_landscape_widgets[] = { |
9910
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
111 { WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
112 { WWT_CAPTION, RESIZE_NONE, COLOUR_BROWN, 11, 337, 0, 13, STR_WORLD_GENERATION_CAPTION, STR_NULL}, |
10877
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
113 { WWT_PANEL, RESIZE_NONE, COLOUR_BROWN, 0, 337, 14, 313, 0x0, STR_NULL}, |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
114 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
115 /* Landscape selection */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
116 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 10, 86, 24, 78, SPR_SELECT_TEMPERATE, STR_030E_SELECT_TEMPERATE_LANDSCAPE}, // GLAND_TEMPERATE |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
117 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 90, 166, 24, 78, SPR_SELECT_SUB_ARCTIC, STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE}, // GLAND_ARCTIC |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
118 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 170, 246, 24, 78, SPR_SELECT_SUB_TROPICAL, STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE}, // GLAND_TROPICAL |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
119 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 250, 326, 24, 78, SPR_SELECT_TOYLAND, STR_0311_SELECT_TOYLAND_LANDSCAPE}, // GLAND_TOYLAND |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
120 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
121 /* Mapsize X */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
122 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 91, 101, STR_MAPSIZE, STR_NULL}, // GLAND_MAPSIZE_X_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
123 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 161, 90, 101, STR_NUM_1, STR_NULL}, // GLAND_MAPSIZE_X_PULLDOWN |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
124 /* Mapsize Y */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
125 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 168, 176, 91, 101, STR_BY, STR_NULL}, // GLAND_MAPSIZE_Y_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
126 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 180, 227, 90, 101, STR_NUM_2, STR_NULL}, // GLAND_MAPSIZE_Y_PULLDOWN |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
127 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
128 /* Number of towns */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
129 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 113, 123, STR_NUMBER_OF_TOWNS, STR_NULL}, // GLAND_TOWN_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
130 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 175, 112, 123, 0x0, STR_NULL}, // GLAND_TOWN_PULLDOWN |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
131 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
132 /* Number of industries */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
133 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 131, 141, STR_NUMBER_OF_INDUSTRIES, STR_NULL}, // GLAND_INDUSTRY_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
134 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 175, 130, 141, 0x0, STR_NULL}, // GLAND_INDUSTRY_PULLDOWN |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
135 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
136 /* Edit box for seed */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
137 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 153, 163, STR_RANDOM_SEED, STR_NULL}, // GLAND_RANDOM_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
138 { WWT_EDITBOX, RESIZE_NONE, COLOUR_WHITE, 114, 207, 152, 163, STR_RANDOM_SEED_OSKTITLE, STR_RANDOM_SEED_HELP}, // GLAND_RANDOM_EDITBOX |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
139 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 216, 326, 152, 163, STR_RANDOM, STR_RANDOM_HELP}, // GLAND_RANDOM_BUTTON |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
140 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
141 /* Generate button */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
142 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREEN, 243, 326, 228, 257, STR_GENERATE, STR_NULL}, // GLAND_GENERATE_BUTTON |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
143 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
144 /* Start date */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
145 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 182, 212, 113, 123, STR_DATE, STR_NULL}, // GLAND_START_DATE_TEXT1 |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
146 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 216, 227, 112, 123, SPR_ARROW_DOWN, STR_029E_MOVE_THE_STARTING_DATE}, // GLAND_START_DATE_DOWN |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
147 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 228, 314, 112, 123, STR_GENERATE_DATE, STR_NULL}, // GLAND_START_DATE_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
148 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 315, 326, 112, 123, SPR_ARROW_UP, STR_029F_MOVE_THE_STARTING_DATE}, // GLAND_START_DATE_UP |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
149 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
150 /* Snow line */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
151 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 182, 278, 131, 141, STR_SNOW_LINE_HEIGHT, STR_NULL}, // GLAND_SNOW_LEVEL_TEXT1 |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
152 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 282, 293, 130, 141, SPR_ARROW_DOWN, STR_SNOW_LINE_DOWN}, // GLAND_SNOW_LEVEL_DOWN |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
153 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 294, 314, 130, 141, STR_NUM_3, STR_NULL}, // GLAND_SNOW_LEVEL_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
154 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 315, 326, 130, 141, SPR_ARROW_UP, STR_SNOW_LINE_UP}, // GLAND_SNOW_LEVEL_UP |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
155 |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
156 /* Tree placer */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
157 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 193, 203, STR_TREE_PLACER, STR_NULL}, // GLAND_TREE_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
158 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 231, 192, 203, 0x0, STR_NULL}, // GLAND_TREE_PULLDOWN |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
159 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
160 /* Landscape generator */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
161 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 175, 185, STR_LAND_GENERATOR, STR_NULL}, // GLAND_LANDSCAPE_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
162 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 231, 174, 185, 0x0, STR_NULL}, // GLAND_LANDSCAPE_PULLDOWN |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
163 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
164 /* Terrain type */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
165 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 211, 221, STR_TERRAIN_TYPE, STR_NULL}, // GLAND_TERRAIN_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
166 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 231, 210, 221, 0x0, STR_NULL}, // GLAND_TERRAIN_PULLDOWN |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
167 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
168 /* Water quantity */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
169 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 229, 239, STR_QUANTITY_OF_SEA_LAKES, STR_NULL}, // GLAND_WATER_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
170 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 231, 228, 239, 0x0, STR_NULL}, // GLAND_WATER_PULLDOWN |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
171 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
172 /* Map smoothness */ |
10877
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
173 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 247, 257, STR_SMOOTHNESS, STR_NULL}, // GLAND_SMOOTHNESS_TEXT |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
174 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 231, 246, 257, 0x0, STR_NULL}, // GLAND_SMOOTHNESS_PULLDOWN |
10855
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
175 |
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
176 /* Water borders */ |
10877
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
177 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 265, 275, STR_BORDER_TYPE, STR_NULL}, // GLAND_BORDER_TYPES |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
178 { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 114, 231, 264, 275, STR_BORDER_RANDOMIZE, STR_NULL}, // GLAND_BORDERS_RANDOM |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
179 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 95, 282, 292, STR_NORTHWEST, STR_NULL}, // GLAND_WATER_NW_TEXT |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
180 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 250, 326, 282, 292, STR_NORTHEAST, STR_NULL}, // GLAND_WATER_NE_TEXT |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
181 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 250, 326, 294, 304, STR_SOUTHEAST, STR_NULL}, // GLAND_WATER_SE_TEXT |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
182 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 95, 294, 304, STR_SOUTHWEST, STR_NULL}, // GLAND_WATER_SW_TEXT |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
183 { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 100, 172, 280, 291, 0x0, STR_NORTHWEST}, // GLAND_WATER_NW |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
184 { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 173, 245, 280, 291, 0x0, STR_NORTHEAST}, // GLAND_WATER_NE |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
185 { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 173, 245, 292, 303, 0x0, STR_SOUTHEAST}, // GLAND_WATER_SE |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
186 { WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_ORANGE, 100, 172, 292, 303, 0x0, STR_SOUTHWEST}, // GLAND_WATER_SW |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
187 { WIDGETS_END}, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
188 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
189 |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
190 static const Widget _heightmap_load_widgets[] = { |
9910
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
191 { WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
192 { WWT_CAPTION, RESIZE_NONE, COLOUR_BROWN, 11, 337, 0, 13, STR_WORLD_GENERATION_CAPTION, STR_NULL}, |
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
193 { WWT_PANEL, RESIZE_NONE, COLOUR_BROWN, 0, 337, 14, 235, 0x0, STR_NULL}, |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
194 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
195 /* Landscape selection */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
196 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 10, 86, 24, 78, SPR_SELECT_TEMPERATE, STR_030E_SELECT_TEMPERATE_LANDSCAPE}, // GLAND_TEMPERATE |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
197 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 90, 166, 24, 78, SPR_SELECT_SUB_ARCTIC, STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE}, // GLAND_ARCTIC |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
198 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 170, 246, 24, 78, SPR_SELECT_SUB_TROPICAL, STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE}, // GLAND_TROPICAL |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
199 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 250, 326, 24, 78, SPR_SELECT_TOYLAND, STR_0311_SELECT_TOYLAND_LANDSCAPE}, // GLAND_TOYLAND |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
200 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
201 /* Mapsize X */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
202 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 113, 123, STR_MAPSIZE, STR_NULL}, // GLAND_MAPSIZE_X_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
203 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 161, 112, 123, STR_NUM_1, STR_NULL}, // GLAND_MAPSIZE_X_PULLDOWN |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
204 /* Mapsize Y */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
205 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 168, 176, 113, 123, STR_BY, STR_NULL}, // GLAND_MAPSIZE_Y_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
206 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 180, 227, 112, 123, STR_NUM_2, STR_NULL}, // GLAND_MAPSIZE_Y_PULLDOWN |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
207 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
208 /* Number of towns */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
209 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 135, 145, STR_NUMBER_OF_TOWNS, STR_NULL}, // GLAND_TOWN_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
210 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 175, 134, 145, 0x0, STR_NULL}, // GLAND_TOWN_PULLDOWN |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
211 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
212 /* Number of industries */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
213 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 153, 163, STR_NUMBER_OF_INDUSTRIES, STR_NULL}, // GLAND_INDUSTRY_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
214 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 175, 152, 163, 0x0, STR_NULL}, // GLAND_INDUSTRY_PULLDOWN |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
215 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
216 /* Edit box for seed */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
217 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 175, 185, STR_RANDOM_SEED, STR_NULL}, // GLAND_RANDOM_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
218 { WWT_EDITBOX, RESIZE_NONE, COLOUR_WHITE, 114, 207, 174, 185, STR_RANDOM_SEED_OSKTITLE, STR_RANDOM_SEED_HELP}, // GLAND_RANDOM_EDITBOX |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
219 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 216, 326, 174, 185, STR_RANDOM, STR_RANDOM_HELP}, // GLAND_RANDOM_BUTTON |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
220 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
221 /* Generate button */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
222 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREEN, 243, 326, 196, 225, STR_GENERATE, STR_NULL}, // GLAND_GENERATE_BUTTON |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
223 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
224 /* Starting date */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
225 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 182, 212, 135, 145, STR_DATE, STR_NULL}, // GLAND_START_DATE_TEXT1 |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
226 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 216, 227, 134, 145, SPR_ARROW_DOWN, STR_029E_MOVE_THE_STARTING_DATE}, // GLAND_START_DATE_DOWN |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
227 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 228, 314, 134, 145, STR_GENERATE_DATE, STR_NULL}, // GLAND_START_DATE_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
228 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 315, 326, 134, 145, SPR_ARROW_UP, STR_029F_MOVE_THE_STARTING_DATE}, // GLAND_START_DATE_UP |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
229 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
230 /* Snow line */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
231 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 182, 278, 153, 163, STR_SNOW_LINE_HEIGHT, STR_NULL}, // GLAND_SNOW_LEVEL_TEXT1 |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
232 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 282, 293, 152, 163, SPR_ARROW_DOWN, STR_SNOW_LINE_DOWN}, // GLAND_SNOW_LEVEL_DOWN |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
233 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 294, 314, 152, 163, STR_NUM_3, STR_NULL}, // GLAND_SNOW_LEVEL_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
234 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 315, 326, 152, 163, SPR_ARROW_UP, STR_SNOW_LINE_UP}, // GLAND_SNOW_LEVEL_UP |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
235 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
236 /* Tree placer */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
237 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 197, 207, STR_TREE_PLACER, STR_NULL}, // GLAND_TREE_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
238 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 231, 196, 207, STR_0225, STR_NULL}, // GLAND_TREE_PULLDOWN |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
239 |
10592
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
240 /* Heightmap rotation */ |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
241 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 12, 110, 215, 225, STR_HEIGHTMAP_ROTATION, STR_NULL}, // GLAND_HEIGHTMAP_ROTATION_TEXT |
38213fd57745
(svn r14855) -Documentation: Apply some widget naming to the widget arrays. Based on Yorick's work
belugas <belugas@openttd.org>
parents:
10547
diff
changeset
|
242 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 114, 231, 214, 225, STR_0225, STR_NULL}, // GLAND_HEIGHTMAP_ROTATION_PULLDOWN |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
243 |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
244 { WIDGETS_END}, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
245 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
246 |
5899
71bc001a6dde
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater <Darkvater@openttd.org>
parents:
5894
diff
changeset
|
247 void StartGeneratingLandscape(glwp_modes mode) |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
248 { |
5899
71bc001a6dde
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater <Darkvater@openttd.org>
parents:
5894
diff
changeset
|
249 DeleteAllNonVitalWindows(); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
250 |
11148
3cb2d503c4e8
(svn r15495) -Revert (r15383,r15422): Loading NewGRFs depends on correct settings, but the economy can only be started after loading NewGRFs. In short: r15383 causes more problems then it's worth.
yexo <yexo@openttd.org>
parents:
11081
diff
changeset
|
251 /* Copy all XXX_newgame to XXX when coming from outside the editor */ |
3cb2d503c4e8
(svn r15495) -Revert (r15383,r15422): Loading NewGRFs depends on correct settings, but the economy can only be started after loading NewGRFs. In short: r15383 causes more problems then it's worth.
yexo <yexo@openttd.org>
parents:
11081
diff
changeset
|
252 MakeNewgameSettingsLive(); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
253 ResetGRFConfig(true); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
254 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
255 SndPlayFx(SND_15_BEEP); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
256 switch (mode) { |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
257 case GLWP_GENERATE: _switch_mode = (_game_mode == GM_EDITOR) ? SM_GENRANDLAND : SM_NEWGAME; break; |
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
258 case GLWP_HEIGHTMAP: _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_HEIGHTMAP : SM_START_HEIGHTMAP; break; |
5899
71bc001a6dde
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater <Darkvater@openttd.org>
parents:
5894
diff
changeset
|
259 case GLWP_SCENARIO: _switch_mode = SM_EDITOR; break; |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
260 default: NOT_REACHED(); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
261 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
262 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
263 |
6571
6777295c2328
(svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas <belugas@openttd.org>
parents:
6560
diff
changeset
|
264 static void LandscapeGenerationCallback(Window *w, bool confirmed) |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
265 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
266 if (confirmed) StartGeneratingLandscape((glwp_modes)w->window_number); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
267 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
268 |
8327
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
269 static DropDownList *BuildMapsizeDropDown() |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
270 { |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
271 DropDownList *list = new DropDownList(); |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
272 |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
273 for (uint i = 6; i <= 11; i++) { |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
274 DropDownListParamStringItem *item = new DropDownListParamStringItem(STR_JUST_INT, i, false); |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
275 item->SetParam(0, 1 << i); |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
276 list->push_back(item); |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
277 } |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
278 |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
279 return list; |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
280 } |
b5058eea06a1
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138 <peter1138@openttd.org>
parents:
8284
diff
changeset
|
281 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
282 static const StringID _elevations[] = {STR_682A_VERY_FLAT, STR_682B_FLAT, STR_682C_HILLY, STR_682D_MOUNTAINOUS, INVALID_STRING_ID}; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
283 static const StringID _sea_lakes[] = {STR_VERY_LOW, STR_6820_LOW, STR_6821_MEDIUM, STR_6822_HIGH, INVALID_STRING_ID}; |
11069
36d798171bfd
(svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability.
rubidium <rubidium@openttd.org>
parents:
11043
diff
changeset
|
284 static const StringID _smoothness[] = {STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH, INVALID_STRING_ID}; |
36d798171bfd
(svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability.
rubidium <rubidium@openttd.org>
parents:
11043
diff
changeset
|
285 static const StringID _tree_placer[] = {STR_CONFIG_SETTING_TREE_PLACER_NONE, STR_CONFIG_SETTING_TREE_PLACER_ORIGINAL, STR_CONFIG_SETTING_TREE_PLACER_IMPROVED, INVALID_STRING_ID}; |
36d798171bfd
(svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability.
rubidium <rubidium@openttd.org>
parents:
11043
diff
changeset
|
286 static const StringID _rotation[] = {STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE, STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_CLOCKWISE, INVALID_STRING_ID}; |
36d798171bfd
(svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability.
rubidium <rubidium@openttd.org>
parents:
11043
diff
changeset
|
287 static const StringID _landscape[] = {STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL, STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS, INVALID_STRING_ID}; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
288 static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID}; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
289 static const StringID _num_inds[] = {STR_NONE, STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID}; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
290 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
291 struct GenerateLandscapeWindow : public QueryStringBaseWindow { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
292 uint widget_id; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
293 uint x; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
294 uint y; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
295 char name[64]; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
296 glwp_modes mode; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
297 |
9897
5b558ce6cb0e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium <rubidium@openttd.org>
parents:
9648
diff
changeset
|
298 GenerateLandscapeWindow(const WindowDesc *desc, WindowNumber number = 0) : QueryStringBaseWindow(11, desc, number) |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
299 { |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
300 this->LowerWidget(_settings_newgame.game_creation.landscape + GLAND_TEMPERATE); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
301 |
10276
a5286e772120
(svn r14514) -Codechange: use 'size' instead of 'length' for querystring and textbuf, explicitly say it includes the terminating zero
smatz <smatz@openttd.org>
parents:
10180
diff
changeset
|
302 /* snprintf() always outputs trailing '\0', so whole buffer can be used */ |
9897
5b558ce6cb0e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium <rubidium@openttd.org>
parents:
9648
diff
changeset
|
303 snprintf(this->edit_str_buf, this->edit_str_size, "%u", _settings_newgame.game_creation.generation_seed); |
5b558ce6cb0e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium <rubidium@openttd.org>
parents:
9648
diff
changeset
|
304 InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, 120); |
11081
0a26df8849a2
(svn r15424) -Codechange: make it possible to have multiple windows with edit box open simultaniously (Zuu).
rubidium <rubidium@openttd.org>
parents:
11069
diff
changeset
|
305 this->SetFocusedWidget(GLAND_RANDOM_EDITBOX); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
306 this->caption = STR_NULL; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
307 this->afilter = CS_NUMERAL; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
308 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
309 this->mode = (glwp_modes)this->window_number; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
310 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
311 this->FindWindowPlacementAndResize(desc); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
312 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
313 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
314 virtual void OnPaint() |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
315 { |
10855
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
316 /* You can't select smoothness / non-water borders if not terragenesis */ |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
317 if (mode == GLWP_GENERATE) { |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
318 this->SetWidgetDisabledState(GLAND_SMOOTHNESS_PULLDOWN, _settings_newgame.game_creation.land_generator == 0); |
10877
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
319 this->SetWidgetDisabledState(GLAND_BORDERS_RANDOM, _settings_newgame.game_creation.land_generator == 0 || !_settings_newgame.construction.freeform_edges); |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
320 this->SetWidgetsDisabledState(_settings_newgame.game_creation.land_generator == 0 || !_settings_newgame.construction.freeform_edges || _settings_newgame.game_creation.water_borders == BORDERS_RANDOM, |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
321 GLAND_WATER_NW, GLAND_WATER_NE, GLAND_WATER_SE, GLAND_WATER_SW, WIDGET_LIST_END); |
10905
1aa79a9da08e
(svn r15240) -Fix (r15212): Loading heightmaps resulted in an assert.
Yexo <Yexo@openttd.org>
parents:
10877
diff
changeset
|
322 |
1aa79a9da08e
(svn r15240) -Fix (r15212): Loading heightmaps resulted in an assert.
Yexo <Yexo@openttd.org>
parents:
10877
diff
changeset
|
323 this->SetWidgetLoweredState(GLAND_BORDERS_RANDOM, _settings_newgame.game_creation.water_borders == BORDERS_RANDOM); |
1aa79a9da08e
(svn r15240) -Fix (r15212): Loading heightmaps resulted in an assert.
Yexo <Yexo@openttd.org>
parents:
10877
diff
changeset
|
324 |
1aa79a9da08e
(svn r15240) -Fix (r15212): Loading heightmaps resulted in an assert.
Yexo <Yexo@openttd.org>
parents:
10877
diff
changeset
|
325 this->SetWidgetLoweredState(GLAND_WATER_NW, HasBit(_settings_newgame.game_creation.water_borders, BORDER_NW)); |
1aa79a9da08e
(svn r15240) -Fix (r15212): Loading heightmaps resulted in an assert.
Yexo <Yexo@openttd.org>
parents:
10877
diff
changeset
|
326 this->SetWidgetLoweredState(GLAND_WATER_NE, HasBit(_settings_newgame.game_creation.water_borders, BORDER_NE)); |
1aa79a9da08e
(svn r15240) -Fix (r15212): Loading heightmaps resulted in an assert.
Yexo <Yexo@openttd.org>
parents:
10877
diff
changeset
|
327 this->SetWidgetLoweredState(GLAND_WATER_SE, HasBit(_settings_newgame.game_creation.water_borders, BORDER_SE)); |
1aa79a9da08e
(svn r15240) -Fix (r15212): Loading heightmaps resulted in an assert.
Yexo <Yexo@openttd.org>
parents:
10877
diff
changeset
|
328 this->SetWidgetLoweredState(GLAND_WATER_SW, HasBit(_settings_newgame.game_creation.water_borders, BORDER_SW)); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
329 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
330 /* Disable snowline if not hilly */ |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
331 this->SetWidgetDisabledState(GLAND_SNOW_LEVEL_TEXT, _settings_newgame.game_creation.landscape != LT_ARCTIC); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
332 /* Disable town, industry and trees in SE */ |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
333 this->SetWidgetDisabledState(GLAND_TOWN_PULLDOWN, _game_mode == GM_EDITOR); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
334 this->SetWidgetDisabledState(GLAND_INDUSTRY_PULLDOWN, _game_mode == GM_EDITOR); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
335 this->SetWidgetDisabledState(GLAND_TREE_PULLDOWN, _game_mode == GM_EDITOR); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
336 |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
337 this->SetWidgetDisabledState(GLAND_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= MIN_YEAR); |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
338 this->SetWidgetDisabledState(GLAND_START_DATE_UP, _settings_newgame.game_creation.starting_year >= MAX_YEAR); |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
339 this->SetWidgetDisabledState(GLAND_SNOW_LEVEL_DOWN, _settings_newgame.game_creation.snow_line_height <= 2 || _settings_newgame.game_creation.landscape != LT_ARCTIC); |
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
340 this->SetWidgetDisabledState(GLAND_SNOW_LEVEL_UP, _settings_newgame.game_creation.snow_line_height >= MAX_SNOWLINE_HEIGHT || _settings_newgame.game_creation.landscape != LT_ARCTIC); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
341 |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
342 this->SetWidgetLoweredState(GLAND_TEMPERATE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); |
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
343 this->SetWidgetLoweredState(GLAND_ARCTIC, _settings_newgame.game_creation.landscape == LT_ARCTIC); |
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
344 this->SetWidgetLoweredState(GLAND_TROPICAL, _settings_newgame.game_creation.landscape == LT_TROPIC); |
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
345 this->SetWidgetLoweredState(GLAND_TOYLAND, _settings_newgame.game_creation.landscape == LT_TOYLAND); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
346 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
347 if (_game_mode == GM_EDITOR) { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
348 this->widget[GLAND_TOWN_PULLDOWN].data = STR_6836_OFF; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
349 this->widget[GLAND_INDUSTRY_PULLDOWN].data = STR_6836_OFF; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
350 } else { |
9358
12f4585b2124
(svn r13255) -Codechange: move _opt to _settings.
rubidium <rubidium@openttd.org>
parents:
9354
diff
changeset
|
351 this->widget[GLAND_TOWN_PULLDOWN].data = _num_towns[_settings_newgame.difficulty.number_towns]; |
12f4585b2124
(svn r13255) -Codechange: move _opt to _settings.
rubidium <rubidium@openttd.org>
parents:
9354
diff
changeset
|
352 this->widget[GLAND_INDUSTRY_PULLDOWN].data = _num_inds[_settings_newgame.difficulty.number_industries]; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
353 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
354 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
355 if (mode == GLWP_GENERATE) { |
10877
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
356 this->widget[GLAND_LANDSCAPE_PULLDOWN].data = _landscape[_settings_newgame.game_creation.land_generator]; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
357 this->widget[GLAND_TREE_PULLDOWN].data = _tree_placer[_settings_newgame.game_creation.tree_placer]; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
358 this->widget[GLAND_TERRAIN_PULLDOWN].data = _elevations[_settings_newgame.difficulty.terrain_type]; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
359 this->widget[GLAND_WATER_PULLDOWN].data = _sea_lakes[_settings_newgame.difficulty.quantity_sea_lakes]; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
360 this->widget[GLAND_SMOOTHNESS_PULLDOWN].data = _smoothness[_settings_newgame.game_creation.tgen_smoothness]; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
361 this->widget[GLAND_BORDERS_RANDOM].data = (_settings_newgame.game_creation.water_borders == BORDERS_RANDOM) ? STR_BORDER_RANDOMIZE : STR_BORDER_MANUAL; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
362 |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
363 if (_settings_newgame.game_creation.water_borders == BORDERS_RANDOM) { |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
364 this->widget[GLAND_WATER_NE].data = STR_BORDER_RANDOM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
365 this->widget[GLAND_WATER_NW].data = STR_BORDER_RANDOM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
366 this->widget[GLAND_WATER_SE].data = STR_BORDER_RANDOM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
367 this->widget[GLAND_WATER_SW].data = STR_BORDER_RANDOM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
368 } else { |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
369 this->widget[GLAND_WATER_NE].data = HasBit(_settings_newgame.game_creation.water_borders,BORDER_NE) ? STR_BORDER_WATER : STR_BORDER_FREEFORM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
370 this->widget[GLAND_WATER_NW].data = HasBit(_settings_newgame.game_creation.water_borders,BORDER_NW) ? STR_BORDER_WATER : STR_BORDER_FREEFORM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
371 this->widget[GLAND_WATER_SE].data = HasBit(_settings_newgame.game_creation.water_borders,BORDER_SE) ? STR_BORDER_WATER : STR_BORDER_FREEFORM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
372 this->widget[GLAND_WATER_SW].data = HasBit(_settings_newgame.game_creation.water_borders,BORDER_SW) ? STR_BORDER_WATER : STR_BORDER_FREEFORM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
373 } |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
374 } else { |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
375 this->widget[GLAND_TREE_PULLDOWN].data = _tree_placer[_settings_newgame.game_creation.tree_placer]; |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
376 this->widget[GLAND_HEIGHTMAP_ROTATION_PULLDOWN].data = _rotation[_settings_newgame.game_creation.heightmap_rotation]; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
377 } |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
378 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
379 /* Set parameters for widget text that requires them. */ |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
380 SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); // GLAND_START_DATE_TEXT |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
381 SetDParam(1, 1 << _settings_newgame.game_creation.map_x); // GLAND_MAPSIZE_X_PULLDOWN |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
382 SetDParam(2, 1 << _settings_newgame.game_creation.map_y); // GLAND_MAPSIZE_Y_PULLDOWN |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
383 SetDParam(3, _settings_newgame.game_creation.snow_line_height); // GLAND_SNOW_LEVEL_TEXT |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
384 |
9273
72a6d2e60834
(svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium <rubidium@openttd.org>
parents:
9266
diff
changeset
|
385 this->DrawWidgets(); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
386 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
387 this->DrawEditBox(GLAND_RANDOM_EDITBOX); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
388 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
389 if (mode != GLWP_GENERATE) { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
390 char buffer[512]; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
391 |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
392 if (_settings_newgame.game_creation.heightmap_rotation == HM_CLOCKWISE) { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
393 SetDParam(0, this->y); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
394 SetDParam(1, this->x); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
395 } else { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
396 SetDParam(0, this->x); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
397 SetDParam(1, this->y); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
398 } |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
399 GetString(buffer, STR_HEIGHTMAP_SIZE, lastof(buffer)); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
400 DrawStringRightAligned(326, 91, STR_HEIGHTMAP_SIZE, TC_BLACK); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
401 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
402 DrawString( 12, 91, STR_HEIGHTMAP_NAME, TC_BLACK); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
403 SetDParamStr(0, this->name); |
9648
b53049484e44
(svn r13715) -Fix [FS#2129]: C-like strings had to be rebound each time they were printed, otherwise the text could change due to the few number of slots that could be used to bind.
rubidium <rubidium@openttd.org>
parents:
9605
diff
changeset
|
404 DrawStringTruncated(114, 91, STR_JUST_RAW_STRING, TC_ORANGE, 326 - 114 - GetStringBoundingBox(buffer).width - 5); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
405 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
406 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
407 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
408 virtual void OnClick(Point pt, int widget) |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
409 { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
410 switch (widget) { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
411 case 0: delete this; break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
412 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
413 case GLAND_TEMPERATE: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
414 case GLAND_ARCTIC: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
415 case GLAND_TROPICAL: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
416 case GLAND_TOYLAND: |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
417 this->RaiseWidget(_settings_newgame.game_creation.landscape + GLAND_TEMPERATE); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
418 SetNewLandscapeType(widget - GLAND_TEMPERATE); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
419 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
420 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
421 case GLAND_MAPSIZE_X_PULLDOWN: // Mapsize X |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
422 ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_x, GLAND_MAPSIZE_X_PULLDOWN); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
423 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
424 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
425 case GLAND_MAPSIZE_Y_PULLDOWN: // Mapsize Y |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
426 ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_y, GLAND_MAPSIZE_Y_PULLDOWN); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
427 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
428 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
429 case GLAND_TOWN_PULLDOWN: // Number of towns |
9358
12f4585b2124
(svn r13255) -Codechange: move _opt to _settings.
rubidium <rubidium@openttd.org>
parents:
9354
diff
changeset
|
430 ShowDropDownMenu(this, _num_towns, _settings_newgame.difficulty.number_towns, GLAND_TOWN_PULLDOWN, 0, 0); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
431 break; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
432 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
433 case GLAND_INDUSTRY_PULLDOWN: // Number of industries |
9358
12f4585b2124
(svn r13255) -Codechange: move _opt to _settings.
rubidium <rubidium@openttd.org>
parents:
9354
diff
changeset
|
434 ShowDropDownMenu(this, _num_inds, _settings_newgame.difficulty.number_industries, GLAND_INDUSTRY_PULLDOWN, 0, 0); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
435 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
436 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
437 case GLAND_RANDOM_BUTTON: // Random seed |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
438 _settings_newgame.game_creation.generation_seed = InteractiveRandom(); |
9897
5b558ce6cb0e
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
rubidium <rubidium@openttd.org>
parents:
9648
diff
changeset
|
439 snprintf(this->edit_str_buf, this->edit_str_size, "%u", _settings_newgame.game_creation.generation_seed); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
440 UpdateTextBufferSize(&this->text); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
441 this->SetDirty(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
442 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
443 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
444 case GLAND_GENERATE_BUTTON: // Generate |
11148
3cb2d503c4e8
(svn r15495) -Revert (r15383,r15422): Loading NewGRFs depends on correct settings, but the economy can only be started after loading NewGRFs. In short: r15383 causes more problems then it's worth.
yexo <yexo@openttd.org>
parents:
11081
diff
changeset
|
445 MakeNewgameSettingsLive(); |
3cb2d503c4e8
(svn r15495) -Revert (r15383,r15422): Loading NewGRFs depends on correct settings, but the economy can only be started after loading NewGRFs. In short: r15383 causes more problems then it's worth.
yexo <yexo@openttd.org>
parents:
11081
diff
changeset
|
446 |
11000
def5dbb7e314
(svn r15340) -Fix [FS#2121]: changing town road layout in-game caused ugly road networks
smatz <smatz@openttd.org>
parents:
10960
diff
changeset
|
447 if (mode == GLWP_HEIGHTMAP && |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
448 (this->x * 2 < (1U << _settings_newgame.game_creation.map_x) || |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
449 this->x / 2 > (1U << _settings_newgame.game_creation.map_x) || |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
450 this->y * 2 < (1U << _settings_newgame.game_creation.map_y) || |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
451 this->y / 2 > (1U << _settings_newgame.game_creation.map_y))) { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
452 ShowQuery( |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
453 STR_HEIGHTMAP_SCALE_WARNING_CAPTION, |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
454 STR_HEIGHTMAP_SCALE_WARNING_MESSAGE, |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
455 this, |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
456 LandscapeGenerationCallback); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
457 } else { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
458 StartGeneratingLandscape(mode); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
459 } |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
460 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
461 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
462 case GLAND_START_DATE_DOWN: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
463 case GLAND_START_DATE_UP: // Year buttons |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
464 /* Don't allow too fast scrolling */ |
10180
e024f1d28082
(svn r14390) -Codechange: replace magic constants with symbolic constants.
rubidium <rubidium@openttd.org>
parents:
10145
diff
changeset
|
465 if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
466 this->HandleButtonClick(widget); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
467 this->SetDirty(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
468 |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
469 _settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + widget - GLAND_START_DATE_TEXT, MIN_YEAR, MAX_YEAR); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
470 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
471 _left_button_clicked = false; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
472 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
473 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
474 case GLAND_START_DATE_TEXT: // Year text |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
475 this->widget_id = GLAND_START_DATE_TEXT; |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
476 SetDParam(0, _settings_newgame.game_creation.starting_year); |
11069
36d798171bfd
(svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability.
rubidium <rubidium@openttd.org>
parents:
11043
diff
changeset
|
477 ShowQueryString(STR_CONFIG_SETTING_INT32, STR_START_DATE_QUERY_CAPT, 8, 100, this, CS_NUMERAL, QSF_NONE); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
478 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
479 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
480 case GLAND_SNOW_LEVEL_DOWN: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
481 case GLAND_SNOW_LEVEL_UP: // Snow line buttons |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
482 /* Don't allow too fast scrolling */ |
10180
e024f1d28082
(svn r14390) -Codechange: replace magic constants with symbolic constants.
rubidium <rubidium@openttd.org>
parents:
10145
diff
changeset
|
483 if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
484 this->HandleButtonClick(widget); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
485 this->SetDirty(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
486 |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
487 _settings_newgame.game_creation.snow_line_height = Clamp(_settings_newgame.game_creation.snow_line_height + widget - GLAND_SNOW_LEVEL_TEXT, 2, MAX_SNOWLINE_HEIGHT); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
488 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
489 _left_button_clicked = false; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
490 break; |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
491 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
492 case GLAND_SNOW_LEVEL_TEXT: // Snow line text |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
493 this->widget_id = GLAND_SNOW_LEVEL_TEXT; |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
494 SetDParam(0, _settings_newgame.game_creation.snow_line_height); |
11069
36d798171bfd
(svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability.
rubidium <rubidium@openttd.org>
parents:
11043
diff
changeset
|
495 ShowQueryString(STR_CONFIG_SETTING_INT32, STR_SNOW_LINE_QUERY_CAPT, 3, 100, this, CS_NUMERAL, QSF_NONE); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
496 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
497 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
498 case GLAND_TREE_PULLDOWN: // Tree placer |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
499 ShowDropDownMenu(this, _tree_placer, _settings_newgame.game_creation.tree_placer, GLAND_TREE_PULLDOWN, 0, 0); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
500 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
501 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
502 case GLAND_LANDSCAPE_PULLDOWN: // Landscape generator OR Heightmap rotation |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
503 /* case GLAND_HEIGHTMAP_ROTATION_TEXT: case GLAND_HEIGHTMAP_ROTATION_PULLDOWN:*/ |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
504 if (mode == GLWP_HEIGHTMAP) { |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
505 ShowDropDownMenu(this, _rotation, _settings_newgame.game_creation.heightmap_rotation, GLAND_HEIGHTMAP_ROTATION_PULLDOWN, 0, 0); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
506 } else { |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
507 ShowDropDownMenu(this, _landscape, _settings_newgame.game_creation.land_generator, GLAND_LANDSCAPE_PULLDOWN, 0, 0); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
508 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
509 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
510 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
511 case GLAND_TERRAIN_PULLDOWN: // Terrain type |
9358
12f4585b2124
(svn r13255) -Codechange: move _opt to _settings.
rubidium <rubidium@openttd.org>
parents:
9354
diff
changeset
|
512 ShowDropDownMenu(this, _elevations, _settings_newgame.difficulty.terrain_type, GLAND_TERRAIN_PULLDOWN, 0, 0); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
513 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
514 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
515 case GLAND_WATER_PULLDOWN: // Water quantity |
9358
12f4585b2124
(svn r13255) -Codechange: move _opt to _settings.
rubidium <rubidium@openttd.org>
parents:
9354
diff
changeset
|
516 ShowDropDownMenu(this, _sea_lakes, _settings_newgame.difficulty.quantity_sea_lakes, GLAND_WATER_PULLDOWN, 0, 0); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
517 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
518 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
519 case GLAND_SMOOTHNESS_PULLDOWN: // Map smoothness |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
520 ShowDropDownMenu(this, _smoothness, _settings_newgame.game_creation.tgen_smoothness, GLAND_SMOOTHNESS_PULLDOWN, 0, 0); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
521 break; |
10855
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
522 |
10877
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
523 /* Freetype map borders */ |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
524 case GLAND_WATER_NW: |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
525 _settings_newgame.game_creation.water_borders = ToggleBit(_settings_newgame.game_creation.water_borders, BORDER_NW); |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
526 break; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
527 |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
528 case GLAND_WATER_NE: |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
529 _settings_newgame.game_creation.water_borders = ToggleBit(_settings_newgame.game_creation.water_borders, BORDER_NE); |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
530 break; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
531 |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
532 case GLAND_WATER_SE: |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
533 _settings_newgame.game_creation.water_borders = ToggleBit(_settings_newgame.game_creation.water_borders, BORDER_SE); |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
534 break; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
535 |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
536 case GLAND_WATER_SW: |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
537 _settings_newgame.game_creation.water_borders = ToggleBit(_settings_newgame.game_creation.water_borders, BORDER_SW); |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
538 break; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
539 |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
540 case GLAND_BORDERS_RANDOM: |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
541 _settings_newgame.game_creation.water_borders = (_settings_newgame.game_creation.water_borders == BORDERS_RANDOM) ? 0 : BORDERS_RANDOM; |
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
542 this->SetDirty(); |
10855
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
543 break; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
544 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
545 } |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
546 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
547 virtual void OnMouseLoop() |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
548 { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
549 this->HandleEditBox(GLAND_RANDOM_EDITBOX); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
550 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
551 |
9285
3b3f13cb6db6
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium <rubidium@openttd.org>
parents:
9273
diff
changeset
|
552 virtual EventState OnKeyPress(uint16 key, uint16 keycode) |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
553 { |
9285
3b3f13cb6db6
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium <rubidium@openttd.org>
parents:
9273
diff
changeset
|
554 EventState state; |
3b3f13cb6db6
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium <rubidium@openttd.org>
parents:
9273
diff
changeset
|
555 this->HandleEditBoxKey(GLAND_RANDOM_EDITBOX, key, keycode, state); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
556 /* the seed is unsigned, therefore atoi cannot be used. |
9605
9ea90d50b73c
(svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant
skidd13 <skidd13@openttd.org>
parents:
9516
diff
changeset
|
557 * As 2^32 - 1 (UINT32_MAX) is a 'magic' value |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
558 * (use random seed) it should not be possible to be |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
559 * entered into the input field; the generate seed |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
560 * button can be used instead. */ |
9605
9ea90d50b73c
(svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant
skidd13 <skidd13@openttd.org>
parents:
9516
diff
changeset
|
561 _settings_newgame.game_creation.generation_seed = minu(strtoul(this->edit_str_buf, NULL, 10), UINT32_MAX - 1); |
9285
3b3f13cb6db6
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium <rubidium@openttd.org>
parents:
9273
diff
changeset
|
562 return state; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
563 } |
8341
f43e029e9905
(svn r11907) -Codechange: clean up of worldgen/heightmap ui: replace many separate DrawString() calls with widgets, use dropdown widgets, and use consistent positioning/sizing.
peter1138 <peter1138@openttd.org>
parents:
8327
diff
changeset
|
564 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
565 virtual void OnDropdownSelect(int widget, int index) |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
566 { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
567 switch (widget) { |
10855
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
568 case GLAND_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break; |
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
569 case GLAND_MAPSIZE_Y_PULLDOWN: _settings_newgame.game_creation.map_y = index; break; |
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
570 case GLAND_TREE_PULLDOWN: _settings_newgame.game_creation.tree_placer = index; break; |
7881d9cd55ab
(svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map.
Yexo <Yexo@openttd.org>
parents:
10784
diff
changeset
|
571 case GLAND_SMOOTHNESS_PULLDOWN: _settings_newgame.game_creation.tgen_smoothness = index; break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
572 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
573 case GLAND_TOWN_PULLDOWN: |
11185
ffeedd433485
(svn r15538) -Fix (r15334): The difficulty level wasn't set to custom when changing the amount of towns/industries from the newgame gui.
yexo <yexo@openttd.org>
parents:
11148
diff
changeset
|
574 IConsoleSetSetting("difficulty.number_towns", index); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
575 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
576 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
577 case GLAND_INDUSTRY_PULLDOWN: |
11185
ffeedd433485
(svn r15538) -Fix (r15334): The difficulty level wasn't set to custom when changing the amount of towns/industries from the newgame gui.
yexo <yexo@openttd.org>
parents:
11148
diff
changeset
|
578 IConsoleSetSetting("difficulty.number_industries", index); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
579 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
580 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
581 case GLAND_LANDSCAPE_PULLDOWN: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
582 /* case GLAND_HEIGHTMAP_PULLDOWN: */ |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
583 if (mode == GLWP_HEIGHTMAP) { |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
584 _settings_newgame.game_creation.heightmap_rotation = index; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
585 } else { |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
586 _settings_newgame.game_creation.land_generator = index; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
587 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
588 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
589 |
11220
3f640ecc6b09
(svn r15573) -Fix (r15538): Terrain type and sea level couldn't be changed in the scenario editor.
yexo <yexo@openttd.org>
parents:
11185
diff
changeset
|
590 case GLAND_TERRAIN_PULLDOWN: { |
11222
d0328639d3a8
(svn r15575) -Codechange: Rename GameModes to GameMode and store _game_mode as GameMode instead of as byte.
yexo <yexo@openttd.org>
parents:
11220
diff
changeset
|
591 GameMode old_gm = _game_mode; |
11220
3f640ecc6b09
(svn r15573) -Fix (r15538): Terrain type and sea level couldn't be changed in the scenario editor.
yexo <yexo@openttd.org>
parents:
11185
diff
changeset
|
592 _game_mode = GM_MENU; |
11185
ffeedd433485
(svn r15538) -Fix (r15334): The difficulty level wasn't set to custom when changing the amount of towns/industries from the newgame gui.
yexo <yexo@openttd.org>
parents:
11148
diff
changeset
|
593 IConsoleSetSetting("difficulty.terrain_type", index); |
11220
3f640ecc6b09
(svn r15573) -Fix (r15538): Terrain type and sea level couldn't be changed in the scenario editor.
yexo <yexo@openttd.org>
parents:
11185
diff
changeset
|
594 _game_mode = old_gm; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
595 break; |
11220
3f640ecc6b09
(svn r15573) -Fix (r15538): Terrain type and sea level couldn't be changed in the scenario editor.
yexo <yexo@openttd.org>
parents:
11185
diff
changeset
|
596 } |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
597 |
11220
3f640ecc6b09
(svn r15573) -Fix (r15538): Terrain type and sea level couldn't be changed in the scenario editor.
yexo <yexo@openttd.org>
parents:
11185
diff
changeset
|
598 case GLAND_WATER_PULLDOWN: { |
11222
d0328639d3a8
(svn r15575) -Codechange: Rename GameModes to GameMode and store _game_mode as GameMode instead of as byte.
yexo <yexo@openttd.org>
parents:
11220
diff
changeset
|
599 GameMode old_gm = _game_mode; |
11220
3f640ecc6b09
(svn r15573) -Fix (r15538): Terrain type and sea level couldn't be changed in the scenario editor.
yexo <yexo@openttd.org>
parents:
11185
diff
changeset
|
600 _game_mode = GM_MENU; |
11185
ffeedd433485
(svn r15538) -Fix (r15334): The difficulty level wasn't set to custom when changing the amount of towns/industries from the newgame gui.
yexo <yexo@openttd.org>
parents:
11148
diff
changeset
|
601 IConsoleSetSetting("difficulty.quantity_sea_lakes", index); |
11220
3f640ecc6b09
(svn r15573) -Fix (r15538): Terrain type and sea level couldn't be changed in the scenario editor.
yexo <yexo@openttd.org>
parents:
11185
diff
changeset
|
602 _game_mode = old_gm; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
603 break; |
11220
3f640ecc6b09
(svn r15573) -Fix (r15538): Terrain type and sea level couldn't be changed in the scenario editor.
yexo <yexo@openttd.org>
parents:
11185
diff
changeset
|
604 } |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
605 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
606 this->SetDirty(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
607 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
608 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
609 virtual void OnQueryTextFinished(char *str) |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
610 { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
611 if (!StrEmpty(str)) { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
612 int32 value = atoi(str); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
613 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
614 switch (this->widget_id) { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
615 case GLAND_START_DATE_TEXT: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
616 this->InvalidateWidget(GLAND_START_DATE_TEXT); |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
617 _settings_newgame.game_creation.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR); |
8737
b62e473a9029
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents:
8433
diff
changeset
|
618 break; |
b62e473a9029
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents:
8433
diff
changeset
|
619 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
620 case GLAND_SNOW_LEVEL_TEXT: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
621 this->InvalidateWidget(GLAND_SNOW_LEVEL_TEXT); |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
622 _settings_newgame.game_creation.snow_line_height = Clamp(value, 2, MAX_SNOWLINE_HEIGHT); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
623 break; |
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
624 } |
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
625 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
626 this->SetDirty(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
627 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
628 } |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
629 }; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
630 |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
631 static const WindowDesc _generate_landscape_desc = { |
10877
e9c95718d466
(svn r15212) -Feature [FS#2566]: Change the dropdown box where you can chose which edges will be water to 4 pushbuttons (based on patch by planetmaker).
Yexo <Yexo@openttd.org>
parents:
10855
diff
changeset
|
632 WDP_CENTER, WDP_CENTER, 338, 313, 338, 313, |
5893
8547517ef719
(svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium <rubidium@openttd.org>
parents:
5892
diff
changeset
|
633 WC_GENERATE_LANDSCAPE, WC_NONE, |
8019
9e262ce81acf
(svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas <belugas@openttd.org>
parents:
8018
diff
changeset
|
634 WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
635 _generate_landscape_widgets, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
636 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
637 |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
638 static const WindowDesc _heightmap_load_desc = { |
7341
549c757023fc
(svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium <rubidium@openttd.org>
parents:
7313
diff
changeset
|
639 WDP_CENTER, WDP_CENTER, 338, 236, 338, 236, |
5893
8547517ef719
(svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium <rubidium@openttd.org>
parents:
5892
diff
changeset
|
640 WC_GENERATE_LANDSCAPE, WC_NONE, |
8019
9e262ce81acf
(svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas <belugas@openttd.org>
parents:
8018
diff
changeset
|
641 WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
642 _heightmap_load_widgets, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
643 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
644 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
645 static void _ShowGenerateLandscape(glwp_modes mode) |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
646 { |
7103
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
647 uint x = 0; |
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
648 uint y = 0; |
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
649 |
5901
6715d3646509
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater <Darkvater@openttd.org>
parents:
5899
diff
changeset
|
650 DeleteWindowByClass(WC_GENERATE_LANDSCAPE); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
651 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
652 /* Always give a new seed if not editor */ |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
653 if (_game_mode != GM_EDITOR) _settings_newgame.game_creation.generation_seed = InteractiveRandom(); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
654 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
655 if (mode == GLWP_HEIGHTMAP) { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
656 /* If the function returns negative, it means there was a problem loading the heightmap */ |
7103
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
657 if (!GetHeightmapDimensions(_file_to_saveload.name, &x, &y)) return; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
658 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
659 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
660 GenerateLandscapeWindow *w = AllocateWindowDescFront<GenerateLandscapeWindow>((mode == GLWP_HEIGHTMAP) ? &_heightmap_load_desc : &_generate_landscape_desc, mode); |
7103
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
661 |
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
662 if (mode == GLWP_HEIGHTMAP) { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
663 w->x = x; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
664 w->y = y; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
665 strecpy(w->name, _file_to_saveload.title, lastof(w->name)); |
7103
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
666 } |
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
667 |
960e94818e5f
(svn r10370) -Fix: Heightmap GUI abused custom name system and used unnecessary globals. All details are now kept within the window's custom data.
peter1138 <peter1138@openttd.org>
parents:
7018
diff
changeset
|
668 InvalidateWindow(WC_GENERATE_LANDSCAPE, mode); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
669 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
670 |
6247
57363e064324
(svn r9050) -Codechange: Foo(void) -> Foo()
rubidium <rubidium@openttd.org>
parents:
6179
diff
changeset
|
671 void ShowGenerateLandscape() |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
672 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
673 _ShowGenerateLandscape(GLWP_GENERATE); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
674 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
675 |
6247
57363e064324
(svn r9050) -Codechange: Foo(void) -> Foo()
rubidium <rubidium@openttd.org>
parents:
6179
diff
changeset
|
676 void ShowHeightmapLoad() |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
677 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
678 _ShowGenerateLandscape(GLWP_HEIGHTMAP); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
679 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
680 |
6247
57363e064324
(svn r9050) -Codechange: Foo(void) -> Foo()
rubidium <rubidium@openttd.org>
parents:
6179
diff
changeset
|
681 void StartScenarioEditor() |
5899
71bc001a6dde
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater <Darkvater@openttd.org>
parents:
5894
diff
changeset
|
682 { |
71bc001a6dde
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater <Darkvater@openttd.org>
parents:
5894
diff
changeset
|
683 StartGeneratingLandscape(GLWP_SCENARIO); |
71bc001a6dde
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater <Darkvater@openttd.org>
parents:
5894
diff
changeset
|
684 } |
71bc001a6dde
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater <Darkvater@openttd.org>
parents:
5894
diff
changeset
|
685 |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
686 void StartNewGameWithoutGUI(uint seed) |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
687 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
688 /* GenerateWorld takes care of the possible GENERATE_NEW_SEED value in 'seed' */ |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
689 _settings_newgame.game_creation.generation_seed = seed; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
690 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
691 StartGeneratingLandscape(GLWP_GENERATE); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
692 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
693 |
5892
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
694 enum CreateScenarioWindowWidgets { |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
695 CSCEN_TEMPERATE = 3, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
696 CSCEN_ARCTIC, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
697 CSCEN_TROPICAL, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
698 CSCEN_TOYLAND, |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
699 CSCEN_EMPTY_WORLD, |
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
700 CSCEN_RANDOM_WORLD, |
5892
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
701 CSCEN_MAPSIZE_X_TEXT, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
702 CSCEN_MAPSIZE_X_PULLDOWN, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
703 CSCEN_MAPSIZE_Y_TEXT, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
704 CSCEN_MAPSIZE_Y_PULLDOWN, |
8353
6fb24ab5c935
(svn r11919) -Codechange: Assign numbered parameters to world generator widgets to avoid separate DrawString()s, and do the same for the scenario flat-land window.
peter1138 <peter1138@openttd.org>
parents:
8341
diff
changeset
|
705 CSCEN_START_DATE_LABEL, |
5892
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
706 CSCEN_START_DATE_DOWN, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
707 CSCEN_START_DATE_TEXT, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
708 CSCEN_START_DATE_UP, |
8353
6fb24ab5c935
(svn r11919) -Codechange: Assign numbered parameters to world generator widgets to avoid separate DrawString()s, and do the same for the scenario flat-land window.
peter1138 <peter1138@openttd.org>
parents:
8341
diff
changeset
|
709 CSCEN_FLAT_LAND_HEIGHT_LABEL, |
5892
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
710 CSCEN_FLAT_LAND_HEIGHT_DOWN, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
711 CSCEN_FLAT_LAND_HEIGHT_TEXT, |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
712 CSCEN_FLAT_LAND_HEIGHT_UP |
64960d9ae9f3
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater <Darkvater@openttd.org>
parents:
5668
diff
changeset
|
713 }; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
714 |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
715 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
716 struct CreateScenarioWindow : public Window |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
717 { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
718 uint widget_id; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
719 |
9203
375bae14ff71
(svn r13069) -Codechange: it is no longer needed to pass a void *data pointer with the WE_CREATE message because nothing uses it anymore.
rubidium <rubidium@openttd.org>
parents:
9179
diff
changeset
|
720 CreateScenarioWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
721 { |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
722 this->LowerWidget(_settings_newgame.game_creation.landscape + CSCEN_TEMPERATE); |
9333
5236ba6c7d54
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138 <peter1138@openttd.org>
parents:
9317
diff
changeset
|
723 this->FindWindowPlacementAndResize(desc); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
724 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
725 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
726 virtual void OnPaint() |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
727 { |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
728 this->SetWidgetDisabledState(CSCEN_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= MIN_YEAR); |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
729 this->SetWidgetDisabledState(CSCEN_START_DATE_UP, _settings_newgame.game_creation.starting_year >= MAX_YEAR); |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
730 this->SetWidgetDisabledState(CSCEN_FLAT_LAND_HEIGHT_DOWN, _settings_newgame.game_creation.se_flat_world_height <= 0); |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
731 this->SetWidgetDisabledState(CSCEN_FLAT_LAND_HEIGHT_UP, _settings_newgame.game_creation.se_flat_world_height >= MAX_TILE_HEIGHT); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
732 |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
733 this->SetWidgetLoweredState(CSCEN_TEMPERATE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); |
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
734 this->SetWidgetLoweredState(CSCEN_ARCTIC, _settings_newgame.game_creation.landscape == LT_ARCTIC); |
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
735 this->SetWidgetLoweredState(CSCEN_TROPICAL, _settings_newgame.game_creation.landscape == LT_TROPIC); |
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
736 this->SetWidgetLoweredState(CSCEN_TOYLAND, _settings_newgame.game_creation.landscape == LT_TOYLAND); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
737 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
738 /* Set parameters for widget text that requires them */ |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
739 SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); // CSCEN_START_DATE_TEXT |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
740 SetDParam(1, 1 << _settings_newgame.game_creation.map_x); // CSCEN_MAPSIZE_X_PULLDOWN |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
741 SetDParam(2, 1 << _settings_newgame.game_creation.map_y); // CSCEN_MAPSIZE_Y_PULLDOWN |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
742 SetDParam(3, _settings_newgame.game_creation.se_flat_world_height); // CSCEN_FLAT_LAND_HEIGHT_TEXT |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
743 |
9273
72a6d2e60834
(svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium <rubidium@openttd.org>
parents:
9266
diff
changeset
|
744 this->DrawWidgets(); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
745 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
746 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
747 virtual void OnClick(Point pt, int widget) |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
748 { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
749 switch (widget) { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
750 case CSCEN_TEMPERATE: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
751 case CSCEN_ARCTIC: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
752 case CSCEN_TROPICAL: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
753 case CSCEN_TOYLAND: |
9359
c3a0ec3104c9
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium <rubidium@openttd.org>
parents:
9358
diff
changeset
|
754 this->RaiseWidget(_settings_newgame.game_creation.landscape + CSCEN_TEMPERATE); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
755 SetNewLandscapeType(widget - CSCEN_TEMPERATE); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
756 break; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
757 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
758 case CSCEN_MAPSIZE_X_PULLDOWN: // Mapsize X |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
759 ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_x, CSCEN_MAPSIZE_X_PULLDOWN); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
760 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
761 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
762 case CSCEN_MAPSIZE_Y_PULLDOWN: // Mapsize Y |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
763 ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_y, CSCEN_MAPSIZE_Y_PULLDOWN); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
764 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
765 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
766 case CSCEN_EMPTY_WORLD: // Empty world / flat world |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
767 StartGeneratingLandscape(GLWP_SCENARIO); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
768 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
769 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
770 case CSCEN_RANDOM_WORLD: // Generate |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
771 ShowGenerateLandscape(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
772 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
773 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
774 case CSCEN_START_DATE_DOWN: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
775 case CSCEN_START_DATE_UP: // Year buttons |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
776 /* Don't allow too fast scrolling */ |
10180
e024f1d28082
(svn r14390) -Codechange: replace magic constants with symbolic constants.
rubidium <rubidium@openttd.org>
parents:
10145
diff
changeset
|
777 if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
778 this->HandleButtonClick(widget); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
779 this->SetDirty(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
780 |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
781 _settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + widget - CSCEN_START_DATE_TEXT, MIN_YEAR, MAX_YEAR); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
782 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
783 _left_button_clicked = false; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
784 break; |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
785 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
786 case CSCEN_START_DATE_TEXT: // Year text |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
787 this->widget_id = CSCEN_START_DATE_TEXT; |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
788 SetDParam(0, _settings_newgame.game_creation.starting_year); |
11069
36d798171bfd
(svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability.
rubidium <rubidium@openttd.org>
parents:
11043
diff
changeset
|
789 ShowQueryString(STR_CONFIG_SETTING_INT32, STR_START_DATE_QUERY_CAPT, 8, 100, this, CS_NUMERAL, QSF_NONE); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
790 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
791 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
792 case CSCEN_FLAT_LAND_HEIGHT_DOWN: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
793 case CSCEN_FLAT_LAND_HEIGHT_UP: // Height level buttons |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
794 /* Don't allow too fast scrolling */ |
10180
e024f1d28082
(svn r14390) -Codechange: replace magic constants with symbolic constants.
rubidium <rubidium@openttd.org>
parents:
10145
diff
changeset
|
795 if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) { |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
796 this->HandleButtonClick(widget); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
797 this->SetDirty(); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
798 |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
799 _settings_newgame.game_creation.se_flat_world_height = Clamp(_settings_newgame.game_creation.se_flat_world_height + widget - CSCEN_FLAT_LAND_HEIGHT_TEXT, 0, MAX_TILE_HEIGHT); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
800 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
801 _left_button_clicked = false; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
802 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
803 |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
804 case CSCEN_FLAT_LAND_HEIGHT_TEXT: // Height level text |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
805 this->widget_id = CSCEN_FLAT_LAND_HEIGHT_TEXT; |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
806 SetDParam(0, _settings_newgame.game_creation.se_flat_world_height); |
11069
36d798171bfd
(svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability.
rubidium <rubidium@openttd.org>
parents:
11043
diff
changeset
|
807 ShowQueryString(STR_CONFIG_SETTING_INT32, STR_FLAT_WORLD_HEIGHT_QUERY_CAPT, 3, 100, this, CS_NUMERAL, QSF_NONE); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
808 break; |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
809 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
810 } |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
811 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
812 virtual void OnDropdownSelect(int widget, int index) |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
813 { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
814 switch (widget) { |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
815 case CSCEN_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break; |
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
816 case CSCEN_MAPSIZE_Y_PULLDOWN: _settings_newgame.game_creation.map_y = index; break; |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
817 } |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
818 this->SetDirty(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
819 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
820 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
821 virtual void OnQueryTextFinished(char *str) |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
822 { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
823 if (!StrEmpty(str)) { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
824 int32 value = atoi(str); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
825 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
826 switch (this->widget_id) { |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
827 case CSCEN_START_DATE_TEXT: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
828 this->InvalidateWidget(CSCEN_START_DATE_TEXT); |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
829 _settings_newgame.game_creation.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
830 break; |
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
831 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
832 case CSCEN_FLAT_LAND_HEIGHT_TEXT: |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
833 this->InvalidateWidget(CSCEN_FLAT_LAND_HEIGHT_TEXT); |
9354
2b0c6e62535e
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium <rubidium@openttd.org>
parents:
9346
diff
changeset
|
834 _settings_newgame.game_creation.se_flat_world_height = Clamp(value, 0, MAX_TILE_HEIGHT); |
8355
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
835 break; |
73ad124db503
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138 <peter1138@openttd.org>
parents:
8353
diff
changeset
|
836 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
837 |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
838 this->SetDirty(); |
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
839 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
840 } |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
841 }; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
842 |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
843 static const Widget _create_scenario_widgets[] = { |
9910
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
844 { WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
845 { WWT_CAPTION, RESIZE_NONE, COLOUR_BROWN, 11, 337, 0, 13, STR_SE_CAPTION, STR_NULL}, |
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
846 { WWT_PANEL, RESIZE_NONE, COLOUR_BROWN, 0, 337, 14, 169, 0x0, STR_NULL}, |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
847 |
10782
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
848 /* Landscape selection */ |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
849 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 10, 86, 24, 78, SPR_SELECT_TEMPERATE, STR_030E_SELECT_TEMPERATE_LANDSCAPE}, // CSCEN_TEMPERATE |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
850 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 90, 166, 24, 78, SPR_SELECT_SUB_ARCTIC, STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE}, // CSCEN_ARCTIC |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
851 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 170, 246, 24, 78, SPR_SELECT_SUB_TROPICAL, STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE}, // CSCEN_TROPICAL |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
852 { WWT_IMGBTN_2, RESIZE_NONE, COLOUR_ORANGE, 250, 326, 24, 78, SPR_SELECT_TOYLAND, STR_0311_SELECT_TOYLAND_LANDSCAPE}, // CSCEN_TOYLAND |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
853 |
10782
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
854 /* Generation type */ |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
855 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREEN, 12, 115, 95, 124, STR_SE_FLAT_WORLD, STR_SE_FLAT_WORLD_TIP}, // CSCEN_EMPTY_WORLD |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
856 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_GREEN, 12, 115, 131, 160, STR_SE_RANDOM_LAND, STR_022A_GENERATE_RANDOM_LAND}, // CSCEN_RANDOM_WORLD |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
857 |
10782
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
858 /* Mapsize X */ |
10784
9423b1eb8363
(svn r15117) -Codechange: enlarge a few text boxes in the Create Scenario window, allowing them to be more visible.
belugas <belugas@openttd.org>
parents:
10782
diff
changeset
|
859 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 135, 212, 96, 106, STR_MAPSIZE, STR_NULL}, // CSCEN_MAPSIZE_X_TEXT |
10782
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
860 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 216, 263, 95, 106, STR_NUM_1, STR_NULL}, // CSCEN_MAPSIZE_X_PULLDOWN |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
861 /* Mapsize Y */ |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
862 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 268, 276, 96, 106, STR_BY, STR_NULL}, // CSCEN_MAPSIZE_Y_TEXT |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
863 { WWT_DROPDOWN, RESIZE_NONE, COLOUR_ORANGE, 279, 326, 95, 106, STR_NUM_2, STR_NULL}, // CSCEN_MAPSIZE_Y_PULLDOWN |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
864 |
10782
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
865 /* Start date */ |
10784
9423b1eb8363
(svn r15117) -Codechange: enlarge a few text boxes in the Create Scenario window, allowing them to be more visible.
belugas <belugas@openttd.org>
parents:
10782
diff
changeset
|
866 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 135, 212, 114, 124, STR_DATE, STR_NULL}, // CSCEN_START_DATE_LABEL |
10782
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
867 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 216, 227, 113, 124, SPR_ARROW_DOWN, STR_029E_MOVE_THE_STARTING_DATE}, // CSCEN_START_DATE_DOWN |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
868 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 228, 314, 113, 124, STR_GENERATE_DATE, STR_NULL}, // CSCEN_START_DATE_TEXT |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
869 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 315, 326, 113, 124, SPR_ARROW_UP, STR_029F_MOVE_THE_STARTING_DATE}, // CSCEN_START_DATE_UP |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
870 |
10782
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
871 /* Flat map height */ |
10784
9423b1eb8363
(svn r15117) -Codechange: enlarge a few text boxes in the Create Scenario window, allowing them to be more visible.
belugas <belugas@openttd.org>
parents:
10782
diff
changeset
|
872 { WWT_TEXT, RESIZE_NONE, COLOUR_ORANGE, 135, 278, 132, 142, STR_FLAT_WORLD_HEIGHT, STR_NULL}, // CSCEN_FLAT_LAND_HEIGHT_LABEL |
10782
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
873 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 282, 293, 131, 142, SPR_ARROW_DOWN, STR_FLAT_WORLD_HEIGHT_DOWN}, // CSCEN_FLAT_LAND_HEIGHT_DOWN |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
874 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_ORANGE, 294, 314, 131, 142, STR_NUM_3, STR_NULL}, // CSCEN_FLAT_LAND_HEIGHT_TEXT |
13d0f21ff44d
(svn r15115) -Documentation: Add some widget enums to the widget array definition (Terkhen).
belugas <belugas@openttd.org>
parents:
10696
diff
changeset
|
875 { WWT_IMGBTN, RESIZE_NONE, COLOUR_ORANGE, 315, 326, 131, 142, SPR_ARROW_UP, STR_FLAT_WORLD_HEIGHT_UP}, // CSCEN_FLAT_LAND_HEIGHT_UP |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
876 { WIDGETS_END}, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
877 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
878 |
5894
c4ab8176e02e
(svn r8512) -Codechange: From the intro window enter the scenario editor. From the scenario editor dialog, remove the 'load heightmap' option and put that with the other options like 'load scenario', 'save scenario', etc. Play a little bit with positioning of elements inside the scenario editor dialog so it looks better.
Darkvater <Darkvater@openttd.org>
parents:
5893
diff
changeset
|
879 static const WindowDesc _create_scenario_desc = { |
7341
549c757023fc
(svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium <rubidium@openttd.org>
parents:
7313
diff
changeset
|
880 WDP_CENTER, WDP_CENTER, 338, 170, 338, 170, |
5893
8547517ef719
(svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium <rubidium@openttd.org>
parents:
5892
diff
changeset
|
881 WC_GENERATE_LANDSCAPE, WC_NONE, |
8019
9e262ce81acf
(svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas <belugas@openttd.org>
parents:
8018
diff
changeset
|
882 WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
883 _create_scenario_widgets, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
884 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
885 |
6247
57363e064324
(svn r9050) -Codechange: Foo(void) -> Foo()
rubidium <rubidium@openttd.org>
parents:
6179
diff
changeset
|
886 void ShowCreateScenario() |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
887 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
888 DeleteWindowByClass(WC_GENERATE_LANDSCAPE); |
9179
3b7b689031d6
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium <rubidium@openttd.org>
parents:
9164
diff
changeset
|
889 new CreateScenarioWindow(&_create_scenario_desc, GLWP_SCENARIO); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
890 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
891 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
892 |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
893 static const Widget _generate_progress_widgets[] = { |
9910
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
894 { WWT_CAPTION, RESIZE_NONE, COLOUR_GREY, 0, 180, 0, 13, STR_GENERATION_WORLD, STR_018C_WINDOW_TITLE_DRAG_THIS}, // GPWW_CAPTION |
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
895 { WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 180, 14, 96, 0x0, STR_NULL}, // GPWW_BACKGROUND |
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
896 { WWT_TEXTBTN, RESIZE_NONE, COLOUR_WHITE, 20, 161, 74, 85, STR_GENERATION_ABORT, STR_NULL}, // GPWW_ABORT |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
897 { WIDGETS_END}, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
898 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
899 |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
900 static const WindowDesc _generate_progress_desc = { |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
901 WDP_CENTER, WDP_CENTER, 181, 97, 181, 97, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
902 WC_GENERATE_PROGRESS_WINDOW, WC_NONE, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
903 WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
904 _generate_progress_widgets, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
905 }; |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
906 |
6248
0789677a15a0
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents:
6247
diff
changeset
|
907 struct tp_info { |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
908 uint percent; |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
909 StringID cls; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
910 uint current; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
911 uint total; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
912 int timer; |
6248
0789677a15a0
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium <rubidium@openttd.org>
parents:
6247
diff
changeset
|
913 }; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
914 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
915 static tp_info _tp; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
916 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
917 static void AbortGeneratingWorldCallback(Window *w, bool confirmed) |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
918 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
919 if (confirmed) { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
920 AbortGeneratingWorld(); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
921 } else if (IsGeneratingWorld() && !IsGeneratingWorldAborted()) { |
5668
3d6d9bff3dd8
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138 <peter1138@openttd.org>
parents:
5587
diff
changeset
|
922 SetMouseCursor(SPR_CURSOR_ZZZ, PAL_NONE); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
923 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
924 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
925 |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
926 struct GenerateProgressWindow : public Window { |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
927 private: |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
928 enum GenerationProgressWindowWidgets { |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
929 GPWW_CAPTION, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
930 GPWW_BACKGROUND, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
931 GPWW_ABORT, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
932 }; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
933 |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
934 public: |
9333
5236ba6c7d54
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138 <peter1138@openttd.org>
parents:
9317
diff
changeset
|
935 GenerateProgressWindow() : Window(&_generate_progress_desc) |
5236ba6c7d54
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138 <peter1138@openttd.org>
parents:
9317
diff
changeset
|
936 { |
5236ba6c7d54
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138 <peter1138@openttd.org>
parents:
9317
diff
changeset
|
937 this->FindWindowPlacementAndResize(&_generate_progress_desc); |
5236ba6c7d54
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138 <peter1138@openttd.org>
parents:
9317
diff
changeset
|
938 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
939 |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
940 virtual void OnClick(Point pt, int widget) |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
941 { |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
942 switch (widget) { |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
943 case GPWW_ABORT: |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
944 if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE); |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
945 ShowQuery( |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
946 STR_GENERATION_ABORT_CAPTION, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
947 STR_GENERATION_ABORT_MESSAGE, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
948 this, |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
949 AbortGeneratingWorldCallback |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
950 ); |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
951 break; |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
952 } |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
953 } |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
954 |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
955 virtual void OnPaint() |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
956 { |
9273
72a6d2e60834
(svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium <rubidium@openttd.org>
parents:
9266
diff
changeset
|
957 this->DrawWidgets(); |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
958 |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
959 /* Draw the % complete with a bar and a text */ |
9910
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
960 DrawFrameRect(19, 20, (this->width - 18), 37, COLOUR_GREY, FR_BORDERONLY); |
5035b1d90357
(svn r14060) -Codechange: Replace numbers with Colours enum on Gen world gui.
belugas <belugas@openttd.org>
parents:
9897
diff
changeset
|
961 DrawFrameRect(20, 21, (int)((this->width - 40) * _tp.percent / 100) + 20, 36, COLOUR_MAUVE, FR_NONE); |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
962 SetDParam(0, _tp.percent); |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
963 DrawStringCentered(90, 25, STR_PROGRESS, TC_FROMSTRING); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
964 |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
965 /* Tell which class we are generating */ |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
966 DrawStringCentered(90, 46, _tp.cls, TC_FROMSTRING); |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
967 |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
968 /* And say where we are in that class */ |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
969 SetDParam(0, _tp.current); |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
970 SetDParam(1, _tp.total); |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
971 DrawStringCentered(90, 58, STR_GENERATION_PROGRESS, TC_FROMSTRING); |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
972 |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
973 this->SetDirty(); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
974 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
975 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
976 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
977 /** |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
978 * Initializes the progress counters to the starting point. |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
979 */ |
6247
57363e064324
(svn r9050) -Codechange: Foo(void) -> Foo()
rubidium <rubidium@openttd.org>
parents:
6179
diff
changeset
|
980 void PrepareGenerateWorldProgress() |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
981 { |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
982 _tp.cls = STR_WORLD_GENERATION; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
983 _tp.current = 0; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
984 _tp.total = 0; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
985 _tp.percent = 0; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
986 _tp.timer = 0; // Forces to paint the progress window immediatelly |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
987 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
988 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
989 /** |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
990 * Show the window where a user can follow the process of the map generation. |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
991 */ |
6247
57363e064324
(svn r9050) -Codechange: Foo(void) -> Foo()
rubidium <rubidium@openttd.org>
parents:
6179
diff
changeset
|
992 void ShowGenerateWorldProgress() |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
993 { |
9266
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
994 if (BringWindowToFrontById(WC_GENERATE_PROGRESS_WINDOW, 0)) return; |
3108515a123e
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx <glx@openttd.org>
parents:
9203
diff
changeset
|
995 new GenerateProgressWindow(); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
996 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
997 |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
998 static void _SetGeneratingWorldProgress(gwp_class cls, uint progress, uint total) |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
999 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1000 static const int percent_table[GWP_CLASS_COUNT + 1] = {0, 5, 15, 20, 40, 60, 65, 80, 85, 99, 100 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1001 static const StringID class_table[GWP_CLASS_COUNT] = { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1002 STR_WORLD_GENERATION, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1003 STR_022E_LANDSCAPE_GENERATION, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1004 STR_CLEARING_TILES, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1005 STR_022F_TOWN_GENERATION, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1006 STR_0230_INDUSTRY_GENERATION, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1007 STR_UNMOVABLE_GENERATION, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1008 STR_TREE_GENERATION, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1009 STR_SETTINGUP_GAME, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1010 STR_PREPARING_TILELOOP, |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1011 STR_PREPARING_GAME |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1012 }; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1013 |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1014 assert(cls < GWP_CLASS_COUNT); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1015 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1016 /* Do not run this function if we aren't in a thread */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1017 if (!IsGenerateWorldThreaded() && !_network_dedicated) return; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1018 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1019 if (IsGeneratingWorldAborted()) HandleGeneratingWorldAbortion(); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1020 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1021 if (total == 0) { |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1022 assert(_tp.cls == class_table[cls]); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1023 _tp.current += progress; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1024 } else { |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1025 _tp.cls = class_table[cls]; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1026 _tp.current = progress; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1027 _tp.total = total; |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1028 _tp.percent = percent_table[cls]; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1029 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1030 |
7018
a05bbdc788a2
(svn r10276) -Codechange: made a counter based on milliseconds and independent of the game-state to base double-click and TGP Generation Process on
truelight <truelight@openttd.org>
parents:
6571
diff
changeset
|
1031 /* Don't update the screen too often. So update it once in every 200ms */ |
a05bbdc788a2
(svn r10276) -Codechange: made a counter based on milliseconds and independent of the game-state to base double-click and TGP Generation Process on
truelight <truelight@openttd.org>
parents:
6571
diff
changeset
|
1032 if (!_network_dedicated && _tp.timer != 0 && _realtime_tick - _tp.timer < 200) return; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1033 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1034 /* Percentage is about the number of completed tasks, so 'current - 1' */ |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1035 _tp.percent = percent_table[cls] + (percent_table[cls + 1] - percent_table[cls]) * (_tp.current == 0 ? 0 : _tp.current - 1) / _tp.total; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1036 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1037 if (_network_dedicated) { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1038 static uint last_percent = 0; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1039 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1040 /* Never display 0% */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1041 if (_tp.percent == 0) return; |
9950
dbf95da604b3
(svn r14105) -Fix: Some typos that are more grammatical errors, as it seems.
belugas <belugas@openttd.org>
parents:
9910
diff
changeset
|
1042 /* Reset if percent is lower than the last recorded */ |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1043 if (_tp.percent < last_percent) last_percent = 0; |
9950
dbf95da604b3
(svn r14105) -Fix: Some typos that are more grammatical errors, as it seems.
belugas <belugas@openttd.org>
parents:
9910
diff
changeset
|
1044 /* Display every 5%, but 6% is also very valid.. just not smaller steps than 5% */ |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1045 if (_tp.percent % 5 != 0 && _tp.percent <= last_percent + 5) return; |
9950
dbf95da604b3
(svn r14105) -Fix: Some typos that are more grammatical errors, as it seems.
belugas <belugas@openttd.org>
parents:
9910
diff
changeset
|
1046 /* Never show steps smaller than 2%, even if it is a mod 5% */ |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1047 if (_tp.percent <= last_percent + 2) return; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1048 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1049 DEBUG(net, 1, "Map generation percentage complete: %d", _tp.percent); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1050 last_percent = _tp.percent; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1051 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1052 /* Don't continue as dedicated never has a thread running */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1053 return; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1054 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1055 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1056 InvalidateWindow(WC_GENERATE_PROGRESS_WINDOW, 0); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1057 MarkWholeScreenDirty(); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1058 SetGeneratingWorldPaintStatus(true); |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1059 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1060 /* We wait here till the paint is done, so we don't read and write |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1061 * on the same tile at the same moment. Nasty hack, but that happens |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1062 * if you implement threading afterwards */ |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1063 while (IsGeneratingWorldReadyForPaint()) { CSleep(10); } |
7123
b89905ec574e
(svn r10396) -Fix: When landscape generating, allow for 200ms between screen updates instead of updating every 200ms. Previously slow screen updates would result in very slow map generation (GeekToo)
peter1138 <peter1138@openttd.org>
parents:
7103
diff
changeset
|
1064 |
b89905ec574e
(svn r10396) -Fix: When landscape generating, allow for 200ms between screen updates instead of updating every 200ms. Previously slow screen updates would result in very slow map generation (GeekToo)
peter1138 <peter1138@openttd.org>
parents:
7103
diff
changeset
|
1065 _tp.timer = _realtime_tick; |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1066 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1067 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1068 /** |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1069 * Set the total of a stage of the world generation. |
6481
85a1a79387a2
(svn r9662) -Documentation: Doxygen corrections and @file omissions
belugas <belugas@openttd.org>
parents:
6357
diff
changeset
|
1070 * @param cls the current class we are in. |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1071 * @param total Set the total expected items for this class. |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1072 * |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1073 * Warning: this function isn't clever. Don't go from class 4 to 3. Go upwards, always. |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1074 * Also, progress works if total is zero, total works if progress is zero. |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1075 */ |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1076 void SetGeneratingWorldProgress(gwp_class cls, uint total) |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1077 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1078 if (total == 0) return; |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1079 |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1080 _SetGeneratingWorldProgress(cls, 0, total); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1081 } |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1082 |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1083 /** |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1084 * Increases the current stage of the world generation with one. |
6481
85a1a79387a2
(svn r9662) -Documentation: Doxygen corrections and @file omissions
belugas <belugas@openttd.org>
parents:
6357
diff
changeset
|
1085 * @param cls the current class we are in. |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1086 * |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1087 * Warning: this function isn't clever. Don't go from class 4 to 3. Go upwards, always. |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1088 * Also, progress works if total is zero, total works if progress is zero. |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1089 */ |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1090 void IncreaseGeneratingWorldProgress(gwp_class cls) |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1091 { |
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1092 /* In fact the param 'class' isn't needed.. but for some security reasons, we want it around */ |
5587
c44c070c5032
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium <rubidium@openttd.org>
parents:
5584
diff
changeset
|
1093 _SetGeneratingWorldProgress(cls, 1, 0); |
5584
4b26bd55bd24
(svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp)
KUDr <KUDr@openttd.org>
parents:
diff
changeset
|
1094 } |