From 65b12271bfd4645526338fb9375dba67fa3f73bc Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 20 Nov 2018 19:37:04 +0100 Subject: Refractor game state change detection / locks --- src/subconscious/graphics/GameWindow.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/subconscious/graphics/GameWindow.java') diff --git a/src/subconscious/graphics/GameWindow.java b/src/subconscious/graphics/GameWindow.java index 19f8ce1..d7bb655 100644 --- a/src/subconscious/graphics/GameWindow.java +++ b/src/subconscious/graphics/GameWindow.java @@ -14,7 +14,6 @@ import javax.swing.JButton; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; - /* GameWindow * This class manages the graphical part of the game, such as loading and * unloading scenes, and the window itself @@ -101,6 +100,8 @@ public class GameWindow extends JFrame implements ActionListener { } } + + this.quit(); } private void loadScene(Scene scene) { @@ -168,7 +169,7 @@ public class GameWindow extends JFrame implements ActionListener { public void actionPerformed(ActionEvent e) { if (e.getActionCommand().startsWith("btn")) { if (e.getActionCommand().equals("btn-exit")) { - this.quit(); + this.game.quit(); return; } -- cgit v1.2.1