[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Eliot-dev] eliot game/navigation.cpp game/navigation.h qt/...
From: |
Olivier Teulière |
Subject: |
[Eliot-dev] eliot game/navigation.cpp game/navigation.h qt/... |
Date: |
Sun, 30 Nov 2008 20:51:06 +0000 |
CVSROOT: /cvsroot/eliot
Module name: eliot
Changes by: Olivier Teulière <ipkiss> 08/11/30 20:51:06
Modified files:
game : navigation.cpp navigation.h
qt : main_window.cpp
Log message:
When navigating in the history, display the current turn in the status
bar
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/game/navigation.cpp?cvsroot=eliot&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/eliot/game/navigation.h?cvsroot=eliot&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/main_window.cpp?cvsroot=eliot&r1=1.19&r2=1.20
Patches:
Index: game/navigation.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/navigation.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- game/navigation.cpp 23 Nov 2008 20:13:02 -0000 1.4
+++ game/navigation.cpp 30 Nov 2008 20:51:05 -0000 1.5
@@ -60,6 +60,24 @@
}
+unsigned int Navigation::getCurrTurn() const
+{
+ unsigned int currTurn = m_currTurn;
+ if (isLastTurn() && m_turnCommands.back()->isEmpty())
+ --currTurn;
+ return currTurn;
+}
+
+
+unsigned int Navigation::getNbTurns() const
+{
+ unsigned int count = m_turnCommands.size();
+ if (m_turnCommands.back()->isEmpty())
+ --count;
+ return count;
+}
+
+
bool Navigation::isFirstTurn() const
{
return m_currTurn == 1 ||
Index: game/navigation.h
===================================================================
RCS file: /cvsroot/eliot/eliot/game/navigation.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- game/navigation.h 23 Nov 2008 17:08:12 -0000 1.3
+++ game/navigation.h 30 Nov 2008 20:51:05 -0000 1.4
@@ -38,7 +38,8 @@
void newTurn();
void addAndExecute(Command *iCmd);
- unsigned int getCurrTurn() const { return m_currTurn; }
+ unsigned int getCurrTurn() const;
+ unsigned int getNbTurns() const;
bool isFirstTurn() const;
bool isLastTurn() const;
Index: qt/main_window.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/main_window.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- qt/main_window.cpp 29 Nov 2008 16:41:00 -0000 1.19
+++ qt/main_window.cpp 30 Nov 2008 20:51:06 -0000 1.20
@@ -789,6 +789,9 @@
m_game->accessNavigation().firstTurn();
emit gameUpdated();
+ unsigned int currTurn = m_game->getNavigation().getCurrTurn();
+ unsigned int nbTurns = m_game->getNavigation().getNbTurns();
+ displayInfoMsg(_q("Turn %1/%2").arg(currTurn).arg(nbTurns));
}
@@ -799,6 +802,9 @@
m_game->accessNavigation().prevTurn();
emit gameUpdated();
+ unsigned int currTurn = m_game->getNavigation().getCurrTurn();
+ unsigned int nbTurns = m_game->getNavigation().getNbTurns();
+ displayInfoMsg(_q("Turn %1/%2").arg(currTurn).arg(nbTurns));
}
@@ -809,6 +815,9 @@
m_game->accessNavigation().nextTurn();
emit gameUpdated();
+ unsigned int currTurn = m_game->getNavigation().getCurrTurn();
+ unsigned int nbTurns = m_game->getNavigation().getNbTurns();
+ displayInfoMsg(_q("Turn %1/%2").arg(currTurn).arg(nbTurns));
}
@@ -819,6 +828,9 @@
m_game->accessNavigation().lastTurn();
emit gameUpdated();
+ unsigned int currTurn = m_game->getNavigation().getCurrTurn();
+ unsigned int nbTurns = m_game->getNavigation().getNbTurns();
+ displayInfoMsg(_q("Turn %1/%2").arg(currTurn).arg(nbTurns));
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Eliot-dev] eliot game/navigation.cpp game/navigation.h qt/...,
Olivier Teulière <=