This commit is contained in:
François Autin 2021-06-25 18:41:46 +02:00
commit 417bd199a7
2 changed files with 19 additions and 4 deletions

View File

@ -29,9 +29,10 @@ public class KeyboardInput extends GLFWKeyCallback {
match.showP1Hitbox = !match.showP1Hitbox;
match.showP2Hitbox = !match.showP2Hitbox;
}
else if(key == GLFW_KEY_D && action == GLFW_PRESS){
else if(key == GLFW_KEY_D && action == GLFW_PRESS)
match.debugToggle();
}
else if(key == GLFW_KEY_I && action == GLFW_PRESS)
match.inputP1Toggle();
}
public static boolean isKeyDown(int keyCode) {

View File

@ -123,7 +123,7 @@ public class match {
objP1.getShadow().translate(new Vector3f(0f,p1.getPosY(),0));
objP2.getShadow().translate(new Vector3f(0f,p2.getPosY(),0));
// Crée l'InputList
if(showInputListP1){
if (showInputListP1){
inputListP1 = new UIInputList(inputsP1, 10f, 0f, 0.85f, 110f, engine);
engine.add_uiElement(inputListP1);
inputListP1.init();
@ -150,7 +150,7 @@ public class match {
}
engine.remove_uiElement(matchWon);
if(showInputListP1){
if(inputListP1 != null){
engine.remove_uiElement(inputListP1);
}
@ -963,4 +963,18 @@ public class match {
}
}
public static void inputP1Toggle(){
if (showInputListP1){
if (inputListP1 != null){
engine.remove_uiElement(inputListP1);
}
showInputListP1 = false;
} else {
inputListP1 = new UIInputList(inputsP1, 10f, 0f, 0.85f, 110f, engine);
engine.add_uiElement(inputListP1);
inputListP1.init();
showInputListP1 = true;
}
}
}