38 static const NWidgetPart _nested_group_widgets[] = {
60 SetDataTip(SPR_GROUP_CREATE_TRAIN, STR_GROUP_CREATE_TOOLTIP),
62 SetDataTip(SPR_GROUP_DELETE_TRAIN, STR_GROUP_DELETE_TOOLTIP),
64 SetDataTip(SPR_GROUP_RENAME_TRAIN, STR_GROUP_RENAME_TOOLTIP),
66 SetDataTip(SPR_GROUP_LIVERY_TRAIN, STR_GROUP_LIVERY_TOOLTIP),
69 SetDataTip(SPR_GROUP_REPLACE_OFF_TRAIN, STR_GROUP_REPLACE_PROTECTION_TOOLTIP),
80 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_GL_LIST_VEHICLE),
SetMinimalSize(248, 0),
SetMatrixDataTip(1, 0, STR_NULL),
SetResize(1, 1),
SetFill(1, 0),
SetScrollbar(
WID_GL_LIST_VEHICLE_SCROLLBAR),
86 SetDataTip(STR_BLACK_STRING, STR_VEHICLE_LIST_AVAILABLE_ENGINES_TOOLTIP),
89 SetDataTip(STR_VEHICLE_LIST_MANAGE_LIST, STR_VEHICLE_LIST_MANAGE_LIST_TOOLTIP),
91 SetDataTip(SPR_FLAG_VEH_STOPPED, STR_VEHICLE_LIST_MASS_STOP_LIST_TOOLTIP),
93 SetDataTip(SPR_FLAG_VEH_RUNNING, STR_VEHICLE_LIST_MASS_START_LIST_TOOLTIP),
129 for (
const Group *g : *source) {
130 if (g->parent != parent)
continue;
131 this->groups.push_back(g);
132 this->indents.push_back(indent);
135 auto child = std::find_if(source->begin(), source->end(), [g](
const Group *child){
return child->parent == g->index; });
136 bool has_children = child != source->end();
139 AddChildren(source, g->index, indent + 1);
147 static const Group *last_group[2] = {
nullptr,
nullptr };
148 static char last_name[2][64] = {
"",
"" };
150 if (a != last_group[0]) {
153 GetString(last_name[0], STR_GROUP_NAME,
lastof(last_name[0]));
156 if (b != last_group[1]) {
159 GetString(last_name[1], STR_GROUP_NAME,
lastof(last_name[1]));
162 int r =
strnatcmp(last_name[0], last_name[1]);
176 this->groups.clear();
177 this->indents.clear();
182 if (g->owner == owner && g->vehicle_type == this->vli.vtype) {
192 this->groups.shrink_to_fit();
203 this->tiny_step_height = this->column_size[
VGC_FOLD].height;
207 this->tiny_step_height =
max(this->tiny_step_height, this->column_size[
VGC_NAME].
height);
210 this->tiny_step_height =
max(this->tiny_step_height, this->column_size[
VGC_PROTECT].height);
213 this->tiny_step_height =
max(this->tiny_step_height, this->column_size[
VGC_AUTOREPLACE].height);
217 static const SpriteID profit_sprites[] = {SPR_PROFIT_NA, SPR_PROFIT_NEGATIVE, SPR_PROFIT_SOME, SPR_PROFIT_LOT};
218 for (uint i = 0; i <
lengthof(profit_sprites); i++) {
222 this->tiny_step_height =
max(this->tiny_step_height, this->column_size[
VGC_PROFIT].height);
228 this->tiny_step_height =
max(this->tiny_step_height, this->column_size[
VGC_NUMBER].height);
233 this->column_size[
VGC_FOLD].width + 2 +
234 this->column_size[
VGC_NAME].width + 8 +
252 void DrawGroupInfo(
int y,
int left,
int right,
GroupID g_id,
int indent = 0,
bool protection =
false,
bool has_children =
false)
const 255 if (g_id == this->group_over) {
269 DrawSprite(
Group::Get(g_id)->folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED, PAL_NONE, rtl ? x - indent : x + indent, y + (this->tiny_step_height - this->column_size[
VGC_FOLD].
height) / 2);
275 str = STR_GROUP_ALL_TRAINS + this->
vli.
vtype;
276 }
else if (IsDefaultGroupID(g_id)) {
277 str = STR_GROUP_DEFAULT_TRAINS + this->
vli.
vtype;
280 str = STR_GROUP_NAME;
282 x = rtl ? x - 2 - this->column_size[
VGC_NAME].width : x + 2 + this->column_size[
VGC_FOLD].width;
283 DrawString(x + (rtl ? 0 : indent), x + this->column_size[
VGC_NAME].
width - 1 - (rtl ? indent : 0), y + (this->tiny_step_height - this->column_size[
VGC_NAME].
height) / 2, str, colour);
286 x = rtl ? x - 8 - this->column_size[
VGC_PROTECT].width : x + 8 + this->column_size[
VGC_NAME].width;
287 if (protection)
DrawSprite(SPR_GROUP_REPLACE_PROTECT, PAL_NONE, x, y + (this->tiny_step_height - this->column_size[
VGC_PROTECT].height) / 2);
298 if (num_profit_vehicle == 0) {
300 }
else if (profit_last_year < 0) {
301 spr = SPR_PROFIT_NEGATIVE;
302 }
else if (profit_last_year < (
Money)10000 * num_profit_vehicle) {
303 spr = SPR_PROFIT_SOME;
305 spr = SPR_PROFIT_LOT;
307 DrawSprite(spr, PAL_NONE, x, y + (this->tiny_step_height - this->column_size[
VGC_PROFIT].height) / 2);
310 x = rtl ? x - 2 - this->column_size[
VGC_NUMBER].width : x + 2 + this->column_size[
VGC_PROFIT].width;
313 if (
IsAllGroupID(g_id) || IsDefaultGroupID(g_id) || num_vehicle_with_subgroups == num_vehicle) {
318 SetDParam(1, num_vehicle_with_subgroups - num_vehicle);
332 }
else if (IsDefaultGroupID(this->group_over)) {
348 default: NOT_REACHED();
365 this->BuildVehicleList();
366 this->SortVehicleList();
371 this->group_sb->
SetCount((uint)this->groups.size());
373 this->GetWidget<NWidgetCore>(
WID_GL_CAPTION)->widget_data = STR_VEHICLE_LIST_TRAIN_CAPTION + this->
vli.
vtype;
382 this->FinishInitNested(window_number);
411 size->height =
Ceil(size->height - max_icon_height, tiny_step_height);
424 d.height += padding.height;
432 size->height = 4 * resize->height;
437 d.height += padding.height;
438 d.width += padding.width;
510 this->BuildVehicleList();
511 this->SortVehicleList();
515 this->group_sb->
SetCount((uint)this->groups.size());
551 uint16 protect_sprite = SPR_GROUP_REPLACE_OFF_TRAIN;
575 uint32 occupancy = 0;
576 size_t vehicle_count = this->
vehicles.size();
578 for (uint i = 0; i < vehicle_count; i++) {
580 assert(v->
owner == this->owner);
591 DrawString(left, right, y, STR_GROUP_PROFIT_THIS_YEAR, TC_BLACK);
596 DrawString(left, right, y, STR_GROUP_PROFIT_LAST_YEAR, TC_BLACK);
601 DrawString(left, right, y, STR_GROUP_OCCUPANCY, TC_BLACK);
602 if (vehicle_count > 0) {
614 const Group *g = this->groups[i];
616 assert(g->
owner == this->owner);
639 if (v->
group_id != this->vli.index) {
651 static void DeleteGroupCallback(
Window *win,
bool confirmed)
681 if (!IsDefaultGroupID(this->
vli.
index)) {
690 if (id_g >= this->groups.size())
return;
692 if (groups[id_g]->folded || (id_g + 1 < this->groups.size() && this->indents[id_g + 1] > this->indents[id_g])) {
694 NWidgetCore *group_display = this->GetWidget<NWidgetCore>(widget);
698 if (click_count > 1 || (pt.x >= x && pt.x < (
int)(x + this->column_size[
VGC_FOLD].width))) {
704 if (g == groups[id_g]->index) {
711 Group::Get(groups[id_g]->index)->folded = !groups[id_g]->folded;
719 this->group_sel = this->
vli.
index = this->groups[id_g]->index;
730 if (id_v >= this->
vehicles.size())
return;
735 this->vehicle_sel = v->
index;
755 this->group_confirm = this->
vli.
index;
756 ShowQuery(STR_QUERY_GROUP_DELETE_CAPTION, STR_GROUP_DELETE_QUERY_TEXT,
this, DeleteGroupCallback);
761 this->ShowRenameGroupWindow(this->
vli.
index,
false);
793 void OnDragDrop_Group(
Point pt,
int widget)
813 if (this->group_sel != new_g && g->
parent != new_g) {
825 void OnDragDrop_Vehicle(
Point pt,
int widget)
844 GroupID new_g = id_g >= this->groups.size() ?
NEW_GROUP : this->groups[id_g]->index;
857 if (id_v >= this->
vehicles.size())
return;
870 if (this->vehicle_sel !=
INVALID_VEHICLE) OnDragDrop_Vehicle(pt, widget);
871 if (this->group_sel !=
INVALID_GROUP) OnDragDrop_Group(pt, widget);
918 default: NOT_REACHED();
922 default: NOT_REACHED();
957 new_group_over = id_g >= this->groups.size() ?
NEW_GROUP : this->groups[id_g]->index;
970 if (new_group_over != this->group_over) {
972 this->group_over = new_group_over;
977 void ShowRenameGroupWindow(
GroupID group,
bool empty)
980 this->group_rename = group;
985 str = STR_GROUP_NAME;
1035 _nested_group_widgets,
lengthof(_nested_group_widgets)
1039 WDP_AUTO,
"list_groups_train", 525, 246,
1042 _nested_group_widgets,
lengthof(_nested_group_widgets)
1059 w = AllocateWindowDescFront<VehicleGroupWindow>(&_train_group_desc, num, need_existing_window);
1062 w = AllocateWindowDescFront<VehicleGroupWindow>(&_other_group_desc, num, need_existing_window);
1098 if (result.
Failed())
return;
1102 if (w !=
nullptr) w->ShowRenameGroupWindow(_new_group_id,
true);
1115 if (result.
Failed())
return;
Functions related to OTTD's strings.
Owner
Enum for all companies/owners.
void DirtyHighlightedGroupWidget()
Mark the widget containing the currently highlighted group as dirty.
void UnselectVehicle(VehicleID vehicle)
Tests whether a given vehicle is selected in the window, and unselects it if necessary.
void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask, uint width)
Show a dropdown menu window near a widget of the parent window.
void RebuildDone()
Notify the sortlist that the rebuild is done.
Definition of stuff that is very close to a company, like the company struct itself.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
bool replace_protection
If set to true, the global autoreplace have no effect on the group.
CompanyID company
The company associated with this list.
The information about a vehicle list.
ResizeInfo resize
Resize information.
void GfxFillRect(int left, int top, int right, int bottom, int colour, FillRectMode mode)
Applies a certain FillRectMode-operation to a rectangle [left, right] x [top, bottom] on the screen...
void OnPaint() override
The window must be repainted.
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.
Money GetDisplayProfitThisYear() const
Gets the profit vehicle had this year.
Window * parent
Parent window.
High level window description.
Functions related to the autoreplace GUIs.
int left
x position of left edge of the window
bool vehchain
vehicle chain is dragged
SpecialMouseMode _special_mouse_mode
Mode of the mouse.
bool VehicleClicked(const Vehicle *v)
Dispatch a "vehicle selected" event if any window waits for it.
void DrawWidgets() const
Paint all widgets of a window.
static Titem * Get(size_t index)
Returns Titem with given index.
void SetWidgetDirty(byte widget_index) const
Invalidate a widget, i.e.
Offset at top to draw the frame rectangular area.
std::vector< int > indents
Indentation levels.
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
byte _colour_gradient[COLOUR_END][8]
All 16 colour gradients 8 colours per gradient from darkest (0) to lightest (7)
void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets,...)
Sets the enabled/disabled status of a list of widgets.
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.
GUIVehicleList vehicles
The list of vehicles.
Functions related to vehicles.
void SelectGroup(const GroupID g_id)
Selects the specified group in the list.
Tindex index
Index of this pool item.
Offset at top of a matrix cell.
bool NeedResort()
Check if a resort is needed next loop If used the resort timer will decrease every call till 0...
#define lastof(x)
Get the last element of an fixed size array.
bool autoreplace_finished
Have all autoreplacement finished?
uint GetGroupNumProfitVehicle(CompanyID company, GroupID id_g, VehicleType type)
Get the number of vehicles above profit minimum age in the group with GroupID id_g and its sub-groups...
Stuff related to the text buffer GUI.
void OnDragDrop(Point pt, int widget) override
A dragged 'object' has been released.
Common return value for all commands.
static const VehicleID INVALID_VEHICLE
Constant representing a non-existing vehicle.
static T max(const T a, const T b)
Returns the maximum of two values.
VehicleID vehicle_sel
Selected vehicle.
void RaiseWidget(byte widget_index)
Marks a widget as raised.
WindowClass cls
Class of the window,.
void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
Opens a 'Rename group' window for newly created group.
uint ComputeGroupInfoSize()
Compute tiny_step_height and column_size.
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.
void SetListing(Listing l)
Import sort conditions.
GroupID group_rename
Group being renamed, INVALID_GROUP if none.
int HideDropDownMenu(Window *pw)
Delete the drop-down menu from window pw.
bool NeedRebuild() const
Check if a rebuild is needed.
void ShowDropDownList(Window *w, DropDownList &&list, int selected, int button, uint width, bool auto_width, bool instant_close)
Show a drop down list.
Force the alignment, i.e. don't swap for RTL languages.
void ForceRebuild()
Force that a rebuild is needed.
void ShowCompanyGroupForVehicle(const Vehicle *v)
Show the group window for the given vehicle.
Data structure for an opened window.
bool _ctrl_pressed
Is Ctrl pressed?
static const GroupID NEW_GROUP
Sentinel for a to-be-created group.
dragging items in the depot windows
enable the 'Default' button ("\0" is returned)
static bool IsAllGroupID(GroupID id_g)
Checks if a GroupID stands for all vehicles of a company.
add all other shared vehicles to a group which are missing
static const uint MAX_LENGTH_GROUP_NAME_CHARS
The maximum length of a group name in characters including '\0'.
void ShowCompanyGroup(CompanyID company, VehicleType vehicle_type, GroupID group=INVALID_GROUP, bool need_existing_window=false)
Show the group window for the given company and vehicle type.
Functions related to low-level strings.
static const int LEVEL_WIDTH
Indenting width of a sub-group in pixels.
remove all vehicles from a group
void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const
Draw all the vehicle list items.
void OnGameTick() override
Called once per (game) tick.
bool IsWidgetLowered(byte widget_index) const
Gets the lowered state of a widget.
Statistics and caches on the vehicles in a group.
Listing GetListing() const
Export current sort conditions.
void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallbackProc *callback)
Show a modal confirmation window with standard 'yes' and 'no' buttons The window is aligned to the ce...
Dimension column_size[VGC_END]
Size of the columns in the group list.
uint32 index
A vehicle list type specific index.
uint32 VehicleID
The type all our vehicle IDs have.
DropDownList BuildActionDropdownList(bool show_autoreplace, bool show_group)
Display the Action dropdown window.
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
Definition of base types and functions in a cross-platform compatible way.
Tells that it's a mass send to depot command (type in VLW flag)
the length of the string is counted in characters
A number of safeguards to prevent using unsafe methods.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
void CcAddVehicleNewGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
Open rename window after adding a vehicle to a new group via drag and drop.
uint16 GroupID
Type for all group identifiers.
void DrawSortButtonState(int widget, SortButtonState state) const
Draw a sort button's up or down arrow symbol.
uint step_height
Step-size of height resize changes.
const Scrollbar * GetScrollbar(uint widnum) const
Return the Scrollbar to a widget index.
GUI Functions related to companies.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
static GroupStatistics & Get(CompanyID company, GroupID id_g, VehicleType type)
Returns the GroupStatistics for a specific group.
Offset at bottom to draw the frame rectangular area.
uint GetGroupNumVehicle(CompanyID company, GroupID id_g, VehicleType type)
Get the number of vehicles in the group with GroupID id_g and its sub-groups.
static const GroupID INVALID_GROUP
Sentinel for invalid groups.
int DrawString(int left, int right, int top, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
void ShowVehicleViewWindow(const Vehicle *v)
Shows the vehicle view window of the given vehicle.
uint16 num_vehicle
Number of vehicles.
Owner owner
Which company owns the vehicle?
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.
static T min(const T a, const T b)
Returns the minimum of two values.
void OnQueryTextFinished(char *str) override
The query window opened from this window has closed.
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
Number of vehicles in the group.
void SetSortType(uint8 n_type)
Set the sorttype of the list.
bool Sort(SortFunction *compare)
Sort the list.
static int SortButtonWidth()
Get width of up/down arrow of sort button state.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
void DrawGroupInfo(int y, int left, int right, GroupID g_id, int indent=0, bool protection=false, bool has_children=false) const
Draw a row in the group list.
bool Failed() const
Did this command fail?
void DeleteWindowByClass(WindowClass cls)
Delete all windows of a given class.
Functions/classes shared between the different vehicle list GUIs.
void SetDirty() const
Mark entire window as dirty (in need of re-paint)
void BuildGroupList(Owner owner)
(Re)Build the group list.
Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize)
Return the string dimension in pixels.
void OnPlaceObjectAbort() override
The user cancelled a tile highlight mode that has been set.
void ForceResort()
Force a resort next Sort call Reset the resort timer if used too.
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
Draw only every second pixel, used for greying-out.
No window, redirects to WC_MAIN_WINDOW.
int8 trip_occupancy
NOSAVE: Occupancy of vehicle of the current trip (updated after leaving a station).
static const GroupID DEFAULT_GROUP
Ungrouped vehicles are in this group.
The vehicle will leave the depot right after arrival (service only)
Functions related to companies.
Vehicle drawn in vehicle list, group list, ...
void SetObjectToPlaceWnd(CursorID icon, PaletteID pal, HighLightStyle mode, Window *w)
Change the cursor and mouse click/drag handling to a mode for performing special operations like tile...
Both numeric and alphabetic and spaces and stuff.
Money GetGroupProfitLastYear(CompanyID company, GroupID id_g, VehicleType type)
Get last year's profit for the group with GroupID id_g and its sub-groups.
void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type)
Set the mouse cursor to look like a vehicle.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
GroupID parent
Parent group.
int strnatcmp(const char *s1, const char *s2, bool ignore_garbage_at_front)
Compares two strings using case insensitive natural sort.
Autoreplace protect icon.
Base class for all vehicles.
static VehicleGroupWindow * FindVehicleGroupWindow(VehicleType vt, Owner owner)
Finds a group list window determined by vehicle type and owner.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32 TileIndex
The index/ID of a Tile.
static const PaletteID PALETTE_CRASH
Recolour sprite greying of crashed vehicles.
uint32 Pack() const
Pack a VehicleListIdentifier in a single uint32.
void DeleteGroupHighlightOfVehicle(const Vehicle *v)
Removes the highlight of a vehicle in a group window.
bool autoreplace_defined
Are any autoreplace rules set?
TextDirection _current_text_dir
Text direction of the currently selected language.
void ToggleSortOrder()
Toggle the sort order Since that is the worst condition for the sort function reverse the list here...
void SetDParamMaxValue(uint n, uint64 max_value, uint min_count, FontSize size)
Set DParam n to some number that is suitable for string size computations.
static bool GroupNameSorter(const Group *const &a, const Group *const &b)
Sort the groups by their name.
bool folded
NOSAVE: Is this group folded in the group view?
void ShowReplaceGroupVehicleWindow(GroupID id_g, VehicleType vehicletype)
Show the autoreplace configuration window for a particular group.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
void OnMouseDrag(Point pt, int widget) override
An 'object' is being dragged at the provided position, highlight the target if possible.
Trains list; Window numbers:
VehicleType type
Type of vehicle.
GroupID group_sel
Selected group (for drag/drop)
Functions related to the drop down widget.
void SetStringParameters(int widget) const override
Initialize string parameters for a widget.
VehicleListIdentifier vli
Identifier of the vehicle list we want to currently show.
Bottom offset of the dropdown widget string.
Functions related to commands.
Coordinates of a point in 2D.
set the autoreplace-protection for a group
Dimension GetSpriteSize(SpriteID sprid, Point *offset, ZoomLevel zoom)
Get the size of a sprite.
CompanyID _current_company
Company currently doing an action.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
Index of the small font in the font tables.
static WindowClass GetWindowClassForVehicleType(VehicleType vt)
Get WindowClass for vehicle list of given vehicle type.
start/stop all vehicles (in a depot)
void OnResize() override
Called after the window got resized.
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable...
Offset at right to draw the frame rectangular area.
int width
width of the window (number of pixels to the right in x direction)
uint GetVehicleListHeight(VehicleType type, uint divisor)
Get the height of a vehicle in the vehicle list GUIs.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
GUIGroupList groups
List of groups.
bool IsDescSortOrder() const
Check if the sort order is descending.
#define CMD_MSG(x)
Used to combine a StringID with the command.
int32 WindowNumber
Number to differentiate different windows of the same 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.
Text is written right-to-left by default.
Right align the text (must be a single bit).
WindowNumber window_number
Window number within the window class.
Functions related to tile highlights.
Window functions not directly related to making/drawing windows.
static uint Ceil(uint a, uint b)
Computes ceil(a / b) * b for non-negative a and b.
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
Find a place automatically.
uint tiny_step_height
Step height for the group list.
Dimension GetActionDropdownSize(bool show_autoreplace, bool show_group)
Compute the size for the Action dropdown.
Listing * sorting
Pointer to the vehicle type related sorting.
static const CursorID SPR_CURSOR_MOUSE
Cursor sprite numbers.
GroupID group_over
Group over which a vehicle is dragged, INVALID_GROUP if none.
GroupID group_confirm
Group awaiting delete confirmation.
VehicleType vtype
The vehicle type associated with this list.
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.
Query string window; Window numbers:
Offset at left to draw the frame rectangular area.
void OnDropdownSelect(int widget, int index) override
A dropdown option associated to this window has been selected.
This file contains all sprite-related enums and defines.
Money GetDisplayProfitLastYear() const
Gets the profit vehicle had last year.
int find_index(std::vector< T > const &vec, T const &item)
Helper function to get the index of an item Consider using std::set, std::unordered_set or std::flat_...
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
Top offset of the dropdown widget string.
GroupID group_id
Index of group Pool array.
int height
Height of the window (number of pixels down in y direction)
uint8 SortType() const
Get the sorttype of the list.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
static const GroupID ALL_GROUP
All vehicles are in this group.