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

Method eventOccurred

game/ui/tileview/cityview.cpp:3031–3079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3029}
3030
3031void CityView::eventOccurred(Event *e)
3032{
3033 this->drawCity = true;
3034 if (overlayTab->isVisible())
3035 {
3036 overlayTab->eventOccured(e);
3037 }
3038 baseForm->eventOccured(e);
3039
3040 // Exclude mouse down events that are over the form
3041 if (activeTab->eventIsWithin(e) || baseForm->eventIsWithin(e) || overlayTab->eventIsWithin(e))
3042 {
3043 // We pass this event so that scroll can work
3044 if (e->type() != EVENT_MOUSE_MOVE)
3045 {
3046 return;
3047 }
3048 }
3049
3050 if (e->type() == EVENT_KEY_DOWN)
3051 {
3052 if (handleKeyDown(e))
3053 {
3054 return;
3055 }
3056 }
3057 if (e->type() == EVENT_KEY_UP)
3058 {
3059 if (handleKeyUp(e))
3060 {
3061 return;
3062 }
3063 }
3064 if (e->type() == EVENT_MOUSE_DOWN)
3065 {
3066 if (handleMouseDown(e))
3067 {
3068 return;
3069 }
3070 }
3071 if (e->type() == EVENT_GAME_STATE)
3072 {
3073 if (handleGameStateEvent(e))
3074 {
3075 return;
3076 }
3077 }
3078 CityTileView::eventOccurred(e);
3079}
3080
3081bool CityView::handleKeyDown(Event *e)
3082{

Callers

nothing calls this directly

Calls 4

eventIsWithinMethod · 0.80
typeMethod · 0.80
isVisibleMethod · 0.45
eventOccuredMethod · 0.45

Tested by

no test coverage detected