-rw-r--r-- | noncore/games/wordgame/opie-wordgame.control | 2 | ||||
-rw-r--r-- | noncore/games/wordgame/wordgame.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
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) ); |