OpenTTD Source
12.0-beta2
|
#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 "core/random_func.hpp"
#include "sound_func.h"
#include "strings_func.h"
#include "zoom_func.h"
#include "tree_map.h"
#include "widgets/tree_widget.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "table/tree_land.h"
#include "safeguards.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. More... | |
uint | PlaceTreeGroupAroundTile (TileIndex tile, TreeType treetype, uint radius, uint count) |
Place some trees in a radius around a tile. More... | |
static Dimension | GetMaxTreeSpriteSize () |
Calculate the maximum size of all tree sprites. More... | |
static NWidgetBase * | MakeTreeTypeButtons (int *biggest_index) |
Make widgets for the current available tree types. More... | |
void | ShowBuildTreesToolbar () |
Variables | |
const PalSpriteID | tree_sprites [] |
Tree Sprites with their palettes. More... | |
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)) |
GUIs for building trees.
Definition in file tree_gui.cpp.
|
static |
Calculate the maximum size of all tree sprites.
Definition at line 52 of file tree_gui.cpp.
Referenced by BuildTreesWindow::UpdateWidgetSize().
|
static |
Make widgets for the current available tree types.
This does not use a NWID_MATRIX or WWT_MATRIX control as those are more difficult to get producing the correct result than dynamically building the widgets is.
Definition at line 259 of file tree_gui.cpp.
Place some trees in a radius around a tile.
The trees are placed in an quasi-normal distribution around the indicated tile, meaning that while the radius does define a square, the distribution inside the square will be roughly circular.
tile | Tile to place trees around. |
treetype | Type of trees to place. Must be a valid tree type for the climate. |
radius | Maximum distance (on each axis) from tile to place trees. |
count | Maximum number of trees to place. |
Definition at line 306 of file tree_cmd.cpp.
References TREE_CACTUS, TREE_COUNT_TOYLAND, and TREE_TOYLAND.
void PlaceTreesRandomly | ( | ) |
Place some trees randomly.
This function just place some trees randomly on the map.
Definition at line 247 of file tree_cmd.cpp.
References DEFAULT_TREE_STEPS, and ScaleByMapSize().
|
static |
Definition at line 289 of file tree_gui.cpp.
const PalSpriteID tree_sprites[] |
Tree Sprites with their palettes.
Definition at line 35 of file tree_gui.cpp.
Referenced by BuildTreesWindow::DrawWidget().