Finish initiate all the button in the gridPane For MenuLevel

This commit is contained in:
Mat 2023-05-01 20:45:51 +02:00
parent dc5da4956a
commit a076ca12cb

View File

@ -10,38 +10,49 @@ public class MenuLevel extends GridPane {
public int StartLevel;
public MenuLevel(int choose_day) {
BckMenu = new Button("Back to menu");
for (int i = 0; i < Days.length; i++) {
int a = 1;
Days[i] = new Button(Integer.toString(a));
a += 1;
}
if (choose_day == 1)
StartLevel = 1;
if (choose_day == 2)
StartLevel = 11;
if (choose_day == 3)
StartLevel = 21;
GridPane GdP = new GridPane();
BckMenu = new Button("Back to menu");
for (int i = 0; i < Days.length; i++){
Days[i] = new Button("Day"+(i+1));
}
if (choose_day == 1) {
StartLevel = 1;
GdP.add(Days[1],0,0);
GdP.add(Days[2],1,0);
}
if (choose_day == 2) {
StartLevel = 11;
GdP.add(Days[0], 0, 0);
GdP.add(Days[2], 1, 0);
}
if (choose_day == 3) {
StartLevel = 21;
GdP.add(Days[0], 0, 0);
GdP.add(Days[1], 1, 0);
}
for (int i = 0; i < 3; i++) {
if (i == 1)
StartLevel=2;
else if (i ==2)
StartLevel=3;
for (int j = 0; j < 4; j++) {
for (int j = 1; j < 5; j++) {
if(i==0){
Button Level = new Button(Integer.toString(StartLevel));
StartLevel+=3;
GdP.add(Level,i,j);
if(j==4){
StartLevel-=11;
}
else if(i==1&&j!=3){
}
else if(i==1&&j!=4) {
Button Level = new Button(Integer.toString(StartLevel));
StartLevel+=3;
GdP.add(Level,i,j);
StartLevel += 3;
GdP.add(Level, i, j);
if (j == 3) {
StartLevel -=8;
}
}
else if(i==2&&j!=3){
else if(i==2&&j!=4){
Button Level = new Button(Integer.toString(StartLevel));
StartLevel+=3;
GdP.add(Level,i,j);