OpenTTD Source: src/station_gui.h Source File

OpenTTD Source 15.3

station_gui.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef STATION_GUI_H
11#define STATION_GUI_H
12
13#include "core/geometry_type.hpp"
14#include "command_type.h"
15#include "tilearea_type.h"
16#include "window_type.h"
17#include "station_type.h"
18
19
21 enum StationCoverageType : uint8_t {
22 SCT_PASSENGERS_ONLY,
23 SCT_NON_PASSENGERS_ONLY,
24 SCT_ALL,
25};
26
27int DrawStationCoverageAreaText(const Rect &r, StationCoverageType sct, int rad, bool supplies);
28void CheckRedrawStationCoverage(const Window *w);
29void CheckRedrawRailWaypointCoverage(const Window *w);
30void CheckRedrawRoadWaypointCoverage(const Window *w);
31
32using StationPickerCmdProc = std::function<bool(bool test, StationID to_join)>;
33
34void ShowSelectStationIfNeeded(TileArea ta, StationPickerCmdProc proc);
35void ShowSelectRailWaypointIfNeeded(TileArea ta, StationPickerCmdProc proc);
36void ShowSelectRoadWaypointIfNeeded(TileArea ta, StationPickerCmdProc proc);
37
38#endif /* STATION_GUI_H */
command_type.h
Types related to commands.
geometry_type.hpp
All geometry types in OpenTTD.
ShowSelectStationIfNeeded
void ShowSelectStationIfNeeded(TileArea ta, StationPickerCmdProc proc)
Show the station selection window when needed.
Definition station_gui.cpp:2475
StationCoverageType
StationCoverageType
Types of cargo to display for station coverage.
Definition station_gui.h:21
SCT_NON_PASSENGERS_ONLY
@ SCT_NON_PASSENGERS_ONLY
Draw all non-passenger class cargoes.
Definition station_gui.h:23
SCT_PASSENGERS_ONLY
@ SCT_PASSENGERS_ONLY
Draw only passenger class cargoes.
Definition station_gui.h:22
SCT_ALL
@ SCT_ALL
Draw all cargoes.
Definition station_gui.h:24
ShowSelectRailWaypointIfNeeded
void ShowSelectRailWaypointIfNeeded(TileArea ta, StationPickerCmdProc proc)
Show the rail waypoint selection window when needed.
Definition station_gui.cpp:2485
DrawStationCoverageAreaText
int DrawStationCoverageAreaText(const Rect &r, StationCoverageType sct, int rad, bool supplies)
Calculates and draws the accepted or supplied cargo around the selected tile(s)
Definition station_gui.cpp:77
CheckRedrawStationCoverage
void CheckRedrawStationCoverage(const Window *w)
Check whether we need to redraw the station coverage text.
Definition station_gui.cpp:159
ShowSelectRoadWaypointIfNeeded
void ShowSelectRoadWaypointIfNeeded(TileArea ta, StationPickerCmdProc proc)
Show the road waypoint selection window when needed.
Definition station_gui.cpp:2495
station_type.h
Types related to stations.
OrthogonalTileArea
Represents the covered area of e.g.
Definition tilearea_type.h:18
PoolID< uint16_t, struct StationIDTag, 64000, 0xFFFF >
Rect
Specification of a rectangle with absolute coordinates of all edges.
Definition geometry_type.hpp:101
Window
Data structure for an opened window.
Definition window_gui.h:274
tilearea_type.h
Type for storing the 'area' of something uses on the map.
window_type.h
Types related to windows.