Exemplo n.º 1
0
    // Switch between gui modes. Besides controlling the Gui windows
    // this also makes sure input is directed to the right place
    void setGuiMode(MWGui::GuiMode mode)
    {
        // Tell the GUI what to show (this also takes care of the mouse
        // pointer)
        windows.setMode(mode);

        // Are we in GUI mode now?
        if(windows.isGuiMode())
        {
            // Disable mouse look
            mouse->setCamera(NULL);

            // Enable GUI events
            guiEvents->enabled = true;
        }
        else
        {
            // Start mouse-looking again. TODO: This should also allow
            // for other ways to disable mouselook, like paralyzation.
            mouse->setCamera(player.getCamera());

            // Disable GUI events
            guiEvents->enabled = false;
        }
    }
Exemplo n.º 2
0
    // Switch between gui modes. Besides controlling the Gui windows
    // this also makes sure input is directed to the right place
    void changeInputMode(bool guiMode)
    {
      // Are we in GUI mode now?
      if(guiMode)
        {
          // Disable mouse look
          mouse->setCamera(NULL);

          // Enable GUI events
          guiEvents->enabled = true;
        }
      else
        {
          // Start mouse-looking again. TODO: This should also allow
          // for other ways to disable mouselook, like paralyzation.
          mouse->setCamera(player.getRenderer()->getCamera());

          // Disable GUI events
          guiEvents->enabled = false;
        }
    }