[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdegames/kasteroids
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2003-07-22 16:47:18
[Download RAW message or body]

CVS commit by aacid: 

 - Removed bool isPaused; because it was not beign used
 - Make the game pause when the focus is lost and unpause it when the focus is \
                recovered
 - Commented some more teleport code in toplevel.cpp as it seems to have been never \
working (or at least not enabled) in view.cpp (we don't want to see the teleport \
action in Configure Shortcuts... if it does nothing)


  M +7 -10     toplevel.cpp   1.65
  M +0 -1      toplevel.h   1.32


--- kdegames/kasteroids/toplevel.cpp  #1.64:1.65
@@ -300,5 +300,5 @@ void KAstTopLevel::initKAction()
     keycodes.insert(RotateRight, new KAction(i18n("Rotate Right"), Qt::Key_Right, 0, \
                0, actionCollection(), "RotateRight"));
     keycodes.insert(Shoot, new KAction(i18n("Shoot"), Qt::Key_Space, 0, 0, \
                actionCollection(), "Shoot"));
-    keycodes.insert(Teleport, new KAction(i18n("Teleport"), Qt::Key_Z, 0, 0, \
actionCollection(), "Teleport")); +//     keycodes.insert(Teleport, new \
                KAction(i18n("Teleport"), Qt::Key_Z, 0, 0, actionCollection(), \
                "Teleport"));
     keycodes.insert(Brake, new KAction(i18n("Brake"), Qt::Key_X, 0, 0, \
                actionCollection(), "Brake"));
     keycodes.insert(Shield, new KAction(i18n("Shield"), Qt::Key_S, 0, 0, \
actionCollection(), "Shield")); @@ -411,7 +411,7 @@ bool \
KAstTopLevel::processKeyPress( QKey  break;
 
-        case Teleport:
+/*        case Teleport:
             view->teleport( true );
-            break;
+            break;*/
 
         case Brake:
@@ -465,7 +465,7 @@ bool KAstTopLevel::processKeyRelease( QK
             break;
 
-        case Teleport:
+/*        case Teleport:
             view->teleport( false );
-            break;
+            break;*/
 
         case Invalid:
@@ -479,4 +479,5 @@ bool KAstTopLevel::processKeyRelease( QK
 void KAstTopLevel::focusInEvent( QFocusEvent *e )
 {
+    view->pause( false );
     XAutoRepeatOff( qt_xdisplay() );
     KMainWindow::focusInEvent(e);
@@ -485,4 +486,5 @@ void KAstTopLevel::focusInEvent( QFocusE
 void KAstTopLevel::focusOutEvent( QFocusEvent *e )
 {
+    view->pause( true );
     XAutoRepeatOn( qt_xdisplay() );
     KMainWindow::focusOutEvent(e);
@@ -504,5 +506,4 @@ void KAstTopLevel::slotNewGame()
                     yellow );
     waitShip = true;
-    isPaused = false;
     gameOver = false;
 }
@@ -591,10 +592,8 @@ void KAstTopLevel::slotRocksRemoved()
 void KAstTopLevel::slotKeyConfig()
 {
-    view->pause( true );
     KKeyDialog::configure( actionCollection(), this );
     if ( waitShip ) view->showText( i18n( "Press %1 to launch." )
                     .arg(launchAction->shortcut().seq(0).toString()),
                     yellow, false );
-    view->pause( false );
 }
 
@@ -674,9 +673,7 @@ void KAstTopLevel::slotUpdateVitals()
 void KAstTopLevel::slotPause()
 {
-    view->pause( true );
     KMessageBox::information( this,
                               i18n("KAsteroids is paused"),
                               i18n("Paused") );
-    view->pause( false );
 }
 

--- kdegames/kasteroids/toplevel.h  #1.31:1.32
@@ -78,5 +78,4 @@ private:
     // waiting for user to press Enter to launch a ship
     bool waitShip;
-    bool isPaused;
     bool gameOver;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic