|
OpenTTD Source
14.0-beta1
|
Go to the documentation of this file.
28 #include "table/strings.h"
44 if (!this->wp->
IsInUse())
return this->wp->
xy;
64 this->GetWidget<NWidgetCore>(
WID_W_SHOW_VEHICLES)->SetDataTip(STR_TRAIN, STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP);
65 this->GetWidget<NWidgetCore>(
WID_W_CENTER_VIEW)->tool_tip = STR_WAYPOINT_VIEW_CENTER_TOOLTIP;
66 this->GetWidget<NWidgetCore>(
WID_W_RENAME)->tool_tip = STR_WAYPOINT_VIEW_CHANGE_WAYPOINT_NAME;
79 void Close([[maybe_unused]]
int data = 0)
override
86 void SetStringParameters(
WidgetID widget)
const override
100 void OnClick([[maybe_unused]]
Point pt,
WidgetID widget, [[maybe_unused]]
int click_count)
override
117 ShowVehicleListWindow(this->wp->
owner, this->vt, this->wp->index);
131 void OnInvalidateData([[maybe_unused]]
int data = 0, [[maybe_unused]]
bool gui_scope =
true)
override
133 if (!gui_scope)
return;
153 void OnQueryTextFinished(
char *str)
override
155 if (str ==
nullptr)
return;
179 NWidget(
WWT_TEXTBTN, COLOUR_GREY,
WID_W_CATCHMENT),
SetMinimalSize(50, 12),
SetResize(1, 0),
SetFill(1, 1),
SetDataTip(STR_BUTTON_CATCHMENT, STR_TOOLTIP_CATCHMENT),
187 WDP_AUTO,
"view_waypoint", 260, 118,
const Waypoint * _viewport_highlight_waypoint
Currently selected waypoint for coverage area highlight.
bool ScrollMainWindowToTile(TileIndex tile, bool instant)
Scrolls the viewport of the main window to a given location.
void ShowExtraViewportWindow(TileIndex tile=INVALID_TILE)
Show a new Extra Viewport window.
The information about a vehicle list.
@ WF_DISABLE_VP_SCROLL
Window does not do autoscroll,.
ViewportData * viewport
Pointer to viewport data, if present.
void CloseWindowById(WindowClass cls, WindowNumber number, bool force, int data)
Close a window by its class and window number (if it is open).
void OnResize() override
Called after the window got resized.
Tindex index
Index of this pool item.
virtual void Close(int data=0)
Hide the window and all its child windows, and mark them for a later deletion.
Representation of a waypoint.
bool _ctrl_pressed
Is Ctrl pressed?
static Waypoint * Get(size_t index)
Gets station with given index.
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable.
ZoomLevel ScaleZoomGUI(ZoomLevel value)
Scale zoom level relative to GUI zoom.
void GetTileArea(TileArea *ta, StationType type) const override
Get the tile area for a given station type.
Owner owner
The owner of this station.
StringID string_id
Default name (town area) of station.
@ QSF_LEN_IN_CHARS
the length of the string is counted in characters
High level window description.
void UpdateVirtCoord() override
Update the virtual coords needed to draw the waypoint sign.
@ WDP_AUTO
Find a place automatically.
int32_t WindowNumber
Number to differentiate different windows of the same class.
WaypointWindow(WindowDesc *desc, WindowNumber window_number)
Construct the window.
bool ScrollWindowToTile(TileIndex tile, Window *w, bool instant)
Scrolls the viewport in a window to a given location.
void ShowWaypointWindow(const Waypoint *wp)
Show the window for the given waypoint.
void OnPaint() override
The window must be repainted.
Represents the covered area of e.g.
CompanyID _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
void ShowQueryString(StringID str, StringID caption, uint maxsize, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
Show a query popup window with a textbox in it.
@ WC_WAYPOINT_VIEW
Waypoint view; Window numbers:
WindowFlags flags
Window flags.
Waypoint * wp
Waypoint displayed by the window.
Coordinates of a point in 2D.
void OnInvalidateData([[maybe_unused]] int data=0, [[maybe_unused]] bool gui_scope=true) override
Some data on this window has become invalid.
@ ZOOM_LVL_VIEWPORT
Default zoom level for viewports.
WindowNumber window_number
Window number within the window class.
VehicleType
Available vehicle types.
TileIndex GetCenterTile() const
Get the center tile of the waypoint.
@ CS_ALPHANUMERAL
Both numeric and alphabetic and spaces and stuff.
static WindowDesc _waypoint_view_desc(__FILE__, __LINE__, WDP_AUTO, "view_waypoint", 260, 118, WC_WAYPOINT_VIEW, WC_NONE, 0, std::begin(_nested_waypoint_view_widgets), std::end(_nested_waypoint_view_widgets))
The description of the waypoint view.
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
void SetWidgetLoweredState(WidgetID widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
TileIndex GetCenterTile() const
Get the center tile.
void SetWidgetDisabledState(WidgetID widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
static const uint MAX_LENGTH_STATION_NAME_CHARS
The maximum length of a station name in characters including '\0'.
bool IsWidgetLowered(WidgetID widget_index) const
Gets the lowered state of a widget.
VehicleType vt
Vehicle type using the waypoint.
void CreateNestedTree()
Perform the first part of the initialization of a nested widget tree.
void SetDParam(size_t n, uint64_t v)
Set a string parameter v at index n in the global string parameter array.
@ OWNER_NONE
The tile has no ownership.
void SetViewportCatchmentWaypoint(const Waypoint *wp, bool sel)
Select or deselect waypoint for coverage area highlight.
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
TileIndex xy
Base tile of the station.
static constexpr NWidgetPart _nested_waypoint_view_widgets[]
The widgets of the waypoint view.
GUI for accessing waypoints and buoys.
bool IsInUse() const
Check whether the base station currently is in use; in use means that it is not scheduled for deletio...
Data structure for an opened window.
@ VEH_TRAIN
Train vehicle type.
void DrawWidgets() const
Paint all widgets of a window.
@ VEH_SHIP
Ship vehicle type.
@ QSF_ENABLE_DEFAULT
enable the 'Default' button ("\0" is returned)
WindowClass GetWindowClassForVehicleType(VehicleType vt)
Get WindowClass for vehicle list of given vehicle type.