From c62eb8a6f5742c5689b21e3a4b822b77f943a332 Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Wed, 7 Nov 2007 00:32:07 +0000 Subject: [PATCH] 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. --- src/java/com/threerings/getdown/launcher/Getdown.java | 7 ++++++- .../threerings/getdown/launcher/RotatingBackgrounds.java | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/getdown/launcher/Getdown.java b/src/java/com/threerings/getdown/launcher/Getdown.java index bbeb37a..b82084a 100644 --- a/src/java/com/threerings/getdown/launcher/Getdown.java +++ b/src/java/com/threerings/getdown/launcher/Getdown.java @@ -758,7 +758,12 @@ public abstract class Getdown extends Thread _container = createContainer(); _status = new StatusPanel(_msgs); _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()); showContainer(); diff --git a/src/java/com/threerings/getdown/launcher/RotatingBackgrounds.java b/src/java/com/threerings/getdown/launcher/RotatingBackgrounds.java index 33994b4..48ebd8e 100644 --- a/src/java/com/threerings/getdown/launcher/RotatingBackgrounds.java +++ b/src/java/com/threerings/getdown/launcher/RotatingBackgrounds.java @@ -75,6 +75,13 @@ public class RotatingBackgrounds return images[current]; } + /** + * @return the number of images in this RotatingBackgrounds + */ + public int getNumImages() { + return images.length; + } + protected void makeEmpty () { percentages = new int[] {};