MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / RefitWindow

Method RefitWindow

src/vehicle_gui.cpp:927–946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

925 }
926
927 RefitWindow(WindowDesc &desc, const Vehicle *v, VehicleOrderID order, bool auto_refit) : Window(desc)
928 {
929 this->auto_refit = auto_refit;
930 this->order = order;
931 this->CreateNestedTree();
932
933 this->vscroll = this->GetScrollbar(WID_VR_SCROLLBAR);
934 this->hscroll = (v->IsGroundVehicle() ? this->GetScrollbar(WID_VR_HSCROLLBAR) : nullptr);
935 this->GetWidget<NWidgetCore>(WID_VR_SELECT_HEADER)->SetToolTip(STR_REFIT_TRAIN_LIST_TOOLTIP + v->type);
936 this->GetWidget<NWidgetCore>(WID_VR_MATRIX)->SetToolTip(STR_REFIT_TRAIN_LIST_TOOLTIP + v->type);
937 NWidgetCore *nwi = this->GetWidget<NWidgetCore>(WID_VR_REFIT);
938 nwi->SetStringTip(STR_REFIT_TRAIN_REFIT_BUTTON + v->type, STR_REFIT_TRAIN_REFIT_TOOLTIP + v->type);
939 this->GetWidget<NWidgetStacked>(WID_VR_SHOW_HSCROLLBAR)->SetDisplayedPlane(v->IsGroundVehicle() ? 0 : SZSP_HORIZONTAL);
940 this->GetWidget<NWidgetCore>(WID_VR_VEHICLE_PANEL_DISPLAY)->SetToolTip((v->type == VEH_TRAIN) ? STR_REFIT_SELECT_VEHICLES_TOOLTIP : STR_NULL);
941
942 this->FinishInitNested(v->index);
943 this->owner = v->owner;
944
945 this->SetWidgetDisabledState(WID_VR_REFIT, this->selected_refit == nullptr);
946 }
947
948 void OnInit() override
949 {

Callers

nothing calls this directly

Calls 8

CreateNestedTreeMethod · 0.80
GetScrollbarMethod · 0.80
SetToolTipMethod · 0.80
SetStringTipMethod · 0.80
SetDisplayedPlaneMethod · 0.80
FinishInitNestedMethod · 0.80
IsGroundVehicleMethod · 0.45

Tested by

no test coverage detected