| 347 | } |
| 348 | |
| 349 | void RecruitScreen::fillBaseBar(int percent) |
| 350 | { |
| 351 | auto facilityBar = form->findControlTyped<Graphic>("FACILITY_FIRST_FILL"); |
| 352 | facilityBar->setVisible(true); |
| 353 | |
| 354 | auto progressImage = mksp<RGBImage>(facilityBar->Size); |
| 355 | int redHeight = progressImage->size.y * std::min(100, percent) / 100; |
| 356 | { |
| 357 | // FIXME: For some reason, there's no border here like in the research screen, so we |
| 358 | // have to make one manually, probably there's a better way |
| 359 | RGBImageLock l(progressImage); |
| 360 | for (int x = 0; x < 2; x++) |
| 361 | { |
| 362 | for (int y = 1; y <= progressImage->size.y; y++) |
| 363 | { |
| 364 | if (y < redHeight) |
| 365 | { |
| 366 | l.set({x, progressImage->size.y - y}, {255, 0, 0, 255}); |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | } |
| 371 | facilityBar->setImage(progressImage); |
| 372 | } |
| 373 | |
| 374 | /** |
| 375 | * Display stats of an agent |
nothing calls this directly
no test coverage detected