author | imm <imm> | 2002-09-24 23:49:15 (UTC) |
---|---|---|
committer | imm <imm> | 2002-09-24 23:49:15 (UTC) |
commit | a390040768072b4b2b931ec0bcdaaa55daae0b4c (patch) (unidiff) | |
tree | 1938c484842f0c35e40dc406e719c0d86e07091c | |
parent | c280cda4ece4a4aa60f4ef2c632d7a37ac08b258 (diff) | |
download | opie-a390040768072b4b2b931ec0bcdaaa55daae0b4c.zip opie-a390040768072b4b2b931ec0bcdaaa55daae0b4c.tar.gz opie-a390040768072b4b2b931ec0bcdaaa55daae0b4c.tar.bz2 |
pics dir changed
-rw-r--r-- | noncore/games/wordgame/wordgame.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp index 16d37b3..d3160f4 100644 --- a/noncore/games/wordgame/wordgame.cpp +++ b/noncore/games/wordgame/wordgame.cpp | |||
@@ -106,49 +106,49 @@ const char* sampleWGR= | |||
106 | "4 c 2\n" | 106 | "4 c 2\n" |
107 | "5 l 1\n" | 107 | "5 l 1\n" |
108 | "5 o 1\n" | 108 | "5 o 1\n" |
109 | "7 t 1\n" | 109 | "7 t 1\n" |
110 | "7 n 1\n" | 110 | "7 n 1\n" |
111 | "7 a 1\n" | 111 | "7 a 1\n" |
112 | "7 r 1\n" | 112 | "7 r 1\n" |
113 | "8 s 1\n" | 113 | "8 s 1\n" |
114 | "8 i 1\n" | 114 | "8 i 1\n" |
115 | "11 e 1\n" | 115 | "11 e 1\n" |
116 | "0\n"; | 116 | "0\n"; |
117 | 117 | ||
118 | WordGame::WordGame( QWidget* parent, const char* name, WFlags fl ) : | 118 | WordGame::WordGame( QWidget* parent, const char* name, WFlags fl ) : |
119 | QMainWindow(parent, name, fl) | 119 | QMainWindow(parent, name, fl) |
120 | { | 120 | { |
121 | if ( qApp->desktop()->width() < 240 ) { | 121 | if ( qApp->desktop()->width() < 240 ) { |
122 | tile_smallw = 10; | 122 | tile_smallw = 10; |
123 | tile_smallh = 10; | 123 | tile_smallh = 10; |
124 | tile_bigw = 16; | 124 | tile_bigw = 16; |
125 | tile_bigh = 16; | 125 | tile_bigh = 16; |
126 | tile_stweak = 0; | 126 | tile_stweak = 0; |
127 | tile_btweak = 0; | 127 | tile_btweak = 0; |
128 | } | 128 | } |
129 | 129 | ||
130 | setIcon( Resource::loadPixmap( "wordgame" ) ); | 130 | setIcon( Resource::loadPixmap( "wordgame/WordGame.png" ) ); |
131 | setCaption( tr("Word Game") ); | 131 | setCaption( tr("Word Game") ); |
132 | 132 | ||
133 | setToolBarsMovable( FALSE ); | 133 | setToolBarsMovable( FALSE ); |
134 | vbox = new QVBox(this); | 134 | vbox = new QVBox(this); |
135 | 135 | ||
136 | setCentralWidget(vbox); | 136 | setCentralWidget(vbox); |
137 | toolbar = new QPEToolBar(this); | 137 | toolbar = new QPEToolBar(this); |
138 | addToolBar(toolbar, Bottom); | 138 | addToolBar(toolbar, Bottom); |
139 | reset = new QToolButton(Resource::loadPixmap("back"), tr("Back"), "", this, SLOT(resetTurn()), toolbar); | 139 | reset = new QToolButton(Resource::loadPixmap("back"), tr("Back"), "", this, SLOT(resetTurn()), toolbar); |
140 | done = new QToolButton(Resource::loadPixmap("done"), tr("Done"), "", this, SLOT(endTurn()), toolbar); | 140 | done = new QToolButton(Resource::loadPixmap("done"), tr("Done"), "", this, SLOT(endTurn()), toolbar); |
141 | scoreinfo = new ScoreInfo(toolbar); | 141 | scoreinfo = new ScoreInfo(toolbar); |
142 | scoreinfo->setFont(QFont("Helvetica",10)); | 142 | scoreinfo->setFont(QFont("Helvetica",10)); |
143 | new QToolButton(Resource::loadPixmap("finish"), tr("Close"), "", this, SLOT(endGame()), toolbar); | 143 | new QToolButton(Resource::loadPixmap("finish"), tr("Close"), "", this, SLOT(endGame()), toolbar); |
144 | toolbar->setStretchableWidget(scoreinfo); | 144 | toolbar->setStretchableWidget(scoreinfo); |
145 | 145 | ||
146 | cpu = 0; | 146 | cpu = 0; |
147 | board = 0; | 147 | board = 0; |
148 | bag = 0; | 148 | bag = 0; |
149 | racks = 0; | 149 | racks = 0; |
150 | 150 | ||
151 | aiheart = new QTimer(this); | 151 | aiheart = new QTimer(this); |
152 | connect(aiheart, SIGNAL(timeout()), this, SLOT(think())); | 152 | connect(aiheart, SIGNAL(timeout()), this, SLOT(think())); |
153 | 153 | ||
154 | readConfig(); | 154 | readConfig(); |
@@ -293,49 +293,49 @@ bool WordGame::loadRules(const QString &name) | |||
293 | setCaption( title ); | 293 | setCaption( title ); |
294 | 294 | ||
295 | QString shapepixmap; | 295 | QString shapepixmap; |
296 | ts >> shapepixmap; | 296 | ts >> shapepixmap; |
297 | int htiles,vtiles; | 297 | int htiles,vtiles; |
298 | ts >> htiles >> vtiles; | 298 | ts >> htiles >> vtiles; |
299 | 299 | ||
300 | if ( htiles < 3 || vtiles < 3 ) | 300 | if ( htiles < 3 || vtiles < 3 ) |
301 | return FALSE; | 301 | return FALSE; |
302 | 302 | ||
303 | QString rule_shapes; | 303 | QString rule_shapes; |
304 | for (int i=0; i<vtiles; i++) { | 304 | for (int i=0; i<vtiles; i++) { |
305 | QString line; | 305 | QString line; |
306 | ts >> line; | 306 | ts >> line; |
307 | rule_shapes += line; | 307 | rule_shapes += line; |
308 | } | 308 | } |
309 | static int rule_effects[12]; | 309 | static int rule_effects[12]; |
310 | int re=0,e; | 310 | int re=0,e; |
311 | ts >> e; | 311 | ts >> e; |
312 | while ( e && re < 10 ) { | 312 | while ( e && re < 10 ) { |
313 | rule_effects[re] = e; | 313 | rule_effects[re] = e; |
314 | if ( re++ < 10 ) ts >> e; | 314 | if ( re++ < 10 ) ts >> e; |
315 | } | 315 | } |
316 | 316 | ||
317 | QImage shim = Resource::loadImage(shapepixmap); | 317 | QImage shim = Resource::loadImage("wordgame/wordgame_shapes.xpm"); |
318 | shim = shim.smoothScale((re-1)*TileItem::smallWidth(),TileItem::smallHeight()); | 318 | shim = shim.smoothScale((re-1)*TileItem::smallWidth(),TileItem::smallHeight()); |
319 | QPixmap bgshapes; | 319 | QPixmap bgshapes; |
320 | bgshapes.convertFromImage(shim); | 320 | bgshapes.convertFromImage(shim); |
321 | 321 | ||
322 | rule_effects[re++] = 100; // default bonus | 322 | rule_effects[re++] = 100; // default bonus |
323 | board = new Board(bgshapes, htiles, vtiles, vbox); | 323 | board = new Board(bgshapes, htiles, vtiles, vbox); |
324 | board->setRules(rule_shapes, rule_effects); | 324 | board->setRules(rule_shapes, rule_effects); |
325 | connect(board, SIGNAL(temporaryScore(int)), scoreinfo, SLOT(showTemporaryScore(int))); | 325 | connect(board, SIGNAL(temporaryScore(int)), scoreinfo, SLOT(showTemporaryScore(int))); |
326 | 326 | ||
327 | bag = new Bag; | 327 | bag = new Bag; |
328 | 328 | ||
329 | int count; | 329 | int count; |
330 | ts >> count; | 330 | ts >> count; |
331 | while ( count ) { | 331 | while ( count ) { |
332 | QString text; | 332 | QString text; |
333 | int value; | 333 | int value; |
334 | ts >> text >> value; | 334 | ts >> text >> value; |
335 | if ( text == "_" ) | 335 | if ( text == "_" ) |
336 | text = ""; | 336 | text = ""; |
337 | 337 | ||
338 | Tile t(text, value); | 338 | Tile t(text, value); |
339 | for (int n=count; n--; ) | 339 | for (int n=count; n--; ) |
340 | bag->add(t); | 340 | bag->add(t); |
341 | 341 | ||