|
OpenTTD Source 20261112-master-gbcbec5e63f
|
A single row of ChainField. More...
Public Member Functions | |
| int | Height () const |
| Get the height of this row of fields. | |
| void | Draw (Rect r) const |
| Draw this row of fields. | |
| ChainField::ClickedAtResult | ClickedAt (Rect r, Point pt) const |
| Get the ClickedAt result for a field in this row. | |
| void | ConnectProducedCargo (int column) |
| Connect produced cargoes to the connection column after it. | |
| void | MakeCargoLabel (int column, bool accepting) |
| Construct a Cargo chain field. | |
| void | ConnectAcceptedCargo (int column) |
| Connect accepted cargoes to the connection column before it. | |
Static Public Member Functions | |
| static bool | IsValidColumn (int column) |
| Test if a given column index is valid. | |
Data Fields | |
| std::array< std::unique_ptr< ChainField >, MAX_COLUMNS > | columns {} |
| One row of fields. | |
Static Public Attributes | |
| static const int | MAX_COLUMNS = 5 |
| Maximum number of columns in a row. | |
A single row of ChainField.
Definition at line 2484 of file industry_gui.cpp.
|
inline |
Get the ClickedAt result for a field in this row.
| r | The rect of the row. |
| pt | The click position. |
ChainField::ClickedAtResult Definition at line 2533 of file industry_gui.cpp.
References _current_text_dir, ChainField::connection_field_width, Rect::Indent(), ChainField::industry_width, IsValidColumn(), MAX_COLUMNS, Point, TD_RTL, and Rect::WithWidth().
|
inline |
Connect accepted cargoes to the connection column before it.
| column | Column of the industry or house. |
Definition at line 2612 of file industry_gui.cpp.
References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::begin(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::end(), AcceptsProducesChainField::GetAccepted(), HasBit(), INVALID_CARGO, IsValidColumn(), ChainField::max_cargoes, and AcceptsProducesChainField::other_accepted.
|
inline |
Connect produced cargoes to the connection column after it.
| column | Column of the industry or house. |
Definition at line 2556 of file industry_gui.cpp.
References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::begin(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::end(), AcceptsProducesChainField::GetProduced(), HasBit(), INVALID_CARGO, IsValidColumn(), ChainField::max_cargoes, and AcceptsProducesChainField::other_produced.
|
inline |
Draw this row of fields.
| r | Rect to draw within. |
Definition at line 2517 of file industry_gui.cpp.
References _current_text_dir, ChainField::connection_field_width, Rect::Indent(), ChainField::industry_width, MAX_COLUMNS, TD_RTL, and Rect::WithWidth().
|
inline |
Get the height of this row of fields.
Definition at line 2503 of file industry_gui.cpp.
|
inlinestatic |
Test if a given column index is valid.
| column | The column index. |
true iff the column index is valid. Definition at line 2494 of file industry_gui.cpp.
References columns.
Referenced by ClickedAt(), ConnectAcceptedCargo(), ConnectProducedCargo(), and MakeCargoLabel().
|
inline |
Construct a Cargo chain field.
| column | Column for the new field. |
| accepting | Display accepted cargo (if false, display produced cargo). |
Definition at line 2589 of file industry_gui.cpp.
References ConnectionChainField::ConnectCargo(), End, INVALID_CARGO, IsValidColumn(), ConnectionChainField::num_cargoes, Start, and ConnectionChainField::vertical_cargoes.
| std::array<std::unique_ptr<ChainField>, MAX_COLUMNS> ChainRow::columns {} |
One row of fields.
Definition at line 2487 of file industry_gui.cpp.
Referenced by IndustryCargoesWindow::ComputeAcceptsProducesIndustryDisplay(), IndustryCargoesWindow::ComputeCargoDisplay(), and IsValidColumn().
|
static |
Maximum number of columns in a row.
Definition at line 2486 of file industry_gui.cpp.
Referenced by ClickedAt(), and Draw().