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

Method eventOccurred

game/ui/tileview/citytileview.cpp:116–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114CityTileView::~CityTileView() = default;
115
116void CityTileView::eventOccurred(Event *e)
117{
118 if (e->type() == EVENT_KEY_DOWN)
119 {
120 if (debugHotkeyMode)
121 {
122 switch (e->keyboard().KeyCode)
123 {
124 case SDLK_w:
125 {
126 DEBUG_SHOW_ALIEN = !DEBUG_SHOW_ALIEN;
127 return;
128 }
129 case SDLK_F2:
130 {
131 DEBUG_SHOW_ROAD_PATHFINDING = !DEBUG_SHOW_ROAD_PATHFINDING;
132 return;
133 }
134 case SDLK_PAGEUP:
135 if (DEBUG_LAYER == -1 || DEBUG_LAYER >= map.size.z)
136 {
137 DEBUG_LAYER = 0;
138 }
139 else
140 {
141 DEBUG_LAYER++;
142 }
143 return;
144 case SDLK_PAGEDOWN:
145 if (DEBUG_LAYER <= 0)
146 {
147 DEBUG_LAYER = 0;
148 }
149 else
150 {
151 DEBUG_LAYER--;
152 }
153 return;
154 case SDLK_F3:
155 {
156 DEBUG_SHOW_MISC_TYPE++;
157 DEBUG_SHOW_MISC_TYPE = DEBUG_SHOW_MISC_TYPE % 6;
158 if (DEBUG_SHOW_MISC_TYPE)
159 {
160 DEBUG_SHOW_SLOPES = false;
161 DEBUG_SHOW_TUBE = false;
162 DEBUG_SHOW_ROADS = false;
163 DEBUG_SHOW_ALIEN_CREW = false;
164 DEBUG_LAYER = -1;
165 }
166 LogWarning("Debug walk type display set to %s", DEBUG_SHOW_MISC_TYPE);
167 return;
168 }
169 case SDLK_F5:
170 {
171 DEBUG_SHOW_VEHICLE_PATH = !DEBUG_SHOW_VEHICLE_PATH;
172 return;
173 }

Callers

nothing calls this directly

Calls 4

typeMethod · 0.80
getScreenOffsetMethod · 0.80
dumpVoxelViewMethod · 0.80
writeImageMethod · 0.45

Tested by

no test coverage detected