Data Structures | Functions | Variables

# tree_gui.cpp File Reference

GUIs for building trees. More...

`#include "stdafx.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 "tree_map.h"`
`#include "widgets/tree_widget.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...
## Functions
void | PlaceTreesRandomly ()
| Place some trees randomly.
void | ShowBuildTreesToolbar ()
## Variables
const PalSpriteID | tree_sprites []
| Tree Sprites with their palettes.
static const NWidgetPart | _nested_build_trees_widgets []
static WindowDesc | _build_trees_desc (WDP_AUTO,"build_tree", 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.

## Function Documentation

void PlaceTreesRandomly | ( |  | ) |

Place some trees randomly.

This function just place some trees randomly on the map.

Definition at line 244 of file tree_cmd.cpp.

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

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

## Variable Documentation

const PalSpriteID tree_sprites[]

Initial value:

     {
      { 1621, PAL_NONE }, { 1587, PAL_NONE }, { 1656, PAL_NONE }, { 1579, PAL_NONE },
      { 1607, PAL_NONE }, { 1593, PAL_NONE }, { 1614, PAL_NONE }, { 1586, PAL_NONE },
      { 1663, PAL_NONE }, { 1677, PAL_NONE }, { 1691, PAL_NONE }, { 1705, PAL_NONE },
      { 1711, PAL_NONE }, { 1746, PAL_NONE }, { 1753, PAL_NONE }, { 1732, PAL_NONE },
      { 1739, PAL_NONE }, { 1718, PAL_NONE }, { 1725, PAL_NONE }, { 1760, PAL_NONE },
      { 1838, PAL_NONE }, { 1844, PAL_NONE }, { 1866, PAL_NONE }, { 1871, PAL_NONE },
      { 1899, PAL_NONE }, { 1935, PAL_NONE }, { 1928, PAL_NONE }, { 1915, PAL_NONE },
      { 1887, PAL_NONE }, { 1908, PAL_NONE }, { 1824, PAL_NONE }, { 1943, PAL_NONE },
      { 1950, PAL_NONE }, { 1957, PALETTE_TO_GREEN }, { 1964, PALETTE_TO_RED },        { 1971, PAL_NONE },
      { 1978, PAL_NONE }, { 1985, PALETTE_TO_RED, },  { 1992, PALETTE_TO_PALE_GREEN }, { 1999, PALETTE_TO_YELLOW }, { 2006, PALETTE_TO_RED }
    }

Tree Sprites with their palettes.

Definition at line 31 of file tree_gui.cpp.