MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / handleMouseWheel

Method handleMouseWheel

source/modes/GameMode.cpp:423–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423void GameMode::handleMouseWheel(const OIS::MouseEvent& arg)
424{
425 if(isMouseWheelOnCEGUIWindow())
426 return;
427
428 ODFrameListener& frameListener = ODFrameListener::getSingleton();
429
430 if (arg.state.Z.rel > 0)
431 {
432 if (getKeyboard()->isModifierDown(OIS::Keyboard::Ctrl))
433 {
434 mGameMap->getLocalPlayer()->rotateHand(Player::Direction::left);
435 }
436 else
437 {
438 frameListener.moveCamera(CameraManager::moveDown);
439 }
440 }
441 else if (arg.state.Z.rel < 0)
442 {
443 if (getKeyboard()->isModifierDown(OIS::Keyboard::Ctrl))
444 {
445 mGameMap->getLocalPlayer()->rotateHand(Player::Direction::right);
446 }
447 else
448 {
449 frameListener.moveCamera(CameraManager::moveUp);
450 }
451 }
452}
453
454bool GameMode::isMouseDownOnCEGUIWindow()
455{

Callers

nothing calls this directly

Calls 3

rotateHandMethod · 0.80
getLocalPlayerMethod · 0.80
moveCameraMethod · 0.80

Tested by

no test coverage detected