|
OpenTTD Source 20261112-master-gbcbec5e63f
|
Base cargo chain field. More...
Public Types | |
| using | CargoSlotMask = uint16_t |
| Type representing a mask of cargo slots. | |
| using | ClickedAtResult = std::variant<std::monostate, HouseID, IndustryType, CargoType> |
| Result type of testing clicked position. | |
Public Member Functions | |
| template<typename T> | |
| T * | Get () |
| Get this field as a specific type implemention. | |
| template<typename T> | |
| const T * | Get () const |
| Get this field as a specific type implemention. | |
| virtual int | Width () const |
| Get the width of this field. | |
| virtual int | Height () const |
| Get the height of this field. | |
| virtual void | Draw (Rect r) const =0 |
| Draw the field. | |
| virtual ClickedAtResult | ClickedAt (Rect r, Point pt) const |
| Decide which industry/house or cargo was clicked at. | |
Static Public Member Functions | |
| static uint | GetConnectionHeight () |
| Get the height of all cargo connections in a row. | |
Static Public Attributes | |
| static constexpr uint | MAX_CARGOES = 16 |
| Maximum number of cargoes carried in a field. | |
| static constexpr CargoSlotMask | ALL_CARGO_SLOTS {std::numeric_limits<CargoSlotMask>::max()} |
| Value representing all cargo slots. | |
| static constexpr PixelColour | CARGO_LINE_COLOUR = PC_BLACK |
| Line colour around the cargo. | |
| static FontSize | fontsize = FontSize::Normal |
| Font size of industry chain strings. | |
| static CargoTypes | town_accepts |
| Mask of cargo types accepted by towns. | |
| static CargoTypes | town_produces |
| Mask of cargo types produced by towns. | |
| static int | vert_inter_industry_space |
| Amount of space between two industries in a column. | |
| static int | blob_distance |
| Distance of the industry legend colour from the edge of the industry box. | |
| static Dimension | legend |
| Dimension of the legend blob. | |
| static Dimension | cargo_border |
| Dimensions of border between cargo lines and industry boxes. | |
| static Dimension | cargo_line |
| Dimensions of cargo lines. | |
| static Dimension | cargo_space |
| Dimensions of space between cargo lines. | |
| static Dimension | cargo_stub |
| Dimensions of cargo stub (unconnected cargo line.). | |
| static int | small_height |
| Height of the header row. | |
| static int | normal_height |
| Height of the non-header rows. | |
| static int | connection_field_width |
| Width of a cargo connection field. | |
| static int | industry_width |
| Width of an industry field. | |
| static uint | max_cargoes |
| Largest number of cargoes actually on any industry. | |
Base cargo chain field.
Definition at line 1968 of file industry_gui.cpp.
| using ChainField::CargoSlotMask = uint16_t |
Type representing a mask of cargo slots.
Definition at line 1972 of file industry_gui.cpp.
| using ChainField::ClickedAtResult = std::variant<std::monostate, HouseID, IndustryType, CargoType> |
Result type of testing clicked position.
Definition at line 2046 of file industry_gui.cpp.
|
inlinevirtual |
Decide which industry/house or cargo was clicked at.
| r | Rect of this cargo field. |
| pt | Click position in the cargo field. |
Reimplemented in AcceptsProducesChainField, CargoChainField, ConnectionChainField, HouseChainField, and IndustryChainField.
Definition at line 2054 of file industry_gui.cpp.
References Point.
|
pure virtual |
Draw the field.
| r | Rect to draw within. |
Implemented in AcceptsProducesChainField, CargoChainField, ConnectionChainField, HeaderChainField, HouseChainField, and IndustryChainField.
Get this field as a specific type implemention.
| T | The type of chain field. |
Definition at line 2018 of file industry_gui.cpp.
References T.
Get this field as a specific type implemention.
| T | The type of chain field. |
Definition at line 2025 of file industry_gui.cpp.
References T.
|
inlinestatic |
Get the height of all cargo connections in a row.
Definition at line 2006 of file industry_gui.cpp.
References cargo_line, cargo_space, and max_cargoes.
Referenced by AcceptsProducesChainField::ClickedAt(), CargoChainField::ClickedAt(), ConnectionChainField::ClickedAt(), AcceptsProducesChainField::Draw(), CargoChainField::Draw(), ConnectionChainField::Draw(), and IndustryCargoesWindow::OnInit().
|
inlinevirtual |
Get the height of this field.
Reimplemented in HeaderChainField.
Definition at line 2037 of file industry_gui.cpp.
References normal_height.
|
inlinevirtual |
Get the width of this field.
Reimplemented in ConnectionChainField.
Definition at line 2031 of file industry_gui.cpp.
References industry_width.
|
staticconstexpr |
Value representing all cargo slots.
Definition at line 1975 of file industry_gui.cpp.
Referenced by ConnectionChainField::ClickedAt(), ConnectionChainField::Draw(), and IndustryCargoesWindow::ShortenConnectionsColumn().
|
inlinestatic |
Distance of the industry legend colour from the edge of the industry box.
Definition at line 1988 of file industry_gui.cpp.
Referenced by IndustryChainField::Draw(), and IndustryCargoesWindow::OnInit().
|
inlinestatic |
Dimensions of border between cargo lines and industry boxes.
Definition at line 1991 of file industry_gui.cpp.
Referenced by IndustryCargoesWindow::OnInit().
|
inlinestatic |
Dimensions of cargo lines.
Definition at line 1992 of file industry_gui.cpp.
Referenced by AcceptsProducesChainField::ClickedAt(), CargoChainField::ClickedAt(), ConnectionChainField::ClickedAt(), AcceptsProducesChainField::Draw(), CargoChainField::Draw(), ConnectionChainField::Draw(), GetConnectionHeight(), and IndustryCargoesWindow::OnInit().
|
staticconstexpr |
Line colour around the cargo.
Definition at line 1980 of file industry_gui.cpp.
Referenced by AcceptsProducesChainField::Draw(), and ConnectionChainField::Draw().
|
inlinestatic |
Dimensions of space between cargo lines.
Definition at line 1993 of file industry_gui.cpp.
Referenced by AcceptsProducesChainField::ClickedAt(), CargoChainField::ClickedAt(), ConnectionChainField::ClickedAt(), AcceptsProducesChainField::Draw(), CargoChainField::Draw(), ConnectionChainField::Draw(), GetConnectionHeight(), and IndustryCargoesWindow::OnInit().
|
inlinestatic |
Dimensions of cargo stub (unconnected cargo line.).
Definition at line 1994 of file industry_gui.cpp.
Referenced by AcceptsProducesChainField::ClickedAt(), AcceptsProducesChainField::Draw(), IndustryCargoesWindow::OnInit(), and IndustryCargoesWindow::UpdateWidgetSize().
|
inlinestatic |
Width of a cargo connection field.
Definition at line 1998 of file industry_gui.cpp.
Referenced by ChainRow::ClickedAt(), ChainRow::Draw(), IndustryCargoesWindow::GetRowRect(), IndustryCargoesWindow::OnInit(), IndustryCargoesWindow::UpdateWidgetSize(), and ConnectionChainField::Width().
|
inlinestatic |
Font size of industry chain strings.
Definition at line 1982 of file industry_gui.cpp.
Referenced by CargoChainField::ClickedAt(), CargoChainField::Draw(), HeaderChainField::Draw(), HouseChainField::Draw(), IndustryChainField::Draw(), and IndustryCargoesWindow::OnInit().
|
inlinestatic |
Width of an industry field.
Definition at line 1999 of file industry_gui.cpp.
Referenced by ChainRow::ClickedAt(), ChainRow::Draw(), IndustryCargoesWindow::GetRowRect(), IndustryCargoesWindow::OnInit(), IndustryCargoesWindow::UpdateWidgetSize(), and Width().
|
inlinestatic |
Dimension of the legend blob.
Definition at line 1990 of file industry_gui.cpp.
Referenced by IndustryChainField::Draw(), and IndustryCargoesWindow::OnInit().
|
staticconstexpr |
Maximum number of cargoes carried in a field.
Definition at line 1970 of file industry_gui.cpp.
Referenced by CargoChainField::Draw().
|
inlinestatic |
Largest number of cargoes actually on any industry.
Definition at line 2000 of file industry_gui.cpp.
Referenced by AcceptsProducesChainField::ClickedAt(), ChainRow::ConnectAcceptedCargo(), ChainRow::ConnectProducedCargo(), AcceptsProducesChainField::Draw(), GetConnectionHeight(), and IndustryCargoesWindow::OnInit().
|
inlinestatic |
Height of the non-header rows.
Definition at line 1997 of file industry_gui.cpp.
Referenced by Height(), IndustryCargoesWindow::OnInit(), and IndustryCargoesWindow::UpdateWidgetSize().
|
inlinestatic |
Height of the header row.
Definition at line 1996 of file industry_gui.cpp.
Referenced by HeaderChainField::Height(), IndustryCargoesWindow::OnInit(), IndustryCargoesWindow::OnResize(), and IndustryCargoesWindow::UpdateWidgetSize().
|
inlinestatic |
Mask of cargo types accepted by towns.
Definition at line 1984 of file industry_gui.cpp.
Referenced by IndustryCargoesWindow::ComputeHouseDisplay(), IndustryCargoesWindow::CountHouseCargoTypes(), HouseChainField::GetAccepted(), IndustryCargoesWindow::HousesCanAccept(), and IndustryCargoesWindow::OnTooltip().
|
inlinestatic |
Mask of cargo types produced by towns.
Definition at line 1985 of file industry_gui.cpp.
Referenced by IndustryCargoesWindow::ComputeHouseDisplay(), IndustryCargoesWindow::CountHouseCargoTypes(), HouseChainField::GetProduced(), IndustryCargoesWindow::HousesCanSupply(), and IndustryCargoesWindow::OnTooltip().
|
inlinestatic |
Amount of space between two industries in a column.
Definition at line 1987 of file industry_gui.cpp.
Referenced by ConnectionChainField::ClickedAt(), IndustryCargoesWindow::ClickedAt(), ConnectionChainField::Draw(), IndustryCargoesWindow::DrawWidget(), IndustryCargoesWindow::OnInit(), and IndustryCargoesWindow::UpdateWidgetSize().