OpenTTD
Public Member Functions | Data Fields
TileHighlightData Struct Reference

Metadata about the current highlighting. More...

#include <tilehighlight_type.h>

Public Member Functions

void Reset ()
 Reset tile highlighting.
 
bool IsDraggingDiagonal ()
 Is the user dragging a 'diagonal rectangle'? More...
 
WindowGetCallbackWnd ()
 Get the window that started the current highlighting. More...
 

Data Fields

Point pos
 Location, in tile "units", of the northern tile of the selected area.
 
Point size
 Size, in tile "units", of the white/red selection area.
 
Point offs
 Offset, in tile "units", for the blue coverage area from the selected area's northern tile.
 
Point outersize
 Size, in tile "units", of the blue coverage area excluding the side of the selected area.
 
bool diagonal
 Whether the dragged area is a 45 degrees rotated rectangle.
 
Point new_pos
 New value for pos; used to determine whether to redraw the selection.
 
Point new_size
 New value for size; used to determine whether to redraw the selection.
 
Point new_outersize
 New value for outersize; used to determine whether to redraw the selection.
 
byte dirty
 Whether the build station window needs to redraw due to the changed selection.
 
Point selstart
 The location where the dragging started.
 
Point selend
 The location where the drag currently ends.
 
byte sizelimit
 Whether the selection is limited in length, and what the maximum length is.
 
HighLightStyle drawstyle
 Lower bits 0-3 are reserved for detailed highlight information.
 
HighLightStyle next_drawstyle
 Queued, but not yet drawn style.
 
HighLightStyle place_mode
 Method which is used to place the selection.
 
WindowClass window_class
 The WindowClass of the window that is responsible for the selection mode.
 
WindowNumber window_number
 The WindowNumber of the window that is responsible for the selection mode.
 
bool make_square_red
 Whether to give a tile a red selection.
 
TileIndex redsq
 The tile that has to get a red selection.
 
ViewportPlaceMethod select_method
 The method which governs how tiles are selected.
 
ViewportDragDropSelectionProcess select_proc
 The procedure that has to be called when the selection is done.
 

Detailed Description

Metadata about the current highlighting.

Definition at line 48 of file tilehighlight_type.h.

Member Function Documentation

◆ GetCallbackWnd()

Window * TileHighlightData::GetCallbackWnd ( )

Get the window that started the current highlighting.

Returns
The window that requested the current tile highlighting, or NULL if not available.

Definition at line 2341 of file viewport.cpp.

References FindWindowById().

Referenced by SetObjectToPlace(), and VpHandlePlaceSizingDrag().

◆ IsDraggingDiagonal()

bool TileHighlightData::IsDraggingDiagonal ( )

Is the user dragging a 'diagonal rectangle'?

Returns
User is dragging a rotated rectangle.

Definition at line 2332 of file viewport.cpp.

References _ctrl_pressed, _left_button_down, and HT_DIAGONAL.

Referenced by UpdateTileSelection(), and VpSelectTilesWithMethod().


The documentation for this struct was generated from the following files: