Go to the documentation of this file.
42 extern void MakeNewgameSettingsLive();
112 NWidget(
WWT_TEXT, COLOUR_ORANGE),
SetDataTip(STR_MAPGEN_BY, STR_NULL),
SetPadding(1, 0, 0, 0),
SetFill(1, 1),
178 NWidget(
WWT_TEXT, COLOUR_ORANGE),
SetDataTip(STR_MAPGEN_NORTHWEST, STR_NULL),
SetPadding(1, 0, 0, 0),
SetFill(0, 1),
183 NWidget(
WWT_TEXT, COLOUR_ORANGE),
SetDataTip(STR_MAPGEN_NORTHEAST, STR_NULL),
SetPadding(1, 0, 0, 0),
SetFill(0, 1),
190 NWidget(
WWT_TEXT, COLOUR_ORANGE),
SetDataTip(STR_MAPGEN_SOUTHWEST, STR_NULL),
SetPadding(1, 0, 0, 0),
SetFill(0, 1),
195 NWidget(
WWT_TEXT, COLOUR_ORANGE),
SetDataTip(STR_MAPGEN_SOUTHEAST, STR_NULL),
SetPadding(1, 0, 0, 0),
SetFill(0, 1),
208 NWidget(
WWT_PUSHTXTBTN, COLOUR_GREEN,
WID_GL_GENERATE_BUTTON),
SetMinimalSize(84, 36),
SetDataTip(STR_MAPGEN_GENERATE, STR_NULL),
SetPadding(0, 10, 0, 10),
SetFill(1, 1),
258 NWidget(
WWT_TEXT, COLOUR_ORANGE),
SetDataTip(STR_MAPGEN_BY, STR_NULL),
SetPadding(1, 0, 0, 0),
SetFill(1, 1),
327 NWidget(
WWT_PUSHTXTBTN, COLOUR_GREEN,
WID_GL_GENERATE_BUTTON),
SetMinimalSize(84, 36),
SetDataTip(STR_MAPGEN_GENERATE, STR_NULL),
SetPadding(0, 10, 0, 10),
SetFill(1, 1),
338 MakeNewgameSettingsLive();
346 default: NOT_REACHED();
350 static void LandscapeGenerationCallback(
Window *w,
bool confirmed)
361 item->SetParam(0, 1LL << i);
362 list.emplace_back(item);
373 const auto &grf_names = GetGRFTownNameList();
374 for (uint i = 0; i < grf_names.size(); i++) {
379 size_t newgrf_size = list.size();
381 if (newgrf_size > 0) {
396 static const StringID _elevations[] = {STR_TERRAIN_TYPE_VERY_FLAT, STR_TERRAIN_TYPE_FLAT, STR_TERRAIN_TYPE_HILLY, STR_TERRAIN_TYPE_MOUNTAINOUS, STR_TERRAIN_TYPE_ALPINIST, STR_TERRAIN_TYPE_CUSTOM,
INVALID_STRING_ID};
397 static const StringID _sea_lakes[] = {STR_SEA_LEVEL_VERY_LOW, STR_SEA_LEVEL_LOW, STR_SEA_LEVEL_MEDIUM, STR_SEA_LEVEL_HIGH, STR_SEA_LEVEL_CUSTOM,
INVALID_STRING_ID};
398 static const StringID _rivers[] = {STR_RIVERS_NONE, STR_RIVERS_FEW, STR_RIVERS_MODERATE, STR_RIVERS_LOT,
INVALID_STRING_ID};
399 static const StringID _smoothness[] = {STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH,
INVALID_STRING_ID};
400 static const StringID _rotation[] = {STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE, STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_CLOCKWISE,
INVALID_STRING_ID};
401 static const StringID _landscape[] = {STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL, STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS,
INVALID_STRING_ID};
402 static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, STR_NUM_CUSTOM,
INVALID_STRING_ID};
403 static const StringID _num_inds[] = {STR_FUNDING_ONLY, STR_MINIMAL, STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, STR_NUM_CUSTOM,
INVALID_STRING_ID};
404 static const StringID _variety[] = {STR_VARIETY_NONE, STR_VARIETY_VERY_LOW, STR_VARIETY_LOW, STR_VARIETY_MEDIUM, STR_VARIETY_HIGH, STR_VARIETY_VERY_HIGH,
INVALID_STRING_ID};
446 if (_game_mode == GM_EDITOR) {
459 STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH + gen :
466 if (_game_mode == GM_EDITOR) {
480 SetDParam(0, STR_TERRAIN_TYPE_CUSTOM_VALUE);
489 SetDParam(0, STR_SEA_LEVEL_CUSTOM_PERCENTAGE);
526 if (!gui_scope)
return;
558 int climate_plane = 0;
560 case LT_TEMPERATE: climate_plane = 2;
break;
561 case LT_ARCTIC: climate_plane = 0;
break;
562 case LT_TROPIC: climate_plane = 1;
break;
563 case LT_TOYLAND: climate_plane = 2;
break;
676 if (strs !=
nullptr) {
681 size->width += padding.width;
732 STR_WARNING_HEIGHTMAP_SCALE_CAPTION,
733 STR_WARNING_HEIGHTMAP_SCALE_MESSAGE,
735 LandscapeGenerationCallback);
737 StartGeneratingLandscape(mode);
829 uint32 hidden_mask = 0;
895 const int *widget = (mode ==
GLWM_HEIGHTMAP) ? heightmap_raise_widgets : newgame_raise_widgets;
925 this->widget_id = widget;
941 this->widget_id = widget;
950 this->widget_id = widget;
960 this->widget_id = widget;
974 if (str ==
nullptr)
return;
981 switch (this->widget_id) {
990 default: NOT_REACHED();
994 switch (this->widget_id) {
1159 str = STR_BLACK_DATE_LONG;
1175 size->width += padding.width;
1176 size->height += padding.height;
1247 for (
const int *widget = raise_widgets; *widget !=
WIDGET_LIST_END; widget++) {
1267 int32 value = atoi(str);
1269 switch (this->widget_id) {
1286 static const NWidgetPart _nested_create_scenario_widgets[] = {
1342 _nested_create_scenario_widgets,
lengthof(_nested_create_scenario_widgets)
1352 static const NWidgetPart _nested_generate_progress_widgets[] = {
1368 _nested_generate_progress_widgets,
lengthof(_nested_generate_progress_widgets)
1376 std::chrono::steady_clock::time_point next_update;
1381 static const StringID _generation_class_table[] = {
1382 STR_GENERATION_WORLD_GENERATION,
1383 STR_SCENEDIT_TOOLBAR_LANDSCAPE_GENERATION,
1384 STR_GENERATION_RIVER_GENERATION,
1385 STR_GENERATION_CLEARING_TILES,
1386 STR_SCENEDIT_TOOLBAR_TOWN_GENERATION,
1387 STR_SCENEDIT_TOOLBAR_INDUSTRY_GENERATION,
1388 STR_GENERATION_OBJECT_GENERATION,
1389 STR_GENERATION_TREE_GENERATION,
1390 STR_GENERATION_SETTINGUP_GAME,
1391 STR_GENERATION_PREPARING_TILELOOP,
1392 STR_GENERATION_PREPARING_SCRIPT,
1393 STR_GENERATION_PREPARING_GAME
1395 static_assert(
lengthof(_generation_class_table) == GWP_CLASS_COUNT);
1398 static void AbortGeneratingWorldCallback(
Window *w,
bool confirmed)
1420 STR_GENERATION_ABORT_CAPTION,
1421 STR_GENERATION_ABORT_MESSAGE,
1423 AbortGeneratingWorldCallback
1442 for (uint i = 0; i < GWP_CLASS_COUNT; i++) {
1480 _gws.cls = STR_GENERATION_WORLD_GENERATION;
1484 _gws.next_update = std::chrono::steady_clock::now();
1496 static void _SetGeneratingWorldProgress(
GenWorldProgress cls, uint progress, uint total)
1498 static const int percent_table[] = {0, 5, 14, 17, 20, 40, 60, 65, 80, 85, 95, 99, 100 };
1499 static_assert(
lengthof(percent_table) == GWP_CLASS_COUNT + 1);
1500 assert(cls < GWP_CLASS_COUNT);
1514 assert(_gws.cls == _generation_class_table[cls]);
1515 _gws.current += progress;
1516 assert(_gws.current <= _gws.total);
1518 _gws.cls = _generation_class_table[cls];
1519 _gws.current = progress;
1521 _gws.percent = percent_table[cls];
1525 _gws.percent = percent_table[cls] + (percent_table[cls + 1] - percent_table[cls]) * (_gws.current == 0 ? 0 : _gws.current - 1) / _gws.total;
1528 static uint last_percent = 0;
1531 if (_gws.percent == 0)
return;
1533 if (_gws.percent < last_percent) last_percent = 0;
1535 if (_gws.percent % 5 != 0 && _gws.percent <= last_percent + 5)
return;
1537 if (_gws.percent <= last_percent + 2)
return;
1539 Debug(net, 3,
"Map generation percentage complete: {}", _gws.percent);
1540 last_percent = _gws.percent;
1560 if (total == 0)
return;
1562 _SetGeneratingWorldProgress(cls, 0, total);
1575 _SetGeneratingWorldProgress(cls, 1, 0);
char title[255]
Internal name of the game.
void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFConfig **config)
Setup the NewGRF gui.
void SetMouseCursorBusy(bool busy)
Set or unset the ZZZ cursor.
uint32 generation_seed
noise seed for world generation
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
void SetNewLandscapeType(byte landscape)
Changes landscape type and sets genworld window dirty.
uint8 timeout_timer
Timer value of the WF_TIMEOUT for flags.
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
String list item with parameters.
@ SM_START_HEIGHTMAP
Load a heightmap and start a new game from it.
Dimensions (a width and height) of a rectangle in 2D.
byte custom_sea_level
manually entered percentage of water in the map
void ShowCreateScenario()
Show the window to create a scenario.
void AbortGeneratingWorld()
Initializes the abortion process.
uint8 map_y
Y size of map.
Rect Shrink(int s) const
Copy and shrink Rect by s pixels.
byte landscape
the landscape we're currently in
@ ID_CUSTOM
Custom number of industries.
byte tgen_smoothness
how rough is the terrain from 0-3
static const uint CUSTOM_SEA_LEVEL_MIN_PERCENTAGE
Minimum percentage a user can specify for custom sea level.
void OnDropdownSelect(int widget, int index) override
A dropdown option associated to this window has been selected.
@ WC_SELECT_GAME
Select game window; Window numbers:
@ HM_CLOCKWISE
Rotate the map clockwise 45 degrees.
@ SM_EDITOR
Switch to scenario editor.
static const uint MIN_MAP_SIZE_BITS
Minimal and maximal map width and height.
std::string name
Name of the file.
std::vector< std::unique_ptr< const DropDownListItem > > DropDownList
A drop down list is a collection of drop down list items.
uint8 map_height_limit
the maximum allowed heightlevel
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
@ LG_ORIGINAL
The original landscape generator.
DifficultySettings difficulty
settings related to the difficulty
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
byte variety
variety level applied to TGP
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
@ SND_15_BEEP
19 == 0x13 GUI button click
byte town_name
the town name generator used for town names
@ WC_GENERATE_LANDSCAPE
Generate landscape (newgame); Window numbers:
Base list item class from which others are derived.
ClientSettings _settings_client
The current settings for this game.
int DrawString(int left, int right, int top, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
static const uint MIN_CUSTOM_TERRAIN_TYPE
Lowest possible peak value for world generation.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
int32 WindowNumber
Number to differentiate different windows of the same class.
@ FR_LOWERED
If set the frame is lowered and the background colour brighter (ie. buttons when pressed)
static const uint MAX_TILE_HEIGHT
Maximum allowed tile height.
void HandleButtonClick(byte widget)
Do all things to make a button look clicked and mark it to be unclicked in a few ticks.
Window(WindowDesc *desc)
Empty constructor, initialization has been moved to InitNested() called from the constructor of the d...
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
byte heightmap_height
highest mountain for heightmap (towards what it scales)
Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize)
Return the string dimension in pixels.
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
Update size and resize step of a widget in the window.
GameCreationSettings game_creation
settings used during the creation of a game (map)
static const NWidgetPart _nested_heightmap_load_widgets[]
Widgets of GenerateLandscapeWindow when loading heightmap.
@ WN_GAME_OPTIONS_GAME_OPTIONS
Game options.
High level window description.
static constexpr size_t MAX_SIZE
Make template parameter accessible from outside.
@ WC_MODAL_PROGRESS
Progress report of landscape generation; Window numbers:
void PrepareGenerateWorldProgress()
Initializes the progress counters to the starting point.
static const uint CUSTOM_TOWN_MAX_NUMBER
this is the maximum number of towns a user can specify in customisation
void ClearErrorMessages()
Clear all errors from the queue.
ResizeInfo resize
Resize information.
GenerateLandscapeWindowMode
Enum for the modes we can generate in.
SoundSettings sound
sound effect settings
void SetMouseCursor(CursorID sprite, PaletteID pal)
Assign a single non-animated sprite to the cursor.
void ShowGenerateLandscape()
Start with a normal game.
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
@ SM_NEWGAME
New Game --> 'Random game'.
static const Year MIN_YEAR
The absolute minimum & maximum years in OTTD.
static const uint MAX_MAP_HEIGHT_LIMIT
Upper bound of maximum allowed heightlevel (in the construction settings)
byte terrain_type
the mountainousness of the landscape
uint16 custom_town_number
manually entered number of towns
void SetDirty() const
Mark entire window as dirty (in need of re-paint)
Date ConvertYMDToDate(Year year, Month month, Day day)
Converts a tuple of Year, Month and Day to a Date.
uint Horizontal() const
Get total horizontal padding of RectPadding.
static const uint DEF_DESERT_COVERAGE
Default desert coverage.
byte water_borders
bitset of the borders that are water
void ShowDropDownList(Window *w, DropDownList &&list, int selected, int button, uint width, bool auto_width, bool instant_close)
Show a drop down list.
static const uint CUSTOM_SEA_LEVEL_MAX_PERCENTAGE
Maximum percentage a user can specify for custom sea level.
static const uint MAP_HEIGHT_LIMIT_AUTO_MINIMUM
When map height limit is auto, make this the lowest possible map height limit.
void SetWidgetDisabledState(byte widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
void OnTimeout() override
Called when this window's timeout has been reached.
void ShowQueryString(StringID str, StringID caption, uint maxsize, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
Show a query popup window with a textbox in it.
WindowFlags flags
Window flags.
byte custom_terrain_type
manually entered height for TGP to aim for
bool freeform_edges
allow terraforming the tiles at the map edges
@ WF_TIMEOUT
Window timeout counter.
static bool StrEmpty(const char *s)
Check if a string buffer is empty.
byte quantity_sea_lakes
the amount of seas/lakes
byte industry_density
The industry density.
byte se_flat_world_height
land height a flat world gets in SE
Rect WithWidth(int width, bool end) const
Copy Rect and set its width.
@ GLWM_SCENARIO
Generate flat land.
Coordinates of a point in 2D.
void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask, uint width)
Show a dropdown menu window near a widget of the parent window.
bool _network_dedicated
are we a dedicated server?
@ SM_GENRANDLAND
Generate random land within scenario editor.
WindowNumber window_number
Window number within the window class.
uint Vertical() const
Get total vertical padding of RectPadding.
void ShowGSConfigWindow()
Open the GS config window.
void IncreaseGeneratingWorldProgress(GenWorldProgress cls)
Increases the current stage of the world generation with one.
void InvalidateData(int data=0, bool gui_scope=true)
Mark this window's data as invalid (in need of re-computing)
static VideoDriver * GetInstance()
Get the currently active instance of the video driver.
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
@ SA_HOR_CENTER
Horizontally center the text.
static constexpr uint BUILTIN_TOWNNAME_GENERATOR_COUNT
Number of built-in town name generators.
void ShowHeightmapLoad()
Start with loading a heightmap.
bool GetHeightmapDimensions(DetailedFileType dft, const char *filename, uint *x, uint *y)
Get the dimensions of a heightmap.
void StartNewGameWithoutGUI(uint32 seed)
Start a normal game without the GUI.
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
Update size and resize step of a widget in the window.
@ SM_LOAD_HEIGHTMAP
Load heightmap from scenario editor.
GenWorldProgress
Current stage of world generation process.
void GameLoopPause()
Pause the game-loop for a bit, releasing the game-state lock.
static const uint MIN_HEIGHTMAP_HEIGHT
Lowest possible peak value for heightmap creation.
SwitchMode _switch_mode
The next mainloop command.
@ GLWM_HEIGHTMAP
Load from heightmap.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
Update size and resize step of a widget in the window.
void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallbackProc *callback)
Show a modal confirmation window with standard 'yes' and 'no' buttons The window is aligned to the ce...
bool confirm
Play sound effect on successful constructions or other actions.
byte heightmap_rotation
rotation director for the heightmap
@ WC_GAME_OPTIONS
Game options window; Window numbers:
static T Clamp(const T a, const T min, const T max)
Clamp a value between an interval.
static const uint MIN_MAP_HEIGHT_LIMIT
Lower bound of maximum allowed heightlevel (in the construction settings)
static const uint MAX_MAP_SIZE_BITS
Maximal size of map is equal to 2 ^ MAX_MAP_SIZE_BITS.
static size_t GetNumItems()
Returns number of valid items in the pool.
void ShowGenerateWorldProgress()
Show the window where a user can follow the process of the map generation.
void SetStringParameters(int widget) const override
Initialize string parameters for a widget.
void HandleGeneratingWorldAbortion()
Really handle the abortion, i.e.
uint8 map_x
X size of map.
byte desert_coverage
the amount of desert coverage on the map
byte amount_of_rivers
the amount of rivers
byte land_generator
the landscape generator
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
void OnTimeout() override
Called when this window's timeout has been reached.
void SetDParamMaxValue(uint n, uint64 max_value, uint min_count, FontSize size)
Set DParam n to some number that is suitable for string size computations.
void CloseWindowByClass(WindowClass cls)
Close all windows of a given class.
void InvalidateWindowClassesData(WindowClass cls, int data, bool gui_scope)
Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by de...
FileToSaveLoad _file_to_saveload
File to save or load in the openttd loop.
void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets,...)
Sets the enabled/disabled status of a list of widgets.
static const uint CUSTOM_TERRAIN_TYPE_NUMBER_DIFFICULTY
Value for custom terrain type in difficulty settings.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
bool IsWidgetLowered(byte widget_index) const
Gets the lowered state of a widget.
void OnQueryTextFinished(char *str) override
The query window opened from this window has closed.
uint16 custom_industry_number
manually entered number of industries
@ GLWM_GENERATE
Generate new game.
Year starting_year
starting date
static const Year DEF_START_YEAR
The default starting year.
static int CenterBounds(int min, int max, int size)
Determine where to draw a centred object inside a widget.
static T ToggleBit(T &x, const uint8 y)
Toggles a bit in a variable.
#define Debug(name, level, format_string,...)
Ouptut a line of debugging information.
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
#define lengthof(x)
Return the length of an fixed size array.
int width
width of the window (number of pixels to the right in x direction)
bool IsGeneratingWorldAborted()
Is the generation being aborted?
byte snow_coverage
the amount of snow coverage on the map
static const NWidgetPart _nested_generate_landscape_widgets[]
Widgets of GenerateLandscapeWindow when generating world.
void StartScenarioEditor()
Start with a scenario editor.
@ ID_END
Number of industry density settings.
void SetGeneratingWorldProgress(GenWorldProgress cls, uint total)
Set the total of a stage of the world generation.
ConstructionSettings construction
construction of things in-game
void CloseAllNonVitalWindows()
It is possible that a stickied window gets to a position where the 'close' button is outside the gami...
Data structure for an opened window.
DetailedFileType detail_ftype
Concrete file type (PNG, BMP, old save, etc).
static uint GetMapHeightLimit()
Get the map height limit, or if set to "auto", the absolute limit.
void ResetGRFConfig(bool defaults)
Reset the current GRF Config to either blank or newgame settings.
void RaiseWidget(byte widget_index)
Marks a widget as raised.
void DrawWidgets() const
Paint all widgets of a window.
static bool HasModalProgress()
Check if we are currently in a modal progress state.
static const uint MAX_MAP_SIZE
Maximal map size = 4096.
int Width() const
Get width of Rect.
char * strecpy(char *dst, const char *src, const char *last)
Copies characters from one buffer to another.
static const uint CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY
Value for custom sea level in difficulty settings.
void SetWidgetDirty(byte widget_index) const
Invalidate a widget, i.e.
void ShowAIConfigWindow()
Open the AI config window.
Specification of a rectangle with absolute coordinates of all edges.
void LowerWidget(byte widget_index)
Marks a widget as lowered.
Window * BringWindowToFrontById(WindowClass cls, WindowNumber number)
Find a window and make it the relative top-window on the screen.
byte number_towns
the amount of towns
@ QSF_ENABLE_DEFAULT
enable the 'Default' button ("\0" is returned)
void OnPaint() override
The window must be repainted.
#define lastof(x)
Get the last element of an fixed size array.
@ WDP_CENTER
Center the window.
void SetWidgetLoweredState(byte widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
void OnQueryTextFinished(char *str) override
The query window opened from this window has closed.
bool _left_button_clicked
Is left mouse button clicked?
@ CS_NUMERAL
Only numeric ones.
void SetStringParameters(int widget) const override
Initialize string parameters for a widget.
void OnDropdownSelect(int widget, int index) override
A dropdown option associated to this window has been selected.
static const uint CUSTOM_TOWN_NUMBER_DIFFICULTY
value for custom town number in difficulty settings
void SetDParamStr(uint n, const char *str)
This function is used to "bind" a C string to a OpenTTD dparam slot.
GameSettings _settings_newgame
Game settings for new games (updated from the intro screen).
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
@ FR_BORDERONLY
Draw border only, no background.
GRFConfig * _grfconfig_newgame
First item in list of default GRF set up.
static const Year MAX_YEAR
MAX_YEAR, nicely rounded value of the number of years that can be encoded in a single 32 bits date,...
static const uint DEF_SNOW_COVERAGE
Default snow coverage.
static bool NatSortFunc(std::unique_ptr< const DropDownListItem > const &first, std::unique_ptr< const DropDownListItem > const &second)
Natural sorting comparator function for DropDownList::sort().