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

Method displayEquipImplementation

game/ui/general/vehiclesheet.cpp:131–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void VehicleSheet::displayEquipImplementation(sp<VEquipment> item, sp<VEquipmentType> type)
132{
133 form->findControlTyped<TextEdit>("TEXT_VEHICLE_NAME")->setText("");
134 form->findControlTyped<Label>("ITEM_NAME")->setText(item ? item->type->name : type->name);
135 form->findControlTyped<Graphic>("SELECTED_IMAGE")->setImage(type->equipscreen_sprite);
136
137 form->findControlTyped<Label>("LABEL_1_L")->setText(tr("Weight"));
138 form->findControlTyped<Label>("LABEL_1_R")->setText(format("%d", type->weight));
139
140 // Draw equipment stats
141 switch (type->type)
142 {
143 case EquipmentSlotType::VehicleEngine:
144 displayEngine(item, type);
145 break;
146 case EquipmentSlotType::VehicleWeapon:
147 displayWeapon(item, type);
148 break;
149 case EquipmentSlotType::VehicleGeneral:
150 displayGeneral(item, type);
151 break;
152 default:
153 LogError("Unhandled equipment type %s on vehicle", type->id);
154 break;
155 }
156}
157
158void VehicleSheet::displayEngine(sp<VEquipment> item [[maybe_unused]], sp<VEquipmentType> type)
159{

Callers

nothing calls this directly

Calls 4

trFunction · 0.85
formatFunction · 0.85
setTextMethod · 0.45
setImageMethod · 0.45

Tested by

no test coverage detected