This commit is contained in:
@@ -20,7 +20,8 @@ public class MultiMenu extends BaseView {
|
||||
private void renderCreate() {
|
||||
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
||||
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")) {
|
||||
try {
|
||||
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, (short) port.get()));
|
||||
@@ -35,12 +36,12 @@ public class MultiMenu extends BaseView {
|
||||
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
||||
ImGui.beginChild("##JoinGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
||||
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")) {
|
||||
try {
|
||||
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, address.get(), (short) port.get()));
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,8 @@ public class MultiPlayerView extends BaseView {
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user