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

Method VehicleGroupWindow

src/group_gui.cpp:421–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419
420public:
421 VehicleGroupWindow(WindowDesc &desc, WindowNumber window_number, const VehicleListIdentifier &vli) : BaseVehicleListWindow(desc, vli)
422 {
423 this->CreateNestedTree();
424
425 this->vscroll = this->GetScrollbar(WID_GL_LIST_VEHICLE_SCROLLBAR);
426 this->group_sb = this->GetScrollbar(WID_GL_LIST_GROUP_SCROLLBAR);
427
428 this->vli.SetIndex(ALL_GROUP);
429
430 this->groups.ForceRebuild();
431 this->groups.NeedResort();
432 this->BuildGroupList(vli.company);
433 this->group_sb->SetCount(this->groups.size());
434
435 this->GetWidget<NWidgetCore>(WID_GL_CAPTION)->SetString(STR_VEHICLE_LIST_TRAIN_CAPTION + this->vli.vtype);
436 this->GetWidget<NWidgetCore>(WID_GL_LIST_VEHICLE)->SetToolTip(STR_VEHICLE_LIST_TRAIN_LIST_TOOLTIP + this->vli.vtype);
437
438 this->GetWidget<NWidgetCore>(WID_GL_CREATE_GROUP)->SetSprite(SPR_GROUP_CREATE_TRAIN + this->vli.vtype);
439 this->GetWidget<NWidgetCore>(WID_GL_RENAME_GROUP)->SetSprite(SPR_GROUP_RENAME_TRAIN + this->vli.vtype);
440 this->GetWidget<NWidgetCore>(WID_GL_DELETE_GROUP)->SetSprite(SPR_GROUP_DELETE_TRAIN + this->vli.vtype);
441 this->GetWidget<NWidgetCore>(WID_GL_LIVERY_GROUP)->SetSprite(SPR_GROUP_LIVERY_TRAIN + this->vli.vtype);
442 this->GetWidget<NWidgetCore>(WID_GL_REPLACE_PROTECTION)->SetSprite(SPR_GROUP_REPLACE_OFF_TRAIN + this->vli.vtype);
443
444 this->FinishInitNested(window_number);
445 this->owner = vli.company;
446
447 this->BuildVehicleList();
448 this->SortVehicleList();
449 }
450
451 ~VehicleGroupWindow()
452 {

Callers

nothing calls this directly

Calls 14

BuildGroupListMethod · 0.95
CreateNestedTreeMethod · 0.80
GetScrollbarMethod · 0.80
ForceRebuildMethod · 0.80
NeedResortMethod · 0.80
SetToolTipMethod · 0.80
SetSpriteMethod · 0.80
FinishInitNestedMethod · 0.80
BuildVehicleListMethod · 0.80
SortVehicleListMethod · 0.80
SetIndexMethod · 0.45
SetCountMethod · 0.45

Tested by

no test coverage detected