SteamWar/SpigotCore
Archiviert
13
0

Add Reopen to SchematicSelector #169

Zusammengeführt
Lixfel hat 4 Commits von re_open_schem_gui nach master 2022-02-09 18:20:03 +01:00 zusammengeführt
Nur Änderungen aus Commit 9fd44392e1 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -89,6 +89,12 @@ public class SchematicSelector {
injectable.onSelectorOpen(this, SchematicSelectorInjectable.OpenFrom.REOPEN);
}
public void reOpenDirUp() {
depth--;
openList(dirUp(lastParent));
injectable.onSelectorOpen(this, SchematicSelectorInjectable.OpenFrom.REOPEN);
}
private void openList(SchematicNode parent) {
lastParent = parent;
List<SchematicNode> nodes = applySorting(filter.isFilter()?getFilteredSchematics():getSchematicList(parent));
@ -150,34 +156,38 @@ public class SchematicSelector {
inv.open();
}
private SchematicNode dirUp(SchematicNode parent) {
if(!singleDirOpen) {
if(NodeMember.getNodeMember(parent.getId(), user.getId()) != null) {
return null;
} else {
return getParent(parent);
}
} else {
SchematicNode currentParent = parent;
boolean isMember = false;
do {
sdoTrigger = false;
if(NodeMember.getNodeMember(currentParent.getId(), user.getId()) != null) {
isMember = true;
}
currentParent = getParent(currentParent);
if(currentParent == null)
break;
getSchematicList(currentParent);
} while (sdoTrigger);
if(isMember || NodeMember.getNodeMember(parent.getId(), user.getId()) != null) {
return null;
} else {
return currentParent;
}
}
}
private void handleClick(SchematicNode node, SchematicNode parent) {
if(node == null) {
depth--;
if(!singleDirOpen) {
if(NodeMember.getNodeMember(parent.getId(), user.getId()) != null) {
openList(null);
} else {
openList(getParent(parent));
}
} else {
SchematicNode currentParent = parent;
boolean isMember = false;
do {
sdoTrigger = false;
if(NodeMember.getNodeMember(currentParent.getId(), user.getId()) != null) {
isMember = true;
}
currentParent = getParent(currentParent);
if(currentParent == null)
break;
getSchematicList(currentParent);
} while (sdoTrigger);
if(isMember || NodeMember.getNodeMember(parent.getId(), user.getId()) != null) {
openList(null);
} else {
openList(currentParent);
}
}
openList(dirUp(parent));
return;
}
if(node.isDir()) {