0x00437949
| 1048 | |
| 1049 | // 0x00437949 |
| 1050 | static void drawGraphLegend(Window* self, Gfx::DrawingContext& drawingCtx, int16_t x, int16_t y) |
| 1051 | { |
| 1052 | auto tr = Gfx::TextRenderer(drawingCtx); |
| 1053 | |
| 1054 | auto cargoCount = 0; |
| 1055 | for (uint8_t i = 0; i < ObjectManager::getMaxObjects(ObjectType::cargo); i++) |
| 1056 | { |
| 1057 | auto cargo = ObjectManager::get<CargoObject>(i); |
| 1058 | if (cargo == nullptr) |
| 1059 | { |
| 1060 | continue; |
| 1061 | } |
| 1062 | |
| 1063 | auto colour = _cargoLineColour[i]; |
| 1064 | auto palette = Colours::getShade(colour, 6); |
| 1065 | auto stringId = StringIds::small_black_string; |
| 1066 | |
| 1067 | if (self->var_854 & (1 << cargoCount)) |
| 1068 | { |
| 1069 | stringId = StringIds::small_white_string; |
| 1070 | } |
| 1071 | |
| 1072 | if (!(self->var_854 & (1 << cargoCount)) || !(_hoverItemTicks & (1 << 2))) |
| 1073 | { |
| 1074 | drawingCtx.fillRect(x, y + 3, x + 4, y + 7, palette, Gfx::RectFlags::none); |
| 1075 | } |
| 1076 | |
| 1077 | auto args = FormatArguments(); |
| 1078 | args.push(cargo->name); |
| 1079 | |
| 1080 | auto point = Point(x + 6, y); |
| 1081 | tr.drawStringLeftClipped(point, 94, Colour::black, stringId, args); |
| 1082 | |
| 1083 | y += 10; |
| 1084 | cargoCount++; |
| 1085 | } |
| 1086 | } |
| 1087 | |
| 1088 | // 0x00437120 |
| 1089 | static void draw(Window& self, Gfx::DrawingContext& drawingCtx) |
no test coverage detected