Actually replace _background when creating the interface again in case a new getdown.txt specifies new background images. If the new getdown.txt set a background but the images aren't already available as part of the existing install as indicated by there being no images in the newly created RotatingBackgrounds, just use the RotatingBackgrounds from the first time.

This commit is contained in:
Charlie Groves
2007-11-07 00:32:07 +00:00
parent dba663e259
commit c62eb8a6f5
2 changed files with 13 additions and 1 deletions
@@ -758,7 +758,12 @@ public abstract class Getdown extends Thread
_container = createContainer(); _container = createContainer();
_status = new StatusPanel(_msgs); _status = new StatusPanel(_msgs);
_container.add(_status, BorderLayout.CENTER); _container.add(_status, BorderLayout.CENTER);
_background = getBackground(); }
RotatingBackgrounds newBackgrounds = getBackground();
if (_background == null || newBackgrounds.getNumImages() > 0) {
// Leave the old _background in place if there is an ond one to leave in place
// and the new getdown.txt didn't yield any images.
_background = newBackgrounds;
} }
_status.init(_ifc, _background, getProgressImage()); _status.init(_ifc, _background, getProgressImage());
showContainer(); showContainer();
@@ -75,6 +75,13 @@ public class RotatingBackgrounds
return images[current]; return images[current];
} }
/**
* @return the number of images in this RotatingBackgrounds
*/
public int getNumImages() {
return images.length;
}
protected void makeEmpty () protected void makeEmpty ()
{ {
percentages = new int[] {}; percentages = new int[] {};