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);
|
TableColumn advantagesColumn = tcm.getColumn(ADVANTAGE_COLUMN);
|
||||||
switch (nationOptions.getNationalAdvantages()) {
|
switch (nationOptions.getNationalAdvantages()) {
|
||||||
case SELECTABLE:
|
case SELECTABLE:
|
||||||
advantagesColumn.setCellEditor(new AdvantageCellEditor(spec
|
advantagesColumn.setCellEditor(new AdvantageCellEditor(spec.getVisibleEuropeanNationTypes()));
|
||||||
.getEuropeanNationTypes()));
|
|
||||||
break;
|
break;
|
||||||
case FIXED:
|
case FIXED:
|
||||||
break; // Do nothing
|
break; // Do nothing
|
||||||
|
|
|
@ -84,13 +84,11 @@ public class NationTypeDetailPanel
|
||||||
getName(), null));
|
getName(), null));
|
||||||
|
|
||||||
List<NationType> nations = new ArrayList<>();
|
List<NationType> nations = new ArrayList<>();
|
||||||
nations.addAll(getSpecification().getEuropeanNationTypes());
|
nations.addAll(getSpecification().getVisibleEuropeanNationTypes());
|
||||||
nations.addAll(getSpecification().getREFNationTypes());
|
nations.addAll(getSpecification().getREFNationTypes());
|
||||||
nations.addAll(getSpecification().getIndianNationTypes());
|
nations.addAll(getSpecification().getIndianNationTypes());
|
||||||
ImageIcon icon = new ImageIcon(ImageUtils.createCenteredImage(getImageLibrary().getLibertyImage(), getListItemIconSize()));
|
ImageIcon icon = new ImageIcon(ImageUtils.createCenteredImage(getImageLibrary().getLibertyImage(), getListItemIconSize()));
|
||||||
for (NationType type : nations) {
|
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));
|
parent.add(buildItem(type, icon));
|
||||||
}
|
}
|
||||||
root.add(parent);
|
root.add(parent);
|
||||||
|
|
|
@ -1556,6 +1556,12 @@ public final class Specification implements OptionContainer {
|
||||||
public List<EuropeanNationType> getEuropeanNationTypes() {
|
public List<EuropeanNationType> getEuropeanNationTypes() {
|
||||||
return europeanNationTypes;
|
return europeanNationTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<EuropeanNationType> getVisibleEuropeanNationTypes() {
|
||||||
|
return europeanNationTypes.stream()
|
||||||
|
.filter(type -> !"model.nationType.optionOnly".equals(type.getId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
public List<EuropeanNationType> getREFNationTypes() {
|
public List<EuropeanNationType> getREFNationTypes() {
|
||||||
return REFNationTypes;
|
return REFNationTypes;
|
||||||
|
|
Loading…
Reference in New Issue