This commit is contained in:
@@ -1,18 +1,56 @@
|
||||
package gui.menu;
|
||||
|
||||
import imgui.ImGui;
|
||||
import imgui.ImVec2;
|
||||
import imgui.type.ImInt;
|
||||
import imgui.type.ImString;
|
||||
|
||||
public class MultiMenu extends BaseView {
|
||||
|
||||
private final ImInt port = new ImInt(25565);
|
||||
private final ImString address = new ImString("localhost");
|
||||
|
||||
public MultiMenu(StateMachine stateMachine) {
|
||||
super(stateMachine);
|
||||
}
|
||||
|
||||
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.button("Créer")) {
|
||||
// TODO: create game
|
||||
}
|
||||
ImGui.endChild();
|
||||
}
|
||||
|
||||
private void renderJoin() {
|
||||
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.button("Rejoindre")) {
|
||||
// TODO: join game
|
||||
}
|
||||
ImGui.endChild();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
// TODO Auto-generated method stub
|
||||
ImGui.text("Multi");
|
||||
renderReturnButton();
|
||||
|
||||
renderCreate();
|
||||
ImGui.sameLine();
|
||||
renderJoin();
|
||||
|
||||
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
||||
ImVec2 buttonSize = new ImVec2(500, 70.0f);
|
||||
|
||||
float centerX = displaySize.x / 2.0f - buttonSize.x / 2.0f;
|
||||
|
||||
ImGui.setCursorPosX(centerX);
|
||||
if (ImGui.button("Retour", buttonSize)) {
|
||||
closeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user