| 164 | } |
| 165 | |
| 166 | void VehicleSheet::displayWeapon(sp<VEquipment> item, sp<VEquipmentType> type) |
| 167 | { |
| 168 | form->findControlTyped<Label>("LABEL_2_L")->setText(tr("Damage")); |
| 169 | form->findControlTyped<Label>("LABEL_2_R")->setText(format("%d", type->damage)); |
| 170 | form->findControlTyped<Label>("LABEL_3_L")->setText(tr("Range")); |
| 171 | form->findControlTyped<Label>("LABEL_3_R")->setText(format("%d", type->getRangeInTiles())); |
| 172 | form->findControlTyped<Label>("LABEL_4_L")->setText(tr("Accuracy")); |
| 173 | form->findControlTyped<Label>("LABEL_4_R")->setText(format("%d%%", type->accuracy)); |
| 174 | |
| 175 | // Only show rounds if non-zero (IE not infinite ammo) |
| 176 | if (type->max_ammo != 0) |
| 177 | { |
| 178 | form->findControlTyped<Label>("LABEL_5_L")->setText(tr("Rounds")); |
| 179 | form->findControlTyped<Label>("LABEL_5_R") |
| 180 | ->setText(item ? format("%d / %d", item->ammo, type->max_ammo) |
| 181 | : format("%d", type->max_ammo)); |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | void VehicleSheet::displayGeneral(sp<VEquipment> item [[maybe_unused]], sp<VEquipmentType> type) |
| 186 | { |
nothing calls this directly
no test coverage detected