Bug 121808 - kshisen wish: give a feedback when the second tile is wrong
Summary: kshisen wish: give a feedback when the second tile is wrong
Status: RESOLVED FIXED
Alias: None
Product: kshisen
Classification: Applications
Component: general (show other bugs)
Version: 1.5.1
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dave Corrie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-12 03:46 UTC by Janet
Modified: 2008-01-12 18:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janet 2006-02-12 03:46:53 UTC
Version:           1.5.1 (using KDE 3.5.1, Debian Package 4:3.5.1-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.14-kanotix-9

KShisen does not give any feedback if a second tile was chosen wrong. Instead nothing happens, even the first tile stays selected. With a rather light tileset and small tiles I sometimes wonder why kshisen is frozen - but when I search a lot I find the marked tile again that keeps me from playing further. 

IMHO another notification is needed that the turn was wrong. I would prefer a short flashing of the first tile so you see the turn was wrong AND that the tile  is still selected.
Comment 1 Wickersheimer Jeremy 2007-04-22 14:49:12 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();
Comment 2 Dmitry Suzdalev 2008-01-12 18:05:24 UTC
Corresponding info is now showed in the status bar