This commit is contained in:
@@ -20,7 +20,8 @@ public class MultiMenu extends BaseView {
|
|||||||
private void renderCreate() {
|
private void renderCreate() {
|
||||||
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
||||||
ImGui.beginChild("##CreateGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
ImGui.beginChild("##CreateGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
||||||
ImGui.inputInt("Port", port);
|
if (ImGui.inputInt("Port", port))
|
||||||
|
port.set(Math.clamp(port.get(), 1, 65535));
|
||||||
if (ImGui.button("Créer")) {
|
if (ImGui.button("Créer")) {
|
||||||
try {
|
try {
|
||||||
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, (short) port.get()));
|
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, (short) port.get()));
|
||||||
@@ -35,12 +36,12 @@ public class MultiMenu extends BaseView {
|
|||||||
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
||||||
ImGui.beginChild("##JoinGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
ImGui.beginChild("##JoinGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
||||||
ImGui.inputText("Adresse", address);
|
ImGui.inputText("Adresse", address);
|
||||||
ImGui.inputInt("Port", port);
|
if (ImGui.inputInt("Port", port))
|
||||||
|
port.set(Math.clamp(port.get(), 1, 65535));
|
||||||
if (ImGui.button("Rejoindre")) {
|
if (ImGui.button("Rejoindre")) {
|
||||||
try {
|
try {
|
||||||
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, address.get(), (short) port.get()));
|
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, address.get(), (short) port.get()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ public class MultiPlayerView extends BaseView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void renderTimer() {
|
private void renderTimer() {
|
||||||
ImGui.inputInt("Temps de la partie (minutes)", gameDurationMinutes);
|
if (ImGui.inputInt("Temps de la partie (minutes)", gameDurationMinutes))
|
||||||
|
gameDurationMinutes.set(Math.clamp(gameDurationMinutes.get(), 1, 90));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -98,7 +98,8 @@ public class SudokuSelector {
|
|||||||
SudokuType currentType = SudokuType.values()[sudokuType.get()];
|
SudokuType currentType = SudokuType.values()[sudokuType.get()];
|
||||||
switch (currentType.getMakerParamCount()) {
|
switch (currentType.getMakerParamCount()) {
|
||||||
case 1:
|
case 1:
|
||||||
ImGui.inputInt("Taille", sudokuSize);
|
if (ImGui.inputInt("Taille", sudokuSize))
|
||||||
|
sudokuSize.set(Math.clamp(sudokuSize.get(), 1, 10));
|
||||||
if (ImGui.button(confirmMessage)) {
|
if (ImGui.button(confirmMessage)) {
|
||||||
selectSudoku(currentType.createDoku(getConstraints(), sudokuSize.get()), false);
|
selectSudoku(currentType.createDoku(getConstraints(), sudokuSize.get()), false);
|
||||||
}
|
}
|
||||||
@@ -108,8 +109,10 @@ public class SudokuSelector {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
ImGui.inputInt("Largeur", sudokuHeight);
|
if (ImGui.inputInt("Longueur", sudokuWidth))
|
||||||
ImGui.inputInt("Longueur", sudokuWidth);
|
sudokuWidth.set(Math.clamp(sudokuWidth.get(), 1, 10));
|
||||||
|
if (ImGui.inputInt("Hauteur", sudokuHeight))
|
||||||
|
sudokuHeight.set(Math.clamp(sudokuHeight.get(), 1, 10));
|
||||||
if (ImGui.button(confirmMessage)) {
|
if (ImGui.button(confirmMessage)) {
|
||||||
selectSudoku(currentType.createDoku(getConstraints(), sudokuWidth.get(), sudokuHeight.get()),
|
selectSudoku(currentType.createDoku(getConstraints(), sudokuWidth.get(), sudokuHeight.get()),
|
||||||
false);
|
false);
|
||||||
|
|||||||
Reference in New Issue
Block a user