Make statusbar text consistent with menu text.

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

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

@ -106,17 +106,17 @@ private:
void showHighscore(int focusitem = -1);
void initTDEAction();
void setCheatMode();
void resetCheatMode();
void setHintMode();
void resetHintMode();
private:
TQString lastPlayerName;
Board *board;
TQValueVector<HighScore> highscore;
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