| 293 | } |
| 294 | |
| 295 | sp<Control> ControlGenerator::createVehicleAssignmentControl(GameState &state, sp<Vehicle> vehicle) |
| 296 | { |
| 297 | const int controlLength = 200, controlHeight = 24, iconLenght = 36; |
| 298 | |
| 299 | auto control = mksp<Control>(); |
| 300 | control->Size = control->SelectionSize = {controlLength, controlHeight}; |
| 301 | control->setData(vehicle); |
| 302 | |
| 303 | auto icon = createVehicleIcon(state, vehicle); |
| 304 | icon->Size = {iconLenght, controlHeight}; |
| 305 | icon->setParent(control); |
| 306 | |
| 307 | auto nameLabel = control->createChild<Label>(vehicle->name, singleton.labelFont); |
| 308 | nameLabel->Size = {controlLength - iconLenght, singleton.labelFont->getFontHeight()}; |
| 309 | nameLabel->Location = {iconLenght, (control->Size.y - nameLabel->Size.y) / 2}; |
| 310 | |
| 311 | return control; |
| 312 | } |
| 313 | |
| 314 | sp<Control> ControlGenerator::createBuildingAssignmentControl(GameState &state, |
| 315 | sp<Building> building) |
nothing calls this directly
no test coverage detected