Translations update
[openttd/fttd.git] / src / tilehighlight_type.h
blob56a2dc89e765a093ab1977064609e3f3a166f766
1 /* $Id$ */
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 */
10 /** @file tilehighlight_type.h Types related to highlighting tiles. */
12 #ifndef TILEHIGHLIGHT_TYPE_H
13 #define TILEHIGHLIGHT_TYPE_H
15 #include "core/geometry_type.hpp"
16 #include "map/coord.h"
17 #include "track_type.h"
18 #include "window_type.h"
19 #include "viewport_type.h"
20 #include "town.h"
22 /** Highlighting draw styles */
23 enum HighLightStyle {
24 HT_NONE, ///< default
25 HT_RECT, ///< rectangle (stations, depots, ...)
26 HT_POINT, ///< point (lower land, raise land, level land, ...)
27 HT_RAIL = 0x8, ///< used for autorail highlighting, lower bits: direction
28 HT_RAIL_X = HT_RAIL | TRACK_X, ///< X direction
29 HT_RAIL_Y = HT_RAIL | TRACK_Y, ///< Y direction
30 HT_RAIL_HU = HT_RAIL | TRACK_UPPER, ///< horizontal upper
31 HT_RAIL_HL = HT_RAIL | TRACK_LOWER, ///< horizontal lower
32 HT_RAIL_VL = HT_RAIL | TRACK_LEFT, ///< vertical left
33 HT_RAIL_VR = HT_RAIL | TRACK_RIGHT, ///< vertical right
34 HT_TRACK_MASK = 0x7, ///< masks the drag-direction
36 DECLARE_ENUM_AS_BIT_SET(HighLightStyle)
39 /** Metadata about the current highlighting. */
40 struct TileHighlightData {
41 Point pos; ///< Location, in tile "units", of the northern tile of the selected area.
42 Point size; ///< Size, in tile "units", of the white/red selection area.
43 Point offs; ///< Offset, in tile "units", for the blue coverage area from the selected area's northern tile.
44 Point outersize; ///< Size, in tile "units", of the blue coverage area excluding the side of the selected area.
45 bool diagonal; ///< Whether the dragged area is a 45 degrees rotated rectangle.
47 Point new_pos; ///< New value for \a pos; used to determine whether to redraw the selection.
48 Point new_size; ///< New value for \a size; used to determine whether to redraw the selection.
49 Point new_outersize; ///< New value for \a outersize; used to determine whether to redraw the selection.
50 byte dirty; ///< Whether the build station window needs to redraw due to the changed selection.
52 Point selstart; ///< The location where the dragging started.
53 Point selend; ///< The location where the drag currently ends.
54 byte sizelimit; ///< Whether the selection is limited in length, and what the maximum length is.
56 HighLightStyle drawstyle; ///< Lower bits 0-3 are reserved for detailed highlight information.
57 HighLightStyle next_drawstyle; ///< Queued, but not yet drawn style.
59 WindowClass window_class; ///< The \c WindowClass of the window that is responsible for the selection mode.
60 WindowNumber window_number; ///< The \c WindowNumber of the window that is responsible for the selection mode.
62 bool make_square_red; ///< Whether to give a tile a red selection.
63 TileIndex redsq; ///< The tile that has to get a red selection.
65 ViewportPlaceMethod select_method; ///< The method which governs how tiles are selected.
66 int select_data; ///< Custom data set by the function that started the selection.
68 void Reset();
70 bool IsDraggingDiagonal();
71 Window *GetCallbackWnd();
73 TownID town; ///< Town area to highlight
76 #endif /* TILEHIGHLIGHT_TYPE_H */