Merge lp:~vthompson/dropping-letters/fix-1196867 into lp:dropping-letters

Proposed by Victor Thompson on 2014-09-16
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„ on 2014-09-16
Approved revision: 65
Merged at revision: 65
Proposed branch: lp:~vthompson/dropping-letters/fix-1196867
Merge into: lp:dropping-letters
Diff against target: 44 lines (+5/-1)
1 file modified
dropping-letters.qml (+5/-1)
To merge this branch: bzr merge lp:~vthompson/dropping-letters/fix-1196867
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ 2014-09-16 Approve on 2014-09-16
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2014-09-16
Review via email: mp+234765@code.launchpad.net

Commit message

* Disable tiles when game ends.
* Disable pause button when game ends.

Description of the change

* Disable tiles when game ends.
* Disable pause button when game ends.

To post a comment you must log in.
65. By Victor Thompson on 2014-09-16

Disable pause button if game has ended.

Victor Thompson (vthompson) wrote :

Disabled the pause button if the game has ended, otherwise the user can toggle the pause button after the game ends and letters continue to fall.

Hah! nice.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dropping-letters.qml'
2--- dropping-letters.qml 2014-09-13 18:26:27 +0000
3+++ dropping-letters.qml 2014-09-16 04:34:07 +0000
4@@ -28,6 +28,7 @@
5 droptimer.start();
6 toolbar.opened = false;
7 game.paused = false;
8+ game.ended = false;
9 }
10
11 Page {
12@@ -54,7 +55,7 @@
13 objectName: "pause_game"
14 text: game.paused ? i18n.tr("Resume") : i18n.tr("Pause")
15 iconName: game.paused ? "media-playback-start": "media-playback-pause"
16- enabled: flipable.flipped
17+ enabled: flipable.flipped && !game.ended
18 onTriggered: {
19 if (game.paused) {
20 droptimer.start();
21@@ -545,6 +546,7 @@
22 lm.get(idx).letters.append({ letter: main.getRandomWeightedLetter() });
23 if (lm.get(idx).letters.count >= 10) {
24 droptimer.stop();
25+ game.ended = true;
26 if (volume.supportsMedia) {
27 gameover.play();
28 }
29@@ -562,6 +564,7 @@
30 id: game
31 objectName: "gametile"
32 property int squaresize: Math.min((flipable.width) / 7, (flipable.height - (flipable.minChromeHeight * 2)) / 10)
33+ property bool ended: false;
34 property bool paused: false;
35 anchors.top: topbar.bottom
36 anchors.bottom: bottombar.top
37@@ -621,6 +624,7 @@
38 color: "#ffffff"
39 }
40 MouseArea {
41+ enabled: !game.ended
42 anchors.fill: parent
43 onClicked: {
44 if (!box.selected) {

Subscribers

People subscribed via source and target branches