Új játék menüpont és beállítások ablak
This commit is contained in:
parent
17a6c9b10f
commit
15adbcef20
17
src/hanoi/Beallitas.fxml
Normal file
17
src/hanoi/Beallitas.fxml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.Spinner?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
|
||||
|
||||
<AnchorPane prefHeight="400.0" prefWidth="400.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/16">
|
||||
<children>
|
||||
<Button fx:id="mentGomb" layoutX="135.0" layoutY="296.0" mnemonicParsing="false" onAction="#mentGombAction" text="Mentés és kilépés" />
|
||||
<Label layoutX="45.0" layoutY="63.0" text="Alapértelmezett korongszám:" />
|
||||
<Spinner fx:id="defaultKszamSpin" layoutX="214.0" layoutY="59.0" prefHeight="25.0" prefWidth="101.0" />
|
||||
<Label layoutX="105.0" layoutY="116.0" text="Lépésszám-korlát:" />
|
||||
<Spinner fx:id="stepMaxSpin" layoutX="214.0" layoutY="112.0" prefHeight="25.0" prefWidth="101.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
|
@ -49,6 +49,7 @@ public class FoablakController {
|
|||
st.show();
|
||||
// a felhasználó és korongszám átadása a hanoi ablaknak
|
||||
HanoiFormController hfc = fl.getController();
|
||||
hfc.setFoAblak(n.getScene());
|
||||
hfc.setFh(fh);
|
||||
hfc.setKorongokSzama(kspin.getValue());
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.ResourceBundle;
|
|||
import javafx.application.Platform;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Alert.AlertType;
|
||||
import javafx.scene.control.ButtonType;
|
||||
|
@ -24,7 +25,15 @@ public class HanoiFormController {
|
|||
|
||||
private Korong kezbeKorong;
|
||||
|
||||
@FXML
|
||||
private Scene foAblak;
|
||||
|
||||
public void setFoAblak(Scene foAblak) {
|
||||
this.foAblak = foAblak;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@FXML
|
||||
private MenuItem ujItem;
|
||||
|
||||
@FXML
|
||||
|
@ -89,6 +98,11 @@ public class HanoiFormController {
|
|||
|
||||
@FXML
|
||||
void ujKattintas(ActionEvent event) {
|
||||
Stage st = (Stage) jatekTerulet.getScene().getWindow();
|
||||
if (foAblak!=null) {
|
||||
st.setScene(foAblak);
|
||||
st.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user