MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / eventOccurred

Method eventOccurred

game/ui/base/recruitscreen.cpp:682–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680void RecruitScreen::finish() {}
681
682void RecruitScreen::eventOccurred(Event *e)
683{
684 form->eventOccured(e);
685
686 if (e->type() == EVENT_MOUSE_MOVE)
687 {
688 arrow->setVisible(!(e->mouse().X > arrow->getLocationOnScreen().x));
689 }
690
691 if (e->type() == EVENT_KEY_DOWN)
692 {
693 if (e->keyboard().KeyCode == SDLK_ESCAPE || e->keyboard().KeyCode == SDLK_RETURN ||
694 e->keyboard().KeyCode == SDLK_SPACE || e->keyboard().KeyCode == SDLK_KP_ENTER)
695 {
696 form->findControl("BUTTON_OK")->click();
697 return;
698 }
699 }
700
701 if (e->type() == EVENT_FORM_INTERACTION)
702 {
703 if (e->forms().EventFlag == FormEventType::ButtonClick)
704 {
705 if (e->forms().RaisedBy->Name == "BUTTON_OK")
706 {
707 attemptCloseScreen();
708 return;
709 }
710 }
711 }
712}
713
714void RecruitScreen::update() { form->update(); }
715

Callers

nothing calls this directly

Calls 6

typeMethod · 0.80
getLocationOnScreenMethod · 0.80
findControlMethod · 0.80
eventOccuredMethod · 0.45
setVisibleMethod · 0.45
clickMethod · 0.45

Tested by

no test coverage detected