eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot game/navigation.cpp qt/player_widget.cpp ...


From: Olivier Teulière
Subject: [Eliot-dev] eliot game/navigation.cpp qt/player_widget.cpp ...
Date: Sun, 30 Nov 2008 21:08:29 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>      08/11/30 21:08:29

Modified files:
        game           : navigation.cpp 
        qt             : player_widget.cpp training_widget.cpp 

Log message:
         - When displaying an old turn, do not allow playing
         - Turns start at 0 instead of 1, to indicate that nothing was played 
on the first turn

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/game/navigation.cpp?cvsroot=eliot&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/player_widget.cpp?cvsroot=eliot&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/training_widget.cpp?cvsroot=eliot&r1=1.6&r2=1.7

Patches:
Index: game/navigation.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/navigation.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- game/navigation.cpp 30 Nov 2008 20:55:46 -0000      1.6
+++ game/navigation.cpp 30 Nov 2008 21:08:29 -0000      1.7
@@ -65,7 +65,7 @@
     unsigned int currTurn = m_currTurn;
     if (isLastTurn() && m_turnCommands.back()->isEmpty())
         --currTurn;
-    return currTurn;
+    return currTurn - 1;
 }
 
 
@@ -74,7 +74,7 @@
     unsigned int count = m_turnCommands.size();
     if (m_turnCommands.back()->isEmpty())
         --count;
-    return count;
+    return count - 1;
 }
 
 

Index: qt/player_widget.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/player_widget.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- qt/player_widget.cpp        30 Nov 2008 20:54:57 -0000      1.12
+++ qt/player_widget.cpp        30 Nov 2008 21:08:29 -0000      1.13
@@ -134,9 +134,18 @@
     lineEditCoords->clear();
     lineEditChange->clear();
 
-    // Do not allow messing with AI players or with players who already played
+    if (!m_game->isLastTurn())
+    {
+        // Do not allow entering a move when displaying an old turn
+        setEnabled(false);
+    }
+    else
+    {
+        // Do not allow messing with AI players or with players
+        // who already played
     setEnabled(!m_game->hasPlayed(m_player) &&
                m_game->getPlayer(m_player).isHuman());
+    }
 }
 
 

Index: qt/training_widget.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/training_widget.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- qt/training_widget.cpp      30 Nov 2008 20:53:46 -0000      1.6
+++ qt/training_widget.cpp      30 Nov 2008 21:08:29 -0000      1.7
@@ -117,6 +117,8 @@
         pushButtonComplement->setEnabled(true);
         pushButtonSearch->setEnabled(m_model->rowCount() == 0 &&
                                      lineEditRack->text() != "");
+        // Do not allow entering a move when displaying an old turn
+        setEnabled(m_game->isLastTurn());
     }
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]