# tree_gui.cpp File Reference

GUIs for building trees. More...

`#include "stdafx.h"`
`#include "openttd.h"`
`#include "window_gui.h"`
`#include "gfx_func.h"`
`#include "tilehighlight_func.h"`
`#include "company_func.h"`
`#include "company_base.h"`
`#include "command_func.h"`
`#include "sound_func.h"`
`#include "table/sprites.h"`
`#include "table/strings.h"`
`#include "table/tree_land.h"`

Go to the source code of this file.

## Data Structures
class | BuildTreesWindow
| The build trees window. More...
## Enumerations
enum | BuildTreesWidgets { BTW_TYPE_11, BTW_TYPE_12, BTW_TYPE_13, BTW_TYPE_14, BTW_TYPE_21, BTW_TYPE_22, BTW_TYPE_23, BTW_TYPE_24, BTW_TYPE_31, BTW_TYPE_32, BTW_TYPE_33, BTW_TYPE_34, BTW_TYPE_RANDOM, BTW_MANY_RANDOM }
| Widget definitions for the build trees window. More...
## Functions
void | PlaceTreesRandomly ()
| Place some trees randomly.
void | ShowBuildTreesToolbar ()
## Variables
static const NWidgetPart | _nested_build_trees_widgets []
static const WindowDesc | _build_trees_desc (WDP_AUTO, 0, 0, WC_BUILD_TREES, WC_NONE, WDF_CONSTRUCTION, _nested_build_trees_widgets, lengthof(_nested_build_trees_widgets))

## Detailed Description

GUIs for building trees.

Definition in file tree_gui.cpp.

## Enumeration Type Documentation

enum BuildTreesWidgets

Widget definitions for the build trees window.

Definition at line 29 of file tree_gui.cpp.

## Function Documentation

void PlaceTreesRandomly | ( |  | ) |

Place some trees randomly.

This function just place some trees randomly on the map.

Definition at line 256 of file tree_cmd.cpp.

References _settings_game, CanPlantTreesOnTile(), GameSettings::game_creation, GetSnowLine(), GetTileZ(), GetTropicZone(), GWP_TREE, IncreaseGeneratingWorldProgress(), GameCreationSettings::landscape, PlaceTree(), PlaceTreeAtSameHeight(), RandomTileSeed(), ScaleByMapSize(), TILE_HEIGHT, TP_IMPROVED, GameCreationSettings::tree_placer, and TROPICZONE_RAINFOREST.

Referenced by GenerateTrees(), and BuildTreesWindow::OnClick().