Git commit 7c1e8649e51ea397e053ae2eeaf5e7ee7ddbc688 by Viranch Mehta. Committed on 08/08/2012 at 15:36. Pushed by viranch into branch 'viranch/qtquick'. Prevent mouse actions after game is over M +2 -0 src/qml/CellItem.qml M +1 -0 src/qml/logic.js M +3 -0 src/qml/main.qml http://commits.kde.org/kmines/7c1e8649e51ea397e053ae2eeaf5e7ee7ddbc688 diff --git a/src/qml/CellItem.qml b/src/qml/CellItem.qml index 3e46dd3..57635f6 100644 --- a/src/qml/CellItem.qml +++ b/src/qml/CellItem.qml @@ -42,11 +42,13 @@ KgCore.CanvasItem { acceptedButtons: Qt.LeftButton | Qt.RightButton enabled: !revealed && border=3D=3D"" onPressed: { + if (canvas.game_over) return; if (mouse.button =3D=3D Qt.LeftButton && cellState=3D=3D0) { cell.pressed =3D true; } } onReleased: { + if (canvas.game_over) return; cell.pressed =3D false; if (mouse.button =3D=3D Qt.LeftButton) { if (cellState>0) return; diff --git a/src/qml/logic.js b/src/qml/logic.js index a51759a..9dbd816 100644 --- a/src/qml/logic.js +++ b/src/qml/logic.js @@ -5,6 +5,7 @@ function reset() { field.columns =3D 0; field.flaggedMines =3D 0; firstClick =3D true; + canvas.game_over =3D false; } = function revealCell(index) { diff --git a/src/qml/main.qml b/src/qml/main.qml index abd4c15..5fed8e3 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -25,6 +25,9 @@ Item { signal minesCountChanged(int count, int total) signal firstClickDone signal gameOver(bool won) + property bool game_over: false + + onGameOver: game_over =3D true; = property bool useQuestionMarks: true =