MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / updateDir

Method updateDir

Minecraft-Utils/1.13/src/FileSelector.java:77–102  ·  view source on GitHub ↗
(File dir)

Source from the content-addressed store, hash-verified

75 }
76
77 @Override
78 public void updateDir(File dir) {
79 currentDir = dir;
80 files.clear();
81 if (dir == null) {
82 File[] a = File.listRoots();
83 if (a == null)
84 return;
85 for (File file : a) {
86 if (!fsv.isDrive(file) || fsv.getSystemDisplayName(file).isEmpty())
87 continue;
88 files.add(file);
89 }
90 selectedFile = files.isEmpty() ? -1 : 0;
91 return;
92 }
93 File[] a = dir.listFiles();
94 if (a == null)
95 return;
96 for (File file : a) {
97 if (file.isHidden())
98 continue;
99 files.add(file);
100 }
101 selectedFile = files.isEmpty() ? -1 : 0;
102 }
103
104 @Override
105 public void draw(int mouseX, int mouseY, float partialTicks) {

Callers 3

FileSelectorMethod · 0.95
goUpMethod · 0.95
elementClickedMethod · 0.95

Calls 4

isEmptyMethod · 0.80
isHiddenMethod · 0.80
clearMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected