28 #include "table/strings.h" 44 if (!this->wp->
IsInUse())
return this->wp->
xy;
47 this->wp->GetTileArea(&ta, this->vt ==
VEH_TRAIN ? STATION_WAYPOINT : STATION_BUOY);
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;
106 ShowVehicleListWindow(this->wp->
owner, this->vt, this->wp->index);
118 if (!gui_scope)
return;
140 if (str == NULL)
return;
158 NWidget(
NWID_VIEWPORT, COLOUR_GREY,
WID_W_VIEWPORT),
SetMinimalSize(256, 88),
SetPadding(1, 1, 1, 1),
SetResize(1, 1),
162 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),
163 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),
171 WDP_AUTO,
"view_waypoint", 260, 118,
174 _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.
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 ShowQueryString(StringID str, StringID caption, uint maxsize, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
Show a query popup window with a textbox in it.
bool IsInUse() const
Check whether the base station currently is in use; in use means that it is not scheduled for deletio...
Tindex index
Index of this pool item.
Representation of a waypoint.
virtual void SetStringParameters(int widget) const
Initialize string parameters for a widget.
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.
virtual void OnQueryTextFinished(char *str)
The query window opened from this window has closed.
Functions, definitions and such used only by the GUI.
void ShowWaypointWindow(const Waypoint *wp)
Show the window for the given waypoint.
CompanyByte _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
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)
Waypoint view; Window numbers:
virtual void OnResize()
Called after the window got resized.
VehicleType
Available vehicle types.
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.
The tile has no ownership.
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.
Default zoom level for viewports.
void ShowExtraViewPortWindow(TileIndex tile=INVALID_TILE)
Show a new Extra Viewport window.
OwnerByte owner
The owner of this station.
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.
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.
void UpdateVirtCoord()
Update the virtual coords needed to draw the waypoint sign.
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.
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...
virtual void OnClick(Point pt, int widget, int click_count)
A click with the left mouse button has been made on the window.
static const uint MAX_LENGTH_STATION_NAME_CHARS
The maximum length of a station name in characters including '\0'.
virtual void OnInvalidateData(int data=0, bool gui_scope=true)
Some data on this window has become invalid.
#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.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.