Merge remote-tracking branch 'origin/master'

master
Chara1236 2022-06-19 21:46:07 -04:00
commit a2b8a12550
2 changed files with 3 additions and 3 deletions

View File

@ -177,7 +177,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
try {
if (isDialogue || isPaused) {
mouseAlreadyTranslated = true;
keyPressed(new KeyEvent(new Component() {}, 0, 0, 0, KeyEvent.VK_ENTER, (char)KeyEvent.VK_ENTER));
keyPressed(new KeyEvent(new Component() {}, 0, -1, 0, KeyEvent.VK_ENTER, (char)KeyEvent.VK_ENTER));
} else {
player.mousePressed(e);
}
@ -553,7 +553,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
isPaused = !isPaused;
System.out.println(isPaused);
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
if (isPaused && (e.getSource() == null)) {
if (isPaused && (e.getWhen() != -1)) {
((CardLayout)gameFrame.getLayout()).show(gameFrame, "menu");
} else if (!waitForDialogue) {
waitForDialogue = true;

View File

@ -75,7 +75,7 @@ public class MenuPanel extends JPanel implements Runnable, KeyListener{
public void mousePressed(MouseEvent e) {
if (hoverCheck(e)) {
keyPressed(new KeyEvent(new Component() {
}, 0, 0, 0, KeyEvent.VK_ENTER, (char)KeyEvent.VK_ENTER));
}, 0, -1, 0, KeyEvent.VK_ENTER, (char)KeyEvent.VK_ENTER));
}
}
});