mirror of https://github.com/FreeCol/freecol.git
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:
parent
19e5e9a22b
commit
4f05e70000
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue