Fixed way that missing tiles are handled: WARNING this update requires JRE 8_40 or higher

This commit is contained in:
Brendan Robert 2015-03-29 01:35:46 -05:00
parent fe2a00c46c
commit e0d16ebd08
2 changed files with 7 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import javafx.scene.control.Alert;
import javafx.scene.image.WritableImage;
import javafx.scene.paint.Color;
import javax.swing.JOptionPane;
@ -197,9 +198,12 @@ public class TileMap extends ArrayList<ArrayList<Tile>> implements Serializable
});
if (!unknownTiles.isEmpty()) {
int numMissing = unknownTiles.size();
JOptionPane.showMessageDialog(null, (numMissing > 1
? "There were " + numMissing + " missing tiles." : "There was a missing tile.")
Alert missingTileAlert = new Alert(Alert.AlertType.WARNING);
missingTileAlert.setContentText(
(numMissing > 1
? "There were " + numMissing + " missing tiles." : "There was a missing tile. ")
+ "Blank placeholders have been added.");
missingTileAlert.showAndWait();
}
backingMap = m;
backingMapStale = false;

View File

@ -150,7 +150,7 @@ public class UIAction {
public static WritableImage getBadImage(int width, int height) {
if (badImage == null) {
badImage = new Image("/org/badvision/outlaw/resources/icon_brokenLink.png");
badImage = new Image("/images/icon_brokenLink.png");
}
WritableImage img = new WritableImage(width, height);
img.getPixelWriter().setPixels(0, 0, (int) badImage.getWidth(), (int) badImage.getHeight(), badImage.getPixelReader(), 0, 0);