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) {
|
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 -> {
|
SchematicSelector selector = new SchematicSelector(p, Config.test() ? SchematicSelector.selectSchematic() : SchematicSelector.selectSchematicType(unchecked ? type.checkType() : type), node -> {
|
||||||
schemSelect(p, 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.setPublicMode(publicSchems ? SchematicSelector.PublicMode.PUBLIC_ONLY : SchematicSelector.PublicMode.PRIVATE_ONLY);
|
||||||
selector.open();
|
selector.open();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -467,7 +467,7 @@ public class SchematicSelector {
|
|||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<SchematicNode> getSchematicList(SchematicNode parent) {
|
protected List<SchematicNode> getSchematicList(SchematicNode parent) {
|
||||||
List<SchematicNode> nodes = new ArrayList<>();
|
List<SchematicNode> nodes = new ArrayList<>();
|
||||||
switch (target.target) {
|
switch (target.target) {
|
||||||
case DIRECTORY:
|
case DIRECTORY:
|
||||||
|
|||||||
Reference in New Issue
Block a user