| 129 | } |
| 130 | |
| 131 | void 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 | |
| 158 | void VehicleSheet::displayEngine(sp<VEquipment> item [[maybe_unused]], sp<VEquipmentType> type) |
| 159 | { |