Finish initiate all the button in the gridPane For MenuLevel
This commit is contained in:
parent
76a4525329
commit
7c28326408
@ -10,38 +10,49 @@ public class MenuLevel extends GridPane {
|
|||||||
public int StartLevel;
|
public int StartLevel;
|
||||||
|
|
||||||
public MenuLevel(int choose_day) {
|
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();
|
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++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
if (i == 1)
|
for (int j = 1; j < 5; j++) {
|
||||||
StartLevel=2;
|
|
||||||
else if (i ==2)
|
|
||||||
StartLevel=3;
|
|
||||||
for (int j = 0; j < 4; j++) {
|
|
||||||
if(i==0){
|
if(i==0){
|
||||||
Button Level = new Button(Integer.toString(StartLevel));
|
Button Level = new Button(Integer.toString(StartLevel));
|
||||||
StartLevel+=3;
|
StartLevel+=3;
|
||||||
GdP.add(Level,i,j);
|
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));
|
Button Level = new Button(Integer.toString(StartLevel));
|
||||||
StartLevel+=3;
|
StartLevel += 3;
|
||||||
GdP.add(Level,i,j);
|
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));
|
Button Level = new Button(Integer.toString(StartLevel));
|
||||||
StartLevel+=3;
|
StartLevel+=3;
|
||||||
GdP.add(Level,i,j);
|
GdP.add(Level,i,j);
|
||||||
|
Loading…
Reference in New Issue
Block a user