|
@@ -1030,15 +1030,15 @@ struct RefitWindow : public Window {
|
|
|
case WID_VR_REFIT: // refit button
|
|
|
if (this->cargo != nullptr) {
|
|
|
const Vehicle *v = Vehicle::Get(this->window_number);
|
|
|
|
|
|
if (this->order == INVALID_VEH_ORDER_ID) {
|
|
|
bool delete_window = this->selected_vehicle == v->index && this->num_vehicles == UINT8_MAX;
|
|
|
if (DoCommandP(v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16, GetCmdRefitVeh(v)) && delete_window) delete this;
|
|
|
if (DoCommandP(v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 16, GetCmdRefitVeh(v)) && delete_window) this->Close();
|
|
|
} else {
|
|
|
if (DoCommandP(v->tile, v->index, this->cargo->cargo | this->order << 16, CMD_ORDER_REFIT)) delete this;
|
|
|
if (DoCommandP(v->tile, v->index, this->cargo->cargo | this->order << 16, CMD_ORDER_REFIT)) this->Close();
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2715,18 +2715,19 @@ public:
|
|
|
this->GetWidget<NWidgetCore>(WID_VV_SHOW_DETAILS)->tool_tip = STR_VEHICLE_VIEW_TRAIN_SHOW_DETAILS_TOOLTIP + v->type;
|
|
|
this->GetWidget<NWidgetCore>(WID_VV_CLONE)->tool_tip = STR_VEHICLE_VIEW_CLONE_TRAIN_INFO + v->type;
|
|
|
|
|
|
this->UpdateButtonStatus();
|
|
|
}
|
|
|
|
|
|
~VehicleViewWindow()
|
|
|
void Close() override
|
|
|
{
|
|
|
DeleteWindowById(WC_VEHICLE_ORDERS, this->window_number, false);
|
|
|
DeleteWindowById(WC_VEHICLE_REFIT, this->window_number, false);
|
|
|
DeleteWindowById(WC_VEHICLE_DETAILS, this->window_number, false);
|
|
|
DeleteWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false);
|
|
|
this->Window::Close();
|
|
|
}
|
|
|
|
|
|
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
|
|
|
{
|
|
|
const Vehicle *v = Vehicle::Get(this->window_number);
|
|
|
switch (widget) {
|