OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
26 #include "table/strings.h"
42 if (!this->wp->
IsInUse())
return this->wp->
xy;
62 this->GetWidget<NWidgetCore>(
WID_W_SHOW_VEHICLES)->SetDataTip(STR_TRAIN, STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP);
63 this->GetWidget<NWidgetCore>(
WID_W_CENTER_VIEW)->tool_tip = STR_WAYPOINT_VIEW_CENTER_TOOLTIP;
64 this->GetWidget<NWidgetCore>(
WID_W_RENAME)->tool_tip = STR_WAYPOINT_VIEW_CHANGE_WAYPOINT_NAME;
104 ShowVehicleListWindow(this->wp->
owner, this->vt, this->wp->index);
116 if (!gui_scope)
return;
138 if (str ==
nullptr)
return;
158 NWidget(
NWID_VIEWPORT, COLOUR_GREY,
WID_W_VIEWPORT),
SetMinimalSize(256, 88),
SetPadding(1, 1, 1, 1),
SetResize(1, 1),
170 WDP_AUTO,
"view_waypoint", 260, 118,
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
#define CMD_MSG(x)
Used to combine a StringID with the command.
uint32 TileIndex
The index/ID of a Tile.
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.
static const NWidgetPart _nested_waypoint_view_widgets[]
The widgets of the waypoint view.
void CreateNestedTree(bool fill_nested=true)
Perform the first part of the initialization of a nested widget tree.
void OnResize() override
Called after the window got resized.
Tindex index
Index of this pool item.
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.
int32 WindowNumber
Number to differentiate different windows of the same class.
void OnQueryTextFinished(char *str) override
The query window opened from this window has closed.
void GetTileArea(TileArea *ta, StationType type) const override
Get the tile area for a given station type.
Owner owner
The owner of this station.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
void SetStringParameters(int widget) const override
Initialize string parameters for a widget.
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.
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
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.
@ CMD_RENAME_WAYPOINT
rename a waypoint
static WindowDesc _waypoint_view_desc(WDP_AUTO, "view_waypoint", 260, 118, WC_WAYPOINT_VIEW, WC_NONE, 0, _nested_waypoint_view_widgets, lengthof(_nested_waypoint_view_widgets))
The description of the waypoint view.
Represents the covered area of e.g.
void SetWidgetDisabledState(byte widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
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.
@ 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.
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
TileIndex GetCenterTile() const
Get the center tile.
static const uint MAX_LENGTH_STATION_NAME_CHARS
The maximum length of a station name in characters including '\0'.
static WindowClass GetWindowClassForVehicleType(VehicleType vt)
Get WindowClass for vehicle list of given vehicle type.
VehicleType vt
Vehicle type using the waypoint.
void DeleteWindowById(WindowClass cls, WindowNumber number, bool force)
Delete a window by its class and window number (if it is open).
@ OWNER_NONE
The tile has no ownership.
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.
#define lengthof(x)
Return the length of an fixed size array.
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.
@ VEH_SHIP
Ship vehicle type.
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
@ QSF_ENABLE_DEFAULT
enable the 'Default' button ("\0" is returned)