use of de.gurkenlabs.litiengine.environment.tilemap.xml.Blueprint in project litiengine by gurkenlabs.
the class EditorScreen method importBlueprints.
public void importBlueprints() {
XmlImportDialog.importXml("Blueprint", files -> {
for (File file : files) {
Blueprint blueprint = XmlUtilities.readFromFile(Blueprint.class, file.toString());
if (blueprint == null) {
continue;
}
if (this.gameFile.getBluePrints().stream().anyMatch(x -> x.getName().equals(blueprint.getName()))) {
int result = JOptionPane.showConfirmDialog(Game.getScreenManager().getRenderComponent(), Resources.get("import_blueprint_question", blueprint.getName()), Resources.get("import_blueprint_title"), JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.NO_OPTION) {
continue;
}
this.gameFile.getBluePrints().removeIf(x -> x.getName().equals(blueprint.getName()));
}
this.gameFile.getBluePrints().add(blueprint);
log.log(Level.INFO, "imported blueprint {0} from {1}", new Object[] { blueprint.getName(), file });
}
});
}
Aggregations