| 65 | } |
| 66 | |
| 67 | char* IndustryObject::getRequiredCargoString(const char* buffer) const |
| 68 | { |
| 69 | char* ptr = (char*)buffer; |
| 70 | auto requiredCargoCount = 0; |
| 71 | |
| 72 | for (const auto& requiredCargo : requiredCargoType) |
| 73 | { |
| 74 | if (requiredCargo != kCargoTypeNull) |
| 75 | { |
| 76 | requiredCargoCount++; |
| 77 | |
| 78 | if (requiredCargoCount > 1) |
| 79 | { |
| 80 | if (hasFlags(IndustryObjectFlags::requiresAllCargo)) |
| 81 | { |
| 82 | ptr = StringManager::formatString(ptr, StringIds::cargo_and); |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | ptr = StringManager::formatString(ptr, StringIds::cargo_or); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | auto cargoObj = ObjectManager::get<CargoObject>(requiredCargo); |
| 91 | ptr = StringManager::formatString(ptr, cargoObj->name); |
| 92 | } |
| 93 | } |
| 94 | return ptr; |
| 95 | } |
| 96 | |
| 97 | // 0x0045932D |
| 98 | void IndustryObject::drawPreviewImage(Gfx::DrawingContext& drawingCtx, const int16_t x, const int16_t y) const |
no test coverage detected