OpenTTD Source 20241224-master-gf74b0cf984
|
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'? | |
Window * | GetCallbackWnd () |
Get the window that started the current highlighting. | |
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. | |
bool | freeze |
Freeze highlight in place. | |
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. | |
uint8_t | 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. | |
uint8_t | 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. | |
Metadata about the current highlighting.
Definition at line 46 of file tilehighlight_type.h.
Window * TileHighlightData::GetCallbackWnd | ( | ) |
Get the window that started the current highlighting.
nullptr
if not available. Definition at line 2588 of file viewport.cpp.
References FindWindowById(), window_class, and window_number.
Referenced by HandleMouseDragDrop(), BuildIndustryWindow::OnClick(), SetObjectToPlace(), ShowMeasurementTooltips(), VehicleClicked(), VehicleClicked(), and VpHandlePlaceSizingDrag().
bool TileHighlightData::IsDraggingDiagonal | ( | ) |
Is the user dragging a 'diagonal rectangle'?
Definition at line 2579 of file viewport.cpp.
References _ctrl_pressed, _left_button_down, HT_DIAGONAL, and place_mode.
Referenced by UpdateTileSelection(), and VpSelectTilesWithMethod().
void TileHighlightData::Reset | ( | ) |
Reset tile highlighting.
Definition at line 2567 of file viewport.cpp.
Referenced by ResetWindowSystem().
bool TileHighlightData::diagonal |
Whether the dragged area is a 45 degrees rotated rectangle.
Definition at line 51 of file tilehighlight_type.h.
Referenced by DrawTileSelection(), SetSelectionTilesDirty(), and UpdateTileSelection().
uint8_t TileHighlightData::dirty |
Whether the build station window needs to redraw due to the changed selection.
Definition at line 58 of file tilehighlight_type.h.
Referenced by CheckRedrawStationCoverage(), SelectStationWindow< T >::OnRealtimeTick(), and UpdateTileSelection().
HighLightStyle TileHighlightData::drawstyle |
Lower bits 0-3 are reserved for detailed highlight information.
Definition at line 64 of file tilehighlight_type.h.
Referenced by CheckRedrawStationCoverage(), DrawStationCoverageAreaText(), DrawTileSelection(), HandleAutoSignalPlacement(), SetObjectToPlace(), UpdateTileSelection(), and VpStartPlaceSizing().
bool TileHighlightData::freeze |
Freeze highlight in place.
Definition at line 53 of file tilehighlight_type.h.
Referenced by SelectStationWindow< T >::Close(), and UpdateTileSelection().
bool TileHighlightData::make_square_red |
Whether to give a tile a red selection.
Definition at line 71 of file tilehighlight_type.h.
Referenced by DrawAutorailSelection(), DrawTileSelection(), and SetObjectToPlace().
Point TileHighlightData::new_outersize |
New value for outersize; used to determine whether to redraw the selection.
Definition at line 57 of file tilehighlight_type.h.
Referenced by SetTileSelectSize(), and UpdateTileSelection().
Point TileHighlightData::new_pos |
New value for pos; used to determine whether to redraw the selection.
Definition at line 55 of file tilehighlight_type.h.
Referenced by Reset(), UpdateTileSelection(), and VpHandlePlaceSizingDrag().
Point TileHighlightData::new_size |
New value for size; used to determine whether to redraw the selection.
Definition at line 56 of file tilehighlight_type.h.
Referenced by SetTileSelectSize(), and UpdateTileSelection().
HighLightStyle TileHighlightData::next_drawstyle |
Queued, but not yet drawn style.
Definition at line 65 of file tilehighlight_type.h.
Referenced by CalcRaildirsDrawstyle(), UpdateTileSelection(), VpHandlePlaceSizingDrag(), VpSelectTilesWithMethod(), VpSetPresizeRange(), VpStartDragging(), and VpStartPlaceSizing().
Point TileHighlightData::offs |
Offset, in tile "units", for the blue coverage area from the selected area's northern tile.
Definition at line 49 of file tilehighlight_type.h.
Referenced by DrawTileSelection(), and SetSelectionTilesDirty().
Point TileHighlightData::outersize |
Size, in tile "units", of the blue coverage area excluding the side of the selected area.
Definition at line 50 of file tilehighlight_type.h.
Referenced by DrawTileSelection(), SetSelectionTilesDirty(), and UpdateTileSelection().
HighLightStyle TileHighlightData::place_mode |
Method which is used to place the selection.
Definition at line 67 of file tilehighlight_type.h.
Referenced by IsDraggingDiagonal(), SetObjectToPlace(), UpdateTileSelection(), VehicleClicked(), VehicleClicked(), VpHandlePlaceSizingDrag(), and VpStartPlaceSizing().
Point TileHighlightData::pos |
Location, in tile "units", of the northern tile of the selected area.
Definition at line 47 of file tilehighlight_type.h.
Referenced by DrawStationCoverageAreaText(), DrawTileSelection(), FindStationsAroundSelection(), IsInsideRotatedRectangle(), BuildRailToolbarWindow::OnHotkey(), BuildRoadToolbarWindow::OnHotkey(), Reset(), SetSelectionTilesDirty(), and UpdateTileSelection().
TileIndex TileHighlightData::redsq |
The tile that has to get a red selection.
Definition at line 72 of file tilehighlight_type.h.
Referenced by DrawTileSelection(), and SetRedErrorSquare().
ViewportPlaceMethod TileHighlightData::select_method |
The method which governs how tiles are selected.
Definition at line 74 of file tilehighlight_type.h.
Referenced by VpHandlePlaceSizingDrag(), VpStartDragging(), and VpStartPlaceSizing().
ViewportDragDropSelectionProcess TileHighlightData::select_proc |
The procedure that has to be called when the selection is done.
Definition at line 75 of file tilehighlight_type.h.
Referenced by VpHandlePlaceSizingDrag(), VpStartDragging(), and VpStartPlaceSizing().
Point TileHighlightData::selend |
The location where the drag currently ends.
Definition at line 61 of file tilehighlight_type.h.
Referenced by CalcRaildirsDrawstyle(), Check2x1AutoRail(), HandleAutoSignalPlacement(), UpdateTileSelection(), VpHandlePlaceSizingDrag(), VpSelectTilesWithMethod(), VpSetPresizeRange(), and VpStartPlaceSizing().
Point TileHighlightData::selstart |
The location where the dragging started.
Definition at line 60 of file tilehighlight_type.h.
Referenced by CalcRaildirsDrawstyle(), DrawTileSelection(), HandleAutoSignalPlacement(), UpdateTileSelection(), VpHandlePlaceSizingDrag(), VpSelectTilesWithMethod(), VpSetPresizeRange(), VpStartDragging(), and VpStartPlaceSizing().
Point TileHighlightData::size |
Size, in tile "units", of the white/red selection area.
Definition at line 48 of file tilehighlight_type.h.
Referenced by DrawStationCoverageAreaText(), DrawTileSelection(), FindStationsAroundSelection(), IsInsideRotatedRectangle(), BuildRoadToolbarWindow::OnPlaceDrag(), PlaceAirport(), SetSelectionTilesDirty(), and UpdateTileSelection().
uint8_t TileHighlightData::sizelimit |
Whether the selection is limited in length, and what the maximum length is.
Definition at line 62 of file tilehighlight_type.h.
Referenced by VpSelectTilesWithMethod().
WindowClass TileHighlightData::window_class |
The WindowClass
of the window that is responsible for the selection mode.
Definition at line 68 of file tilehighlight_type.h.
Referenced by ChangeVehicleWindow(), Window::Close(), GetCallbackWnd(), and SetObjectToPlace().
WindowNumber TileHighlightData::window_number |
The WindowNumber
of the window that is responsible for the selection mode.
Definition at line 69 of file tilehighlight_type.h.
Referenced by ChangeVehicleWindow(), Window::Close(), GetCallbackWnd(), and SetObjectToPlace().