MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getStatusString

Method getStatusString

src/OpenLoco/src/World/Station.cpp:640–669  ·  view source on GitHub ↗

0x00492A98

Source from the content-addressed store, hash-verified

638
639 // 0x00492A98
640 char* Station::getStatusString(char* buffer)
641 {
642 char* ptr = buffer;
643 *ptr = '\0';
644
645 for (uint32_t cargoId = 0; cargoId < kMaxCargoStats; cargoId++)
646 {
647 auto& stationCargoStat = cargoStats[cargoId];
648
649 if (stationCargoStat.quantity == 0)
650 {
651 continue;
652 }
653
654 if (*buffer != '\0')
655 {
656 ptr = StringManager::formatString(ptr, StringIds::waiting_cargo_separator);
657 }
658
659 FormatArguments args{};
660 args.push<uint32_t>(stationCargoStat.quantity);
661
662 auto cargo = ObjectManager::get<CargoObject>(cargoId);
663 auto unitName = stationCargoStat.quantity == 1 ? cargo->unitNameSingular : cargo->unitNamePlural;
664 ptr = StringManager::formatString(ptr, unitName, args);
665 }
666
667 StringId suffix = *buffer == '\0' ? StringIds::nothing_waiting : StringIds::waiting;
668 return StringManager::formatString(ptr, suffix);
669 }
670
671 // 0x00492793
672 bool Station::updateCargo()

Callers 7

getStationArgumentsFunction · 0.45
getIndustryArgumentsFunction · 0.45
drawScrollFunction · 0.45
orderByStatusFunction · 0.45
drawScrollFunction · 0.45
drawFunction · 0.45
prepareDrawFunction · 0.45

Calls 1

formatStringFunction · 0.85

Tested by

no test coverage detected