MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / open

Function open

src/OpenLoco/src/Ui/Windows/VehicleList.cpp:389–420  ·  view source on GitHub ↗

0x004C19DC

Source from the content-addressed store, hash-verified

387
388 // 0x004C19DC
389 Window* open(CompanyId companyId, VehicleType type)
390 {
391 Window* self = WindowManager::bringToFront(WindowType::vehicleList, enumValue(companyId));
392 if (self != nullptr)
393 {
394 const auto tabWidx = getTabFromType(type);
395 self->callOnMouseUp(tabWidx, self->widgets[tabWidx].id);
396 return self;
397 }
398
399 // 0x004C1A05
400 self = create(companyId);
401 auto tabIndex = static_cast<uint8_t>(type);
402 self->currentTab = tabIndex;
403 self->rowHeight = row_heights[tabIndex];
404 self->width = kWindowSize.width;
405 self->height = kWindowSize.height;
406 self->sortMode = 0;
407 self->rowHover = -1;
408 self->var_850 = static_cast<int16_t>(FilterMode::allVehicles);
409 self->var_852 = 0xFFFF;
410
411 populateVehicleList(*self);
412
413 self->invalidate();
414
415 self->callOnResize();
416 self->callPrepareDraw();
417 self->initScrollWidgets();
418
419 return self;
420 }
421
422 // 0x004C1D19
423 void removeTrainFromList(Window& self, EntityId head)

Callers 1

onScrollMouseDownFunction · 0.70

Calls 10

bringToFrontFunction · 0.85
enumValueFunction · 0.85
getTabFromTypeFunction · 0.85
callOnMouseUpMethod · 0.80
callOnResizeMethod · 0.80
callPrepareDrawMethod · 0.80
initScrollWidgetsMethod · 0.80
createFunction · 0.70
populateVehicleListFunction · 0.70
invalidateMethod · 0.45

Tested by

no test coverage detected