OpenTTD

tree_gui.cpp
Go to the documentation of this file.
1 /* $Id: tree_gui.cpp 26482 2014-04-23 20:13:33Z rubidium $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #include "stdafx.h"
13 #include "window_gui.h"
14 #include "gfx_func.h"
15 #include "tilehighlight_func.h"
16 #include "company_func.h"
17 #include "company_base.h"
18 #include "command_func.h"
19 #include "sound_func.h"
20 #include "tree_map.h"
21
22 #include "widgets/tree_widget.h"
23
24 #include "table/sprites.h"
25 #include "table/strings.h"
26 #include "table/tree_land.h"
27
28 #include "safeguards.h"
29
30 void PlaceTreesRandomly();
31
33 const PalSpriteID tree_sprites[] = {
34 { 1621, PAL_NONE }, { 1587, PAL_NONE }, { 1656, PAL_NONE }, { 1579, PAL_NONE },
35 { 1607, PAL_NONE }, { 1593, PAL_NONE }, { 1614, PAL_NONE }, { 1586, PAL_NONE },
36 { 1663, PAL_NONE }, { 1677, PAL_NONE }, { 1691, PAL_NONE }, { 1705, PAL_NONE },
37 { 1711, PAL_NONE }, { 1746, PAL_NONE }, { 1753, PAL_NONE }, { 1732, PAL_NONE },
38 { 1739, PAL_NONE }, { 1718, PAL_NONE }, { 1725, PAL_NONE }, { 1760, PAL_NONE },
39 { 1838, PAL_NONE }, { 1844, PAL_NONE }, { 1866, PAL_NONE }, { 1871, PAL_NONE },
40 { 1899, PAL_NONE }, { 1935, PAL_NONE }, { 1928, PAL_NONE }, { 1915, PAL_NONE },
41 { 1887, PAL_NONE }, { 1908, PAL_NONE }, { 1824, PAL_NONE }, { 1943, PAL_NONE },
42 { 1950, PAL_NONE }, { 1957, PALETTE_TO_GREEN }, { 1964, PALETTE_TO_RED }, { 1971, PAL_NONE },
43 { 1978, PAL_NONE }, { 1985, PALETTE_TO_RED, }, { 1992, PALETTE_TO_PALE_GREEN }, { 1999, PALETTE_TO_YELLOW }, { 2006, PALETTE_TO_RED }
44 };
45
46
50 class BuildTreesWindow : public Window
51 {
52 uint16 base;
53 uint16 count;
54 TreeType tree_to_plant;
55
56 public:
57 BuildTreesWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
58 {
59 this->InitNested(window_number);
60 ResetObjectToPlace();
61 }
62
67 Dimension GetMaxTreeSpriteSize()
68 {
69 Dimension size, this_size;
70 Point offset;
71 /* Avoid to use it uninitialized */
72 size.width = 32; // default width - 2
73 size.height = 39; // default height - 7
74 offset.x = 0;
75 offset.y = 0;
76
77 for (int i = this->base; i < this->base + this->count; i++) {
78 if (i >= (int)lengthof(tree_sprites)) return size;
79 this_size = GetSpriteSize(tree_sprites[i].sprite, &offset);
80 size.width = max<int>(size.width, 2 * max<int>(this_size.width, -offset.x));
81 size.height = max<int>(size.height, max<int>(this_size.height, -offset.y));
82 }
83
84 return size;
85 }
86
87 virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
88 {
89 if (widget >= WID_BT_TYPE_11 && widget <= WID_BT_TYPE_34) {
90 Dimension d = GetMaxTreeSpriteSize();
91 /* Allow some pixels extra width and height */
92 size->width = d.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
93 size->height = d.height + WD_FRAMERECT_RIGHT + WD_FRAMERECT_BOTTOM + 7; // we need some more space
94 return;
95 }
96
97 if (widget != WID_BT_MANY_RANDOM) return;
98
99 if (_game_mode != GM_EDITOR) {
100 size->width = 0;
101 size->height = 0;
102 }
103 }
104
105 virtual void DrawWidget(const Rect &r, int widget) const
106 {
107 if (widget < WID_BT_TYPE_11 || widget > WID_BT_TYPE_34 || widget - WID_BT_TYPE_11 >= this->count) return;
108
109 int i = this->base + widget - WID_BT_TYPE_11;
110 /* Trees "grow" in the centre on the bottom line of the buttons */
111 DrawSprite(tree_sprites[i].sprite, tree_sprites[i].pal, (r.left + r.right) / 2 + WD_FRAMERECT_LEFT, r.bottom - 7);
112 }
113
114 virtual void OnClick(Point pt, int widget, int click_count)
115 {
116 switch (widget) {
117 case WID_BT_TYPE_11: case WID_BT_TYPE_12: case WID_BT_TYPE_13: case WID_BT_TYPE_14:
118 case WID_BT_TYPE_21: case WID_BT_TYPE_22: case WID_BT_TYPE_23: case WID_BT_TYPE_24:
119 case WID_BT_TYPE_31: case WID_BT_TYPE_32: case WID_BT_TYPE_33: case WID_BT_TYPE_34:
120 if (widget - WID_BT_TYPE_11 >= this->count) break;
121
122 if (HandlePlacePushButton(this, widget, SPR_CURSOR_TREE, HT_RECT)) {
123 this->tree_to_plant = (TreeType)(this->base + widget - WID_BT_TYPE_11);
124 }
125 break;
126
127 case WID_BT_TYPE_RANDOM: // tree of random type.
128 if (HandlePlacePushButton(this, WID_BT_TYPE_RANDOM, SPR_CURSOR_TREE, HT_RECT)) {
129 this->tree_to_plant = TREE_INVALID;
130 }
131 break;
132
133 case WID_BT_MANY_RANDOM: // place trees randomly over the landscape
134 if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
135 PlaceTreesRandomly();
136 MarkWholeScreenDirty();
137 break;
138 }
139 }
140
141 virtual void OnPlaceObject(Point pt, TileIndex tile)
142 {
143 VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_PLANT_TREES);
144 }
145
146 virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
147 {
148 VpSelectTilesWithMethod(pt.x, pt.y, select_method);
149 }
150
151 virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
152 {
153 if (pt.x != -1 && select_proc == DDSP_PLANT_TREES) {
154 DoCommandP(end_tile, this->tree_to_plant, start_tile,
155 CMD_PLANT_TREE | CMD_MSG(STR_ERROR_CAN_T_PLANT_TREE_HERE));
156 }
157 }
158
162 virtual void OnInit()
163 {
164 this->base = _tree_base_by_landscape[_settings_game.game_creation.landscape];
165 this->count = _tree_count_by_landscape[_settings_game.game_creation.landscape];
166 }
167
168 virtual void OnPlaceObjectAbort()
169 {
170 this->RaiseButtons();
171 }
172 };
173
174 static const NWidgetPart _nested_build_trees_widgets[] = {
175 NWidget(NWID_HORIZONTAL),
176 NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
177 NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_PLANT_TREE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
178 NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
179 NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
180 EndContainer(),
181 NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
182 NWidget(NWID_SPACER), SetMinimalSize(0, 2),
183 NWidget(NWID_HORIZONTAL),
184 NWidget(NWID_SPACER), SetMinimalSize(2, 0),
185 NWidget(NWID_VERTICAL),
186 NWidget(NWID_HORIZONTAL),
187 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_11), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
188 EndContainer(),
189 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
190 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_12), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
191 EndContainer(),
192 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
193 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_13), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
194 EndContainer(),
195 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
196 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_14), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
197 EndContainer(),
198 EndContainer(),
199 NWidget(NWID_SPACER), SetMinimalSize(0, 1),
200 NWidget(NWID_HORIZONTAL),
201 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_21), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
202 EndContainer(),
203 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
204 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_22), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
205 EndContainer(),
206 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
207 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_23), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
208 EndContainer(),
209 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
210 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_24), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
211 EndContainer(),
212 EndContainer(),
213 NWidget(NWID_SPACER), SetMinimalSize(0, 1),
214 NWidget(NWID_HORIZONTAL),
215 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_31), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
216 EndContainer(),
217 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
218 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_32), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
219 EndContainer(),
220 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
221 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_33), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
222 EndContainer(),
223 NWidget(NWID_SPACER), SetMinimalSize(1, 0),
224 NWidget(WWT_PANEL, COLOUR_GREY, WID_BT_TYPE_34), SetMinimalSize(34, 46), SetDataTip(0x0, STR_PLANT_TREE_TOOLTIP),
225 EndContainer(),
226 EndContainer(),
227 NWidget(NWID_SPACER), SetMinimalSize(0, 1),
228 NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BT_TYPE_RANDOM), SetMinimalSize(139, 12), SetDataTip(STR_TREES_RANDOM_TYPE, STR_TREES_RANDOM_TYPE_TOOLTIP),
229 NWidget(NWID_SPACER), SetMinimalSize(0, 1),
230 NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BT_MANY_RANDOM), SetMinimalSize(139, 12), SetDataTip(STR_TREES_RANDOM_TREES_BUTTON, STR_TREES_RANDOM_TREES_TOOLTIP),
231 NWidget(NWID_SPACER), SetMinimalSize(0, 2),
232 EndContainer(),
233 NWidget(NWID_SPACER), SetMinimalSize(2, 0),
234 EndContainer(),
235 EndContainer(),
236 };
237
238 static WindowDesc _build_trees_desc(
239 WDP_AUTO, "build_tree", 0, 0,
240 WC_BUILD_TREES, WC_NONE,
241 WDF_CONSTRUCTION,
242 _nested_build_trees_widgets, lengthof(_nested_build_trees_widgets)
243 );
244
245 void ShowBuildTreesToolbar()
246 {
247 if (_game_mode != GM_EDITOR && !Company::IsValidID(_local_company)) return;
248 AllocateWindowDescFront<BuildTreesWindow>(&_build_trees_desc, 0);
249 }
ViewportDragDropSelectionProcess
ViewportDragDropSelectionProcess
Drag and drop selection process, or, what to do with an area of land when you&#39;ve selected it...
Definition: viewport_type.h:97
_settings_game
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition: settings.cpp:77
tree_sprites
const PalSpriteID tree_sprites[]
Tree Sprites with their palettes.
Definition: tree_gui.cpp:33
company_base.h
Definition of stuff that is very close to a company, like the company struct itself.
BuildTreesWindow::OnPlaceMouseUp
virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
The user has dragged over the map when the tile highlight mode has been set.
Definition: tree_gui.cpp:151
Window::resize
ResizeInfo resize
Resize information.
Definition: window_gui.h:317
GameCreationSettings::landscape
byte landscape
the landscape we&#39;re currently in
Definition: settings_type.h:288
WindowDesc
High level window description.
Definition: window_gui.h:168
WID_BT_TYPE_32
Tree 3st column 2nd row.
Definition: tree_widget.h:26
WID_BT_TYPE_22
Tree 2st column 2nd row.
Definition: tree_widget.h:22
CMD_PLANT_TREE
plant a tree
Definition: command_type.h:213
NWID_HORIZONTAL
Horizontal container.
Definition: widget_type.h:75
PlaceTreesRandomly
void PlaceTreesRandomly()
Place some trees randomly.
Definition: tree_cmd.cpp:246
PalSpriteID
Combination of a palette sprite and a &#39;real&#39; sprite.
Definition: gfx_type.h:24
BuildTreesWindow::OnInit
virtual void OnInit()
Initialize the window data.
Definition: tree_gui.cpp:162
WWT_CLOSEBOX
Close box (at top-left of a window)
Definition: widget_type.h:69
tree_map.h
Map accessors for tree tiles.
WID_BT_MANY_RANDOM
Button to build many random trees.
Definition: tree_widget.h:30
WID_BT_TYPE_23
Tree 2st column 3rd row.
Definition: tree_widget.h:23
BuildTreesWindow::OnPlaceDrag
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
The user is dragging over the map when the tile highlight mode has been set.
Definition: tree_gui.cpp:146
window_gui.h
Functions, definitions and such used only by the GUI.
BuildTreesWindow::OnPlaceObjectAbort
virtual void OnPlaceObjectAbort()
The user cancelled a tile highlight mode that has been set.
Definition: tree_gui.cpp:168
TREE_INVALID
An invalid tree.
Definition: tree_map.h:33
_local_company
CompanyByte _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
Definition: company_cmd.cpp:46
NWidgetPart
Partial widget specification to allow NWidgets to be written nested.
Definition: widget_type.h:910
Window
Data structure for an opened window.
Definition: window_gui.h:271
Window::InitNested
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
Definition: window.cpp:1833
tree_widget.h
Types related to the tree widgets.
NWID_SPACER
Invisible widget that takes some space.
Definition: widget_type.h:79
DDSP_PLANT_TREES
Plant trees.
Definition: viewport_type.h:106
WDF_CONSTRUCTION
This window is used for construction; close it whenever changing company.
Definition: window_gui.h:210
BuildTreesWindow::count
uint16 count
Number of different trees available.
Definition: tree_gui.cpp:53
ClientSettings::sound
SoundSettings sound
sound effect settings
Definition: settings_type.h:564
tree_land.h
Sprites to use and how to display them for tree tiles.
BuildTreesWindow::base
uint16 base
Base tree number used for drawing the window.
Definition: tree_gui.cpp:52
ViewportPlaceMethod
ViewportPlaceMethod
Viewport place method (type of highlighted area and placed objects)
Definition: viewport_type.h:78
Window::RaiseButtons
void RaiseButtons(bool autoraise=false)
Raise the buttons of the window.
Definition: window.cpp:553
SetDataTip
static NWidgetPart SetDataTip(uint32 data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1014
gfx_func.h
Functions related to the gfx engine.
_settings_client
ClientSettings _settings_client
The current settings for this game.
Definition: settings.cpp:76
SetMinimalSize
static NWidgetPart SetMinimalSize(int16 x, int16 y)
Widget part function for setting the minimal size.
Definition: widget_type.h:947
WID_BT_TYPE_21
Tree 2st column 1st row.
Definition: tree_widget.h:21
stdafx.h
Definition of base types and functions in a cross-platform compatible way.
WID_BT_TYPE_12
Tree 1st column 2nd row.
Definition: tree_widget.h:18
safeguards.h
A number of safeguards to prevent using unsafe methods.
WID_BT_TYPE_31
Tree 3st column 1st row.
Definition: tree_widget.h:25
WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
Definition: widget_type.h:104
HT_RECT
rectangle (stations, depots, ...)
Definition: tilehighlight_type.h:23
WWT_PANEL
Simple depressed panel.
Definition: widget_type.h:50
BuildTreesWindow::tree_to_plant
TreeType tree_to_plant
Tree number to plant, TREE_INVALID for a random tree.
Definition: tree_gui.cpp:54
WID_BT_TYPE_RANDOM
Button to build random type of tree.
Definition: tree_widget.h:29
BuildTreesWindow::OnClick
virtual void OnClick(Point pt, int widget, int click_count)
A click with the left mouse button has been made on the window.
Definition: tree_gui.cpp:114
NWidget
static NWidgetPart NWidget(WidgetType tp, Colours col, int16 idx=-1)
Widget part function for starting a new &#39;real&#39; widget.
Definition: widget_type.h:1114
WD_FRAMERECT_BOTTOM
Offset at bottom to draw the frame rectangular area.
Definition: window_gui.h:65
DoCommandP
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
Definition: command.cpp:527
VpStartPlaceSizing
void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, ViewportDragDropSelectionProcess process)
highlighting tiles while only going over them with the mouse
Definition: viewport.cpp:2471
lengthof
#define lengthof(x)
Return the length of an fixed size array.
Definition: depend.cpp:42
sound_func.h
Functions related to sound.
VpSelectTilesWithMethod
void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method)
Selects tiles while dragging.
Definition: viewport.cpp:2940
WC_BUILD_TREES
Build trees toolbar; Window numbers:
Definition: window_type.h:81
WC_NONE
No window, redirects to WC_MAIN_WINDOW.
Definition: window_type.h:40
company_func.h
Functions related to companies.
VPM_X_AND_Y
area of land in X and Y directions
Definition: viewport_type.h:82
WID_BT_TYPE_13
Tree 1st column 3rd row.
Definition: tree_widget.h:19
WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:61
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
HandlePlacePushButton
bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyle mode)
This code is shared for the majority of the pushbuttons.
Definition: main_gui.cpp:103
NWID_VERTICAL
Vertical container.
Definition: widget_type.h:77
EndContainer
static NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME, WWT_INSET, or WWT_PANEL).
Definition: widget_type.h:999
BuildTreesWindow
The build trees window.
Definition: tree_gui.cpp:50
BuildTreesWindow::GetMaxTreeSpriteSize
Dimension GetMaxTreeSpriteSize()
Calculate the maximum size of all tree sprites.
Definition: tree_gui.cpp:67
WID_BT_TYPE_34
Tree 3st column 4th row.
Definition: tree_widget.h:28
SoundSettings::confirm
bool confirm
Play sound effect on succesful constructions or other actions.
Definition: settings_type.h:177
BuildTreesWindow::DrawWidget
virtual void DrawWidget(const Rect &r, int widget) const
Draw the contents of a nested widget.
Definition: tree_gui.cpp:105
command_func.h
Functions related to commands.
Point
Coordinates of a point in 2D.
Definition: geometry_type.hpp:28
GetSpriteSize
Dimension GetSpriteSize(SpriteID sprid, Point *offset, ZoomLevel zoom)
Get the size of a sprite.
Definition: gfx.cpp:768
TreeType
TreeType
List of tree types along all landscape types.
Definition: tree_map.h:26
Pool::PoolItem<&_company_pool >::IsValidID
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-NULL) Titem.
Definition: pool_type.hpp:235
WD_FRAMERECT_RIGHT
Offset at right to draw the frame rectangular area.
Definition: window_gui.h:63
WWT_STICKYBOX
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition: widget_type.h:66
CMD_MSG
#define CMD_MSG(x)
Used to combine a StringID with the command.
Definition: command_type.h:366
WindowNumber
int32 WindowNumber
Number to differentiate different windows of the same class.
Definition: window_type.h:695
GameSettings::game_creation
GameCreationSettings game_creation
settings used during the creation of a game (map)
Definition: settings_type.h:544
ResetObjectToPlace
void ResetObjectToPlace()
Reset the cursor and mouse mode handling back to default (normal cursor, only clicking in windows)...
Definition: viewport.cpp:3211
Rect
Specification of a rectangle with absolute coordinates of all edges.
Definition: geometry_type.hpp:40
Window::window_number
WindowNumber window_number
Window number within the window class.
Definition: window_gui.h:307
tilehighlight_func.h
Functions related to tile highlights.
BuildTreesWindow::UpdateWidgetSize
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
Update size and resize step of a widget in the window.
Definition: tree_gui.cpp:87
WID_BT_TYPE_11
Tree 1st column 1st row.
Definition: tree_widget.h:17
WDP_AUTO
Find a place automatically.
Definition: window_gui.h:156
WID_BT_TYPE_14
Tree 1st column 4th row.
Definition: tree_widget.h:20
WID_BT_TYPE_33
Tree 3st column 3rd row.
Definition: tree_widget.h:27
Dimension
Dimensions (a width and height) of a rectangle in 2D.
Definition: geometry_type.hpp:34
WD_FRAMERECT_LEFT
Offset at left to draw the frame rectangular area.
Definition: window_gui.h:62
sprites.h
This file contains all sprite-related enums and defines.
WWT_SHADEBOX
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition: widget_type.h:64
DrawSprite
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
Definition: gfx.cpp:833
WID_BT_TYPE_24
Tree 2st column 4th row.
Definition: tree_widget.h:24
MarkWholeScreenDirty
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
Definition: gfx.cpp:1461
WWT_TEXTBTN
(Toggle) Button with text
Definition: widget_type.h:55
BuildTreesWindow::OnPlaceObject
virtual void OnPlaceObject(Point pt, TileIndex tile)
The user clicked some place on the map when a tile highlight mode has been set.
Definition: tree_gui.cpp:141