@@ -298,36 +298,39 @@ DogfightState::DogfightState(Globe *globe, Craft *craft, Ufo *ufo) : _globe(glob
298298 _btnUfo->invalidate (false );
299299
300300 // Set up objects
301+ RuleInterface *dogfightInterface = _game->getRuleset ()->getInterface (" dogfight" );
302+
301303 Surface *graphic;
302304 graphic = _game->getResourcePack ()->getSurface (" INTERWIN.DAT" );
303305 graphic->setX (0 );
304306 graphic->setY (0 );
305307 graphic->getCrop ()->x = 0 ;
306308 graphic->getCrop ()->y = 0 ;
307- graphic->getCrop ()->w = 160 ;
308- graphic->getCrop ()->h = 96 ;
309+ graphic->getCrop ()->w = _window-> getWidth () ;
310+ graphic->getCrop ()->h = _window-> getHeight () ;
309311 _window->drawRect (graphic->getCrop (), 15 );
310312 graphic->blit (_window);
311313
312314 _preview->drawRect (graphic->getCrop (), 15 );
313- graphic->getCrop ()->y = 96 ;
314- graphic->getCrop ()->h = 15 ;
315+ graphic->getCrop ()->y = dogfightInterface-> getElement ( " previewTop " )-> y ;
316+ graphic->getCrop ()->h = dogfightInterface-> getElement ( " previewTop " )-> h ;
315317 graphic->blit (_preview);
316- graphic->setY (67 );
317- graphic->getCrop ()->y = 111 ;
318- graphic->getCrop ()->h = 29 ;
318+ graphic->setY (_window-> getHeight () - dogfightInterface-> getElement ( " previewBot " )-> h );
319+ graphic->getCrop ()->y = dogfightInterface-> getElement ( " previewBot " )-> y ;
320+ graphic->getCrop ()->h = dogfightInterface-> getElement ( " previewBot " )-> h ;
319321 graphic->blit (_preview);
320322 if (ufo->getRules ()->getModSprite ().empty ())
321323 {
322- graphic->setY (15 );
323- graphic->getCrop ()->y = 140 + 52 * _ufo->getRules ()->getSprite ();
324- graphic->getCrop ()->h = 52 ;
324+ graphic->setX (dogfightInterface->getElement (" previewTop" )->x );
325+ graphic->setY (dogfightInterface->getElement (" previewTop" )->y );
326+ graphic->getCrop ()->y = dogfightInterface->getElement (" previewMid" )->y + dogfightInterface->getElement (" previewMid" )->h * _ufo->getRules ()->getSprite ();
327+ graphic->getCrop ()->h = dogfightInterface->getElement (" previewMid" )->h ;
325328 }
326329 else
327330 {
328331 graphic = _game->getResourcePack ()->getSurface (ufo->getRules ()->getModSprite ());
329332 graphic->setX (0 );
330- graphic->setY (15 );
333+ graphic->setY (0 );
331334 }
332335 graphic->blit (_preview);
333336 _preview->setVisible (false );
@@ -378,7 +381,6 @@ DogfightState::DogfightState(Globe *globe, Craft *craft, Ufo *ufo) : _globe(glob
378381 _txtInterceptionNumber->setText (ss1.str ());
379382 _txtInterceptionNumber->setVisible (false );
380383
381- RuleInterface *dogfightInterface = _game->getRuleset ()->getInterface (" dogfight" );
382384 // define the colors to be used
383385 _colors[CRAFT_MIN ] = dogfightInterface->getElement (" craftRange" )->color ;
384386 _colors[CRAFT_MAX ] = dogfightInterface->getElement (" craftRange" )->color2 ;
0 commit comments