26 #include "table/strings.h" 42 if (!this->wp->
IsInUse())
return this->wp->
xy;
45 this->wp->GetTileArea(&ta, this->vt ==
VEH_TRAIN ? STATION_WAYPOINT : STATION_BUOY);
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;
156 NWidget(
NWID_VIEWPORT, COLOUR_GREY,
WID_W_VIEWPORT),
SetMinimalSize(256, 88),
SetPadding(1, 1, 1, 1),
SetResize(1, 1),
160 NWidget(
WWT_PUSHTXTBTN, COLOUR_GREY,
WID_W_CENTER_VIEW),
SetMinimalSize(100, 12),
SetResize(1, 0),
SetFill(1, 0),
SetDataTip(STR_BUTTON_LOCATION, STR_BUOY_VIEW_CENTER_TOOLTIP),
161 NWidget(
WWT_PUSHTXTBTN, COLOUR_GREY,
WID_W_RENAME),
SetMinimalSize(100, 12),
SetResize(1, 0),
SetFill(1, 0),
SetDataTip(STR_BUTTON_RENAME, STR_BUOY_VIEW_CHANGE_BUOY_NAME),
169 WDP_AUTO,
"view_waypoint", 260, 118,
172 _nested_waypoint_view_widgets,
lengthof(_nested_waypoint_view_widgets)
Functions related to OTTD's strings.
Definition of stuff that is very close to a company, like the company struct itself.
void UpdateVirtCoord() override
Update the virtual coords needed to draw the waypoint sign.
The information about a vehicle list.
void SetWidgetDisabledState(byte widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
High level window description.
Functions and type for generating vehicle lists.
WindowFlags flags
Window flags.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
void ShowQueryString(StringID str, StringID caption, uint maxsize, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
Show a query popup window with a textbox in it.
VehicleType
Available vehicle types.
bool IsInUse() const
Check whether the base station currently is in use; in use means that it is not scheduled for deletio...
void SetStringParameters(int widget) const override
Initialize string parameters for a widget.
Tindex index
Index of this pool item.
Representation of a waypoint.
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
void OnResize() override
Called after the window got resized.
Stuff related to the text buffer GUI.
WaypointWindow(WindowDesc *desc, WindowNumber window_number)
Construct the window.
void CreateNestedTree(bool fill_nested=true)
Perform the first part of the initialization of a nested widget tree.
Functions related to the vehicle's GUIs.
Functions, definitions and such used only by the GUI.
void ShowWaypointWindow(const Waypoint *wp)
Show the window for the given waypoint.
Functions related to (drawing on) viewports.
Data structure for an opened window.
bool _ctrl_pressed
Is Ctrl pressed?
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
enable the 'Default' button ("\0" is returned)
The tile has no ownership.
Waypoint view; Window numbers:
Definition of base types and functions in a cross-platform compatible way.
TileIndex GetCenterTile() const
Get the center tile.
the length of the string is counted in characters
A number of safeguards to prevent using unsafe methods.
Represents the covered area of e.g.
void OnQueryTextFinished(char *str) override
The query window opened from this window has closed.
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
#define lengthof(x)
Return the length of an fixed size array.
bool ScrollWindowToTile(TileIndex tile, Window *w, bool instant)
Scrolls the viewport in a window to a given location.
void ShowExtraViewPortWindow(TileIndex tile=INVALID_TILE)
Show a new Extra Viewport window.
No window, redirects to WC_MAIN_WINDOW.
void DeleteWindowById(WindowClass cls, WindowNumber number, bool force)
Delete a window by its class and window number (if it is open).
Functions related to companies.
Both numeric and alphabetic and spaces and stuff.
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.
GUI for accessing waypoints and buoys.
Default zoom level for viewports.
uint32 TileIndex
The index/ID of a Tile.
static const NWidgetPart _nested_waypoint_view_widgets[]
The widgets of the waypoint view.
TileIndex xy
Base tile of the station.
TileIndex GetCenterTile() const
Get the center tile of the waypoint.
bool ScrollMainWindowToTile(TileIndex tile, bool instant)
Scrolls the viewport of the main window to a given location.
Functions related to commands.
Coordinates of a point in 2D.
Owner owner
The owner of this station.
static WindowClass GetWindowClassForVehicleType(VehicleType vt)
Get WindowClass for vehicle list of given vehicle type.
Window does not do autoscroll,.
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable...
static const uint MAX_LENGTH_STATION_NAME_CHARS
The maximum length of a station name in characters including '\0'.
#define CMD_MSG(x)
Used to combine a StringID with the command.
int32 WindowNumber
Number to differentiate different windows of the same class.
WindowNumber window_number
Window number within the window class.
Waypoint * wp
Waypoint displayed by the window.
Window functions not directly related to making/drawing windows.
Find a place automatically.
VehicleType vt
Vehicle type using the waypoint.
ViewportData * viewport
Pointer to viewport data, if present.
GUI functions that shouldn't be here.
static Waypoint * Get(size_t index)
Gets station with given index.
StringID string_id
Default name (town area) of station.
CompanyID _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.