Summary: | kshisen wish: give a feedback when the second tile is wrong | ||
---|---|---|---|
Product: | [Applications] kshisen | Reporter: | Janet <bugzilla> |
Component: | general | Assignee: | Dave Corrie <kde> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 1.5.1 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Janet
2006-02-12 03:46:53 UTC
SVN commit 656816 by jwickersheimer: CCBUG: 121808 GUI: Added user notice and feedback in the status bar: - when no tile is selected indicate the user to select one - tell when the second clicked tile doesn't match - tell when the second clicked tile cannot make a move (but match) - tell how to do when the second clicked result in multiple possible moves M +32 -1 app.cpp M +7 -1 app.h M +9 -1 board.cpp M +5 -0 board.h --- trunk/KDE/kdegames/kshisen/app.cpp #656815:656816 @@ -91,9 +91,10 @@ else readOldHighscore(); + statusBar()->insertItem(i18n("Select a tile"), SBI_GAMETIP); statusBar()->insertItem("", SBI_TIME); statusBar()->insertItem("", SBI_TILES); - statusBar()->insertFixedItem(i18n(" Cheat mode "), SBI_CHEAT); + statusBar()->insertItem(i18n(" Cheat mode "), SBI_CHEAT); statusBar()->changeItem("", SBI_CHEAT); initKAction(); @@ -106,6 +107,11 @@ setupGUI(); connect(board, SIGNAL(changed()), this, SLOT(enableItems())); + connect(board, SIGNAL(tilesDontMatch()), this, SLOT(notifyTilesDontMatch())); + connect(board, SIGNAL(invalidMove()), this, SLOT(notifyInvalidMove())); + connect(board, SIGNAL(selectATile()), this, SLOT(notifySelectATile())); + connect(board, SIGNAL(selectAMatchingTile()), this, SLOT(notifySelectAMatchingTile())); + connect(board, SIGNAL(selectAMove()), this, SLOT(notifySelectAMove())); QTimer *t = new QTimer(this); t->start(1000); @@ -295,6 +301,31 @@ board->newGame(); } +void App::notifySelectATile() +{ + statusBar()->changeItem(i18n("Select a tile"), SBI_GAMETIP); +} + +void App::notifySelectAMatchingTile() +{ + statusBar()->changeItem(i18n("Select a matching tile"), SBI_GAMETIP); +} + +void App::notifySelectAMove() +{ + statusBar()->changeItem(i18n("Select the move you want by clicking on the blue line"), SBI_GAMETIP); +} + +void App::notifyTilesDontMatch() +{ + statusBar()->changeItem(i18n("This tile doesn't match the one you selected"), SBI_GAMETIP); +} + +void App::notifyInvalidMove() +{ + statusBar()->changeItem(i18n("You cannot make this move"), SBI_GAMETIP); +} + void App::updateScore() { int t = board->getTimeForGame(); --- trunk/KDE/kdegames/kshisen/app.h #656815:656816 @@ -73,6 +73,12 @@ void updateScore(); void showSettings(); + void notifyTilesDontMatch(); + void notifyInvalidMove(); + void notifySelectATile(); + void notifySelectAMatchingTile(); + void notifySelectAMove(); + void newGame(); void quitGame(); void restartGame(); @@ -113,7 +119,7 @@ KHighscore* highscoreTable; bool cheat; - enum statusBarItems { SBI_TIME, SBI_TILES, SBI_CHEAT }; + enum statusBarItems { SBI_GAMETIP=0, SBI_TIME, SBI_TILES, SBI_CHEAT }; }; --- trunk/KDE/kdegames/kshisen/board.cpp #656815:656816 @@ -958,6 +958,7 @@ undrawPossibleMoves(); possibleMoves.clear(); updateField(x, y); + emit selectATile(); return; } @@ -970,6 +971,7 @@ undrawPossibleMoves(); possibleMoves.clear(); updateField(x, y); + emit selectAMatchingTile(); return; } else if(possibleMoves.count() > 1) // if the click is on any of the current possible moves, make that move @@ -982,6 +984,7 @@ if((*i).isInPath(x,y)) { performMove(*i); + emit selectATile(); return; } } @@ -994,7 +997,10 @@ // both field match if(!tilesMatch(fld1, fld2)) + { + emit tilesDontMatch(); return; + } // trace and perform the move and get the list of possible moves if(findPath(mark_x, mark_y, x, y, possibleMoves)) @@ -1014,19 +1020,21 @@ if(withSlide > 0) { drawPossibleMoves(); + emit selectAMove(); return; } } // only one move possible, perform it performMove(possibleMoves.first()); - + emit selectATile(); // game is over? // Must delay until after tiles fall to make this test // See undrawConnection GP. } else { + emit invalidMove(); connection.clear(); } } --- trunk/KDE/kdegames/kshisen/board.h #656815:656816 @@ -194,6 +194,11 @@ void changed(); void endOfGame(); void resized(); + void invalidMove(); + void tilesDontMatch(); + void selectATile(); + void selectAMove(); + void selectAMatchingTile(); public slots: bool pause(); Corresponding info is now showed in the status bar |