void Campaign::handleEvents() { for (EventQueue::const_iterator event = _eventQueue.begin(); event != _eventQueue.end(); ++event) { // Handle console if (_console->isVisible()) { _console->processEvent(*event); continue; } if (event->type == Events::kEventKeyDown) { // Console if ((event->key.keysym.sym == SDLK_d) && (event->key.keysym.mod & KMOD_CTRL)) { _console->show(); continue; } } // Camera if (handleCameraInput(*event)) continue; _module->addEvent(*event); } _eventQueue.clear(); CameraMan.update(); _module->processEventQueue(); }
void Module::handleEvents() { Events::Event event; while (EventMan.pollEvent(event)) { // Handle console if (_console->processEvent(event)) { if (!_currentArea) return; continue; } if (event.type == Events::kEventKeyDown) { // Console if ((event.key.keysym.sym == SDLK_d) && (event.key.keysym.mod & KMOD_CTRL)) { _console->show(); continue; } } // Camera if (!_console->isVisible()) if (handleCameraInput(event)) continue; _currentArea->addEvent(event); } CameraMan.update(); _currentArea->processEventQueue(); }
void Module::handleEvents() { for (EventQueue::const_iterator event = _eventQueue.begin(); event != _eventQueue.end(); ++event) { // Handle console if (_console->isVisible()) { _console->processEvent(*event); continue; } if (event->type == Events::kEventKeyDown) { // Menu if (event->key.keysym.sym == SDLK_ESCAPE) { // But only if we're not in a conversation, where ESC should abort that if (!_ingameGUI->hasRunningConversation()) { showMenu(); continue; } } // Console if ((event->key.keysym.sym == SDLK_d) && (event->key.keysym.mod & KMOD_CTRL)) { _console->show(); continue; } } // Camera if (!_console->isVisible()) if (handleCameraInput(*event)) continue; _ingameGUI->addEvent(*event); _currentArea->addEvent(*event); } _eventQueue.clear(); CameraMan.update(); _currentArea->processEventQueue(); _ingameGUI->processEventQueue(); }
void Module::handleEvents() { Events::Event event; while (EventMan.pollEvent(event)) { // Handle console if (_console->processEvent(event)) { if (!_currentArea) return; continue; } if (event.type == Events::kEventKeyDown) { // Menu if (event.key.keysym.sym == SDLK_ESCAPE) { // But only if we're not in a conversation, where ESC should abort that if (!_ingameGUI->hasRunningConversation()) { showMenu(); continue; } } // Console if ((event.key.keysym.sym == SDLK_d) && (event.key.keysym.mod & KMOD_CTRL)) { _console->show(); continue; } } // Camera if (!_console->isVisible()) if (handleCameraInput(event)) continue; _ingameGUI->addEvent(event); _currentArea->addEvent(event); } CameraMan.update(); _currentArea->processEventQueue(); _ingameGUI->processEventQueue(); }