blinking = activeGroup.containsUnit(topUnitID);
// Fetch unit-image
Section imageSection = ruleset.getSection("unitimages");
MapObjectReader moReader = gameData.getMapObjectReader();
if (!moReader.isMapObjectModelNameAvailable(topUnitID)) {
// Model-name unknown - TODO: Better handling of the situation
// "We know there is a unit, but we don't know the type"
unitImage = null;
Messages.getMessages().info("QuadIsoLayUnitView", "QMapWarn",
"Warning: There is a unit (id: "
+ topUnitID + "), but I "
+ "don't know its type!");
} else {
String modelName = moReader.getMapObjectModelName(topUnitID);
String imageName = imageSection.getField(modelName).getStringValue();
unitImage = layUnitImageSet.getImage(imageName);
if (unitImage == null) {
Messages messages = Messages.getMessages();
messages.err("QuadIsoLayUnitView", "updateImage: No image for unit "
+ modelName);
messages.err("QuadIsoLayUnitView",
"--> For now we take this as a fatal error - "
+ "CivQuest will ABORT NOW!!!");
System.exit(-1);
}
if (moReader.isMapObjectOwnerAvailable(topUnitID)) {
Long owner = moReader.getMapObjectOwner(topUnitID);
topUnitNationColor = quadMap.getNationColor(owner);
} else {
topUnitNationColor = null;
}
}