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:
@@ -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[] {};
|
||||||
|
|||||||
Reference in New Issue
Block a user