| 110 | } |
| 111 | |
| 112 | sp<Control> MapSelector::createMapRowBase(StateRef<Base> base, sp<GameState> state) |
| 113 | { |
| 114 | auto control = mksp<Control>(); |
| 115 | |
| 116 | const int HEIGHT = 21; |
| 117 | |
| 118 | auto text = |
| 119 | control->createChild<Label>(format("[Base] %s", base->name), ui().getFont("smalfont")); |
| 120 | text->Location = {0, 0}; |
| 121 | text->Size = {488, HEIGHT}; |
| 122 | text->TextVAlign = VerticalAlignment::Centre; |
| 123 | |
| 124 | { |
| 125 | auto btnImage = fw().data->loadImage( |
| 126 | "PCK:xcom3/ufodata/newbut.pck:xcom3/ufodata/newbut.tab:57:ui/menuopt.pal"); |
| 127 | auto btnLocation = control->createChild<GraphicButton>(btnImage, btnImage); |
| 128 | btnLocation->Location = text->Location + Vec2<int>{text->Size.x, 0}; |
| 129 | btnLocation->Size = {22, HEIGHT}; |
| 130 | btnLocation->addCallback(FormEventType::ButtonClick, [base, state, this](Event *) { |
| 131 | skirmish.setLocation(base); |
| 132 | fw().stageQueueCommand({StageCmd::Command::POP}); |
| 133 | }); |
| 134 | } |
| 135 | |
| 136 | return control; |
| 137 | } |
| 138 | |
| 139 | void MapSelector::begin() {} |
| 140 |
nothing calls this directly
no test coverage detected