| 81 | void LocationScreen::finish() {} |
| 82 | |
| 83 | void LocationScreen::eventOccurred(Event *e) |
| 84 | { |
| 85 | menuform->eventOccured(e); |
| 86 | if (menuform->eventIsWithin(e)) |
| 87 | { |
| 88 | return; |
| 89 | } |
| 90 | |
| 91 | if (e->type() == EVENT_KEY_DOWN) |
| 92 | { |
| 93 | if (e->keyboard().KeyCode == SDLK_ESCAPE || e->keyboard().KeyCode == SDLK_RETURN || |
| 94 | e->keyboard().KeyCode == SDLK_KP_ENTER) |
| 95 | { |
| 96 | menuform->findControl("BUTTON_QUIT")->click(); |
| 97 | return; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | if (e->type() == EVENT_FORM_INTERACTION && e->forms().EventFlag == FormEventType::ButtonClick) |
| 102 | { |
| 103 | if (e->forms().RaisedBy->Name == "BUTTON_QUIT") |
| 104 | { |
| 105 | fw().stageQueueCommand({StageCmd::Command::POP}); |
| 106 | return; |
| 107 | } |
| 108 | if (e->forms().RaisedBy->Name == "BUTTON_EQUIPAGENT") |
| 109 | { |
| 110 | if (agentAssignment->currentAgent) |
| 111 | { |
| 112 | fw().stageQueueCommand( |
| 113 | {StageCmd::Command::PUSH, |
| 114 | mksp<AEquipScreen>(this->state, agentAssignment->currentAgent)}); |
| 115 | } |
| 116 | return; |
| 117 | } |
| 118 | if (e->forms().RaisedBy->Name == "BUTTON_EQUIPVEHICLE") |
| 119 | { |
| 120 | if (agentAssignment->currentVehicle) |
| 121 | { |
| 122 | auto equipScreen = mksp<VEquipScreen>(this->state); |
| 123 | equipScreen->setSelectedVehicle(agentAssignment->currentVehicle); |
| 124 | fw().stageQueueCommand({StageCmd::Command::PUSH, equipScreen}); |
| 125 | } |
| 126 | return; |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void LocationScreen::update() { menuform->update(); } |
| 132 |
nothing calls this directly
no test coverage detected