MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / setSelectedVehicle

Method setSelectedVehicle

game/ui/base/vequipscreen.cpp:513–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511bool VEquipScreen::isTransition() { return false; }
512
513void VEquipScreen::setSelectedVehicle(sp<Vehicle> vehicle)
514{
515 if (!vehicle)
516 {
517 LogError("Trying to set invalid selected vehicle");
518 return;
519 }
520 LogInfo("Selecting vehicle \"%s\"", vehicle->name);
521 this->selected = vehicle;
522 auto backgroundImage = vehicle->type->equipment_screen;
523 if (!backgroundImage)
524 {
525 LogError("Trying to view equipment screen of vehicle \"%s\" which has no equipment screen "
526 "background",
527 vehicle->type->name);
528 }
529
530 auto backgroundControl = form->findControlTyped<Graphic>("BACKGROUND");
531 backgroundControl->setImage(backgroundImage);
532
533 this->paperDoll->setObject(vehicle);
534}
535
536void VEquipScreen::setHighlightedSlotType(EquipmentSlotType type)
537{

Callers 8

VEquipScreenMethod · 0.95
eventOccurredMethod · 0.95
eventOccurredMethod · 0.80
eventOccurredMethod · 0.80
initMethod · 0.80
eventOccurredMethod · 0.80
CityViewMethod · 0.80
updateMethod · 0.80

Calls 2

setObjectMethod · 0.80
setImageMethod · 0.45

Tested by

no test coverage detected