forked from SteamWar/SteamWar
Fix GUI.schemDialog for overriden Public list
This commit is contained in:
@@ -255,7 +255,15 @@ public class GUI {
|
||||
private static void schemDialog(Player p, SchematicType type, boolean publicSchems, boolean unchecked) {
|
||||
SchematicSelector selector = new SchematicSelector(p, Config.test() ? SchematicSelector.selectSchematic() : SchematicSelector.selectSchematicType(unchecked ? type.checkType() : type), node -> {
|
||||
schemSelect(p, node);
|
||||
});
|
||||
}) {
|
||||
@Override
|
||||
protected List<SchematicNode> getSchematicList(SchematicNode parent) {
|
||||
if (!publicSchems || parent != null) return super.getSchematicList(parent);
|
||||
List<Integer> publics = Config.GameModeConfig.Schematic.Publics;
|
||||
if (publics.isEmpty()) return super.getSchematicList(null);
|
||||
return publics.stream().map(SchematicNode::byId).collect(Collectors.toList());
|
||||
}
|
||||
};
|
||||
selector.setPublicMode(publicSchems ? SchematicSelector.PublicMode.PUBLIC_ONLY : SchematicSelector.PublicMode.PRIVATE_ONLY);
|
||||
selector.open();
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ public class SchematicSelector {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
private List<SchematicNode> getSchematicList(SchematicNode parent) {
|
||||
protected List<SchematicNode> getSchematicList(SchematicNode parent) {
|
||||
List<SchematicNode> nodes = new ArrayList<>();
|
||||
switch (target.target) {
|
||||
case DIRECTORY:
|
||||
|
||||
Reference in New Issue
Block a user