39 #include "table/strings.h" 44 static void ShowRoadDepotPicker(
Window *parent);
47 static bool _one_way_button_clicked;
55 RF_START_HALFROAD_Y = 0x01,
56 RF_END_HALFROAD_Y = 0x02,
59 RF_START_HALFROAD_X = 0x08,
60 RF_END_HALFROAD_X = 0x10,
136 if (result.
Failed())
return;
162 if (result.
Failed())
return;
167 TileArea roadstop_area(tile,
GB(p1, 0, 8),
GB(p1, 8, 8));
187 uint8 ddir = _road_station_picker_orientation;
188 SB(p2, 16, 16, INVALID_STATION);
210 if (_road_station_picker_orientation <
DIAGDIR_END) {
228 if (_road_station_picker_orientation <
DIAGDIR_END) {
237 typedef void OnButtonClick(
Window *w);
279 this->Initialize(_cur_roadtype);
284 if (RoadTypeIsRoad(this->roadtype)) {
307 if (!gui_scope)
return;
310 bool can_build = _game_mode != GM_EDITOR;
339 if (_game_mode != GM_EDITOR) {
352 this->Initialize(roadtype);
361 SetDParam(0, STR_TOOLBAR_RAILTYPE_VELOCITY);
380 switch (clicked_widget) {
382 if (RoadTypeIsRoad(this->roadtype)) {
404 if (RoadTypeIsRoad(this->roadtype)) {
415 if (RoadTypeIsRoad(this->roadtype)) {
427 _one_way_button_clicked =
false;
431 this->last_started_action = widget;
436 this->last_started_action = widget;
441 this->last_started_action = widget;
446 this->last_started_action = widget;
452 ShowRoadDepotPicker(
this);
453 this->last_started_action = widget;
461 this->last_started_action = widget;
469 this->last_started_action = widget;
477 SetSelectionRed(
false);
482 this->last_started_action = widget;
487 this->last_started_action = widget;
500 this->last_started_action = widget;
503 default: NOT_REACHED();
519 switch (this->last_started_action) {
521 _place_road_flag = RF_DIR_X;
522 if (_tile_fract_coords.x >= 8) _place_road_flag |= RF_START_HALFROAD_X;
527 _place_road_flag = RF_DIR_Y;
528 if (_tile_fract_coords.y >= 8) _place_road_flag |= RF_START_HALFROAD_Y;
533 _place_road_flag = RF_NONE;
534 if (_tile_fract_coords.x >= 8) _place_road_flag |= RF_START_HALFROAD_X;
535 if (_tile_fract_coords.y >= 8) _place_road_flag |= RF_START_HALFROAD_Y;
544 DoCommandP(tile, _cur_roadtype << 2 | _road_depot_orientation, 0,
569 default: NOT_REACHED();
581 if (RoadTypeIsRoad(this->roadtype)) {
599 switch (select_proc) {
601 _place_road_flag &= ~RF_END_HALFROAD_X;
602 if (pt.x & 8) _place_road_flag |= RF_END_HALFROAD_X;
606 _place_road_flag &= ~RF_END_HALFROAD_Y;
607 if (pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y;
611 _place_road_flag &= ~(RF_END_HALFROAD_Y | RF_END_HALFROAD_X);
612 if (pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y;
613 if (pt.x & 8) _place_road_flag |= RF_END_HALFROAD_X;
618 ( (_tile_fract_coords.x < _tile_fract_coords.y && (_tile_fract_coords.x + _tile_fract_coords.y) < 16) ||
619 (_tile_fract_coords.x > _tile_fract_coords.y && (_tile_fract_coords.x + _tile_fract_coords.y) > 16) ))) {
621 _place_road_flag &= ~RF_DIR_Y;
624 _place_road_flag |= RF_DIR_Y;
639 switch (select_proc) {
640 default: NOT_REACHED();
661 _place_road_flag = (
RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3));
663 DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 10),
729 static EventState RoadToolbarGlobalHotkeys(
int hotkey)
733 extern RoadType _last_built_roadtype;
737 static EventState TramToolbarGlobalHotkeys(
int hotkey)
740 extern RoadType _last_built_tramtype;
744 static Hotkey roadtoolbar_hotkeys[] = {
759 HotkeyList BuildRoadToolbarWindow::road_hotkeys(
"roadtoolbar", roadtoolbar_hotkeys, RoadToolbarGlobalHotkeys);
761 static Hotkey tramtoolbar_hotkeys[] = {
775 HotkeyList BuildRoadToolbarWindow::tram_hotkeys(
"tramtoolbar", tramtoolbar_hotkeys, TramToolbarGlobalHotkeys);
778 static const NWidgetPart _nested_build_road_widgets[] = {
817 _nested_build_road_widgets,
lengthof(_nested_build_road_widgets),
818 &BuildRoadToolbarWindow::road_hotkeys
821 static const NWidgetPart _nested_build_tramway_widgets[] = {
858 _nested_build_tramway_widgets,
lengthof(_nested_build_tramway_widgets),
859 &BuildRoadToolbarWindow::tram_hotkeys
877 return AllocateWindowDescFront<BuildRoadToolbarWindow>(RoadTypeIsRoad(_cur_roadtype) ? &_build_road_desc : &_build_tramway_desc,
TRANSPORT_ROAD);
880 static const NWidgetPart _nested_build_road_scen_widgets[] = {
910 WDP_AUTO,
"toolbar_road_scen", 0, 0,
913 _nested_build_road_scen_widgets,
lengthof(_nested_build_road_scen_widgets),
914 &BuildRoadToolbarWindow::road_hotkeys
917 static const NWidgetPart _nested_build_tramway_scen_widgets[] = {
945 WDP_AUTO,
"toolbar_tram_scen", 0, 0,
948 _nested_build_tramway_scen_widgets,
lengthof(_nested_build_tramway_scen_widgets),
949 &BuildRoadToolbarWindow::tram_hotkeys
961 return AllocateWindowDescFront<BuildRoadToolbarWindow>(RoadTypeIsRoad(_cur_roadtype) ? &_build_road_scen_desc : &_build_tramway_scen_desc,
TRANSPORT_ROAD);
970 if (RoadTypeIsTram(_cur_roadtype)) {
971 this->GetWidget<NWidgetCore>(
WID_BROD_CAPTION)->widget_data = STR_BUILD_DEPOT_TRAM_ORIENTATION_CAPTION;
1013 static const NWidgetPart _nested_build_road_depot_widgets[] = {
1047 _nested_build_road_depot_widgets,
lengthof(_nested_build_road_depot_widgets)
1061 if (RoadTypeIsTram(_cur_roadtype) && _road_station_picker_orientation <
DIAGDIR_END) {
1090 SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
1195 SetDataTip(STR_STATION_BUILD_COVERAGE_OFF, STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP),
1197 SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP),
1208 _nested_road_station_picker_widgets,
lengthof(_nested_road_station_picker_widgets)
1233 SetDataTip(STR_STATION_BUILD_COVERAGE_OFF, STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP),
1235 SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP),
1246 _nested_tram_station_picker_widgets,
lengthof(_nested_tram_station_picker_widgets)
1251 new BuildRoadStationWindow(RoadTypeIsRoad(_cur_roadtype) ? &_road_station_picker_desc : &_tram_station_picker_desc, parent, rs);
1254 void InitializeRoadGui()
1257 _road_station_picker_orientation =
DIAGDIR_NW;
1269 DropDownList GetRoadTypeDropDownList(RoadTramTypes rtts,
bool for_replacement,
bool all_option)
1277 if (for_replacement) {
1298 if (!for_replacement) {
1300 if (!
HasBit(used_roadtypes, rt))
continue;
1308 if (!
HasBit(used_roadtypes, rt))
continue;
1313 if (for_replacement) {
1316 StringID str = rti->
max_speed > 0 ? STR_TOOLBAR_RAILTYPE_VELOCITY : STR_JUST_STRING;
1318 iconitem->SetDimension(d);
1323 list.emplace_back(item);
1326 if (list.size() == 0) {
1334 DropDownList GetScenRoadTypeDropDownList(RoadTramTypes rtts)
1350 if (!
HasBit(used_roadtypes, rt))
continue;
1355 if (!
HasBit(used_roadtypes, rt))
continue;
1359 StringID str = rti->
max_speed > 0 ? STR_TOOLBAR_RAILTYPE_VELOCITY : STR_JUST_STRING;
1361 item->SetDimension(d);
1364 list.emplace_back(item);
1367 if (list.size() == 0) {
EventState
State of handling an event.
Functions related to OTTD's strings.
ViewportDragDropSelectionProcess
Drag and drop selection process, or, what to do with an area of land when you've selected it...
static EventState RoadTramToolbarGlobalHotkeys(int hotkey, RoadType last_build)
Handler for global hotkeys of the BuildRoadToolbarWindow.
don't allow building on structures
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Window * ShowBuildRoadScenToolbar(RoadType roadtype)
Show the road building toolbar in the scenario editor.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition of stuff that is very close to a company, like the company struct itself.
static void PlaceRoad_Bridge(TileIndex tile, Window *w)
Callback to start placing a bridge.
Select station (when joining stations); Window numbers:
A standard stop for trucks.
bool link_terraform_toolbar
display terraform toolbar when displaying rail, road, water and airport toolbars
ResizeInfo resize
Resize information.
virtual EventState OnHotkey(int hotkey)
A hotkey has been pressed.
void CheckRedrawStationCoverage(const Window *w)
Check whether we need to redraw the station coverage text.
void SetWidgetDisabledState(byte widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
Point pos
Location, in tile "units", of the northern tile of the selected area.
area of land of limited size
void SetWidgetLoweredState(byte widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
RoadTypes _roadtypes_type
Bitmap of road/tram types.
Window * parent
Parent window.
All data for a single hotkey.
High level window description.
Road stop placement (trucks)
build a complete road (not a "half" one)
static const CursorID ANIMCURSOR_DEMOLISH
704 - 707 - demolish dynamite
CursorID autoroad
Cursor for autorail tool.
Landscape generation (in Scenario Editor); Window numbers:
void ConnectRoadToStructure(TileIndex tile, DiagDirection direction)
If required, connects a new structure to an existing road or tram by building the missing roadbit...
void DrawWidgets() const
Paint all widgets of a window.
bool station_show_coverage
whether to highlight coverage area
CursorID depot
Cursor for building a depot.
static Titem * Get(size_t index)
Returns Titem with given index.
Scenario build toolbar; Window numbers:
SpriteID build_depot
button for building depots
static bool IsBridgeTile(TileIndex t)
checks if there is a bridge on this tile
Hotkey related functions.
Functions related to dates.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
void ShowSelectStationIfNeeded(const CommandContainer &cmd, TileArea ta)
Show the station selection window when needed.
Contains enums and function declarations connected with stations GUI.
remove a complete road (not a "half" one)
#define FOR_ALL_SORTED_ROADTYPES(var)
Loop header for iterating over roadtypes, sorted by sortorder.
void SetWidgetDirty(byte widget_index) const
Invalidate a widget, i.e.
Road stop removal (trucks)
Normal amount of vertical space between two paragraphs of text.
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
Draw only passenger class cargoes.
Functions/types related to the road GUIs.
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
The passed event is not handled.
void SetTileSelectSize(int w, int h)
Highlight w by h tiles at the cursor.
void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets,...)
Sets the enabled/disabled status of a list of widgets.
static int ScaleGUITrad(int value)
Scale traditional pixel dimensions to GUI zoom level.
StringID toolbar_caption
Caption in the construction toolbar GUI for this rail type.
Drag only in X axis with limited size.
Flag for invalid railtype.
RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces)
Get the road types the given company can build.
Point size
Size, in tile "units", of the white/red selection area.
Window * ShowBuildRoadToolbar(RoadType roadtype)
Open the build road toolbar window.
Drag only in Y axis with limited size.
Functions related to vehicles.
SpriteID build_x_road
button for building single rail in X direction
SpriteID build_tunnel
button for building a tunnel
A standard stop for buses.
int top
y position of top edge of the window
void DrawRoadDepotSprite(int x, int y, DiagDirection dir, RoadType rt)
Draw the road depot sprite.
byte station_spread
amount a station may spread
Build depot; Window numbers:
void ToggleWidgetLoweredState(byte widget_index)
Invert the lowered/raised status of a widget.
Tindex index
Index of this pool item.
flag for invalid roadtype
void VpSetPresizeRange(TileIndex from, TileIndex to)
Highlights all tiles between a set of two tiles.
Road stop removal (buses)
void ReInit(int rx=0, int ry=0)
Re-initialize a window, and optionally change its size.
void DisableWidget(byte widget_index)
Sets a widget to disabled.
bool persistent_buildingtools
keep the building tools active after usage
Common return value for all commands.
Catchment for bus stops with "modified catchment" enabled.
RoadType
The different roadtypes we support.
StringID err_convert_road
Converting a road type.
void RaiseWidget(byte widget_index)
Marks a widget as raised.
uint16 w
The width of the area.
void CreateNestedTree(bool fill_nested=true)
Perform the first part of the initialization of a nested widget tree.
StationSettings station
settings related to station management
RoadStopType
Types of RoadStops.
static T SB(T &x, const uint8 s, const uint8 n, const U d)
Set n bits in x starting at bit s to d.
Functions, definitions and such used only by the GUI.
static void ToggleRoadButton_Remove(Window *w)
Toggles state of the Remove button of Build road toolbar.
Functions related to (drawing on) viewports.
StringID replace_text
Text used in the autoreplace GUI.
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.
static bool IsInsideMM(const T x, const size_t min, const size_t max)
Checks if a value is in an interval.
void InitNested(WindowNumber number=0)
Perform complete initialization of the Window with nested widgets, to allow use.
std::vector< std::unique_ptr< const DropDownListItem > > DropDownList
A drop down list is a collection of drop down list items.
static const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
static RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
static TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
bool ValParamRoadType(RoadType roadtype)
Validate functions for rail building.
static const NWidgetPart _nested_road_station_picker_widgets[]
Widget definition of the build road station window.
TileIndex tile
Tile index.
int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies)
Calculates and draws the accepted or supplied cargo around the selected tile(s)
CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags)
Shorthand for calling the long DoCommand with a container.
StringID err_remove_station[2]
Removing of a bus or truck station.
static RoadBits GetRoadBits(TileIndex t, RoadTramType rtt)
Get the present road bits for a specific road type.
This window is used for construction; close it whenever changing company.
bool IsWidgetLowered(byte widget_index) const
Gets the lowered state of a widget.
List item with icon and string.
StringID picker_tooltip[2]
Tooltip for the station picker for bus or truck stations.
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, Date date)
Add the road types that are to be introduced at the given date.
SoundSettings sound
sound effect settings
Header file for things common for tunnels and bridges.
void SetRedErrorSquare(TileIndex tile)
Set a tile to display a red error square.
StringID picker_title[2]
Title for the station picker for bus or truck stations.
ViewportPlaceMethod
Viewport place method (type of highlighted area and placed objects)
void InitializeRoadGUI()
I really don't know why rail_gui.cpp has this too, shouldn't be included in the other one...
static DiagDirection ReverseDiagDir(DiagDirection d)
Returns the reverse direction of the given DiagDirection.
void RaiseButtons(bool autoraise=false)
Raise the buttons of the window.
Structure for buffering the build command when selecting a station to join.
ClientSettings _settings_client
The current settings for this game.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
bool Succeeded() const
Did this command succeed?
StationCoverageType
Types of cargo to display for station coverage.
#define TILE_AREA_LOOP(var, ta)
A loop which iterates over the tiles of a TileArea.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
List of hotkeys for a window.
rectangle (stations, depots, ...)
Road stop placement (buses)
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
Update size and resize step of a widget in the window.
bool IsWidgetDisabled(byte widget_index) const
Gets the enabled/disabled status of a widget.
StringID menu_text
Name of this rail type in the main toolbar dropdown.
Represents the covered area of e.g.
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
void LowerWidget(byte widget_index)
Marks a widget as lowered.
void CcBuildRoadTunnel(const CommandCost &result, TileIndex start_tile, uint32 p1, uint32 p2, uint32 cmd)
Callback executed after a build road tunnel command has been called.
void SetViewportCatchmentStation(const Station *st, bool sel)
Select or deselect station for coverage area highlight.
uint16 max_speed
Maximum speed for vehicles travelling on this road type.
void MarkTileDirtyByTile(TileIndex tile, int bridge_level_offset, int tile_height_override)
Mark a tile given by its index dirty for repaint.
TileIndex _build_tunnel_endtile
The end of a tunnel; as hidden return from the tunnel build command for GUI purposes.
StringID err_remove_road
Removing a normal piece of road.
struct RoadTypeInfo::@42 strings
Strings associated with the rail type.
Functions related to stations.
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, ViewportDragDropSelectionProcess process)
highlighting tiles while only going over them with the mouse
Catchment for truck stops with "modified catchment" enabled.
Catchment for all stations with "modified catchment" disabled.
#define lengthof(x)
Return the length of an fixed size array.
void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transport_type, byte road_rail_type)
Prepare the data for the build a bridge window.
Build bridge; Window numbers:
struct RoadTypeInfo::@40 gui_sprites
struct containing the sprites for the road GUI.
Also allow 'diagonal rectangles'. Only usable in combination with HT_RECT or HT_POINT.
Functions related to sound.
static DiagDirection GetTunnelBridgeDirection(TileIndex t)
Get the direction pointing to the other end.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
void DeleteWindowByClass(WindowClass cls)
Delete all windows of a given class.
bool Failed() const
Did this command fail?
void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method)
Selects tiles while dragging.
bool CanBuildVehicleInfrastructure(VehicleType type, byte subtype)
Check whether we can build infrastructure for the given vehicle type.
void SetDirty() const
Mark entire window as dirty (in need of re-paint)
Build toolbar; Window numbers:
TileIndex tile
The base tile of the area.
CursorID road_nwse
Cursor for building rail in Y direction.
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
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).
static Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
StringID err_depot
Building a depot.
static TileIndex GetOtherTunnelBridgeEnd(TileIndex t)
Determines type of the wormhole and returns its other end.
Functions related to companies.
static TileIndex TileVirtXY(uint x, uint y)
Get a tile from the virtual XY-coordinate.
static bool _remove_button_clicked
Flag whether 'remove' toggle-button is currently enabled.
StationType
Station types.
area of land in X and Y directions
static bool IsNormalRoadTile(TileIndex t)
Return whether a tile is a normal road tile.
GUISettings gui
settings related to the GUI
Align toward the toolbar.
static void PlaceRoad_BusStation(TileIndex tile)
Callback for placing a bus station.
uint32 TileIndex
The index/ID of a Tile.
bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyle mode)
This code is shared for the majority of the pushbuttons.
Draw all non-passenger class cargoes.
CursorID road_swne
Cursor for building rail in X direction.
bool modified_catchment
different-size catchment areas
RoadTypes avail_roadtypes
Road types available to this company.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
Build truck station; Window numbers:
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
StringID err_build_road
Building a normal piece of road.
Functions related to zooming.
Transport by road vehicle.
bool confirm
Play sound effect on successful constructions or other actions.
SpriteID build_y_road
button for building single rail in Y direction
Non-water non-rail construction.
Functions related to commands.
Coordinates of a point in 2D.
Dimension GetSpriteSize(SpriteID sprid, Point *offset, ZoomLevel zoom)
Get the size of a sprite.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
CursorID tunnel
Cursor for building a tunnel.
special mode used for highlighting while dragging (and for tunnels/docks)
Functions that have tunnels and bridges in common.
Offset at right to draw the frame rectangular area.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
DiagDirection
Enumeration for diagonal directions.
static void PlaceRoad_TruckStation(TileIndex tile)
Callback for placing a truck station.
Northeast, upper right on your monitor.
#define CMD_MSG(x)
Used to combine a StringID with the command.
Build bus station; Window numbers:
int32 WindowNumber
Number to differentiate different windows of the same class.
WindowClass window_class
Window class.
void ResetObjectToPlace()
Reset the cursor and mouse mode handling back to default (normal cursor, only clicking in windows)...
Specification of a rectangle with absolute coordinates of all edges.
The passed event is handled.
WindowNumber window_number
Window number within the window class.
Functions related to tile highlights.
Window functions not directly related to making/drawing windows.
Find a place automatically.
static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, uint32 cmd)
Place a new road stop.
void OnRealtimeTick(uint delta_ms) override
Called periodically.
String list item with parameters.
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
Update size and resize step of a widget in the window.
GUI functions that shouldn't be here.
SpriteID auto_road
button for the autoroad construction
struct RoadTypeInfo::@41 cursor
Cursors associated with the road type.
SpriteID convert_road
button for converting road types
RoadTypes GetRoadTypes(bool introduces)
Get list of road types, regardless of company availability.
Date _date
Current date in days (day counter)
StringID err_build_station[2]
Building a bus or truck station.
uint16 h
The height of the area.
static bool RoadToolbar_CtrlChanged(Window *w)
Updates the Remove button because of Ctrl state change.
void CcRoadStop(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
Command callback for building road stops.
void ResizeWindow(Window *w, int delta_x, int delta_y, bool clamp_to_screen)
Resize the window.
RoadFlags
Define the values of the RoadFlags.
CompanyID _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
Dimensions (a width and height) of a rectangle in 2D.
void OnPaint() override
The window must be repainted.
bool click_beep
Beep on a random selection of buttons.
Offset at left to draw the frame rectangular area.
Base class for windows opened from a toolbar.
static const NWidgetPart _nested_tram_station_picker_widgets[]
Widget definition of the build tram station window.
virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
The user has dragged over the map when the tile highlight mode has been set.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.