@@ -1094,15 +1094,12 @@ struct BuildVehicleWindow : Window {
this->vscroll = this->GetScrollbar(WID_BV_SCROLLBAR);
/* If we are just viewing the list of vehicles, we do not need the Build button.
* So we just hide it, and enlarge the Rename button by the now vacant place. */
if (this->listview_mode) this->GetWidget<NWidgetStacked>(WID_BV_BUILD_SEL)->SetDisplayedPlane(SZSP_NONE);
/* disable renaming engines in network games if you are not the server */
this->SetWidgetDisabledState(WID_BV_RENAME, _networking && !_network_server);
NWidgetCore *widget = this->GetWidget<NWidgetCore>(WID_BV_LIST);
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP + type;
widget = this->GetWidget<NWidgetCore>(WID_BV_SHOW_HIDE);
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_HIDE_SHOW_TOGGLE_TOOLTIP + type;
@@ -1605,13 +1602,16 @@ struct BuildVehicleWindow : Window {
void OnPaint() override
{
this->GenerateBuildList();
this->vscroll->SetCount((uint)this->eng_list.size());
this->SetWidgetsDisabledState(this->sel_engine == INVALID_ENGINE, WID_BV_SHOW_HIDE, WID_BV_BUILD, WID_BV_RENAME, WIDGET_LIST_END);
this->SetWidgetsDisabledState(this->sel_engine == INVALID_ENGINE, WID_BV_SHOW_HIDE, WID_BV_BUILD, WIDGET_LIST_END);
/* Disable renaming engines in network games if you are not the server. */
this->SetWidgetDisabledState(WID_BV_RENAME, this->sel_engine == INVALID_ENGINE || (_networking && !_network_server));
this->DrawWidgets();
if (!this->IsShaded()) {
int needed_height = this->details_height;
/* Draw details panels. */
Status change: