forked from mirror/OpenTTD
Change: Hide all variants from UI when (display) parent is hidden. (#10708)
This commit is contained in:
@@ -137,6 +137,18 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> {
|
||||
return c < MAX_COMPANIES && HasBit(this->company_hidden, c);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last display variant for an engine.
|
||||
* @return Engine's last display variant or engine itself if no last display variant is set.
|
||||
*/
|
||||
const Engine *GetDisplayVariant() const
|
||||
{
|
||||
if (this->display_last_variant == this->index || this->display_last_variant == INVALID_ENGINE) return this;
|
||||
return Engine::Get(this->display_last_variant);
|
||||
}
|
||||
|
||||
bool IsVariantHidden(CompanyID c) const;
|
||||
|
||||
/**
|
||||
* Check if the engine is a ground vehicle.
|
||||
* @return True iff the engine is a train or a road vehicle.
|
||||
|
Reference in New Issue
Block a user