# 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 "settings_type.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
## Functions
void | PlaceTreesRandomly ()
| Place some trees randomly.
void | ShowBuildTreesToolbar ()
## Variables
static const Widget | _build_trees_widgets []
static const WindowDesc | _build_trees_desc (WDP_AUTO, WDP_AUTO, 143, 184, 143, 184, WC_BUILD_TREES, WC_NONE, WDF_STD_TOOLTIPS|WDF_STD_BTN|WDF_DEF_WIDGET|WDF_CONSTRUCTION, _build_trees_widgets)

## Detailed Description

GUIs for building trees.

Definition in 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 238 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().

## Variable Documentation

const Widget _build_trees_widgets[]`[static]`

Initial value:

     {
    {   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
    {    WWT_CAPTION,   RESIZE_NONE,  COLOUR_DARK_GREEN,  11,   142,     0,    13, STR_2802_TREES,        STR_018C_WINDOW_TITLE_DRAG_THIS},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_DARK_GREEN,   0,   142,    14,   183, 0x0,                   STR_NULL},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         2,    35,    16,    61, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        37,    70,    16,    61, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        72,   105,    16,    61, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,       107,   140,    16,    61, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         2,    35,    63,   108, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        37,    70,    63,   108, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        72,   105,    63,   108, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,       107,   140,    63,   108, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,         2,    35,   110,   155, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        37,    70,   110,   155, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,        72,   105,   110,   155, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {      WWT_PANEL,   RESIZE_NONE,  COLOUR_GREY,       107,   140,   110,   155, 0x0,                   STR_280D_SELECT_TREE_TYPE_TO_PLANT},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,         2,   140,   157,   168, STR_TREES_RANDOM_TYPE, STR_TREES_RANDOM_TYPE_TIP},
    {    WWT_TEXTBTN,   RESIZE_NONE,  COLOUR_GREY,         2,   140,   170,   181, STR_028A_RANDOM_TREES, STR_028B_PLANT_TREES_RANDOMLY_OVER},
    {    WIDGETS_END},
    }

Definition at line 153 of file tree_gui.cpp.