diff --git a/src/net/sf/freecol/client/gui/panel/PlayersTable.java b/src/net/sf/freecol/client/gui/panel/PlayersTable.java index f349b325c..d7f073146 100644 --- a/src/net/sf/freecol/client/gui/panel/PlayersTable.java +++ b/src/net/sf/freecol/client/gui/panel/PlayersTable.java @@ -708,8 +708,7 @@ public final class PlayersTable extends JTable { TableColumn advantagesColumn = tcm.getColumn(ADVANTAGE_COLUMN); switch (nationOptions.getNationalAdvantages()) { case SELECTABLE: - advantagesColumn.setCellEditor(new AdvantageCellEditor(spec - .getEuropeanNationTypes())); + advantagesColumn.setCellEditor(new AdvantageCellEditor(spec.getVisibleEuropeanNationTypes())); break; case FIXED: break; // Do nothing diff --git a/src/net/sf/freecol/client/gui/panel/colopedia/NationTypeDetailPanel.java b/src/net/sf/freecol/client/gui/panel/colopedia/NationTypeDetailPanel.java index 95d994571..0a8f3ae23 100644 --- a/src/net/sf/freecol/client/gui/panel/colopedia/NationTypeDetailPanel.java +++ b/src/net/sf/freecol/client/gui/panel/colopedia/NationTypeDetailPanel.java @@ -84,13 +84,11 @@ public class NationTypeDetailPanel getName(), null)); List nations = new ArrayList<>(); - nations.addAll(getSpecification().getEuropeanNationTypes()); + nations.addAll(getSpecification().getVisibleEuropeanNationTypes()); nations.addAll(getSpecification().getREFNationTypes()); nations.addAll(getSpecification().getIndianNationTypes()); ImageIcon icon = new ImageIcon(ImageUtils.createCenteredImage(getImageLibrary().getLibertyImage(), getListItemIconSize())); for (NationType type : nations) { - // Suppress special case. FIXME: This is a kludge - if ("model.nationType.optionOnly".equals(type.getId())) continue; parent.add(buildItem(type, icon)); } root.add(parent); diff --git a/src/net/sf/freecol/common/model/Specification.java b/src/net/sf/freecol/common/model/Specification.java index c2267b2aa..1ba0f17a4 100644 --- a/src/net/sf/freecol/common/model/Specification.java +++ b/src/net/sf/freecol/common/model/Specification.java @@ -1556,6 +1556,12 @@ public final class Specification implements OptionContainer { public List getEuropeanNationTypes() { return europeanNationTypes; } + + public List getVisibleEuropeanNationTypes() { + return europeanNationTypes.stream() + .filter(type -> !"model.nationType.optionOnly".equals(type.getId())) + .collect(Collectors.toList()); + } public List getREFNationTypes() { return REFNationTypes;