summaryrefslogtreecommitdiffstats
path: root/kgoldrunner/src/kgoldrunner.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-04-07 15:50:40 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-04-07 23:25:01 +0900
commit664580ffc694a1f9e7ab25d4636ca9696a38d958 (patch)
treedaea2bbeea9cce36e9c8fe66afd1930e397e7ebd /kgoldrunner/src/kgoldrunner.cpp
parentd62a856cb43f9a527dc936783d18fbfe4cc0d9c2 (diff)
downloadtdegames-r14.1.4.tar.gz
tdegames-r14.1.4.zip
Replace TRUE/FALSE with boolean values true/falser14.1.4
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 66230b1cca2fa5c95886d8cf708829e4bfac2b10)
Diffstat (limited to 'kgoldrunner/src/kgoldrunner.cpp')
-rw-r--r--kgoldrunner/src/kgoldrunner.cpp142
1 files changed, 71 insertions, 71 deletions
diff --git a/kgoldrunner/src/kgoldrunner.cpp b/kgoldrunner/src/kgoldrunner.cpp
index 8d417c8d..28419dc8 100644
--- a/kgoldrunner/src/kgoldrunner.cpp
+++ b/kgoldrunner/src/kgoldrunner.cpp
@@ -42,12 +42,12 @@ KGoldrunner::KGoldrunner()
/******************************************************************************/
// Avoid "saveOK()" check if an error-exit occurs during the file checks.
- startupOK = TRUE;
+ startupOK = true;
// Get directory paths for the system levels, user levels and manual.
if (! getDirectories()) {
fprintf (stderr, "getDirectories() FAILED\n");
- startupOK = FALSE;
+ startupOK = false;
return; // If games directory not found, abort.
}
@@ -65,7 +65,7 @@ KGoldrunner::KGoldrunner()
// Initialise the collections of levels (i.e. the list of games).
if (! game->initCollections()) {
- startupOK = FALSE;
+ startupOK = false;
return; // If no game files, abort.
}
@@ -107,7 +107,7 @@ KGoldrunner::KGoldrunner()
if (dw > 1024) { // More than 1024x768.
view->changeSize (+1);
view->changeSize (+1); // Scale 1.75:1.
- setUsesBigPixmaps (TRUE); // Use big toolbar buttons.
+ setUsesBigPixmaps (true); // Use big toolbar buttons.
}
view->setBaseScale(); // Set scale for level-names.
#endif
@@ -115,16 +115,16 @@ KGoldrunner::KGoldrunner()
makeEditToolbar(); // Uses pixmaps from "view".
editToolbar->hide();
- setDockEnabled (DockBottom, FALSE);
- setDockEnabled (DockLeft, FALSE);
- setDockEnabled (DockRight, FALSE);
+ setDockEnabled (DockBottom, false);
+ setDockEnabled (DockLeft, false);
+ setDockEnabled (DockRight, false);
// Make it impossible to turn off the editor toolbar.
// Accidentally hiding it would make editing impossible.
- setDockMenuEnabled (FALSE);
+ setDockMenuEnabled (false);
// Set mouse control of the hero as the default.
- game->setMouseMode (TRUE);
+ game->setMouseMode (true);
// Paint the main widget (title, menu, status bar, blank playfield).
show();
@@ -251,7 +251,7 @@ void KGoldrunner::setupActions()
0,
game, TQ_SLOT(saveLevelFile()), actionCollection(),
"save_edits");
- saveEdits->setEnabled (FALSE); // Nothing to save, yet.
+ saveEdits->setEnabled (false); // Nothing to save, yet.
(void) new TDEAction (
i18n("&Move Level..."),
@@ -318,7 +318,7 @@ void KGoldrunner::setupActions()
setIceCave-> setExclusiveGroup ("landscapes");
setMidnight-> setExclusiveGroup ("landscapes");
setKDEKool-> setExclusiveGroup ("landscapes");
- setKGoldrunner-> setChecked (TRUE);
+ setKGoldrunner-> setChecked (true);
/**************************************************************************/
/**************************** SETTINGS MENU ****************************/
@@ -343,7 +343,7 @@ void KGoldrunner::setupActions()
setMouse-> setExclusiveGroup ("control");
setKeyboard-> setExclusiveGroup ("control");
- setMouse-> setChecked (TRUE);
+ setMouse-> setChecked (true);
// Normal Speed
// Beginner Speed
@@ -381,7 +381,7 @@ void KGoldrunner::setupActions()
nSpeed-> setExclusiveGroup ("speed");
bSpeed-> setExclusiveGroup ("speed");
cSpeed-> setExclusiveGroup ("speed");
- nSpeed-> setChecked (TRUE);
+ nSpeed-> setChecked (true);
// Traditional Rules
// KGoldrunner Rules
@@ -400,7 +400,7 @@ void KGoldrunner::setupActions()
tradRules-> setExclusiveGroup ("rules");
kgrRules-> setExclusiveGroup ("rules");
- tradRules-> setChecked (TRUE);
+ tradRules-> setChecked (true);
// Larger Playing Area
// Smaller Playing Area
@@ -507,7 +507,7 @@ void KGoldrunner::initStatusBar()
int i = statusBar()->fontInfo().pointSize();
statusBar()->setFont (TQFont (s, i, TQFont::Bold));
- statusBar()->setSizeGripEnabled (FALSE); // Use Settings menu ...
+ statusBar()->setSizeGripEnabled (false); // Use Settings menu ...
statusBar()->insertItem ("", ID_LIVES);
statusBar()->insertItem ("", ID_SCORE);
@@ -518,12 +518,12 @@ void KGoldrunner::initStatusBar()
showLives (5); // Start with 5 lives.
showScore (0);
showLevel (0);
- adjustHintAction (FALSE);
+ adjustHintAction (false);
// Set the PAUSE/RESUME key-names into the status bar message.
pauseKeys = myPause->shortcut().toString();
pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \"");
- gameFreeze (FALSE);
+ gameFreeze (false);
statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes.
statusBar()->setItemFixed (ID_SCORE, -1);
@@ -646,8 +646,8 @@ void KGoldrunner::lsKDEKool() {view->changeLandscape ("TDE Kool");}
// Local slots to set mouse or keyboard control of the hero.
-void KGoldrunner::setMouseMode() {game->setMouseMode (TRUE);}
-void KGoldrunner::setKeyBoardMode() {game->setMouseMode (FALSE);}
+void KGoldrunner::setMouseMode() {game->setMouseMode (true);}
+void KGoldrunner::setKeyBoardMode() {game->setMouseMode (false);}
// Local slots to set game speed.
@@ -661,19 +661,19 @@ void KGoldrunner::decSpeed() {hero->setSpeed (-1);}
void KGoldrunner::setTradRules()
{
- KGrFigure::variableTiming = TRUE;
- KGrFigure::alwaysCollectNugget = TRUE;
- KGrFigure::runThruHole = TRUE;
- KGrFigure::reappearAtTop = TRUE;
+ KGrFigure::variableTiming = true;
+ KGrFigure::alwaysCollectNugget = true;
+ KGrFigure::runThruHole = true;
+ KGrFigure::reappearAtTop = true;
KGrFigure::searchStrategy = LOW;
}
void KGoldrunner::setKGrRules()
{
- KGrFigure::variableTiming = FALSE;
- KGrFigure::alwaysCollectNugget = FALSE;
- KGrFigure::runThruHole = FALSE;
- KGrFigure::reappearAtTop = FALSE;
+ KGrFigure::variableTiming = false;
+ KGrFigure::alwaysCollectNugget = false;
+ KGrFigure::runThruHole = false;
+ KGrFigure::reappearAtTop = false;
KGrFigure::searchStrategy = MEDIUM;
}
@@ -819,7 +819,7 @@ void KGoldrunner::changeCaption(const TQString& text)
bool KGoldrunner::getDirectories()
{
- bool result = TRUE;
+ bool result = true;
// WHERE THINGS ARE: In the KDE 3 environment (Release 3.1.1), application
// documentation and data files are in a directory structure given by
@@ -850,7 +850,7 @@ bool KGoldrunner::getDirectories()
i18n("Cannot find documentation sub-folder 'en/%1/' "
"in area '%2' of the TDE folder ($TDEDIRS).")
.arg(myDir).arg(dirs->kde_default ("html")));
- // result = FALSE; // Don't abort if the doc is missing.
+ // result = false; // Don't abort if the doc is missing.
}
else
systemHTMLDir.append ("en/" + myDir + "/");
@@ -862,20 +862,20 @@ bool KGoldrunner::getDirectories()
i18n("Cannot find system games sub-folder '%1/system/' "
"in area '%2' of the TDE folder ($TDEDIRS).")
.arg(myDir).arg(dirs->kde_default ("data")));
- result = FALSE; // ABORT if the games data is missing.
+ result = false; // ABORT if the games data is missing.
}
else
systemDataDir.append (myDir + "/system/");
// Locate and optionally create directories for user collections and levels.
- bool create = TRUE;
+ bool create = true;
userDataDir = dirs->saveLocation ("data", myDir + "/user/", create);
if (userDataDir.length() <= 0) {
KGrMessage::information (this, i18n("Get Folders"),
i18n("Cannot find or create user games sub-folder '%1/user/' "
"in area '%2' of the TDE user area ($TDEHOME).")
.arg(myDir).arg(dirs->kde_default ("data")));
- // result = FALSE; // Don't abort if user area is missing.
+ // result = false; // Don't abort if user area is missing.
}
else {
create = dirs->makeDir (userDataDir + "levels/");
@@ -883,7 +883,7 @@ bool KGoldrunner::getDirectories()
KGrMessage::information (this, i18n("Get Folders"),
i18n("Cannot find or create 'levels/' folder in "
"sub-folder '%1/user/' in the TDE user area ($TDEHOME).").arg(myDir));
- // result = FALSE; // Don't abort if user area is missing.
+ // result = false; // Don't abort if user area is missing.
}
}
@@ -896,9 +896,9 @@ bool KGoldrunner::getDirectories()
bool KGoldrunner::queryClose ()
{
// Last chance to save: user has clicked "X" widget or menu-Quit.
- bool cannotContinue = TRUE;
+ bool cannotContinue = true;
game->saveOK (cannotContinue);
- return (TRUE);
+ return (true);
}
void KGoldrunner::setKey (KBAction movement)
@@ -908,7 +908,7 @@ void KGoldrunner::setKey (KBAction movement)
// Using keyboard control can automatically disable mouse control.
if (game->inMouseMode()) {
// Halt the game while a message is displayed.
- game->setMessageFreeze (TRUE);
+ game->setMessageFreeze (true);
switch (KGrMessage::warning (this, i18n("Switch to Keyboard Mode"),
i18n("You have pressed a key that can be used to move the "
@@ -917,15 +917,15 @@ void KGoldrunner::setKey (KBAction movement)
"- like riding a bike rather than walking!"),
i18n("Switch to &Keyboard Mode"), i18n("Stay in &Mouse Mode")))
{
- case 0: game->setMouseMode (FALSE); // Set internal mouse mode OFF.
- setMouse->setChecked (FALSE); // Adjust the Settings menu.
- setKeyboard->setChecked (TRUE);
+ case 0: game->setMouseMode (false); // Set internal mouse mode OFF.
+ setMouse->setChecked (false); // Adjust the Settings menu.
+ setKeyboard->setChecked (true);
break;
case 1: break;
}
// Unfreeze the game, but only if it was previously unfrozen.
- game->setMessageFreeze (FALSE);
+ game->setMessageFreeze (false);
if (game->inMouseMode())
return; // Stay in Mouse Mode.
@@ -987,77 +987,77 @@ void KGoldrunner::makeEditToolbar()
edenemybg = edenemybg.xForm (w);
}
- editToolbar = new TDEToolBar (this, TQt::DockTop, TRUE, "Editor", TRUE);
+ editToolbar = new TDEToolBar (this, TQt::DockTop, true, "Editor", true);
// Choose a colour that enhances visibility of the KGoldrunner pixmaps.
// editToolbar->setPalette (TQPalette (TQColor (150, 150, 230)));
- // editToolbar->setHorizontallyStretchable (TRUE); // Not effective in KDE.
+ // editToolbar->setHorizontallyStretchable (true); // Not effective in KDE.
// All those separators are just to get reasonable visual spacing of the
- // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in TQt.
+ // pixmaps in KDE. "setHorizontallyStretchable(true)" does it in TQt.
editToolbar->insertSeparator();
editToolbar->insertButton ("document-new", 0, TQ_SIGNAL(clicked()), game,
- TQ_SLOT(createLevel()), TRUE, i18n("&Create a Level"));
+ TQ_SLOT(createLevel()), true, i18n("&Create a Level"));
editToolbar->insertButton ("document-open", 1, TQ_SIGNAL(clicked()), game,
- TQ_SLOT(updateLevel()), TRUE, i18n("&Edit Any Level..."));
+ TQ_SLOT(updateLevel()), true, i18n("&Edit Any Level..."));
editToolbar->insertButton ("document-save", 2, TQ_SIGNAL(clicked()), game,
- TQ_SLOT(saveLevelFile()),TRUE, i18n("&Save Edits..."));
+ TQ_SLOT(saveLevelFile()),true, i18n("&Save Edits..."));
editToolbar->insertSeparator();
editToolbar->insertSeparator();
editToolbar->insertButton ("ktip", 3, TQ_SIGNAL(clicked()), game,
- TQ_SLOT(editNameAndHint()),TRUE,i18n("Edit Name/Hint"));
+ TQ_SLOT(editNameAndHint()),true,i18n("Edit Name/Hint"));
editToolbar->insertSeparator();
editToolbar->insertSeparator();
editToolbar->insertButton (freebg, (int)FREE, TQ_SIGNAL(clicked()), this,
- TQ_SLOT(freeSlot()), TRUE, i18n("Empty space"));
+ TQ_SLOT(freeSlot()), true, i18n("Empty space"));
editToolbar->insertSeparator();
editToolbar->insertButton (edherobg, (int)HERO, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (edheroSlot()), TRUE, i18n("Hero"));
+ TQ_SLOT (edheroSlot()), true, i18n("Hero"));
editToolbar->insertSeparator();
editToolbar->insertButton (edenemybg, (int)ENEMY, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (edenemySlot()), TRUE, i18n("Enemy"));
+ TQ_SLOT (edenemySlot()), true, i18n("Enemy"));
editToolbar->insertSeparator();
editToolbar->insertButton (brickbg, (int)BRICK, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (brickSlot()), TRUE, i18n("Brick (can dig)"));
+ TQ_SLOT (brickSlot()), true, i18n("Brick (can dig)"));
editToolbar->insertSeparator();
editToolbar->insertButton (betonbg, (int)BETON, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)"));
+ TQ_SLOT (betonSlot()), true, i18n("Concrete (cannot dig)"));
editToolbar->insertSeparator();
editToolbar->insertButton (fbrickbg, (int)FBRICK, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)"));
+ TQ_SLOT (fbrickSlot()), true, i18n("Trap (can fall through)"));
editToolbar->insertSeparator();
editToolbar->insertButton (ladderbg, (int)LADDER, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (ladderSlot()), TRUE, i18n("Ladder"));
+ TQ_SLOT (ladderSlot()), true, i18n("Ladder"));
editToolbar->insertSeparator();
editToolbar->insertButton (hladderbg, (int)HLADDER, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (hladderSlot()), TRUE, i18n("Hidden ladder"));
+ TQ_SLOT (hladderSlot()), true, i18n("Hidden ladder"));
editToolbar->insertSeparator();
editToolbar->insertButton (polebg, (int)POLE, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (poleSlot()), TRUE, i18n("Pole (or bar)"));
+ TQ_SLOT (poleSlot()), true, i18n("Pole (or bar)"));
editToolbar->insertSeparator();
editToolbar->insertButton (nuggetbg, (int)NUGGET, TQ_SIGNAL(clicked()), this,
- TQ_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget"));
-
- editToolbar->setToggle ((int) FREE, TRUE);
- editToolbar->setToggle ((int) HERO, TRUE);
- editToolbar->setToggle ((int) ENEMY, TRUE);
- editToolbar->setToggle ((int) BRICK, TRUE);
- editToolbar->setToggle ((int) BETON, TRUE);
- editToolbar->setToggle ((int) FBRICK, TRUE);
- editToolbar->setToggle ((int) LADDER, TRUE);
- editToolbar->setToggle ((int) HLADDER, TRUE);
- editToolbar->setToggle ((int) POLE, TRUE);
- editToolbar->setToggle ((int) NUGGET, TRUE);
+ TQ_SLOT (nuggetSlot()), true, i18n("Gold nugget"));
+
+ editToolbar->setToggle ((int) FREE, true);
+ editToolbar->setToggle ((int) HERO, true);
+ editToolbar->setToggle ((int) ENEMY, true);
+ editToolbar->setToggle ((int) BRICK, true);
+ editToolbar->setToggle ((int) BETON, true);
+ editToolbar->setToggle ((int) FBRICK, true);
+ editToolbar->setToggle ((int) LADDER, true);
+ editToolbar->setToggle ((int) HLADDER, true);
+ editToolbar->setToggle ((int) POLE, true);
+ editToolbar->setToggle ((int) NUGGET, true);
pressedButton = (int) BRICK;
- editToolbar->setButton (pressedButton, TRUE);
+ editToolbar->setButton (pressedButton, true);
}
/******************************************************************************/
@@ -1089,9 +1089,9 @@ void KGoldrunner::defaultEditObj()
void KGoldrunner::setButton (int btn)
{
- editToolbar->setButton (pressedButton, FALSE);
+ editToolbar->setButton (pressedButton, false);
pressedButton = btn;
- editToolbar->setButton (pressedButton, TRUE);
+ editToolbar->setButton (pressedButton, true);
}
#include "kgoldrunner.moc"