Hides the display of the "option only"-nation type from the start game panel. This nation type was already hidden from display in the Colopedia.

This commit is contained in:
Stian Grenborgen 2024-01-28 08:06:52 +01:00
parent 19e5e9a22b
commit 4f05e70000
3 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -84,13 +84,11 @@ public class NationTypeDetailPanel
getName(), null));
List<NationType> 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);

View File

@ -1556,6 +1556,12 @@ public final class Specification implements OptionContainer {
public List<EuropeanNationType> getEuropeanNationTypes() {
return europeanNationTypes;
}
public List<EuropeanNationType> getVisibleEuropeanNationTypes() {
return europeanNationTypes.stream()
.filter(type -> !"model.nationType.optionOnly".equals(type.getId()))
.collect(Collectors.toList());
}
public List<EuropeanNationType> getREFNationTypes() {
return REFNationTypes;