| 1998 | } |
| 1999 | |
| 2000 | std::string GetWidgetString(WidgetID widget, StringID stringid) const override |
| 2001 | { |
| 2002 | switch (widget) { |
| 2003 | case WID_VL_AVAILABLE_VEHICLES: |
| 2004 | return GetString(STR_VEHICLE_LIST_AVAILABLE_TRAINS + this->vli.vtype); |
| 2005 | |
| 2006 | case WID_VL_GROUP_BY_PULLDOWN: |
| 2007 | return GetString(std::data(this->vehicle_group_by_names)[this->grouping]); |
| 2008 | |
| 2009 | case WID_VL_SORT_BY_PULLDOWN: |
| 2010 | return GetString(this->GetVehicleSorterNames()[this->vehgroups.SortType()]); |
| 2011 | |
| 2012 | case WID_VL_FILTER_BY_CARGO: |
| 2013 | return GetString(this->GetCargoFilterLabel(this->cargo_filter_criteria)); |
| 2014 | |
| 2015 | case WID_VL_CAPTION: |
| 2016 | case WID_VL_CAPTION_SHARED_ORDERS: { |
| 2017 | switch (this->vli.type) { |
| 2018 | case VL_SHARED_ORDERS: // Shared Orders |
| 2019 | return GetString(stringid, this->vehicles.size()); |
| 2020 | |
| 2021 | case VL_STANDARD: // Company Name |
| 2022 | return GetString(stringid, STR_COMPANY_NAME, this->vli.ToCompanyID(), std::monostate{}, this->vehicles.size()); |
| 2023 | |
| 2024 | case VL_STATION_LIST: // Station/Waypoint Name |
| 2025 | return GetString(stringid, Station::IsExpected(BaseStation::Get(this->vli.ToStationID())) ? STR_STATION_NAME : STR_WAYPOINT_NAME, this->vli.ToStationID(), std::monostate{}, this->vehicles.size()); |
| 2026 | |
| 2027 | case VL_DEPOT_LIST: |
| 2028 | return GetString(stringid, STR_DEPOT_CAPTION, this->vli.vtype, this->vli.ToDestinationID(), this->vehicles.size()); |
| 2029 | |
| 2030 | default: NOT_REACHED(); |
| 2031 | } |
| 2032 | } |
| 2033 | |
| 2034 | default: |
| 2035 | return this->Window::GetWidgetString(widget, stringid); |
| 2036 | } |
| 2037 | } |
| 2038 | |
| 2039 | void DrawWidget(const Rect &r, WidgetID widget) const override |
| 2040 | { |
nothing calls this directly
no test coverage detected