From 4949576984cd791de0cc68c1013a15e14ad264a2 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 18 Apr 2012 19:03:26 +0200 Subject: [PATCH] disable some player controls in gui mode --- apps/openmw/mwinput/inputmanager.cpp | 48 +++++++++++++++------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/apps/openmw/mwinput/inputmanager.cpp b/apps/openmw/mwinput/inputmanager.cpp index 9b5a9ae30f..c2233f6265 100644 --- a/apps/openmw/mwinput/inputmanager.cpp +++ b/apps/openmw/mwinput/inputmanager.cpp @@ -97,34 +97,36 @@ namespace MWInput void toggleSpell() { - DrawState state = player.getDrawState(); - if(state == DrawState_Weapon || state == DrawState_Nothing) - { - player.setDrawState(DrawState_Spell); - std::cout << "Player has now readied his hands for spellcasting!\n"; - } - else - { - player.setDrawState(DrawState_Nothing); - std::cout << "Player does not have any kind of attack ready now.\n"; - } + if (windows.isGuiMode()) return; + DrawState state = player.getDrawState(); + if (state == DrawState_Weapon || state == DrawState_Nothing) + { + player.setDrawState(DrawState_Spell); + std::cout << "Player has now readied his hands for spellcasting!\n"; + } + else + { + player.setDrawState(DrawState_Nothing); + std::cout << "Player does not have any kind of attack ready now.\n"; + } } void toggleWeapon() { - DrawState state = player.getDrawState(); - if(state == DrawState_Spell || state == DrawState_Nothing) - { - player.setDrawState(DrawState_Weapon); - std::cout << "Player is now drawing his weapon.\n"; - } - else - { - player.setDrawState(DrawState_Nothing); - std::cout << "Player does not have any kind of attack ready now.\n"; - } + if (windows.isGuiMode()) return; + DrawState state = player.getDrawState(); + if (state == DrawState_Spell || state == DrawState_Nothing) + { + player.setDrawState(DrawState_Weapon); + std::cout << "Player is now drawing his weapon.\n"; + } + else + { + player.setDrawState(DrawState_Nothing); + std::cout << "Player does not have any kind of attack ready now.\n"; + } } void screenshot() @@ -184,11 +186,13 @@ namespace MWInput void toggleAutoMove() { + if (windows.isGuiMode()) return; player.setAutoMove (!player.getAutoMove()); } void toggleWalking() { + if (windows.isGuiMode()) return; player.toggleRunning(); }