예제 #1
0
    void Camera::update(float duration, bool paused)
    {
        if (mAnimation->upperBodyReady())
        {
            // Now process the view changes we queued earlier
            if (mVanityToggleQueued)
            {
                toggleVanityMode(!mVanity.enabled);
                mVanityToggleQueued = false;
            }
            if (mViewModeToggleQueued)
            {

                togglePreviewMode(false);
                toggleViewMode();
                mViewModeToggleQueued = false;
            }
        }

        if (paused)
            return;

        // only show the crosshair in game mode and in first person mode.
        MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager();
        wm->showCrosshair(!wm->isGuiMode() && (mFirstPersonView && !mVanity.enabled && !mPreviewMode));

        if(mVanity.enabled)
        {
            rotateCamera(0.f, osg::DegreesToRadians(3.f * duration), true);
        }
    }
예제 #2
0
 void Camera::reset()
 {
     togglePreviewMode(false);
     toggleVanityMode(false);
     if (!mFirstPersonView)
         toggleViewMode();
 }
예제 #3
0
파일: camera.cpp 프로젝트: 0xmono/openmw
    void Camera::update(float duration, bool paused)
    {
        if (mAnimation->allowSwitchViewMode())
        {
            // Now process the view changes we queued earlier
            if (mVanityToggleQueued)
            {
                toggleVanityMode(!mVanity.enabled);
                mVanityToggleQueued = false;
            }
            if (mViewModeToggleQueued)
            {

                togglePreviewMode(false);
                toggleViewMode();
                mViewModeToggleQueued = false;
            }
        }

        updateListener();
        if (paused)
            return;

        // only show the crosshair in game mode and in first person mode.
        MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager();
        wm->showCrosshair(!wm->isGuiMode() && (mFirstPersonView && !mVanity.enabled && !mPreviewMode));

        if(mVanity.enabled)
        {
            Ogre::Vector3 rot(0.f, 0.f, 0.f);
            rot.z = Ogre::Degree(3.f * duration).valueRadians();
            rotateCamera(rot, true);
        }
    }
예제 #4
0
void Toerstein::createMenuBar(void)
{
    QMenuBar *menuBar = new QMenuBar(this);
    menuBar->setVisible(false);

    /* Create File menu */
    QMenu *fileMenu = menuBar->addMenu(tr("&File"));

    fileMenu->addAction( tr("New &Tab"), this, SLOT(createNewTab()) );
    fileMenu->addAction( tr("&New"), this, SLOT(createNewFile()) );
    fileMenu->addAction( tr("&Open"), this, SLOT(open()) );
    fileMenu->addAction( tr("Enter File &Path"), this, SLOT(search()) );
    fileMenu->addAction( tr("&Save"), this, SLOT(save()) );
    fileMenu->addAction( tr("Save As..."), this, SLOT(saveAs()) );
    fileMenu->addAction( tr("&Close File"), this, SLOT(closeFile()) );
    fileMenu->addAction( tr("&Quit"), this, SLOT(close()) );

    QMenu *viewMenu = menuBar->addMenu(tr("&View"));
    viewMenu->addAction( tr("Toggle &Diff View"), this, SLOT(toggleViewMode()) );

    this->setMenuBar(menuBar);
}
예제 #5
0
void Toerstein::createShortcuts(void)
{
    QShortcut *shortcut;

    /* In QMenuBar shortcuts won't work if menuBar is not visible,
     * so we'll add them separately here
     */

    /* Shortcuts to File-menu */
    shortcut = new QShortcut(QKeySequence(tr("Ctrl+T", "File|New Tab")),this,SLOT(createNewTab()));
    shortcut->setAutoRepeat(false);
    shortcut = new QShortcut(QKeySequence(tr("Ctrl+N", "File|New File")),this,SLOT(createNewFile()));
    shortcut->setAutoRepeat(false);
    shortcut = new QShortcut(QKeySequence(tr("Ctrl+O", "File|Open File")),this,SLOT(open()));
    shortcut->setAutoRepeat(false);
    shortcut = new QShortcut(QKeySequence(tr("Ctrl+P", "File|Enter File Path") ),this,SLOT(search()));
    shortcut->setAutoRepeat(false);
    shortcut = new QShortcut(QKeySequence(tr("Ctrl+S", "File|Save File") ),this,SLOT(save()));
    shortcut->setAutoRepeat(false);
    shortcut = new QShortcut(QKeySequence(tr("Ctrl+W", "File|Close File") ),this,SLOT(closeFile()));
    shortcut->setAutoRepeat(false);
    shortcut = new QShortcut(QKeySequence(tr("Ctrl+Q", "File|Quit")),this,SLOT(close()));
    shortcut->setAutoRepeat(false);

    /* Shortcuts to View-menu */
    shortcut = new QShortcut(QKeySequence(tr("Ctrl+D", "Toggle Diff View|Quit")),this,SLOT(toggleViewMode()));
    shortcut->setAutoRepeat(false);
}
예제 #6
0
/*=========================================================================
  slot viewAction 
=========================================================================*/
void KFileBrowser::handleViewAction (void)
  {
  toggleViewMode();
  }