Skip to content

Commit

Permalink
Removed unused stuff, fixed resizability in editor board
Browse files Browse the repository at this point in the history
  • Loading branch information
alemazzo committed Apr 6, 2021
1 parent ed97dc7 commit 0c6109e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 206 deletions.
11 changes: 11 additions & 0 deletions src/main/java/jhaturanga/views/editor/EditorView.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ private boolean checkIfInputIsCorrect() {
return true;
}

@FXML
public void onBoardSizeChangeClick(final ActionEvent event) {

this.blackPiecesSelector.getChildren().clear();
this.whitePiecesSelector.getChildren().clear();
this.container.getChildren().remove(this.editorBoard);
this.getEditorController().resetBoard(Integer.parseInt(this.columnsSelector.getText()),
Integer.parseInt(this.rowsSelector.getText()));
this.init();
}

@FXML
public void onBackClick(final ActionEvent event) throws IOException {
PageLoader.switchPage(this.getStage(), Pages.SELECT_GAME, this.getEditorController().getApplicationInstance());
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/pages/editor.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="66.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="17.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="17.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="17.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" percentHeight="5.0" vgrow="NEVER" />
Expand Down Expand Up @@ -61,7 +62,7 @@
</GridPane.margin>
</Button>
<StackPane fx:id="container" prefHeight="150.0" prefWidth="200.0" GridPane.rowIndex="2" />
<VBox fx:id="blackPiecesSelector" prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.hgrow="NEVER" GridPane.rowIndex="2" GridPane.valignment="CENTER" GridPane.vgrow="NEVER">
<VBox fx:id="blackPiecesSelector" prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.hgrow="NEVER" GridPane.rowIndex="2" GridPane.valignment="CENTER" GridPane.vgrow="NEVER">
<GridPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</GridPane.margin>
Expand All @@ -86,6 +87,11 @@
<Font name="Cascadia Code PL Regular" size="14.0" />
</font>
</Button>
<Button mnemonicParsing="false" onAction="#onBoardSizeChangeClick" stylesheets="@../css/pages/editor.css" text="Resize" GridPane.columnIndex="3" GridPane.halignment="CENTER" GridPane.rowIndex="3" GridPane.valignment="CENTER">
<font>
<Font name="Cascadia Code PL Regular" size="14.0" />
</font>
</Button>
</children>
</GridPane>
</children>
Expand Down
29 changes: 0 additions & 29 deletions src/main/resources/pages/old/leaderboard.fxml

This file was deleted.

80 changes: 0 additions & 80 deletions src/main/resources/pages/old/login.fxml

This file was deleted.

37 changes: 0 additions & 37 deletions src/main/resources/pages/old/oldsettings.fxml

This file was deleted.

59 changes: 0 additions & 59 deletions src/main/resources/pages/old/register.fxml

This file was deleted.

0 comments on commit 0c6109e

Please sign in to comment.