summaryrefslogtreecommitdiff
path: root/noncore/games
authorkergoth <kergoth>2003-08-09 16:24:58 (UTC)
committer kergoth <kergoth>2003-08-09 16:24:58 (UTC)
commite16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (side-by-side diff)
tree9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/games
parent1c58d1407f9584fedcdae390a04e2b37e5853361 (diff)
downloadopie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip
opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz
opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/games') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/backgammon/backgammon.control2
-rw-r--r--noncore/games/backgammon/backgammon.cpp2
-rw-r--r--noncore/games/backgammon/backgammon.h1
-rw-r--r--noncore/games/bounce/kbounce.cpp6
-rw-r--r--noncore/games/buzzword/buzzword.cpp8
-rw-r--r--noncore/games/fifteen/opie-fifteen.control2
-rw-r--r--noncore/games/go/opie-go.control2
-rw-r--r--noncore/games/kpacman/kpacman.cpp2
-rw-r--r--noncore/games/mindbreaker/opie-mindbreaker.control2
-rw-r--r--noncore/games/minesweep/opie-minesweep.control2
-rw-r--r--noncore/games/parashoot/opie-parashoot.control2
-rw-r--r--noncore/games/qasteroids/opie-qasteroids.control2
-rw-r--r--noncore/games/sfcave-sdl/sfcave-sdl.control2
-rw-r--r--noncore/games/sfcave/opie-sfcave.control2
-rw-r--r--noncore/games/snake/interface.cpp4
-rw-r--r--noncore/games/snake/opie-snake.control2
-rw-r--r--noncore/games/solitaire/canvascardwindow.cpp14
-rw-r--r--noncore/games/solitaire/opie-solitaire.control2
-rw-r--r--noncore/games/tetrix/opie-tetrix.control2
-rw-r--r--noncore/games/tictac/main.cpp2
-rw-r--r--noncore/games/tictac/opie-tictac.control2
-rw-r--r--noncore/games/wordgame/opie-wordgame.control2
-rw-r--r--noncore/games/wordgame/wordgame.cpp4
23 files changed, 35 insertions, 36 deletions
diff --git a/noncore/games/backgammon/backgammon.control b/noncore/games/backgammon/backgammon.control
index b75bc60..6468181 100644
--- a/noncore/games/backgammon/backgammon.control
+++ b/noncore/games/backgammon/backgammon.control
@@ -1,10 +1,10 @@
Package: backgammon
Files: bin/backgammon apps/Games/backgammon.desktop pics/backgammon help/en/html/backgammon.html
Priority: optional
Section: opie/games
Maintainer: Ralf Waspe <rwaspe@web.de>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Backgammon Game
A Backgammon game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp
index db1a058..06523f1 100644
--- a/noncore/games/backgammon/backgammon.cpp
+++ b/noncore/games/backgammon/backgammon.cpp
@@ -90,98 +90,96 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
theme.writeEntry("dice2","casino_dice");
theme.writeEntry("table","casino_table_green");
theme.writeEntry("odds","casino_odds");
}
theme.setGroup("theme");
board_name=theme.readEntry("board","casino_board_1");
piecesA_name=theme.readEntry("pieces1","casino_pieces_blue");
piecesB_name=theme.readEntry("pieces2","casino_pieces_white");
diceA_name=theme.readEntry("dice1","casino_dice");
diceB_name=theme.readEntry("dice2","casino_dice");
table_name=theme.readEntry("table","casino_table_green");
odds_name=theme.readEntry("odds","casino_odds");
//the menu
QPEMenuBar* menuBar = new QPEMenuBar(this);
QPopupMenu* gamemenu= new QPopupMenu(this);
gamemenu->insertItem(tr( "New" ),this,SLOT(newgame()));
gamemenu->insertSeparator();
gamemenu->insertItem(tr( "Load" ),this,SLOT(loadgame()));
gamemenu->insertItem(tr( "Save" ),this,SLOT(savegame()));
gamemenu->insertSeparator();
gamemenu->insertItem(tr( "Delete" ),this,SLOT(deletegame()));
menuBar->insertItem(tr( "Game" ),gamemenu);
QPopupMenu* thememenu= new QPopupMenu(this);
thememenu->insertItem(tr( "New" ),this,SLOT(newtheme()));
thememenu->insertSeparator();
thememenu->insertItem(tr( "Load"),this,SLOT(loadtheme()));
thememenu->insertItem(tr( "Save" ),this,SLOT(savetheme()));
thememenu->insertSeparator();
thememenu->insertItem(tr( "Default"),this,SLOT(themedefault()));
thememenu->insertItem(tr( "Delete" ),this,SLOT(deletetheme()));
menuBar->insertItem(tr( "Theme" ),thememenu);
QPopupMenu* optionmenu=new QPopupMenu(this);
optionmenu->insertItem(tr( "Player" ),this,SLOT(playerselect()));
optionmenu->insertSeparator();
optionmenu->insertItem(tr( "AI" ),this,SLOT(modify_AI()));
optionmenu->insertItem(tr( "Rules" ),this,SLOT(setrules()));
menuBar->insertItem(tr( "Options"),optionmenu);
QWidget* mainarea=new QWidget(this);
setCentralWidget(mainarea);
//the main area
QBoxLayout* layout=new QBoxLayout(mainarea,QBoxLayout::TopToBottom);
area=new QCanvas(235,235);
- QColor bgColor=palette().color(QPalette::Normal,QColorGroup::Background);
- area->setBackgroundColor(bgColor);
boardview=new BackGammonView(area,mainarea);
boardview->setMaximumHeight(240);
layout->addWidget(boardview);
connect(boardview,SIGNAL(mouse(int,int)),this,SLOT(mouse(int,int)));
//status bar
message=new QLabel("<b>Backgammon</b>",mainarea);
message->setAlignment(AlignHCenter);
layout->addWidget(message);
//the marker
marker_current=new QCanvasRectangle(area);
marker_current->setBrush(QColor(0,0,255));
marker_current->setSize(15,5);
marker_current->setZ(1);
for(a=0;a<4;a++)
{
marker_next[a]=new QCanvasRectangle(area);
marker_next[a]->setBrush(QColor(0,255,0));
marker_next[a]->setSize(15,5);
marker_next[a]->setZ(1);
}
connect(move,SIGNAL(done_dice1()),this,SLOT(done_dice1()));
connect(move,SIGNAL(done_dice2()),this,SLOT(done_dice2()));
connect(move,SIGNAL(done_dice3()),this,SLOT(done_dice3()));
connect(move,SIGNAL(done_dice4()),this,SLOT(done_dice4()));
connect(move,SIGNAL(nomove()),this,SLOT(nomove()));
connect(move,SIGNAL(player_finished(int)),this,SLOT(finished(int)));
//the pieces
p1=new CanvasImageItem*[15];
p1_side=new CanvasImageItem*[15];
QImage piece_1_all(Resource::loadImage("backgammon/pieces/"+piecesA_name));
QImage piece_1_front=piece_1_all.copy(0,0,15,15);
QImage piece_1_side=piece_1_all.copy(0,15,15,5);
p2=new CanvasImageItem*[15];
p2_side=new CanvasImageItem*[15];
QImage piece_2_all(Resource::loadImage("backgammon/pieces/"+piecesB_name));
QImage piece_2_front=piece_2_all.copy(0,0,15,15);
QImage piece_2_side=piece_2_all.copy(0,15,15,5);
for(a=0;a<15;a++)
{
p1[a]=new CanvasImageItem(piece_1_front,area);
p1[a]->setSize(15,15);
diff --git a/noncore/games/backgammon/backgammon.h b/noncore/games/backgammon/backgammon.h
index d803489..e3276f1 100644
--- a/noncore/games/backgammon/backgammon.h
+++ b/noncore/games/backgammon/backgammon.h
@@ -1,68 +1,69 @@
#ifndef BACKGAMMON_H
#define BACKGAMMON_H
#include "backgammonview.h"
#include "canvasimageitem.h"
//#include "rulesdialog.h"
#include "moveengine.h"
#include <qlabel.h>
#include <qmainwindow.h>
//#include <qwidget.h>
class BackGammon : public QMainWindow
{
Q_OBJECT
private:
+ //GUI
//the "status" bar
QLabel* message;
//the main drawing area
QCanvas* area;
BackGammonView* boardview;
CanvasImageItem* board;
CanvasImageItem* table;
CanvasImageItem** p1;
CanvasImageItem** p2;
CanvasImageItem** p1_side;
CanvasImageItem** p2_side;
CanvasImageItem** diceA1;
CanvasImageItem** diceA2;
CanvasImageItem** diceB1;
CanvasImageItem** diceB2;
//CanvasImageItem** oddsDice;
CanvasImageItem* nomove_marker;
QCanvasRectangle* marker_current;
QCanvasRectangle* marker_next[4];
//ENGINE
MoveEngine* move;
//the dice values
int diceA1_value;
int diceA2_value;
int diceA3_value;
int diceA4_value;
int diceB1_value;
int diceB2_value;
int diceB3_value;
int diceB4_value;
int player;
bool dice1_played;
bool dice2_played;
bool dice3_played;
bool dice4_played;
bool dice_rolled;
//computer opponent
bool player1_auto;
bool player2_auto;
//the images;
QString theme_name;
QString board_name;
QString piecesA_name;
diff --git a/noncore/games/bounce/kbounce.cpp b/noncore/games/bounce/kbounce.cpp
index 5d8aba3..50f4ef6 100644
--- a/noncore/games/bounce/kbounce.cpp
+++ b/noncore/games/bounce/kbounce.cpp
@@ -68,106 +68,106 @@ KJezzball::KJezzball() : QMainWindow(0), m_gameWidget( 0 )
FilledLabel->setText( tr( "Filled: 00%" ) );
FilledLabel->setAlignment( int( QLabel::AlignCenter ) );
m_layout->addWidget( FilledLabel, 1, 1 );
TimeLabel = new QLabel( m_view, "TimeLabel" );
TimeLabel->setText( tr( "Time: 00" ) );
TimeLabel->setAlignment( int( QLabel::AlignCenter ) );
m_layout->addWidget( TimeLabel, 1, 3 );
// create timers
m_nextLevelTimer = new QTimer( this, "m_nextLevelTimer" );
connect( m_nextLevelTimer, SIGNAL(timeout()), this, SLOT(switchLevel()) );
m_gameOverTimer = new QTimer( this, "m_gameOverTimer" );
connect( m_gameOverTimer, SIGNAL(timeout()), this, SLOT(gameOverNow()) );
m_timer = new QTimer( this, "m_timer" );
connect( m_timer, SIGNAL(timeout()), this, SLOT(second()) );
// create demo game
createLevel( 1 );
}
void KJezzball::newGame()
{
// Check for running game
closeGame();
if ( m_state==Idle )
{
// update displays
m_game.level = 1;
m_game.score = 0;
setCaption(tr("Bounce Level %1").arg(m_game.level));
ScoreLabel->setText( tr( "Score: %1" ).arg(m_game.score) );
// start new game
m_state = Running;
createLevel( m_game.level );
startLevel();
}
}
void KJezzball::about()
{
- QMessageBox::information( this, "About",
- "Written by: Stefan Schimanski\n"
+ QMessageBox::information( this, tr("About"),
+ tr("Written by: Stefan Schimanski\n"
"Ported by: Martin Imobersteg\n"
"\n"
"Click to form walls.\n"
"Hit space to switch wall direction.\n"
"Try to reduce total space by 75%.\n"
"\n"
"This program is distributed under\n"
- "the terms of the GPL v2." );
+ "the terms of the GPL v2.") );
}
void KJezzball::closeGame()
{
if ( m_state!=Idle )
{
stopLevel();
m_state = Idle;
}
}
void KJezzball::pauseGame()
{
switch ( m_state )
{
case Running:
m_state = Paused;
m_gameWidget->display( tr("Game paused.\nPress P to continue!") );
stopLevel();
break;
case Paused:
case Suspend:
m_state = Running;
m_gameWidget->display( QString::null );
startLevel();
break;
case Idle:
break;
}
}
void KJezzball::gameOver()
{
stopLevel();
m_gameOverTimer->start( 100, TRUE );
}
void KJezzball::gameOverNow()
{
m_state = Idle;
QString score;
score.setNum( m_game.score );
QMessageBox::information( this, "Game Over", tr("Game Over!\nScore: %1").arg(score) );
}
diff --git a/noncore/games/buzzword/buzzword.cpp b/noncore/games/buzzword/buzzword.cpp
index b870a59..97a17a1 100644
--- a/noncore/games/buzzword/buzzword.cpp
+++ b/noncore/games/buzzword/buzzword.cpp
@@ -1,50 +1,50 @@
/*
- * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch>
+ * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License,Life or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <qlayout.h>
#include <qmessagebox.h>
#include <qmainwindow.h>
#include <qlabel.h>
#include <qgrid.h>
#include <qcolor.h>
#include <qbutton.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qstringlist.h>
#include <qmessagebox.h>
#include <qdir.h>
#include <math.h>
#include <stdlib.h>
#include <qpe/qpeapplication.h>
#include "buzzword.h"
BuzzLabel::BuzzLabel( QWidget *parent, const char *name )
: QLabel( parent, name )
{
}
void BuzzLabel::mousePressEvent(QMouseEvent *e)
{
if(e->button() == LeftButton)
{
emit clicked();
}
}
@@ -57,123 +57,123 @@ BuzzItem::BuzzItem( int row, int column, QString text, QWidget *parent, const ch
label = new BuzzLabel(this, "label");
label->setText(text);
label->setAlignment( int( QLabel::AlignCenter ) );
connect( label, SIGNAL(clicked()), this, SLOT(flip()) );
}
void BuzzItem::flip()
{
setLineWidth( 1 );
label->setBackgroundColor(label->colorGroup().highlight());
emit clicked(_row, _column);
}
BuzzWord::BuzzWord() : QMainWindow(0)
{
setCaption(tr("buZzword"));
menu = menuBar();
game = new QPopupMenu;
game->insertItem(tr("&New game"), this, SLOT(newGame()), Key_N );
menu->insertItem( tr("&Game"), game );
gridVal = 4;
grid = NULL;
gameOver = false;
newGame();
}
void BuzzWord::drawGrid()
{
QStringList l;
QString path = QPEApplication::qpeDir()+"share/buzzword/";
QFile f( path + "buzzwords" );
if ( !f.open( IO_ReadOnly ) )
return;
QTextStream t( &f );
while (!t.atEnd())
{
l << t.readLine();
}
f.close();
grid = new QGrid(gridVal, this);
- grid->setFixedSize(240,240);
+// grid->setFixedSize( 480, 480 );
for( int c = 0 ; c < gridVal ; c++ )
{
for( int r = 0 ; r < gridVal ; r++ )
{
uint pos = rand() % l. count();
-
+
QString word = QStringList::split(" ", l[pos]).join("\n");
BuzzItem* bi = new BuzzItem( c, r, word, grid );
connect( bi, SIGNAL(clicked(int, int)), this, SLOT(clicked(int,int)) );
map[c][r] = 0;
l.remove( l.at( pos ));
}
}
}
void BuzzWord::clicked(int row, int column)
{
if ( ! gameOver )
{
int rowTotal = 0;
int columnTotal = 0;
map[column][row] = 1;
-
+
for( int c = 0 ; c < gridVal ; c++ )
{
for( int r = 0 ; r < gridVal ; r++ )
{
if ( map[c][r] == 1 )
rowTotal++;
if ( rowTotal == 4 )
{
bingo();
}
}
rowTotal = 0;
}
for( int r = 0 ; r < gridVal ; r++ )
{
for( int c = 0 ; c < gridVal ; c++ )
{
if ( map[c][r] == 1 )
columnTotal++;
if ( columnTotal == 4 )
{
bingo();
}
}
columnTotal = 0;
}
if ( map[0][0] && map[1][1] && map[2][2] && map[3][3] )
bingo();
if ( map[0][3] && map[1][2] && map[2][1] && map[3][0] )
bingo();
}
}
void BuzzWord::bingo()
{
gameOver = true;
QMessageBox::information( this, "BUZZWORD", tr("<h1><b>BINGO !</b></h1>"));
}
void BuzzWord::newGame()
{
gameOver = false;
delete grid;
diff --git a/noncore/games/fifteen/opie-fifteen.control b/noncore/games/fifteen/opie-fifteen.control
index 662fd03..8fa355f 100644
--- a/noncore/games/fifteen/opie-fifteen.control
+++ b/noncore/games/fifteen/opie-fifteen.control
@@ -1,11 +1,11 @@
Package: opie-fifteen
Files: bin/fifteen apps/Games/fifteen.desktop pics/fifteen
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
Arch: iPAQ
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Fifteen pieces game
A game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/go/opie-go.control b/noncore/games/go/opie-go.control
index 061c02c..24929de 100644
--- a/noncore/games/go/opie-go.control
+++ b/noncore/games/go/opie-go.control
@@ -1,10 +1,10 @@
Package: opie-go
Files: bin/go apps/Games/go.desktop pics/go
Priority: optional
Section: opie/games
Maintainer: Warwick Allison <warwick@trolltech.com>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: The game of Go
A game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/kpacman/kpacman.cpp b/noncore/games/kpacman/kpacman.cpp
index 812e9ea..df27c76 100644
--- a/noncore/games/kpacman/kpacman.cpp
+++ b/noncore/games/kpacman/kpacman.cpp
@@ -1,85 +1,85 @@
#include "portable.h"
#if defined( KDE2_PORT )
#include <kpacman.h>
#include <kpacman.moc>
#include <kcolordlg.h>
#elif defined( QPE_PORT )
#include <qmenubar.h>
#include <qpe/config.h>
#include <qapplication.h>
#include "kpacman.h"
#endif
#include <qkeycode.h>
#include <qcolor.h>
#include <qstring.h>
#include <qpopmenu.h>
#include <qmsgbox.h>
Kpacman::Kpacman(QWidget *parent, const char *name)
: KTMainWindow(parent, name)
{
schemesPopup = new QList<QPopupMenu>;
schemesPopup->setAutoDelete(TRUE);
menu();
m_view = new QWidget( this, "m_view" );
m_view->setBackgroundColor( black );
m_layout = new QGridLayout( m_view );
m_layout->setMargin( 7 );
view = new KpacmanWidget( this, QString(name)+"widget");
m_layout->addWidget( view, 0, 0 );
- setCaption( "KPacman" );
+ setCaption( tr("KPacman") );
view->referee->setFocus();
connect(view->referee, SIGNAL(setScore(int, int)),
view->score, SLOT(setScore(int, int)));
connect(view->referee, SIGNAL(setPoints(int)),
view->score, SLOT(set(int)));
connect(view->referee, SIGNAL(setLifes(int)),
view->status, SLOT(setLifes(int)));
connect(view->referee, SIGNAL(setLevel(int)),
view->status, SLOT(setLevel(int)));
connect(view->referee, SIGNAL(forcedHallOfFame(bool)),
this, SLOT(forcedHallOfFame(bool)));
connect(view->referee, SIGNAL(togglePaused()), this, SLOT(togglePaused()));
connect(view->referee, SIGNAL(toggleNew()), this, SLOT(toggleNew()));
connect(view->score, SIGNAL(toggleNew()), this, SLOT(toggleNew()));
connect(view->score, SIGNAL(forcedHallOfFame(bool)),
this, SLOT(forcedHallOfFame(bool)));
APP_CONFIG_BEGIN( cfg );
focusOutPause = !cfg->readBoolEntry("FocusOutPause", TRUE);
focusInContinue = !cfg->readBoolEntry("FocusInContinue", TRUE);
hideMouseCursor = !cfg->readBoolEntry("HideMouseCursor", TRUE);
APP_CONFIG_END( cfg );
toggleFocusOutPause();
toggleFocusInContinue();
toggleHideMouseCursor();
setCentralWidget( m_view );
}
Kpacman::~Kpacman()
{
/* APP_CONFIG_BEGIN( cfg );
cfg->writeEntry("FocusOutPause", focusOutPause);
cfg->writeEntry("FocusInContinue", focusInContinue);
cfg->writeEntry("HideMouseCursor", hideMouseCursor);
APP_CONFIG_END( cfg );
*/
delete _menuBar;
}
void Kpacman::menu()
{
gamePopup = new QPopupMenu();
CHECK_PTR( gamePopup );
diff --git a/noncore/games/mindbreaker/opie-mindbreaker.control b/noncore/games/mindbreaker/opie-mindbreaker.control
index 7623d6a..7b5ead6 100644
--- a/noncore/games/mindbreaker/opie-mindbreaker.control
+++ b/noncore/games/mindbreaker/opie-mindbreaker.control
@@ -1,10 +1,10 @@
Package: opie-mindbreaker
Files: bin/mindbreaker apps/Games/mindbreaker.desktop pics/mindbreaker
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Game: crack the coloured code
A game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/minesweep/opie-minesweep.control b/noncore/games/minesweep/opie-minesweep.control
index 7236cf8..32f0352 100644
--- a/noncore/games/minesweep/opie-minesweep.control
+++ b/noncore/games/minesweep/opie-minesweep.control
@@ -1,10 +1,10 @@
Package: opie-minesweep
Files: bin/minesweep apps/Games/minesweep.desktop pics/minesweep
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Game: find the mines
A game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/parashoot/opie-parashoot.control b/noncore/games/parashoot/opie-parashoot.control
index ad955f5..758d24d 100644
--- a/noncore/games/parashoot/opie-parashoot.control
+++ b/noncore/games/parashoot/opie-parashoot.control
@@ -1,10 +1,10 @@
Package: opie-parashoot
Files: bin/parashoot apps/Games/parashoot.desktop pics/parashoot
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Game: shoot the parachutists
A game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/qasteroids/opie-qasteroids.control b/noncore/games/qasteroids/opie-qasteroids.control
index 49cc6b2..25a49b4 100644
--- a/noncore/games/qasteroids/opie-qasteroids.control
+++ b/noncore/games/qasteroids/opie-qasteroids.control
@@ -1,10 +1,10 @@
Package: opie-qasteroids
Files: bin/qasteroids apps/Games/qasteroids.desktop pics/qasteroids/*
Priority: optional
Section: opie/games
Maintainer: Martin Jones <mjones@trolltech.com>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Game: shoot the asteroids
A game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/sfcave-sdl/sfcave-sdl.control b/noncore/games/sfcave-sdl/sfcave-sdl.control
index c017280..9bf43ba 100644
--- a/noncore/games/sfcave-sdl/sfcave-sdl.control
+++ b/noncore/games/sfcave-sdl/sfcave-sdl.control
@@ -1,10 +1,10 @@
Files: bin/sfcave-sdl apps/Games/sfcave-sdl.desktop pics/sfcave-sdl sounds/sfcave-sdl
Package: sfcave-sdl
Priority: optional
Section: Games
-Version: $QPE_VERSION-$SUB_VERSION
Architecture: arm
Maintainer: Andy Qua (andy.qua@blueyonder.co.uk)
Depends: libSDL,libSDL_-mixer,libSDL-image,libSDL-gfx
Description: SFCave SDL for the Zaurus. Fly though the cave avoiding the walls.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/sfcave/opie-sfcave.control b/noncore/games/sfcave/opie-sfcave.control
index 1566959..0ff3e2c 100644
--- a/noncore/games/sfcave/opie-sfcave.control
+++ b/noncore/games/sfcave/opie-sfcave.control
@@ -1,9 +1,9 @@
Package: opie-sfcave
Files: bin/sfcave apps/Games/sfcave.desktop pics/sfcave
Priority: optional
Section: opie/games
Maintainer: Andy Qua <andy.qua@blueyonder.co.uk>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: SFCave for the Zaurus. Fly the dot though the cave avoiding the walls.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/snake/interface.cpp b/noncore/games/snake/interface.cpp
index 0f312ac..68e0f14 100644
--- a/noncore/games/snake/interface.cpp
+++ b/noncore/games/snake/interface.cpp
@@ -55,167 +55,167 @@ SnakeGame::SnakeGame(QWidget* parent, const char* name, WFlags f) :
scorelabel = new QLabel(toolbar);
showScore(0);
scorelabel->setBackgroundMode( PaletteButton );
scorelabel->setAlignment( AlignRight | AlignVCenter | ExpandTabs );
toolbar->setStretchableWidget( scorelabel );
setFocusPolicy(StrongFocus);
setCentralWidget(cv);
QTimer::singleShot( 16, this, SLOT(welcomescreen()) );
gamestopped = true;
waitover = true;
}
SnakeGame::~SnakeGame()
{
delete snake;
}
void SnakeGame::resizeEvent(QResizeEvent *)
{
QSize s = centralWidget()->size();
int fw = style().defaultFrameWidth();
canvas.resize( s.width() - fw - 2, s.height() - fw - 2);
}
void SnakeGame::welcomescreen()
{
QCanvasText* title = new QCanvasText(tr("SNAKE!"), &canvas);
title->setColor(yellow);
title->setFont( QFont("times", 18, QFont::Bold) );
int w = title->boundingRect().width();
title->move(canvas.width()/2 -w/2, canvas.height()/2-110);
title->show();
QCanvasPixmapArray* titlearray = new QCanvasPixmapArray(Resource::findPixmap("snake/title"));
QCanvasSprite* titlepic = new QCanvasSprite(titlearray, &canvas);
titlepic->move(canvas.width()/2 - 33, canvas.height()/2-85);
titlepic->show();
QCanvasText* instr = new QCanvasText(tr("Use the arrow keys to guide the\n"
"snake to eat the mouse. You must not\n"
"crash into the walls, edges or its tail."),
&canvas);
w = instr->boundingRect().width();
instr->move(canvas.width()/2-w/2, canvas.height()/2-20);
instr->setColor(white);
instr->show();
- QCanvasText* cont = new QCanvasText(tr("Press Any Key To Start"), &canvas);
+ QCanvasText* cont = new QCanvasText(tr("Press any key to start"), &canvas);
w = cont->boundingRect().width();
cont->move(canvas.width()/2-w/2, canvas.height()-20);
cont->setColor(yellow);
cont->show();
}
void SnakeGame::newGame()
{
clear();
snake = new Snake(&canvas);
connect(snake, SIGNAL(dead()), this, SLOT(gameOver()) );
connect(snake, SIGNAL(targethit()), this, SLOT(levelUp()) );
connect(snake, SIGNAL(scorechanged()), this, SLOT(scoreInc()) );
connect(this, SIGNAL(moveFaster()), snake, SLOT(increaseSpeed()) );
last = 0;
targetamount = 1;
notargets = 1;
level = 1;
stage = 1;
showScore(0);
gamestopped = false;
waitover = true;
int y = canvas.height()-50;
(void)new Obstacle(&canvas, 32);
(void)new Obstacle(&canvas, y);
createTargets();
}
void SnakeGame::showScore(int score)
{
scorelabel->setText(tr(" Score : %1 ").arg(score) );
}
void SnakeGame::scoreInc()
{
showScore( snake->getScore() );
}
void SnakeGame::levelUp()
{
notargets--;
if (notargets == 0) {
stage++;
if (stage == 3) {
level++;
emit moveFaster();
targetamount++;
stage = 0;
}
createTargets();
}
}
void SnakeGame::createTargets()
{
for (int i = 0; i < targetamount; i++)
(void)new Target(&canvas);
notargets = targetamount;
}
void SnakeGame::clear()
{
delete snake;
snake = 0;
QCanvasItemList l = canvas.allItems();
for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
delete *it;
}
}
void SnakeGame::gameOver()
{
int score = snake->getScore();
QString scoreoutput="";
scoreoutput.setNum(score);
QCanvasText* gameover = new QCanvasText(tr("GAME OVER!\n Your Score: %1").arg( scoreoutput), &canvas);
gameover->setZ(100);
gameover->setColor(yellow);
gameover->setFont( QFont("times", 18, QFont::Bold) );
int w = gameover->boundingRect().width();
gameover->move(canvas.width()/2 -w/2, canvas.height()/2 -50);
gameover->show();
gamestopped = true;
waitover = false;
pauseTimer->start(1500);
}
void SnakeGame::wait()
{
waitover = true;
pauseTimer->stop();
- QCanvasText* cont = new QCanvasText(tr("Press Any Key to Begin a New Game."),
+ QCanvasText* cont = new QCanvasText(tr("Press any key to begin a new game."),
&canvas);
cont->setZ(100);
cont->setColor(white);
int w = cont->boundingRect().width();
cont->move(canvas.width()/2 -w/2, canvas.height()/2);
cont->show();
}
void SnakeGame::keyPressEvent(QKeyEvent* event)
{
if (gamestopped) {
if (waitover)
newGame();
else
return;
}
else {
int newkey = event->key();
snake->go(newkey);
}
}
diff --git a/noncore/games/snake/opie-snake.control b/noncore/games/snake/opie-snake.control
index 3ab6640..ef4fc61 100644
--- a/noncore/games/snake/opie-snake.control
+++ b/noncore/games/snake/opie-snake.control
@@ -1,10 +1,10 @@
Package: opie-snake
Files: bin/snake apps/Games/snake.desktop pics/snake
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Game: control the snake
A game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/solitaire/canvascardwindow.cpp b/noncore/games/solitaire/canvascardwindow.cpp
index e836eb2..317a02d 100644
--- a/noncore/games/solitaire/canvascardwindow.cpp
+++ b/noncore/games/solitaire/canvascardwindow.cpp
@@ -25,127 +25,127 @@
#include "harpcardgame.h"
#include "teeclubcardgame.h"
#include <qpe/resource.h>
#include <qmainwindow.h>
#include <qpopupmenu.h>
#include <qstyle.h>
CanvasCardWindow::CanvasCardWindow(QWidget* parent, const char* name, WFlags f) :
QMainWindow(parent, name, f), canvas(230, 260), snapOn(TRUE), cardBack(4), gameType(0),
cardGame(NULL)
{
setIcon( Resource::loadPixmap( "cards" ) );
// Create Playing Area for Games
if ( QPixmap::defaultDepth() < 12 ) {
// canvas.setBackgroundColor(QColor(0x51, 0x74, 0x6B));
// canvas.setBackgroundColor(QColor(0x20, 0xb0, 0x50));
canvas.setBackgroundColor(QColor(0x08, 0x98, 0x2D));
} else {
QPixmap bg;
bg.convertFromImage( Resource::loadImage( "table_pattern" ), ThresholdDither );
canvas.setBackgroundPixmap(bg);
}
#if defined( QT_QWS_CASSIOPEIA )
canvas.setAdvancePeriod(70);
#else
canvas.setAdvancePeriod(30);
#endif
#ifdef _PATIENCE_USE_ACCELS_
QPEMenuBar* menu = menuBar();
QPopupMenu* file = new QPopupMenu;
file->insertItem(tr("Patience"), this, SLOT(initPatience()), CTRL+Key_F);
file->insertItem(tr("Freecell"), this, SLOT(initFreecell()), CTRL+Key_F);
file->insertItem(tr("Chicane"), this, SLOT(initChicane()), CTRL+Key_F);
file->insertItem(tr("Harp"), this, SLOT(initHarp()), CTRL+Key_F);
file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()), CTRL+Key_F);
menu->insertItem(tr("&Game"), file);
menu->insertSeparator();
settings = new QPopupMenu;
- settings->insertItem(tr("&Change Card Backs"), this, SLOT(changeCardBacks()), Key_F2);
- snap_id = settings->insertItem(tr("&Snap To Position"), this, SLOT(snapToggle()), Key_F3);
+ settings->insertItem(tr("&Change card backs"), this, SLOT(changeCardBacks()), Key_F2);
+ snap_id = settings->insertItem(tr("&Snap to position"), this, SLOT(snapToggle()), Key_F3);
settings->setCheckable(TRUE);
menu->insertItem(tr("&Settings"),settings);
menu->insertSeparator();
QPopupMenu* help = new QPopupMenu;
help->insertItem(tr("&About"), this, SLOT(help()), Key_F1);
help->setItemChecked(dbf_id, TRUE);
menu->insertItem(tr("&Help"),help);
#else
QMenuBar* menu = menuBar();
QPopupMenu* file = new QPopupMenu;
file->insertItem(tr("Patience"), this, SLOT(initPatience()));
file->insertItem(tr("Freecell"), this, SLOT(initFreecell()));
file->insertItem(tr("Chicane"), this, SLOT(initChicane()));
file->insertItem(tr("Harp"), this, SLOT(initHarp()));
file->insertItem(tr("Teeclub"), this, SLOT(initTeeclub()));
menu->insertItem(tr("Play"), file);
menu->insertSeparator();
settings = new QPopupMenu;
settings->setCheckable(TRUE);
- settings->insertItem(tr("Change Card Backs"), this, SLOT(changeCardBacks()));
- snap_id = settings->insertItem(tr("Snap To Position"), this, SLOT(snapToggle()));
+ settings->insertItem(tr("Change card backs"), this, SLOT(changeCardBacks()));
+ snap_id = settings->insertItem(tr("Snap to position"), this, SLOT(snapToggle()));
QString m;
- drawId = settings->insertItem(tr("Turn One Card"), this, SLOT(drawnToggle()));
+ drawId = settings->insertItem(tr("Turn one card"), this, SLOT(drawnToggle()));
menu->insertItem(tr("Settings"),settings);
settings->setCheckable(TRUE);
#endif
menu->show();
Config cfg( "Patience" );
cfg.setGroup( "GlobalSettings" );
snapOn = cfg.readBoolEntry( "SnapOn", TRUE);
settings->setItemChecked(snap_id, snapOn);
gameType = cfg.readNumEntry( "GameType", -1 );
drawThree = cfg.readBoolEntry( "DrawThree", FALSE);
if ( gameType == 0 ) {
cardGame = new PatienceCardGame( &canvas, snapOn, this );
cardGame->setNumberToDraw(drawThree ? 3 : 1);
setCaption(tr("Patience"));
setCentralWidget(cardGame);
cardGame->readConfig( cfg );
setCardBacks();
} else if ( gameType == 1 ) {
cardGame = new FreecellCardGame( &canvas, snapOn, this );
setCaption(tr("Freecell"));
setCentralWidget(cardGame);
//cardGame->newGame(); // Until we know how to handle reading freecell config
cardGame->readConfig( cfg );
setCardBacks();
} else if ( gameType == 2 ) {
cardGame = new ChicaneCardGame( &canvas, snapOn, this );
cardGame->setNumberToDraw(1);
setCaption(tr("Chicane"));
setCentralWidget(cardGame);
cardGame->readConfig( cfg );
setCardBacks();
} else if ( gameType == 3 ) {
cardGame = new HarpCardGame( &canvas, snapOn, this );
cardGame->setNumberToDraw(1);
setCaption(tr("Harp"));
setCentralWidget(cardGame);
cardGame->readConfig( cfg );
setCardBacks();
} else if ( gameType == 4 ) {
cardGame = new TeeclubCardGame( &canvas, snapOn, this );
cardGame->setNumberToDraw(1);
setCaption(tr("Teeclub"));
setCentralWidget(cardGame);
@@ -238,77 +238,77 @@ void CanvasCardWindow::initHarp()
}
cardGame = new HarpCardGame( &canvas, snapOn, this );
cardGame->setNumberToDraw(1);
gameType = 3;
setCaption(tr("Harp"));
setCentralWidget(cardGame);
cardGame->newGame();
setCardBacks();
}
void CanvasCardWindow::initTeeclub()
{
// Create New Game
if ( cardGame ) {
delete cardGame;
}
cardGame = new TeeclubCardGame( &canvas, snapOn, this );
cardGame->setNumberToDraw(1);
gameType = 4;
setCaption(tr("Teeclub"));
setCentralWidget(cardGame);
cardGame->newGame();
setCardBacks();
}
void CanvasCardWindow::snapToggle()
{
snapOn = !snapOn;
settings->setItemChecked(snap_id, snapOn);
cardGame->toggleSnap();
}
void CanvasCardWindow::drawnToggle()
{
drawThree=!drawThree;
Config cfg( "Patience" );
cfg.setGroup( "GlobalSettings" );
cardGame->toggleCardsDrawn();
updateDraw();
cfg.writeEntry( "DrawThree", drawThree);
cfg.write();
}
void CanvasCardWindow::updateDraw() {
if(cardGame->cardsDrawn() == 3){
- settings->changeItem(drawId, tr("Turn One Card"));
+ settings->changeItem(drawId, tr("Turn one card"));
} else {
- settings->changeItem(drawId, tr("Turn Three Cards"));
+ settings->changeItem(drawId, tr("Turn three cards"));
}
}
void CanvasCardWindow::setCardBacks()
{
QCanvasItemList l = canvas.allItems();
for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
if ( (*it)->rtti() == canvasCardId )
((CanvasCard *)(*it))->setCardBack( cardBack );
}
}
void CanvasCardWindow::changeCardBacks()
{
cardBack++;
if (cardBack == 5)
cardBack = 0;
setCardBacks();
}
diff --git a/noncore/games/solitaire/opie-solitaire.control b/noncore/games/solitaire/opie-solitaire.control
index 76e7208..5fa521f 100644
--- a/noncore/games/solitaire/opie-solitaire.control
+++ b/noncore/games/solitaire/opie-solitaire.control
@@ -1,10 +1,10 @@
Package: opie-solitaire
Files: bin/patience apps/Games/patience.desktop pics/cards
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Game: solitaire card games
A solitaire game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/tetrix/opie-tetrix.control b/noncore/games/tetrix/opie-tetrix.control
index e335507..e901dbf 100644
--- a/noncore/games/tetrix/opie-tetrix.control
+++ b/noncore/games/tetrix/opie-tetrix.control
@@ -1,11 +1,11 @@
Package: opie-tetrix
Files: bin/tetrix apps/Games/tetrix.desktop pics/tetrix/*
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
Arch: iPAQ
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Game: control falling blocks
A game for the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/tictac/main.cpp b/noncore/games/tictac/main.cpp
index f2ab334..78fb3b7 100644
--- a/noncore/games/tictac/main.cpp
+++ b/noncore/games/tictac/main.cpp
@@ -1,31 +1,31 @@
/****************************************************************************
** $Id$
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of an example program for Qt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
#include <qpe/qpeapplication.h>
#include <stdlib.h>
#include "tictac.h"
int main( int argc, char **argv )
{
QPEApplication a( argc, argv );
int n = 3;
if ( argc == 2 ) // get board size n
n = atoi(argv[1]);
if ( n < 3 || n > 10 ) { // out of range
qWarning( "%s: Board size must be from 3x3 to 10x10", argv[0] );
return 1;
}
TicTacToe ttt( n ); // create game
a.setMainWidget( &ttt );
- ttt.setCaption("TicTac");
+ ttt.setCaption( QObject::tr("TicTac") );
ttt.show(); // show widget
return a.exec(); // go
}
diff --git a/noncore/games/tictac/opie-tictac.control b/noncore/games/tictac/opie-tictac.control
index c4ee36c..0074505 100644
--- a/noncore/games/tictac/opie-tictac.control
+++ b/noncore/games/tictac/opie-tictac.control
@@ -1,9 +1,9 @@
Package: opie-tictac
Files: bin/tictac apps/Games/tictac.desktop pics/tictac
Priority: optional
Section: opie/games
Maintainer: ljp <ljp@llornkcor.com>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Tic Tac Toe game.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/wordgame/opie-wordgame.control b/noncore/games/wordgame/opie-wordgame.control
index 3be8e8f..c7dc126 100644
--- a/noncore/games/wordgame/opie-wordgame.control
+++ b/noncore/games/wordgame/opie-wordgame.control
@@ -1,11 +1,11 @@
Package: opie-wordgame
Files: bin/wordgame apps/Games/wordgame.desktop pics/wordgame
Priority: optional
Section: opie/games
Maintainer: Martin Imobersteg <imm@gmx.ch>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Description: Crossword game
A crossword game for the Opie environment.
Play against the computer or human opponents.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp
index d3160f4..d46e824 100644
--- a/noncore/games/wordgame/wordgame.cpp
+++ b/noncore/games/wordgame/wordgame.cpp
@@ -245,121 +245,121 @@ void WordGame::startGame()
if ( loadRules(rules) ) {
QStringList names;
names.append(newgame->player0->currentText());
names.append(newgame->player1->currentText());
names.append(newgame->player2->currentText());
names.append(newgame->player3->currentText());
names.append(newgame->player4->currentText());
names.append(newgame->player5->currentText());
delete newgame;
startGame(names);
} else {
// error...
delete newgame;
close();
}
}
void WordGame::startGame(const QStringList& playerlist)
{
toolbar->show();
racks = new QWidgetStack(vbox);
racks->setFixedHeight(TileItem::bigHeight()+2);
namelist.clear();
nplayers=0;
for (QStringList::ConstIterator it=playerlist.begin(); it!=playerlist.end(); ++it)
addPlayer(*it);
scoreinfo->init(namelist);
if ( nplayers ) {
player=0;
readyRack(player);
}
board->show();
racks->show();
}
bool WordGame::loadRules(const QString &name)
{
QString filename = Global::applicationFileName( "wordgame", name );
QFile file( filename );
if ( !file.open( IO_ReadOnly ) )
return FALSE;
QTextStream ts( &file );
QString title = name;
title.truncate( title.length() - 6 );
- setCaption( title );
+ //setCaption( title );
QString shapepixmap;
ts >> shapepixmap;
int htiles,vtiles;
ts >> htiles >> vtiles;
if ( htiles < 3 || vtiles < 3 )
return FALSE;
QString rule_shapes;
for (int i=0; i<vtiles; i++) {
QString line;
ts >> line;
rule_shapes += line;
}
static int rule_effects[12];
int re=0,e;
ts >> e;
while ( e && re < 10 ) {
rule_effects[re] = e;
if ( re++ < 10 ) ts >> e;
}
- QImage shim = Resource::loadImage("wordgame/wordgame_shapes.xpm");
+ QImage shim = Resource::loadImage("wordgame/wordgame_shapes");
shim = shim.smoothScale((re-1)*TileItem::smallWidth(),TileItem::smallHeight());
QPixmap bgshapes;
bgshapes.convertFromImage(shim);
rule_effects[re++] = 100; // default bonus
board = new Board(bgshapes, htiles, vtiles, vbox);
board->setRules(rule_shapes, rule_effects);
connect(board, SIGNAL(temporaryScore(int)), scoreinfo, SLOT(showTemporaryScore(int)));
bag = new Bag;
int count;
ts >> count;
while ( count ) {
QString text;
int value;
ts >> text >> value;
if ( text == "_" )
text = "";
Tile t(text, value);
for (int n=count; n--; )
bag->add(t);
ts >> count;
}
return TRUE;
}
NewGame::NewGame(QWidget* parent) :
NewGameBase(parent)
{
}
void NewGame::updateRuleSets()
{
rules->clear();
QString rulesDir = Global::applicationFileName( "wordgame", "" );
QDir dir( rulesDir, "*.rules" );
ruleslist = dir.entryList();
if ( ruleslist.isEmpty() ) {
// Provide a sample
QFile file( rulesDir + "Sample.rules" );
if ( file.open( IO_WriteOnly ) ) {
file.writeBlock( sampleWGR, strlen(sampleWGR) );