Applied patch by Lilian Gimenez to correct input mode in dialogs
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5496 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
afa305e34b
commit
154a733725
@ -19,6 +19,7 @@
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/widget.hpp"
|
||||
#include "input/input_manager.hpp"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
@ -64,6 +65,9 @@ ModalDialog::ModalDialog(const float percentWidth, const float percentHeight)
|
||||
|
||||
GUIEngine::getSkin()->m_dialog = true;
|
||||
GUIEngine::getSkin()->m_dialog_size = 0.0f;
|
||||
|
||||
m_previous_mode=input_manager->getMode();
|
||||
input_manager->setMode(InputManager::MENU);
|
||||
}
|
||||
|
||||
ModalDialog::~ModalDialog()
|
||||
@ -82,6 +86,8 @@ ModalDialog::~ModalDialog()
|
||||
// restore previous pointer state
|
||||
if (pointer_was_shown) irr_driver->showPointer();
|
||||
else irr_driver->hidePointer();
|
||||
|
||||
input_manager->setMode(m_previous_mode);
|
||||
}
|
||||
|
||||
void ModalDialog::clearWindow()
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "utils/ptr_vector.hpp"
|
||||
#include "guiengine/event_handler.hpp"
|
||||
#include "guiengine/skin.hpp"
|
||||
#include "input/input_manager.hpp"
|
||||
|
||||
class PlayerProfile;
|
||||
|
||||
@ -47,6 +48,8 @@ namespace GUIEngine
|
||||
irr::gui::IGUIWindow* m_irrlicht_window;
|
||||
irr::core::rect< irr::s32 > m_area;
|
||||
|
||||
InputManager::InputDriverMode m_previous_mode;
|
||||
|
||||
/**
|
||||
* Creates a modal dialog with given percentage of screen width and height
|
||||
*/
|
||||
|
@ -87,6 +87,7 @@ public:
|
||||
|
||||
void setMode(InputDriverMode);
|
||||
bool isInMode(InputDriverMode);
|
||||
InputDriverMode getMode() { return m_mode; }
|
||||
|
||||
/** When this mode is enabled, only the master player will be able to play with menus (only works in 'assign' mode) */
|
||||
void setMasterPlayerOnly(bool enabled);
|
||||
|
Loading…
Reference in New Issue
Block a user