| 54 | MapSelector::~MapSelector() = default; |
| 55 | |
| 56 | sp<Control> MapSelector::createMapRowBuilding(StateRef<Building> building, sp<GameState> state) |
| 57 | { |
| 58 | auto control = mksp<Control>(); |
| 59 | |
| 60 | const int HEIGHT = 21; |
| 61 | |
| 62 | auto text = control->createChild<Label>( |
| 63 | format("[%s Building] %s [%s]", building->owner == state->getAliens() ? "Alien" : "Human", |
| 64 | building->name, building->battle_map.id), |
| 65 | ui().getFont("smalfont")); |
| 66 | text->Location = {0, 0}; |
| 67 | text->Size = {488, HEIGHT}; |
| 68 | text->TextVAlign = VerticalAlignment::Centre; |
| 69 | |
| 70 | { |
| 71 | auto btnImage = fw().data->loadImage( |
| 72 | "PCK:xcom3/ufodata/newbut.pck:xcom3/ufodata/newbut.tab:57:ui/menuopt.pal"); |
| 73 | auto btnLocation = control->createChild<GraphicButton>(btnImage, btnImage); |
| 74 | btnLocation->Location = text->Location + Vec2<int>{text->Size.x, 0}; |
| 75 | btnLocation->Size = {22, HEIGHT}; |
| 76 | btnLocation->addCallback(FormEventType::ButtonClick, [building, state, this](Event *) { |
| 77 | skirmish.setLocation(building); |
| 78 | fw().stageQueueCommand({StageCmd::Command::POP}); |
| 79 | }); |
| 80 | } |
| 81 | |
| 82 | return control; |
| 83 | } |
| 84 | |
| 85 | sp<Control> MapSelector::createMapRowVehicle(StateRef<VehicleType> vehicle, sp<GameState> state) |
| 86 | { |
nothing calls this directly
no test coverage detected