| 169 | void ResearchScreen::finish() {} |
| 170 | |
| 171 | void ResearchScreen::eventOccurred(Event *e) |
| 172 | { |
| 173 | form->eventOccured(e); |
| 174 | |
| 175 | if (e->type() == EVENT_KEY_DOWN) |
| 176 | { |
| 177 | if (e->keyboard().KeyCode == SDLK_ESCAPE || e->keyboard().KeyCode == SDLK_RETURN || |
| 178 | e->keyboard().KeyCode == SDLK_KP_ENTER) |
| 179 | { |
| 180 | form->findControl("BUTTON_OK")->click(); |
| 181 | return; |
| 182 | } |
| 183 | } |
| 184 | // DEBUG |
| 185 | if (e->type() == EVENT_KEY_DOWN) |
| 186 | { |
| 187 | switch (e->keyboard().KeyCode) |
| 188 | { |
| 189 | case SDLK_F10: |
| 190 | { |
| 191 | if (current_topic) |
| 192 | { |
| 193 | switch (this->viewFacility->lab->current_project->type) |
| 194 | { |
| 195 | case ResearchTopic::Type::BioChem: |
| 196 | case ResearchTopic::Type::Physics: |
| 197 | current_topic->man_hours_progress = current_topic->man_hours - 1; |
| 198 | break; |
| 199 | case ResearchTopic::Type::Engineering: |
| 200 | viewFacility->lab->manufacture_man_hours_invested = |
| 201 | current_topic->man_hours * |
| 202 | this->viewFacility->lab->manufacture_goal; |
| 203 | break; |
| 204 | default: |
| 205 | LogError("Unknown lab type"); |
| 206 | break; |
| 207 | } |
| 208 | updateProgressInfo(); |
| 209 | } |
| 210 | return; |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | if (e->type() == EVENT_MOUSE_MOVE) |
| 216 | { |
| 217 | arrow->setVisible(!(e->mouse().X > arrow->getLocationOnScreen().x)); |
| 218 | } |
| 219 | |
| 220 | if (e->type() == EVENT_FORM_INTERACTION) |
| 221 | { |
| 222 | if (e->forms().EventFlag == FormEventType::ButtonClick) |
| 223 | { |
| 224 | if (e->forms().RaisedBy->Name == "BUTTON_OK") |
| 225 | { |
| 226 | fw().stageQueueCommand({StageCmd::Command::POP}); |
| 227 | return; |
| 228 | } |
nothing calls this directly
no test coverage detected