author | Tero Marttila <terom@fixme.fi> |
Fri, 18 Jul 2008 21:28:42 +0300 | |
changeset 11175 | 020c61e39c94 |
parent 11157 | a0173588b15e |
permissions | -rw-r--r-- |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1 |
/* $Id$ */ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
2 |
|
10429
1b99254f9607
(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
parents:
9245
diff
changeset
|
3 |
/** @file genworld_gui.cpp GUI to configure and show progress during map generation. */ |
6505
abcb0580d976
(svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6152
diff
changeset
|
4 |
|
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
5 |
#include "stdafx.h" |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
6 |
#include "openttd.h" |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
7 |
#include "heightmap.h" |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
8 |
#include "gui.h" |
8603
88c5ce6a5215
(svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium
parents:
8602
diff
changeset
|
9 |
#include "window_gui.h" |
88c5ce6a5215
(svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium
parents:
8602
diff
changeset
|
10 |
#include "textbuf_gui.h" |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
11 |
#include "gfxinit.h" |
8612
6414fc21c2f3
(svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents:
8610
diff
changeset
|
12 |
#include "command_func.h" |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
13 |
#include "variables.h" |
8704
2857ec554839
(svn r11771) -Codechange: split settings.h into better separated headers.
rubidium
parents:
8653
diff
changeset
|
14 |
#include "settings_func.h" |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
15 |
#include "debug.h" |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
16 |
#include "genworld.h" |
5720
cc0ceeafaa55
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
5715
diff
changeset
|
17 |
#include "network/network.h" |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
18 |
#include "thread.h" |
5228
c4a780348f66
(svn r7348) -Feature: Initial support for saving NewGRF settings with savegames. Back up your savegames...
peter1138
parents:
5213
diff
changeset
|
19 |
#include "newgrf_config.h" |
8610
17cc343a23dd
(svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
8604
diff
changeset
|
20 |
#include "strings_func.h" |
8627
448ebf3a8291
(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
parents:
8617
diff
changeset
|
21 |
#include "window_func.h" |
8636
2b158acb649c
(svn r11702) -Codechange: move all date related stuff to date*.
rubidium
parents:
8627
diff
changeset
|
22 |
#include "date_func.h" |
8653
a83f7a536919
(svn r11719) -Codechange: split sound.h in a header with types and one with functions.
rubidium
parents:
8647
diff
changeset
|
23 |
#include "sound_func.h" |
8647
0709611186e0
(svn r11713) -Codechange: Move some declarations and definitions in a more logical disposition
belugas
parents:
8636
diff
changeset
|
24 |
#include "fios.h" |
8710
52015340050c
(svn r11777) -Codechange: split the string header and make do not include it when it's not necessary.
rubidium
parents:
8704
diff
changeset
|
25 |
#include "string_func.h" |
8720
4e60c30e2006
(svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents:
8710
diff
changeset
|
26 |
#include "gfx_func.h" |
8766
c86cfa3a7580
(svn r11834) -Codechange: only include settings_type.h if needed.
rubidium
parents:
8760
diff
changeset
|
27 |
#include "settings_type.h" |
8823
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
28 |
#include "widgets/dropdown_type.h" |
8780
6f3f3ec6c69a
(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
parents:
8766
diff
changeset
|
29 |
#include "widgets/dropdown_func.h" |
8929
a8732ed52252
(svn r12003) -Codechange: don't declare InteractiveRandom[Range] in multiple places.
rubidium
parents:
8920
diff
changeset
|
30 |
#include "core/random_func.hpp" |
10444
3876060cdef7
(svn r12986) -Codechange: move the landscape and transport related types from openttd.h to their own headers.
rubidium
parents:
10434
diff
changeset
|
31 |
#include "landscape_type.h" |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
32 |
#include "querystring_gui.h" |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
33 |
|
8760
ce0891c412ce
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents:
8750
diff
changeset
|
34 |
#include "table/strings.h" |
ce0891c412ce
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents:
8750
diff
changeset
|
35 |
#include "table/sprites.h" |
ce0891c412ce
(svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents:
8750
diff
changeset
|
36 |
|
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
37 |
/** |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
38 |
* In what 'mode' the GenerateLandscapeWindowProc is. |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
39 |
*/ |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6573
diff
changeset
|
40 |
enum glwp_modes { |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
41 |
GLWP_GENERATE, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
42 |
GLWP_HEIGHTMAP, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
43 |
GLWP_SCENARIO, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
44 |
GLWP_END |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6573
diff
changeset
|
45 |
}; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
46 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
47 |
extern void SwitchMode(int new_mode); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
48 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
49 |
static inline void SetNewLandscapeType(byte landscape) |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
50 |
{ |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
51 |
_settings_newgame.game_creation.landscape = landscape; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
52 |
InvalidateWindowClasses(WC_SELECT_GAME); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
53 |
InvalidateWindowClasses(WC_GENERATE_LANDSCAPE); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
54 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
55 |
|
6152
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
56 |
enum GenerateLandscapeWindowWidgets { |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
57 |
GLAND_TEMPERATE = 3, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
58 |
GLAND_ARCTIC, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
59 |
GLAND_TROPICAL, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
60 |
GLAND_TOYLAND, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
61 |
|
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
62 |
GLAND_MAPSIZE_X_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
63 |
GLAND_MAPSIZE_X_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
64 |
GLAND_MAPSIZE_Y_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
65 |
GLAND_MAPSIZE_Y_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
66 |
|
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
67 |
GLAND_TOWN_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
68 |
GLAND_TOWN_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
69 |
GLAND_INDUSTRY_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
70 |
GLAND_INDUSTRY_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
71 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
72 |
GLAND_RANDOM_TEXT, |
6152
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
73 |
GLAND_RANDOM_EDITBOX, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
74 |
GLAND_RANDOM_BUTTON, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
75 |
|
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
76 |
GLAND_GENERATE_BUTTON, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
77 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
78 |
GLAND_START_DATE_TEXT1, |
6152
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
79 |
GLAND_START_DATE_DOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
80 |
GLAND_START_DATE_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
81 |
GLAND_START_DATE_UP, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
82 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
83 |
GLAND_SNOW_LEVEL_TEXT1, |
6152
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
84 |
GLAND_SNOW_LEVEL_DOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
85 |
GLAND_SNOW_LEVEL_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
86 |
GLAND_SNOW_LEVEL_UP, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
87 |
|
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
88 |
GLAND_TREE_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
89 |
GLAND_TREE_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
90 |
GLAND_LANDSCAPE_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
91 |
GLAND_LANDSCAPE_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
92 |
GLAND_HEIGHTMAP_ROTATION_TEXT = GLAND_LANDSCAPE_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
93 |
GLAND_HEIGHTMAP_ROTATION_PULLDOWN = GLAND_LANDSCAPE_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
94 |
|
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
95 |
GLAND_TERRAIN_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
96 |
GLAND_TERRAIN_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
97 |
GLAND_WATER_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
98 |
GLAND_WATER_PULLDOWN, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
99 |
GLAND_SMOOTHNESS_TEXT, |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
100 |
GLAND_SMOOTHNESS_PULLDOWN |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
101 |
}; |
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
102 |
|
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
103 |
static const Widget _generate_landscape_widgets[] = { |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
104 |
{ WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
105 |
{ WWT_CAPTION, RESIZE_NONE, 13, 11, 337, 0, 13, STR_WORLD_GENERATION_CAPTION, STR_NULL}, |
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
106 |
{ WWT_PANEL, RESIZE_NONE, 13, 0, 337, 14, 267, 0x0, STR_NULL}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
107 |
|
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
108 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 10, 86, 24, 78, SPR_SELECT_TEMPERATE, STR_030E_SELECT_TEMPERATE_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
109 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 90, 166, 24, 78, SPR_SELECT_SUB_ARCTIC, STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
110 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 170, 246, 24, 78, SPR_SELECT_SUB_TROPICAL, STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
111 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 250, 326, 24, 78, SPR_SELECT_TOYLAND, STR_0311_SELECT_TOYLAND_LANDSCAPE}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
112 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
113 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 91, 101, STR_MAPSIZE, STR_NULL}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
114 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 161, 90, 101, STR_NUM_1, STR_NULL}, // Mapsize X |
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
115 |
{ WWT_TEXT, RESIZE_NONE, 0, 168, 176, 91, 101, STR_BY, STR_NULL}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
116 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 180, 227, 90, 101, STR_NUM_2, STR_NULL}, // Mapsize Y |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
117 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
118 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 113, 123, STR_NUMBER_OF_TOWNS, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
119 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 175, 112, 123, 0x0, STR_NULL}, // Number of towns |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
120 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
121 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 131, 141, STR_NUMBER_OF_INDUSTRIES, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
122 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 175, 130, 141, 0x0, STR_NULL}, // Number of industries |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
123 |
|
7f1498dba00e
(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
parents:
8823
diff
changeset
|
124 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 153, 163, STR_RANDOM_SEED, STR_NULL}, |
9233
4daa9bb8dbf7
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents:
8929
diff
changeset
|
125 |
{ WWT_EDITBOX, RESIZE_NONE, 15, 114, 207, 152, 163, STR_RANDOM_SEED_OSKTITLE, STR_RANDOM_SEED_HELP}, // Edit box for seed |
4364
0fc1e43842f6
(svn r6079) -Change: size and alignment of random seed input box and randomise button
glx
parents:
4344
diff
changeset
|
126 |
{ WWT_TEXTBTN, RESIZE_NONE, 12, 216, 326, 152, 163, STR_RANDOM, STR_RANDOM_HELP}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
127 |
|
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
128 |
{ WWT_TEXTBTN, RESIZE_NONE, 6, 243, 326, 228, 257, STR_GENERATE, STR_NULL}, // Generate button |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
129 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
130 |
{ WWT_TEXT, RESIZE_NONE, 0, 182, 212, 113, 123, STR_DATE, STR_NULL}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
131 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 216, 227, 112, 123, SPR_ARROW_DOWN, STR_029E_MOVE_THE_STARTING_DATE}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
132 |
{ WWT_TEXTBTN, RESIZE_NONE, 12, 228, 314, 112, 123, STR_GENERATE_DATE, STR_NULL}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
133 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 112, 123, SPR_ARROW_UP, STR_029F_MOVE_THE_STARTING_DATE}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
134 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
135 |
{ WWT_TEXT, RESIZE_NONE, 0, 182, 278, 131, 141, STR_SNOW_LINE_HEIGHT, STR_NULL}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
136 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 282, 293, 130, 141, SPR_ARROW_DOWN, STR_SNOW_LINE_DOWN}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
137 |
{ WWT_TEXTBTN, RESIZE_NONE, 12, 294, 314, 130, 141, STR_NUM_3, STR_NULL}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
138 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 130, 141, SPR_ARROW_UP, STR_SNOW_LINE_UP}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
139 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
140 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 193, 203, STR_TREE_PLACER, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
141 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 192, 203, 0x0, STR_NULL}, // Tree placer |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
142 |
|
7f1498dba00e
(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
parents:
8823
diff
changeset
|
143 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 175, 185, STR_LAND_GENERATOR, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
144 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 174, 185, 0x0, STR_NULL}, // Landscape generator |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
145 |
|
7f1498dba00e
(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
parents:
8823
diff
changeset
|
146 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 211, 221, STR_TERRAIN_TYPE, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
147 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 210, 221, 0x0, STR_NULL}, // Terrain type |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
148 |
|
7f1498dba00e
(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
parents:
8823
diff
changeset
|
149 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 229, 239, STR_QUANTITY_OF_SEA_LAKES, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
150 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 228, 239, 0x0, STR_NULL}, // Water quantity |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
151 |
|
7f1498dba00e
(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
parents:
8823
diff
changeset
|
152 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 245, 257, STR_SMOOTHNESS, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
153 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 246, 257, 0x0, STR_NULL}, // Map smoothness |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
154 |
{ WIDGETS_END}, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
155 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
156 |
|
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
157 |
static const Widget _heightmap_load_widgets[] = { |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
158 |
{ WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
159 |
{ WWT_CAPTION, RESIZE_NONE, 13, 11, 337, 0, 13, STR_WORLD_GENERATION_CAPTION, STR_NULL}, |
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
160 |
{ WWT_PANEL, RESIZE_NONE, 13, 0, 337, 14, 235, 0x0, STR_NULL}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
161 |
|
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
162 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 10, 86, 24, 78, SPR_SELECT_TEMPERATE, STR_030E_SELECT_TEMPERATE_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
163 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 90, 166, 24, 78, SPR_SELECT_SUB_ARCTIC, STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
164 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 170, 246, 24, 78, SPR_SELECT_SUB_TROPICAL, STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
165 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 250, 326, 24, 78, SPR_SELECT_TOYLAND, STR_0311_SELECT_TOYLAND_LANDSCAPE}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
166 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
167 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 113, 123, STR_MAPSIZE, STR_NULL}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
168 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 161, 112, 123, STR_NUM_1, STR_NULL}, // Mapsize X |
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
169 |
{ WWT_TEXT, RESIZE_NONE, 0, 168, 176, 113, 123, STR_BY, STR_NULL}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
170 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 180, 227, 112, 123, STR_NUM_2, STR_NULL}, // Mapsize Y |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
171 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
172 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 135, 145, STR_NUMBER_OF_TOWNS, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
173 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 175, 134, 145, 0x0, STR_NULL}, // Number of towns |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
174 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
175 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 153, 163, STR_NUMBER_OF_INDUSTRIES, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
176 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 175, 152, 163, 0x0, STR_NULL}, // Number of industries |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
177 |
|
7f1498dba00e
(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
parents:
8823
diff
changeset
|
178 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 175, 185, STR_RANDOM_SEED, STR_NULL}, |
9233
4daa9bb8dbf7
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents:
8929
diff
changeset
|
179 |
{ WWT_EDITBOX, RESIZE_NONE, 15, 114, 207, 174, 185, STR_RANDOM_SEED_OSKTITLE, STR_RANDOM_SEED_HELP}, // Edit box for seed |
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
180 |
{ WWT_TEXTBTN, RESIZE_NONE, 12, 216, 326, 174, 185, STR_RANDOM, STR_RANDOM_HELP}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
181 |
|
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
182 |
{ WWT_TEXTBTN, RESIZE_NONE, 6, 243, 326, 196, 225, STR_GENERATE, STR_NULL}, // Generate button |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
183 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
184 |
{ WWT_TEXT, RESIZE_NONE, 0, 182, 212, 135, 145, STR_DATE, STR_NULL}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
185 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 216, 227, 134, 145, SPR_ARROW_DOWN, STR_029E_MOVE_THE_STARTING_DATE}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
186 |
{ WWT_TEXTBTN, RESIZE_NONE, 12, 228, 314, 134, 145, STR_GENERATE_DATE, STR_NULL}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
187 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 134, 145, SPR_ARROW_UP, STR_029F_MOVE_THE_STARTING_DATE}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
188 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
189 |
{ WWT_TEXT, RESIZE_NONE, 0, 182, 278, 153, 163, STR_SNOW_LINE_HEIGHT, STR_NULL}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
190 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 282, 293, 152, 163, SPR_ARROW_DOWN, STR_SNOW_LINE_DOWN}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
191 |
{ WWT_TEXTBTN, RESIZE_NONE, 12, 294, 314, 152, 163, STR_NUM_3, STR_NULL}, |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
192 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 152, 163, SPR_ARROW_UP, STR_SNOW_LINE_UP}, |
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
193 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
194 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 197, 207, STR_TREE_PLACER, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
195 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 196, 207, STR_0225, STR_NULL}, // Tree placer |
4344
5d0e40cd67b9
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
196 |
|
8837
7f1498dba00e
(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
parents:
8823
diff
changeset
|
197 |
{ WWT_TEXT, RESIZE_NONE, 0, 12, 110, 215, 225, STR_HEIGHTMAP_ROTATION, STR_NULL}, |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
198 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 114, 231, 214, 225, STR_0225, STR_NULL}, // Heightmap rotation |
7f1498dba00e
(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
parents:
8823
diff
changeset
|
199 |
|
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
200 |
{ WIDGETS_END}, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
201 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
202 |
|
6150
648233476115
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater
parents:
6145
diff
changeset
|
203 |
void StartGeneratingLandscape(glwp_modes mode) |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
204 |
{ |
6150
648233476115
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater
parents:
6145
diff
changeset
|
205 |
DeleteAllNonVitalWindows(); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
206 |
|
6150
648233476115
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater
parents:
6145
diff
changeset
|
207 |
/* Copy all XXX_newgame to XXX when coming from outside the editor */ |
10775
7061477bfbcf
(svn r13325) -Codechange: split the client-side only settings from the settings stored in the savegame so there is no need to have a duplicate copy of it for new games.
rubidium
parents:
10727
diff
changeset
|
208 |
_settings_game = _settings_newgame; |
5228
c4a780348f66
(svn r7348) -Feature: Initial support for saving NewGRF settings with savegames. Back up your savegames...
peter1138
parents:
5213
diff
changeset
|
209 |
ResetGRFConfig(true); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
210 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
211 |
SndPlayFx(SND_15_BEEP); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
212 |
switch (mode) { |
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
213 |
case GLWP_GENERATE: _switch_mode = (_game_mode == GM_EDITOR) ? SM_GENRANDLAND : SM_NEWGAME; break; |
d34703513ed0
(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
parents:
6144
diff
changeset
|
214 |
case GLWP_HEIGHTMAP: _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_HEIGHTMAP : SM_START_HEIGHTMAP; break; |
6150
648233476115
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater
parents:
6145
diff
changeset
|
215 |
case GLWP_SCENARIO: _switch_mode = SM_EDITOR; break; |
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
216 |
default: NOT_REACHED(); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
217 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
218 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
219 |
|
7067
ea55b6046015
(svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents:
7056
diff
changeset
|
220 |
static void LandscapeGenerationCallback(Window *w, bool confirmed) |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
221 |
{ |
5669
ea25407ffa55
(svn r7621) -Codechange: Rework ShowQuery into a general modal popup window. It gets passed
Darkvater
parents:
5568
diff
changeset
|
222 |
if (confirmed) StartGeneratingLandscape((glwp_modes)w->window_number); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
223 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
224 |
|
8823
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
225 |
static DropDownList *BuildMapsizeDropDown() |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
226 |
{ |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
227 |
DropDownList *list = new DropDownList(); |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
228 |
|
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
229 |
for (uint i = 6; i <= 11; i++) { |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
230 |
DropDownListParamStringItem *item = new DropDownListParamStringItem(STR_JUST_INT, i, false); |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
231 |
item->SetParam(0, 1 << i); |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
232 |
list->push_back(item); |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
233 |
} |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
234 |
|
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
235 |
return list; |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
236 |
} |
ee856945cb65
(svn r11893) -Codechange: build map size drop downs dynamically and remove unneeded strings
peter1138
parents:
8780
diff
changeset
|
237 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
238 |
static const StringID _elevations[] = {STR_682A_VERY_FLAT, STR_682B_FLAT, STR_682C_HILLY, STR_682D_MOUNTAINOUS, INVALID_STRING_ID}; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
239 |
static const StringID _sea_lakes[] = {STR_VERY_LOW, STR_6820_LOW, STR_6821_MEDIUM, STR_6822_HIGH, INVALID_STRING_ID}; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
240 |
static const StringID _smoothness[] = {STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH, STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_SMOOTH, STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_ROUGH, STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_ROUGH, INVALID_STRING_ID}; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
241 |
static const StringID _tree_placer[] = {STR_CONFIG_PATCHES_TREE_PLACER_NONE, STR_CONFIG_PATCHES_TREE_PLACER_ORIGINAL, STR_CONFIG_PATCHES_TREE_PLACER_IMPROVED, INVALID_STRING_ID}; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
242 |
static const StringID _rotation[] = {STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE, STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_CLOCKWISE, INVALID_STRING_ID}; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
243 |
static const StringID _landscape[] = {STR_CONFIG_PATCHES_LAND_GENERATOR_ORIGINAL, STR_CONFIG_PATCHES_LAND_GENERATOR_TERRA_GENESIS, INVALID_STRING_ID}; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
244 |
static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID}; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
245 |
static const StringID _num_inds[] = {STR_NONE, STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID}; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
246 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
247 |
struct GenerateLandscapeWindow : public QueryStringBaseWindow { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
248 |
uint widget_id; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
249 |
uint x; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
250 |
uint y; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
251 |
char name[64]; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
252 |
glwp_modes mode; |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
253 |
|
10525
da5bc725cda4
(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
parents:
10499
diff
changeset
|
254 |
GenerateLandscapeWindow(const WindowDesc *desc, WindowNumber number = 0) : QueryStringBaseWindow(desc, number) |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
255 |
{ |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
256 |
this->LowerWidget(_settings_newgame.game_creation.landscape + GLAND_TEMPERATE); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
257 |
|
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
258 |
snprintf(this->edit_str_buf, sizeof(this->edit_str_buf), "%u", _settings_newgame.game_creation.generation_seed); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
259 |
InitializeTextBuffer(&this->text, this->edit_str_buf, lengthof(this->edit_str_buf), 120); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
260 |
this->caption = STR_NULL; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
261 |
this->afilter = CS_NUMERAL; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
262 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
263 |
this->mode = (glwp_modes)this->window_number; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
264 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
265 |
this->FindWindowPlacementAndResize(desc); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
266 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
267 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
268 |
virtual void OnPaint() |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
269 |
{ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
270 |
/* You can't select smoothness if not terragenesis */ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
271 |
if (mode == GLWP_GENERATE) { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
272 |
this->SetWidgetDisabledState(GLAND_SMOOTHNESS_PULLDOWN, _settings_newgame.game_creation.land_generator == 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
273 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
274 |
/* Disable snowline if not hilly */ |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
275 |
this->SetWidgetDisabledState(GLAND_SNOW_LEVEL_TEXT, _settings_newgame.game_creation.landscape != LT_ARCTIC); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
276 |
/* Disable town, industry and trees in SE */ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
277 |
this->SetWidgetDisabledState(GLAND_TOWN_PULLDOWN, _game_mode == GM_EDITOR); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
278 |
this->SetWidgetDisabledState(GLAND_INDUSTRY_PULLDOWN, _game_mode == GM_EDITOR); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
279 |
this->SetWidgetDisabledState(GLAND_TREE_PULLDOWN, _game_mode == GM_EDITOR); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
280 |
|
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
281 |
this->SetWidgetDisabledState(GLAND_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= MIN_YEAR); |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
282 |
this->SetWidgetDisabledState(GLAND_START_DATE_UP, _settings_newgame.game_creation.starting_year >= MAX_YEAR); |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
283 |
this->SetWidgetDisabledState(GLAND_SNOW_LEVEL_DOWN, _settings_newgame.game_creation.snow_line_height <= 2 || _settings_newgame.game_creation.landscape != LT_ARCTIC); |
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
284 |
this->SetWidgetDisabledState(GLAND_SNOW_LEVEL_UP, _settings_newgame.game_creation.snow_line_height >= MAX_SNOWLINE_HEIGHT || _settings_newgame.game_creation.landscape != LT_ARCTIC); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
285 |
|
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
286 |
this->SetWidgetLoweredState(GLAND_TEMPERATE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); |
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
287 |
this->SetWidgetLoweredState(GLAND_ARCTIC, _settings_newgame.game_creation.landscape == LT_ARCTIC); |
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
288 |
this->SetWidgetLoweredState(GLAND_TROPICAL, _settings_newgame.game_creation.landscape == LT_TROPIC); |
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
289 |
this->SetWidgetLoweredState(GLAND_TOYLAND, _settings_newgame.game_creation.landscape == LT_TOYLAND); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
290 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
291 |
if (_game_mode == GM_EDITOR) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
292 |
this->widget[GLAND_TOWN_PULLDOWN].data = STR_6836_OFF; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
293 |
this->widget[GLAND_INDUSTRY_PULLDOWN].data = STR_6836_OFF; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
294 |
} else { |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
295 |
this->widget[GLAND_TOWN_PULLDOWN].data = _num_towns[_settings_newgame.difficulty.number_towns]; |
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
296 |
this->widget[GLAND_INDUSTRY_PULLDOWN].data = _num_inds[_settings_newgame.difficulty.number_industries]; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
297 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
298 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
299 |
if (mode == GLWP_GENERATE) { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
300 |
this->widget[GLAND_LANDSCAPE_PULLDOWN].data = _landscape[_settings_newgame.game_creation.land_generator]; |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
301 |
this->widget[GLAND_TREE_PULLDOWN].data = _tree_placer[_settings_newgame.game_creation.tree_placer]; |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
302 |
this->widget[GLAND_TERRAIN_PULLDOWN].data = _elevations[_settings_newgame.difficulty.terrain_type]; |
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
303 |
this->widget[GLAND_WATER_PULLDOWN].data = _sea_lakes[_settings_newgame.difficulty.quantity_sea_lakes]; |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
304 |
this->widget[GLAND_SMOOTHNESS_PULLDOWN].data = _smoothness[_settings_newgame.game_creation.tgen_smoothness]; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
305 |
} else { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
306 |
this->widget[GLAND_TREE_PULLDOWN].data = _tree_placer[_settings_newgame.game_creation.tree_placer]; |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
307 |
this->widget[GLAND_HEIGHTMAP_ROTATION_PULLDOWN].data = _rotation[_settings_newgame.game_creation.heightmap_rotation]; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
308 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
309 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
310 |
/* Set parameters for widget text that requires them. */ |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
311 |
SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); // GLAND_START_DATE_TEXT |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
312 |
SetDParam(1, 1 << _settings_newgame.game_creation.map_x); // GLAND_MAPSIZE_X_PULLDOWN |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
313 |
SetDParam(2, 1 << _settings_newgame.game_creation.map_y); // GLAND_MAPSIZE_Y_PULLDOWN |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
314 |
SetDParam(3, _settings_newgame.game_creation.snow_line_height); // GLAND_SNOW_LEVEL_TEXT |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
315 |
|
10595
7957c71b0dfe
(svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents:
10588
diff
changeset
|
316 |
this->DrawWidgets(); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
317 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
318 |
this->DrawEditBox(GLAND_RANDOM_EDITBOX); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
319 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
320 |
if (mode != GLWP_GENERATE) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
321 |
char buffer[512]; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
322 |
|
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
323 |
if (_settings_newgame.game_creation.heightmap_rotation == HM_CLOCKWISE) { |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
324 |
SetDParam(0, this->y); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
325 |
SetDParam(1, this->x); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
326 |
} else { |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
327 |
SetDParam(0, this->x); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
328 |
SetDParam(1, this->y); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
329 |
} |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
330 |
GetString(buffer, STR_HEIGHTMAP_SIZE, lastof(buffer)); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
331 |
DrawStringRightAligned(326, 91, STR_HEIGHTMAP_SIZE, TC_BLACK); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
332 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
333 |
DrawString( 12, 91, STR_HEIGHTMAP_NAME, TC_BLACK); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
334 |
SetDParamStr(0, this->name); |
11157
a0173588b15e
(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
parents:
11090
diff
changeset
|
335 |
DrawStringTruncated(114, 91, STR_JUST_RAW_STRING, TC_ORANGE, 326 - 114 - GetStringBoundingBox(buffer).width - 5); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
336 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
337 |
} |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
338 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
339 |
virtual void OnClick(Point pt, int widget) |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
340 |
{ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
341 |
switch (widget) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
342 |
case 0: delete this; break; |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
343 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
344 |
case GLAND_TEMPERATE: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
345 |
case GLAND_ARCTIC: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
346 |
case GLAND_TROPICAL: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
347 |
case GLAND_TOYLAND: |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
348 |
this->RaiseWidget(_settings_newgame.game_creation.landscape + GLAND_TEMPERATE); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
349 |
SetNewLandscapeType(widget - GLAND_TEMPERATE); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
350 |
break; |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
351 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
352 |
case GLAND_MAPSIZE_X_PULLDOWN: // Mapsize X |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
353 |
ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_x, GLAND_MAPSIZE_X_PULLDOWN); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
354 |
break; |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
355 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
356 |
case GLAND_MAPSIZE_Y_PULLDOWN: // Mapsize Y |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
357 |
ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_y, GLAND_MAPSIZE_Y_PULLDOWN); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
358 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
359 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
360 |
case GLAND_TOWN_PULLDOWN: // Number of towns |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
361 |
ShowDropDownMenu(this, _num_towns, _settings_newgame.difficulty.number_towns, GLAND_TOWN_PULLDOWN, 0, 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
362 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
363 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
364 |
case GLAND_INDUSTRY_PULLDOWN: // Number of industries |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
365 |
ShowDropDownMenu(this, _num_inds, _settings_newgame.difficulty.number_industries, GLAND_INDUSTRY_PULLDOWN, 0, 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
366 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
367 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
368 |
case GLAND_RANDOM_BUTTON: // Random seed |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
369 |
_settings_newgame.game_creation.generation_seed = InteractiveRandom(); |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
370 |
snprintf(this->edit_str_buf, lengthof(this->edit_str_buf), "%u", _settings_newgame.game_creation.generation_seed); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
371 |
UpdateTextBufferSize(&this->text); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
372 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
373 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
374 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
375 |
case GLAND_RANDOM_EDITBOX: // edit box for random seed |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
376 |
ShowOnScreenKeyboard(this, GLAND_RANDOM_EDITBOX, 0, 0); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
377 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
378 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
379 |
case GLAND_GENERATE_BUTTON: // Generate |
10775
7061477bfbcf
(svn r13325) -Codechange: split the client-side only settings from the settings stored in the savegame so there is no need to have a duplicate copy of it for new games.
rubidium
parents:
10727
diff
changeset
|
380 |
_settings_game = _settings_newgame; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
381 |
|
10775
7061477bfbcf
(svn r13325) -Codechange: split the client-side only settings from the settings stored in the savegame so there is no need to have a duplicate copy of it for new games.
rubidium
parents:
10727
diff
changeset
|
382 |
if (_settings_game.economy.town_layout == TL_NO_ROADS) { |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
383 |
ShowQuery( |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
384 |
STR_TOWN_LAYOUT_WARNING_CAPTION, |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
385 |
STR_TOWN_LAYOUT_WARNING_MESSAGE, |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
386 |
this, |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
387 |
LandscapeGenerationCallback); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
388 |
} else if (mode == GLWP_HEIGHTMAP && |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
389 |
(this->x * 2 < (1U << _settings_newgame.game_creation.map_x) || |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
390 |
this->x / 2 > (1U << _settings_newgame.game_creation.map_x) || |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
391 |
this->y * 2 < (1U << _settings_newgame.game_creation.map_y) || |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
392 |
this->y / 2 > (1U << _settings_newgame.game_creation.map_y))) { |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
393 |
ShowQuery( |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
394 |
STR_HEIGHTMAP_SCALE_WARNING_CAPTION, |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
395 |
STR_HEIGHTMAP_SCALE_WARNING_MESSAGE, |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
396 |
this, |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
397 |
LandscapeGenerationCallback); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
398 |
} else { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
399 |
StartGeneratingLandscape(mode); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
400 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
401 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
402 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
403 |
case GLAND_START_DATE_DOWN: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
404 |
case GLAND_START_DATE_UP: // Year buttons |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
405 |
/* Don't allow too fast scrolling */ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
406 |
if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
407 |
this->HandleButtonClick(widget); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
408 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
409 |
|
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
410 |
_settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + widget - GLAND_START_DATE_TEXT, MIN_YEAR, MAX_YEAR); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
411 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
412 |
_left_button_clicked = false; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
413 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
414 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
415 |
case GLAND_START_DATE_TEXT: // Year text |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
416 |
this->widget_id = GLAND_START_DATE_TEXT; |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
417 |
SetDParam(0, _settings_newgame.game_creation.starting_year); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
418 |
ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_START_DATE_QUERY_CAPT, 8, 100, this, CS_NUMERAL); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
419 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
420 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
421 |
case GLAND_SNOW_LEVEL_DOWN: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
422 |
case GLAND_SNOW_LEVEL_UP: // Snow line buttons |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
423 |
/* Don't allow too fast scrolling */ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
424 |
if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
425 |
this->HandleButtonClick(widget); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
426 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
427 |
|
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
428 |
_settings_newgame.game_creation.snow_line_height = Clamp(_settings_newgame.game_creation.snow_line_height + widget - GLAND_SNOW_LEVEL_TEXT, 2, MAX_SNOWLINE_HEIGHT); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
429 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
430 |
_left_button_clicked = false; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
431 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
432 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
433 |
case GLAND_SNOW_LEVEL_TEXT: // Snow line text |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
434 |
this->widget_id = GLAND_SNOW_LEVEL_TEXT; |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
435 |
SetDParam(0, _settings_newgame.game_creation.snow_line_height); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
436 |
ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_SNOW_LINE_QUERY_CAPT, 3, 100, this, CS_NUMERAL); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
437 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
438 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
439 |
case GLAND_TREE_PULLDOWN: // Tree placer |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
440 |
ShowDropDownMenu(this, _tree_placer, _settings_newgame.game_creation.tree_placer, GLAND_TREE_PULLDOWN, 0, 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
441 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
442 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
443 |
case GLAND_LANDSCAPE_PULLDOWN: // Landscape generator OR Heightmap rotation |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
444 |
/* case GLAND_HEIGHTMAP_ROTATION_TEXT: case GLAND_HEIGHTMAP_ROTATION_PULLDOWN:*/ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
445 |
if (mode == GLWP_HEIGHTMAP) { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
446 |
ShowDropDownMenu(this, _rotation, _settings_newgame.game_creation.heightmap_rotation, GLAND_HEIGHTMAP_ROTATION_PULLDOWN, 0, 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
447 |
} else { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
448 |
ShowDropDownMenu(this, _landscape, _settings_newgame.game_creation.land_generator, GLAND_LANDSCAPE_PULLDOWN, 0, 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
449 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
450 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
451 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
452 |
case GLAND_TERRAIN_PULLDOWN: // Terrain type |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
453 |
ShowDropDownMenu(this, _elevations, _settings_newgame.difficulty.terrain_type, GLAND_TERRAIN_PULLDOWN, 0, 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
454 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
455 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
456 |
case GLAND_WATER_PULLDOWN: // Water quantity |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
457 |
ShowDropDownMenu(this, _sea_lakes, _settings_newgame.difficulty.quantity_sea_lakes, GLAND_WATER_PULLDOWN, 0, 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
458 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
459 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
460 |
case GLAND_SMOOTHNESS_PULLDOWN: // Map smoothness |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
461 |
ShowDropDownMenu(this, _smoothness, _settings_newgame.game_creation.tgen_smoothness, GLAND_SMOOTHNESS_PULLDOWN, 0, 0); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
462 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
463 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
464 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
465 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
466 |
virtual void OnMouseLoop() |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
467 |
{ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
468 |
this->HandleEditBox(GLAND_RANDOM_EDITBOX); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
469 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
470 |
|
10607
1ab30cead125
(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
parents:
10595
diff
changeset
|
471 |
virtual EventState OnKeyPress(uint16 key, uint16 keycode) |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
472 |
{ |
10607
1ab30cead125
(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
parents:
10595
diff
changeset
|
473 |
EventState state; |
1ab30cead125
(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
parents:
10595
diff
changeset
|
474 |
this->HandleEditBoxKey(GLAND_RANDOM_EDITBOX, key, keycode, state); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
475 |
/* the seed is unsigned, therefore atoi cannot be used. |
11090
3ac220ac9a47
(svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant
skidd13
parents:
10954
diff
changeset
|
476 |
* As 2^32 - 1 (UINT32_MAX) is a 'magic' value |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
477 |
* (use random seed) it should not be possible to be |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
478 |
* entered into the input field; the generate seed |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
479 |
* button can be used instead. */ |
11090
3ac220ac9a47
(svn r13647) -Codechange: replace MAX_UVALUE() for std types with the equivalent constant
skidd13
parents:
10954
diff
changeset
|
480 |
_settings_newgame.game_creation.generation_seed = minu(strtoul(this->edit_str_buf, NULL, 10), UINT32_MAX - 1); |
10607
1ab30cead125
(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
parents:
10595
diff
changeset
|
481 |
return state; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
482 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
483 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
484 |
virtual void OnDropdownSelect(int widget, int index) |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
485 |
{ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
486 |
switch (widget) { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
487 |
case GLAND_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break; |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
488 |
case GLAND_MAPSIZE_Y_PULLDOWN: _settings_newgame.game_creation.map_y = index; break; |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
489 |
case GLAND_TREE_PULLDOWN: _settings_newgame.game_creation.tree_placer = index; break; |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
490 |
case GLAND_SMOOTHNESS_PULLDOWN: _settings_newgame.game_creation.tgen_smoothness = index; break; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
491 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
492 |
case GLAND_TOWN_PULLDOWN: |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
493 |
_settings_newgame.difficulty.number_towns = index; |
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
494 |
if (_settings_newgame.difficulty.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0); |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
495 |
IConsoleSetPatchSetting("difficulty.number_towns", _settings_newgame.difficulty.number_towns); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
496 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
497 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
498 |
case GLAND_INDUSTRY_PULLDOWN: |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
499 |
_settings_newgame.difficulty.number_industries = index; |
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
500 |
if (_settings_newgame.difficulty.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0); |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
501 |
IConsoleSetPatchSetting("difficulty.number_industries", _settings_newgame.difficulty.number_industries); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
502 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
503 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
504 |
case GLAND_LANDSCAPE_PULLDOWN: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
505 |
/* case GLAND_HEIGHTMAP_PULLDOWN: */ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
506 |
if (mode == GLWP_HEIGHTMAP) { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
507 |
_settings_newgame.game_creation.heightmap_rotation = index; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
508 |
} else { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
509 |
_settings_newgame.game_creation.land_generator = index; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
510 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
511 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
512 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
513 |
case GLAND_TERRAIN_PULLDOWN: |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
514 |
_settings_newgame.difficulty.terrain_type = index; |
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
515 |
if (_settings_newgame.difficulty.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0); |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
516 |
IConsoleSetPatchSetting("difficulty.terrain_type", _settings_newgame.difficulty.terrain_type); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
517 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
518 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
519 |
case GLAND_WATER_PULLDOWN: |
10707
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
520 |
_settings_newgame.difficulty.quantity_sea_lakes = index; |
81a4013a7680
(svn r13255) -Codechange: move _opt to _settings.
rubidium
parents:
10703
diff
changeset
|
521 |
if (_settings_newgame.difficulty.diff_level != 3) ShowErrorMessage(INVALID_STRING_ID, STR_DIFFICULTY_TO_CUSTOM, 0, 0); |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
522 |
IConsoleSetPatchSetting("difficulty.quantity_sea_lakes", _settings_newgame.difficulty.quantity_sea_lakes); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
523 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
524 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
525 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
526 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
527 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
528 |
virtual void OnQueryTextFinished(char *str) |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
529 |
{ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
530 |
if (!StrEmpty(str)) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
531 |
int32 value = atoi(str); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
532 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
533 |
switch (this->widget_id) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
534 |
case GLAND_START_DATE_TEXT: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
535 |
this->InvalidateWidget(GLAND_START_DATE_TEXT); |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
536 |
_settings_newgame.game_creation.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR); |
9233
4daa9bb8dbf7
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents:
8929
diff
changeset
|
537 |
break; |
4daa9bb8dbf7
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents:
8929
diff
changeset
|
538 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
539 |
case GLAND_SNOW_LEVEL_TEXT: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
540 |
this->InvalidateWidget(GLAND_SNOW_LEVEL_TEXT); |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
541 |
_settings_newgame.game_creation.snow_line_height = Clamp(value, 2, MAX_SNOWLINE_HEIGHT); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
542 |
break; |
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
543 |
} |
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
544 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
545 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
546 |
} |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
547 |
} |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
548 |
}; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
549 |
|
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
550 |
static const WindowDesc _generate_landscape_desc = { |
7837
65d7362153a6
(svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium
parents:
7809
diff
changeset
|
551 |
WDP_CENTER, WDP_CENTER, 338, 268, 338, 268, |
6144
5a0ffbf27ced
(svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium
parents:
6143
diff
changeset
|
552 |
WC_GENERATE_LANDSCAPE, WC_NONE, |
8515
d0401d967e99
(svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas
parents:
8514
diff
changeset
|
553 |
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
554 |
_generate_landscape_widgets, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
555 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
556 |
|
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
557 |
static const WindowDesc _heightmap_load_desc = { |
7837
65d7362153a6
(svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium
parents:
7809
diff
changeset
|
558 |
WDP_CENTER, WDP_CENTER, 338, 236, 338, 236, |
6144
5a0ffbf27ced
(svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium
parents:
6143
diff
changeset
|
559 |
WC_GENERATE_LANDSCAPE, WC_NONE, |
8515
d0401d967e99
(svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas
parents:
8514
diff
changeset
|
560 |
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
561 |
_heightmap_load_widgets, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
562 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
563 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
564 |
static void _ShowGenerateLandscape(glwp_modes mode) |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
565 |
{ |
7599
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
566 |
uint x = 0; |
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
567 |
uint y = 0; |
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
568 |
|
6152
42ce779b1765
(svn r8524) -Cleanup: Ala r8509 add some enum names to the generate landscape window
Darkvater
parents:
6150
diff
changeset
|
569 |
DeleteWindowByClass(WC_GENERATE_LANDSCAPE); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
570 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
571 |
/* Always give a new seed if not editor */ |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
572 |
if (_game_mode != GM_EDITOR) _settings_newgame.game_creation.generation_seed = InteractiveRandom(); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
573 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
574 |
if (mode == GLWP_HEIGHTMAP) { |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
575 |
/* If the function returns negative, it means there was a problem loading the heightmap */ |
7599
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
576 |
if (!GetHeightmapDimensions(_file_to_saveload.name, &x, &y)) return; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
577 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
578 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
579 |
GenerateLandscapeWindow *w = AllocateWindowDescFront<GenerateLandscapeWindow>((mode == GLWP_HEIGHTMAP) ? &_heightmap_load_desc : &_generate_landscape_desc, mode); |
7599
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
580 |
|
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
581 |
if (mode == GLWP_HEIGHTMAP) { |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
582 |
w->x = x; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
583 |
w->y = y; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
584 |
strecpy(w->name, _file_to_saveload.title, lastof(w->name)); |
7599
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
585 |
} |
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
586 |
|
6c68085d9bdd
(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
parents:
7514
diff
changeset
|
587 |
InvalidateWindow(WC_GENERATE_LANDSCAPE, mode); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
588 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
589 |
|
6573 | 590 |
void ShowGenerateLandscape() |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
591 |
{ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
592 |
_ShowGenerateLandscape(GLWP_GENERATE); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
593 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
594 |
|
6573 | 595 |
void ShowHeightmapLoad() |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
596 |
{ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
597 |
_ShowGenerateLandscape(GLWP_HEIGHTMAP); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
598 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
599 |
|
6573 | 600 |
void StartScenarioEditor() |
6150
648233476115
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater
parents:
6145
diff
changeset
|
601 |
{ |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
602 |
if (_settings_newgame.economy.town_layout == TL_NO_ROADS) { |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
603 |
_settings_newgame.economy.town_layout = TL_ORIGINAL; |
7067
ea55b6046015
(svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents:
7056
diff
changeset
|
604 |
} |
ea55b6046015
(svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents:
7056
diff
changeset
|
605 |
|
6150
648233476115
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater
parents:
6145
diff
changeset
|
606 |
StartGeneratingLandscape(GLWP_SCENARIO); |
648233476115
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater
parents:
6145
diff
changeset
|
607 |
} |
648233476115
(svn r8522) -Regression (r8512): The flat/random window moved the to scenario editor did not use the right settings for generating land
Darkvater
parents:
6145
diff
changeset
|
608 |
|
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
609 |
void StartNewGameWithoutGUI(uint seed) |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
610 |
{ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
611 |
/* GenerateWorld takes care of the possible GENERATE_NEW_SEED value in 'seed' */ |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
612 |
_settings_newgame.game_creation.generation_seed = seed; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
613 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
614 |
StartGeneratingLandscape(GLWP_GENERATE); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
615 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
616 |
|
6143
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
617 |
enum CreateScenarioWindowWidgets { |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
618 |
CSCEN_TEMPERATE = 3, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
619 |
CSCEN_ARCTIC, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
620 |
CSCEN_TROPICAL, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
621 |
CSCEN_TOYLAND, |
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
622 |
CSCEN_EMPTY_WORLD, |
d34703513ed0
(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
parents:
6144
diff
changeset
|
623 |
CSCEN_RANDOM_WORLD, |
6143
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
624 |
CSCEN_MAPSIZE_X_TEXT, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
625 |
CSCEN_MAPSIZE_X_PULLDOWN, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
626 |
CSCEN_MAPSIZE_Y_TEXT, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
627 |
CSCEN_MAPSIZE_Y_PULLDOWN, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
628 |
CSCEN_START_DATE_LABEL, |
6143
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
629 |
CSCEN_START_DATE_DOWN, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
630 |
CSCEN_START_DATE_TEXT, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
631 |
CSCEN_START_DATE_UP, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
632 |
CSCEN_FLAT_LAND_HEIGHT_LABEL, |
6143
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
633 |
CSCEN_FLAT_LAND_HEIGHT_DOWN, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
634 |
CSCEN_FLAT_LAND_HEIGHT_TEXT, |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
635 |
CSCEN_FLAT_LAND_HEIGHT_UP |
87e99d425124
(svn r8509) -Cleanup: Add some enum names to the create scenario window
Darkvater
parents:
5919
diff
changeset
|
636 |
}; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
637 |
|
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
638 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
639 |
struct CreateScenarioWindow : public Window |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
640 |
{ |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
641 |
uint widget_id; |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
642 |
|
10525
da5bc725cda4
(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
parents:
10499
diff
changeset
|
643 |
CreateScenarioWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number) |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
644 |
{ |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
645 |
this->LowerWidget(_settings_newgame.game_creation.landscape + CSCEN_TEMPERATE); |
10681
3aa3de4d448b
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138
parents:
10641
diff
changeset
|
646 |
this->FindWindowPlacementAndResize(desc); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
647 |
} |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
648 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
649 |
virtual void OnPaint() |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
650 |
{ |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
651 |
this->SetWidgetDisabledState(CSCEN_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= MIN_YEAR); |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
652 |
this->SetWidgetDisabledState(CSCEN_START_DATE_UP, _settings_newgame.game_creation.starting_year >= MAX_YEAR); |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
653 |
this->SetWidgetDisabledState(CSCEN_FLAT_LAND_HEIGHT_DOWN, _settings_newgame.game_creation.se_flat_world_height <= 0); |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
654 |
this->SetWidgetDisabledState(CSCEN_FLAT_LAND_HEIGHT_UP, _settings_newgame.game_creation.se_flat_world_height >= MAX_TILE_HEIGHT); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
655 |
|
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
656 |
this->SetWidgetLoweredState(CSCEN_TEMPERATE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); |
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
657 |
this->SetWidgetLoweredState(CSCEN_ARCTIC, _settings_newgame.game_creation.landscape == LT_ARCTIC); |
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
658 |
this->SetWidgetLoweredState(CSCEN_TROPICAL, _settings_newgame.game_creation.landscape == LT_TROPIC); |
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
659 |
this->SetWidgetLoweredState(CSCEN_TOYLAND, _settings_newgame.game_creation.landscape == LT_TOYLAND); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
660 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
661 |
/* Set parameters for widget text that requires them */ |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
662 |
SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); // CSCEN_START_DATE_TEXT |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
663 |
SetDParam(1, 1 << _settings_newgame.game_creation.map_x); // CSCEN_MAPSIZE_X_PULLDOWN |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
664 |
SetDParam(2, 1 << _settings_newgame.game_creation.map_y); // CSCEN_MAPSIZE_Y_PULLDOWN |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
665 |
SetDParam(3, _settings_newgame.game_creation.se_flat_world_height); // CSCEN_FLAT_LAND_HEIGHT_TEXT |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
666 |
|
10595
7957c71b0dfe
(svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents:
10588
diff
changeset
|
667 |
this->DrawWidgets(); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
668 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
669 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
670 |
virtual void OnClick(Point pt, int widget) |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
671 |
{ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
672 |
switch (widget) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
673 |
case CSCEN_TEMPERATE: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
674 |
case CSCEN_ARCTIC: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
675 |
case CSCEN_TROPICAL: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
676 |
case CSCEN_TOYLAND: |
10708
5f1e9cffcfa5
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
rubidium
parents:
10707
diff
changeset
|
677 |
this->RaiseWidget(_settings_newgame.game_creation.landscape + CSCEN_TEMPERATE); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
678 |
SetNewLandscapeType(widget - CSCEN_TEMPERATE); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
679 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
680 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
681 |
case CSCEN_MAPSIZE_X_PULLDOWN: // Mapsize X |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
682 |
ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_x, CSCEN_MAPSIZE_X_PULLDOWN); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
683 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
684 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
685 |
case CSCEN_MAPSIZE_Y_PULLDOWN: // Mapsize Y |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
686 |
ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_y, CSCEN_MAPSIZE_Y_PULLDOWN); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
687 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
688 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
689 |
case CSCEN_EMPTY_WORLD: // Empty world / flat world |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
690 |
StartGeneratingLandscape(GLWP_SCENARIO); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
691 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
692 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
693 |
case CSCEN_RANDOM_WORLD: // Generate |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
694 |
ShowGenerateLandscape(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
695 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
696 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
697 |
case CSCEN_START_DATE_DOWN: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
698 |
case CSCEN_START_DATE_UP: // Year buttons |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
699 |
/* Don't allow too fast scrolling */ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
700 |
if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
701 |
this->HandleButtonClick(widget); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
702 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
703 |
|
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
704 |
_settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + widget - CSCEN_START_DATE_TEXT, MIN_YEAR, MAX_YEAR); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
705 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
706 |
_left_button_clicked = false; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
707 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
708 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
709 |
case CSCEN_START_DATE_TEXT: // Year text |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
710 |
this->widget_id = CSCEN_START_DATE_TEXT; |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
711 |
SetDParam(0, _settings_newgame.game_creation.starting_year); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
712 |
ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_START_DATE_QUERY_CAPT, 8, 100, this, CS_NUMERAL); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
713 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
714 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
715 |
case CSCEN_FLAT_LAND_HEIGHT_DOWN: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
716 |
case CSCEN_FLAT_LAND_HEIGHT_UP: // Height level buttons |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
717 |
/* Don't allow too fast scrolling */ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
718 |
if ((this->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
719 |
this->HandleButtonClick(widget); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
720 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
721 |
|
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
722 |
_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); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
723 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
724 |
_left_button_clicked = false; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
725 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
726 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
727 |
case CSCEN_FLAT_LAND_HEIGHT_TEXT: // Height level text |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
728 |
this->widget_id = CSCEN_FLAT_LAND_HEIGHT_TEXT; |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
729 |
SetDParam(0, _settings_newgame.game_creation.se_flat_world_height); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
730 |
ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_FLAT_WORLD_HEIGHT_QUERY_CAPT, 3, 100, this, CS_NUMERAL); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
731 |
break; |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
732 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
733 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
734 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
735 |
virtual void OnDropdownSelect(int widget, int index) |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
736 |
{ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
737 |
switch (widget) { |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
738 |
case CSCEN_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break; |
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
739 |
case CSCEN_MAPSIZE_Y_PULLDOWN: _settings_newgame.game_creation.map_y = index; break; |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
740 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
741 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
742 |
} |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
743 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
744 |
virtual void OnQueryTextFinished(char *str) |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
745 |
{ |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
746 |
if (!StrEmpty(str)) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
747 |
int32 value = atoi(str); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
748 |
|
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
749 |
switch (this->widget_id) { |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
750 |
case CSCEN_START_DATE_TEXT: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
751 |
this->InvalidateWidget(CSCEN_START_DATE_TEXT); |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
752 |
_settings_newgame.game_creation.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
753 |
break; |
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
754 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
755 |
case CSCEN_FLAT_LAND_HEIGHT_TEXT: |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
756 |
this->InvalidateWidget(CSCEN_FLAT_LAND_HEIGHT_TEXT); |
10703
2c998f3776d1
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
rubidium
parents:
10695
diff
changeset
|
757 |
_settings_newgame.game_creation.se_flat_world_height = Clamp(value, 0, MAX_TILE_HEIGHT); |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
758 |
break; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
759 |
} |
8851
7b1feace0564
(svn r11921) -Cleanup: correct indenting and switch case line spacing.
peter1138
parents:
8849
diff
changeset
|
760 |
|
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
761 |
this->SetDirty(); |
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
762 |
} |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
763 |
} |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
764 |
}; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
765 |
|
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
766 |
static const Widget _create_scenario_widgets[] = { |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
767 |
{ WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
768 |
{ WWT_CAPTION, RESIZE_NONE, 13, 11, 337, 0, 13, STR_SE_CAPTION, STR_NULL}, |
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
769 |
{ WWT_PANEL, RESIZE_NONE, 13, 0, 337, 14, 169, 0x0, STR_NULL}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
770 |
|
4938
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
771 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 10, 86, 24, 78, SPR_SELECT_TEMPERATE, STR_030E_SELECT_TEMPERATE_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
772 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 90, 166, 24, 78, SPR_SELECT_SUB_ARCTIC, STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
773 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 170, 246, 24, 78, SPR_SELECT_SUB_TROPICAL, STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE}, |
074f734a91ca
(svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
Darkvater
parents:
4937
diff
changeset
|
774 |
{ WWT_IMGBTN_2, RESIZE_NONE, 12, 250, 326, 24, 78, SPR_SELECT_TOYLAND, STR_0311_SELECT_TOYLAND_LANDSCAPE}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
775 |
|
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
776 |
{ WWT_TEXTBTN, RESIZE_NONE, 6, 12, 115, 95, 124, STR_SE_FLAT_WORLD, STR_SE_FLAT_WORLD_TIP}, // Empty (sea-level) map |
d34703513ed0
(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
parents:
6144
diff
changeset
|
777 |
{ WWT_TEXTBTN, RESIZE_NONE, 6, 12, 115, 131, 160, STR_SE_RANDOM_LAND, STR_022A_GENERATE_RANDOM_LAND}, // Generate |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
778 |
|
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
779 |
{ WWT_TEXT, RESIZE_NONE, 12, 182, 212, 96, 106, STR_MAPSIZE, STR_NULL}, |
0e1357f6b480
(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
parents:
8837
diff
changeset
|
780 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 216, 263, 95, 106, STR_NUM_1, STR_NULL}, // Mapsize X |
0e1357f6b480
(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
parents:
8837
diff
changeset
|
781 |
{ WWT_TEXT, RESIZE_NONE, 12, 268, 276, 96, 106, STR_BY, STR_NULL}, |
0e1357f6b480
(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
parents:
8837
diff
changeset
|
782 |
{ WWT_DROPDOWN, RESIZE_NONE, 12, 279, 326, 95, 106, STR_NUM_2, STR_NULL}, // Mapsize Y |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
783 |
|
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
784 |
{ WWT_TEXT, RESIZE_NONE, 0, 182, 212, 114, 124, STR_DATE, STR_NULL}, |
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
785 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 216, 227, 113, 124, SPR_ARROW_DOWN, STR_029E_MOVE_THE_STARTING_DATE}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
786 |
{ WWT_TEXTBTN, RESIZE_NONE, 12, 228, 314, 113, 124, STR_GENERATE_DATE, STR_NULL}, |
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
787 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 113, 124, SPR_ARROW_UP, STR_029F_MOVE_THE_STARTING_DATE}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
788 |
|
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
789 |
{ WWT_TEXT, RESIZE_NONE, 0, 182, 278, 132, 142, STR_FLAT_WORLD_HEIGHT, STR_NULL}, |
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
790 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 282, 293, 131, 142, SPR_ARROW_DOWN, STR_FLAT_WORLD_HEIGHT_DOWN}, |
8849
0e1357f6b480
(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
parents:
8837
diff
changeset
|
791 |
{ WWT_TEXTBTN, RESIZE_NONE, 12, 294, 314, 131, 142, STR_NUM_3, STR_NULL}, |
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
792 |
{ WWT_IMGBTN, RESIZE_NONE, 12, 315, 326, 131, 142, SPR_ARROW_UP, STR_FLAT_WORLD_HEIGHT_UP}, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
793 |
{ WIDGETS_END}, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
794 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
795 |
|
6145
d34703513ed0
(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
parents:
6144
diff
changeset
|
796 |
static const WindowDesc _create_scenario_desc = { |
7837
65d7362153a6
(svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium
parents:
7809
diff
changeset
|
797 |
WDP_CENTER, WDP_CENTER, 338, 170, 338, 170, |
6144
5a0ffbf27ced
(svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium
parents:
6143
diff
changeset
|
798 |
WC_GENERATE_LANDSCAPE, WC_NONE, |
8515
d0401d967e99
(svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas
parents:
8514
diff
changeset
|
799 |
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
800 |
_create_scenario_widgets, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
801 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
802 |
|
6573 | 803 |
void ShowCreateScenario() |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
804 |
{ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
805 |
DeleteWindowByClass(WC_GENERATE_LANDSCAPE); |
10499
9c2d9bdea61a
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents:
10484
diff
changeset
|
806 |
new CreateScenarioWindow(&_create_scenario_desc, GLWP_SCENARIO); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
807 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
808 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
809 |
|
10588
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
810 |
static const Widget _generate_progress_widgets[] = { |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
811 |
{ WWT_CAPTION, RESIZE_NONE, 14, 0, 180, 0, 13, STR_GENERATION_WORLD, STR_018C_WINDOW_TITLE_DRAG_THIS}, // GPWW_CAPTION |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
812 |
{ WWT_PANEL, RESIZE_NONE, 14, 0, 180, 14, 96, 0x0, STR_NULL}, // GPWW_BACKGROUND |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
813 |
{ WWT_TEXTBTN, RESIZE_NONE, 15, 20, 161, 74, 85, STR_GENERATION_ABORT, STR_NULL}, // GPWW_ABORT |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
814 |
{ WIDGETS_END}, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
815 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
816 |
|
10588
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
817 |
static const WindowDesc _generate_progress_desc = { |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
818 |
WDP_CENTER, WDP_CENTER, 181, 97, 181, 97, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
819 |
WC_GENERATE_PROGRESS_WINDOW, WC_NONE, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
820 |
WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
821 |
_generate_progress_widgets, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
822 |
}; |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
823 |
|
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6573
diff
changeset
|
824 |
struct tp_info { |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
825 |
uint percent; |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
826 |
StringID cls; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
827 |
uint current; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
828 |
uint total; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
829 |
int timer; |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6573
diff
changeset
|
830 |
}; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
831 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
832 |
static tp_info _tp; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
833 |
|
5669
ea25407ffa55
(svn r7621) -Codechange: Rework ShowQuery into a general modal popup window. It gets passed
Darkvater
parents:
5568
diff
changeset
|
834 |
static void AbortGeneratingWorldCallback(Window *w, bool confirmed) |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
835 |
{ |
5669
ea25407ffa55
(svn r7621) -Codechange: Rework ShowQuery into a general modal popup window. It gets passed
Darkvater
parents:
5568
diff
changeset
|
836 |
if (confirmed) { |
ea25407ffa55
(svn r7621) -Codechange: Rework ShowQuery into a general modal popup window. It gets passed
Darkvater
parents:
5568
diff
changeset
|
837 |
AbortGeneratingWorld(); |
ea25407ffa55
(svn r7621) -Codechange: Rework ShowQuery into a general modal popup window. It gets passed
Darkvater
parents:
5568
diff
changeset
|
838 |
} else if (IsGeneratingWorld() && !IsGeneratingWorldAborted()) { |
5919
2b58160d667d
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5838
diff
changeset
|
839 |
SetMouseCursor(SPR_CURSOR_ZZZ, PAL_NONE); |
5669
ea25407ffa55
(svn r7621) -Codechange: Rework ShowQuery into a general modal popup window. It gets passed
Darkvater
parents:
5568
diff
changeset
|
840 |
} |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
841 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
842 |
|
10588
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
843 |
struct GenerateProgressWindow : public Window { |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
844 |
private: |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
845 |
enum GenerationProgressWindowWidgets { |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
846 |
GPWW_CAPTION, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
847 |
GPWW_BACKGROUND, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
848 |
GPWW_ABORT, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
849 |
}; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
850 |
|
10588
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
851 |
public: |
10681
3aa3de4d448b
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138
parents:
10641
diff
changeset
|
852 |
GenerateProgressWindow() : Window(&_generate_progress_desc) |
3aa3de4d448b
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138
parents:
10641
diff
changeset
|
853 |
{ |
3aa3de4d448b
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138
parents:
10641
diff
changeset
|
854 |
this->FindWindowPlacementAndResize(&_generate_progress_desc); |
3aa3de4d448b
(svn r13225) -Fix (r13041): Missing calls to FindWindowPlacementAndResize() from lots
peter1138
parents:
10641
diff
changeset
|
855 |
} |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
856 |
|
10588
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
857 |
virtual void OnClick(Point pt, int widget) |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
858 |
{ |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
859 |
switch (widget) { |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
860 |
case GPWW_ABORT: |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
861 |
if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
862 |
ShowQuery( |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
863 |
STR_GENERATION_ABORT_CAPTION, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
864 |
STR_GENERATION_ABORT_MESSAGE, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
865 |
this, |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
866 |
AbortGeneratingWorldCallback |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
867 |
); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
868 |
break; |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
869 |
} |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
870 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
871 |
|
10588
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
872 |
virtual void OnPaint() |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
873 |
{ |
10595
7957c71b0dfe
(svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents:
10588
diff
changeset
|
874 |
this->DrawWidgets(); |
10588
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
875 |
|
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
876 |
/* Draw the % complete with a bar and a text */ |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
877 |
DrawFrameRect(19, 20, (this->width - 18), 37, 14, FR_BORDERONLY); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
878 |
DrawFrameRect(20, 21, (int)((this->width - 40) * _tp.percent / 100) + 20, 36, 10, FR_NONE); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
879 |
SetDParam(0, _tp.percent); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
880 |
DrawStringCentered(90, 25, STR_PROGRESS, TC_FROMSTRING); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
881 |
|
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
882 |
/* Tell which class we are generating */ |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
883 |
DrawStringCentered(90, 46, _tp.cls, TC_FROMSTRING); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
884 |
|
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
885 |
/* And say where we are in that class */ |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
886 |
SetDParam(0, _tp.current); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
887 |
SetDParam(1, _tp.total); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
888 |
DrawStringCentered(90, 58, STR_GENERATION_PROGRESS, TC_FROMSTRING); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
889 |
|
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
890 |
this->SetDirty(); |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
891 |
} |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
892 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
893 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
894 |
/** |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
895 |
* Initializes the progress counters to the starting point. |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
896 |
*/ |
6573 | 897 |
void PrepareGenerateWorldProgress() |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
898 |
{ |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
899 |
_tp.cls = STR_WORLD_GENERATION; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
900 |
_tp.current = 0; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
901 |
_tp.total = 0; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
902 |
_tp.percent = 0; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
903 |
_tp.timer = 0; // Forces to paint the progress window immediatelly |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
904 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
905 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
906 |
/** |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
907 |
* Show the window where a user can follow the process of the map generation. |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
908 |
*/ |
6573 | 909 |
void ShowGenerateWorldProgress() |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
910 |
{ |
10588
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
911 |
if (BringWindowToFrontById(WC_GENERATE_PROGRESS_WINDOW, 0)) return; |
49c55801ec2b
(svn r13132) -Codechange: make a class of the GenerateProgressWindow.
glx
parents:
10525
diff
changeset
|
912 |
new GenerateProgressWindow(); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
913 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
914 |
|
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
915 |
static void _SetGeneratingWorldProgress(gwp_class cls, uint progress, uint total) |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
916 |
{ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
917 |
static const int percent_table[GWP_CLASS_COUNT + 1] = {0, 5, 15, 20, 40, 60, 65, 80, 85, 99, 100 }; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
918 |
static const StringID class_table[GWP_CLASS_COUNT] = { |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
919 |
STR_WORLD_GENERATION, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
920 |
STR_022E_LANDSCAPE_GENERATION, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
921 |
STR_CLEARING_TILES, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
922 |
STR_022F_TOWN_GENERATION, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
923 |
STR_0230_INDUSTRY_GENERATION, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
924 |
STR_UNMOVABLE_GENERATION, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
925 |
STR_TREE_GENERATION, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
926 |
STR_SETTINGUP_GAME, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
927 |
STR_PREPARING_TILELOOP, |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
928 |
STR_PREPARING_GAME |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
929 |
}; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
930 |
|
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
931 |
assert(cls < GWP_CLASS_COUNT); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
932 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
933 |
/* Do not run this function if we aren't in a thread */ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
934 |
if (!IsGenerateWorldThreaded() && !_network_dedicated) return; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
935 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
936 |
if (IsGeneratingWorldAborted()) HandleGeneratingWorldAbortion(); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
937 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
938 |
if (total == 0) { |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
939 |
assert(_tp.cls == class_table[cls]); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
940 |
_tp.current += progress; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
941 |
} else { |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
942 |
_tp.cls = class_table[cls]; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
943 |
_tp.current = progress; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
944 |
_tp.total = total; |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
945 |
_tp.percent = percent_table[cls]; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
946 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
947 |
|
7514
98a024616010
(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
parents:
7067
diff
changeset
|
948 |
/* Don't update the screen too often. So update it once in every 200ms */ |
98a024616010
(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
parents:
7067
diff
changeset
|
949 |
if (!_network_dedicated && _tp.timer != 0 && _realtime_tick - _tp.timer < 200) return; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
950 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
951 |
/* Percentage is about the number of completed tasks, so 'current - 1' */ |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
952 |
_tp.percent = percent_table[cls] + (percent_table[cls + 1] - percent_table[cls]) * (_tp.current == 0 ? 0 : _tp.current - 1) / _tp.total; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
953 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
954 |
if (_network_dedicated) { |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
955 |
static uint last_percent = 0; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
956 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
957 |
/* Never display 0% */ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
958 |
if (_tp.percent == 0) return; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
959 |
/* Reset if percent is lower then the last recorded */ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
960 |
if (_tp.percent < last_percent) last_percent = 0; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
961 |
/* Display every 5%, but 6% is also very valid.. just not smaller steps then 5% */ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
962 |
if (_tp.percent % 5 != 0 && _tp.percent <= last_percent + 5) return; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
963 |
/* Never show steps smaller then 2%, even if it is a mod 5% */ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
964 |
if (_tp.percent <= last_percent + 2) return; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
965 |
|
5568
75f13d7bfaed
(svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate debugging levels to
Darkvater
parents:
5228
diff
changeset
|
966 |
DEBUG(net, 1, "Map generation percentage complete: %d", _tp.percent); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
967 |
last_percent = _tp.percent; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
968 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
969 |
/* Don't continue as dedicated never has a thread running */ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
970 |
return; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
971 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
972 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
973 |
InvalidateWindow(WC_GENERATE_PROGRESS_WINDOW, 0); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
974 |
MarkWholeScreenDirty(); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
975 |
SetGeneratingWorldPaintStatus(true); |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
976 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
977 |
/* We wait here till the paint is done, so we don't read and write |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
978 |
* on the same tile at the same moment. Nasty hack, but that happens |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
979 |
* if you implement threading afterwards */ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
980 |
while (IsGeneratingWorldReadyForPaint()) { CSleep(10); } |
7619
ebef4067b88a
(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
parents:
7599
diff
changeset
|
981 |
|
ebef4067b88a
(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
parents:
7599
diff
changeset
|
982 |
_tp.timer = _realtime_tick; |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
983 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
984 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
985 |
/** |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
986 |
* Set the total of a stage of the world generation. |
6977
67b989528f3d
(svn r9662) -Documentation: Doxygen corrections and @file omissions
belugas
parents:
6683
diff
changeset
|
987 |
* @param cls the current class we are in. |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
988 |
* @param total Set the total expected items for this class. |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
989 |
* |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
990 |
* Warning: this function isn't clever. Don't go from class 4 to 3. Go upwards, always. |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
991 |
* Also, progress works if total is zero, total works if progress is zero. |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
992 |
*/ |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
993 |
void SetGeneratingWorldProgress(gwp_class cls, uint total) |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
994 |
{ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
995 |
if (total == 0) return; |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
996 |
|
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
997 |
_SetGeneratingWorldProgress(cls, 0, total); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
998 |
} |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
999 |
|
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1000 |
/** |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1001 |
* Increases the current stage of the world generation with one. |
6977
67b989528f3d
(svn r9662) -Documentation: Doxygen corrections and @file omissions
belugas
parents:
6683
diff
changeset
|
1002 |
* @param cls the current class we are in. |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1003 |
* |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1004 |
* Warning: this function isn't clever. Don't go from class 4 to 3. Go upwards, always. |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1005 |
* Also, progress works if total is zero, total works if progress is zero. |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1006 |
*/ |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
1007 |
void IncreaseGeneratingWorldProgress(gwp_class cls) |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1008 |
{ |
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1009 |
/* In fact the param 'class' isn't needed.. but for some security reasons, we want it around */ |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5835
diff
changeset
|
1010 |
_SetGeneratingWorldProgress(cls, 1, 0); |
4300
687a17c9c557
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
diff
changeset
|
1011 |
} |