Make statusbar text consistent with menu text.

pull/1/head
Darrell Anderson 11 years ago
parent 063e2351a3
commit 859a24e2cc

@ -63,7 +63,7 @@
#include "settings.h" #include "settings.h"
App::App(TQWidget *parent, const char *name) : TDEMainWindow(parent, name), App::App(TQWidget *parent, const char *name) : TDEMainWindow(parent, name),
cheat(false) hintmode(false)
{ {
highscoreTable = new KHighscore(TQT_TQOBJECT(this)); highscoreTable = new KHighscore(TQT_TQOBJECT(this));
@ -77,8 +77,8 @@ App::App(TQWidget *parent, const char *name) : TDEMainWindow(parent, name),
statusBar()->insertItem("", SBI_TIME); statusBar()->insertItem("", SBI_TIME);
statusBar()->insertItem("", SBI_TILES); statusBar()->insertItem("", SBI_TILES);
statusBar()->insertFixedItem(i18n(" Cheat mode "), SBI_CHEAT); statusBar()->insertFixedItem(i18n(" Hint mode "), SBI_HINT);
statusBar()->changeItem("", SBI_CHEAT); statusBar()->changeItem("", SBI_HINT);
initTDEAction(); initTDEAction();
@ -135,7 +135,7 @@ void App::hallOfFame()
void App::newGame() void App::newGame()
{ {
board->newGame(); board->newGame();
resetCheatMode(); resetHintMode();
enableItems(); enableItems();
} }
@ -173,7 +173,7 @@ void App::undo()
if(board->canUndo()) if(board->canUndo())
{ {
board->undo(); board->undo();
setCheatMode(); setHintMode();
enableItems(); enableItems();
} }
} }
@ -191,7 +191,7 @@ void App::hint()
board->makeHintMove(); board->makeHintMove();
#else #else
board->showHint(); board->showHint();
setCheatMode(); setHintMode();
#endif #endif
enableItems(); enableItems();
} }
@ -289,7 +289,7 @@ void App::slotEndOfGame()
else if(isBetter(hs, highscore[HIGHSCORE_MAX-1])) else if(isBetter(hs, highscore[HIGHSCORE_MAX-1]))
isHighscore = true; isHighscore = true;
if(isHighscore && !cheat) if(isHighscore && !hintmode)
{ {
hs.name = getPlayerName(); hs.name = getPlayerName();
hs.date = time((time_t*)0); hs.date = time((time_t*)0);
@ -307,7 +307,7 @@ void App::slotEndOfGame()
} }
} }
resetCheatMode(); resetHintMode();
board->newGame(); board->newGame();
} }
@ -331,23 +331,23 @@ void App::updateScore()
statusBar()->changeItem(s, SBI_TILES); statusBar()->changeItem(s, SBI_TILES);
} }
void App::setCheatMode() void App::setHintMode()
{ {
// set the cheat mode if not set // set the hintmode mode if not set
if(!cheat) if(!hintmode)
{ {
cheat = true; hintmode = true;
statusBar()->changeItem(i18n(" Cheat mode "), SBI_CHEAT); statusBar()->changeItem(i18n(" Hint mode "), SBI_HINT);
} }
} }
void App::resetCheatMode() void App::resetHintMode()
{ {
// reset cheat mode if set // reset hintmode mode if set
if(cheat) if(hintmode)
{ {
cheat = false; hintmode = false;
statusBar()->changeItem("", SBI_CHEAT); statusBar()->changeItem("", SBI_HINT);
} }
} }

@ -106,17 +106,17 @@ private:
void showHighscore(int focusitem = -1); void showHighscore(int focusitem = -1);
void initTDEAction(); void initTDEAction();
void setCheatMode(); void setHintMode();
void resetCheatMode(); void resetHintMode();
private: private:
TQString lastPlayerName; TQString lastPlayerName;
Board *board; Board *board;
TQValueVector<HighScore> highscore; TQValueVector<HighScore> highscore;
KHighscore* highscoreTable; KHighscore* highscoreTable;
bool cheat; bool hintmode;
enum statusBarItems { SBI_TIME, SBI_TILES, SBI_CHEAT }; enum statusBarItems { SBI_TIME, SBI_TILES, SBI_HINT };
}; };

Loading…
Cancel
Save