Skip to content

Commit

Permalink
feat: update GUIGameCreation
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse0w0 committed Oct 3, 2019
1 parent d151a24 commit a360867
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
30 changes: 30 additions & 0 deletions EngineClient/src/main/java/nullengine/client/util/Files2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package nullengine.client.util;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Iterator;

public final class Files2 {

public static boolean deleteIfPresent(Path path) throws IOException {
if (!Files.exists(path)) {
return false;
}
delete(path);
return true;
}

public static void delete(Path path) throws IOException {
if (Files.isDirectory(path)) {
Iterator<Path> iterator = Files.list(path).iterator();
while (iterator.hasNext()) {
delete(iterator.next());
}
}
Files.delete(path);
}

private Files2() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public GUIGameCreation() {
text.font().setValue(new Font(Font.getDefaultFont(), 20));
vBox.getChildren().add(text);

Button buttonCreate = new Button("New World");
Button buttonCreate = new Button("New Game");
buttonCreate.border().setValue(new Border(Color.WHITE));
buttonCreate.setOnClick(mouseClickEvent -> {
var engine = Platform.getEngineClient();
Expand Down Expand Up @@ -64,7 +64,7 @@ public GUIGameCreation() {
buttonExit.setOnClick(mouseClickEvent -> Platform.getEngine().terminate());
vBox.getChildren().add(buttonExit);

var butCS = new Button("Multiplayer");
var butCS = new Button("MultiPlayer");
butCS.setOnClick(e -> {
Platform.getEngineClient().getRenderManager().getGuiManager().showScreen(new Scene(new GuiDirectConnectServer()));
});
Expand Down

0 comments on commit a360867

Please sign in to comment.