summaryrefslogtreecommitdiff
path: root/NET/worlds/console/QuitDialog.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/console/QuitDialog.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/console/QuitDialog.java')
-rw-r--r--NET/worlds/console/QuitDialog.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/NET/worlds/console/QuitDialog.java b/NET/worlds/console/QuitDialog.java
new file mode 100644
index 0000000..8c1eef1
--- /dev/null
+++ b/NET/worlds/console/QuitDialog.java
@@ -0,0 +1,49 @@
+package NET.worlds.console;
+
+import NET.worlds.core.IniFile;
+import java.awt.Component;
+import java.awt.Event;
+import java.awt.Rectangle;
+
+public class QuitDialog extends PolledDialog implements ImageButtonsCallback {
+ private static final long serialVersionUID = 2648594609846911429L;
+ private ImageButtons ib;
+
+ public QuitDialog(java.awt.Window parent, DialogReceiver receiver) {
+ super(parent, receiver, Console.message("Quit"), true);
+ Rectangle[] rects = new Rectangle[2];
+ int yesX = IniFile.override().getIniInt("quitYesX", 141);
+ int yesY = IniFile.override().getIniInt("quitYesY", 76);
+ int yesW = IniFile.override().getIniInt("quitYesW", 78);
+ int yesH = IniFile.override().getIniInt("quitYesH", 22);
+ rects[0] = new Rectangle(yesX, yesY, yesW, yesH);
+ int noX = IniFile.override().getIniInt("quitNoX", 141);
+ int noY = IniFile.override().getIniInt("quitNoY", 114);
+ int noW = IniFile.override().getIniInt("quitNoW", 78);
+ int noH = IniFile.override().getIniInt("quitNoH", 22);
+ rects[1] = new Rectangle(noX, noY, noW, noH);
+ String quitGif = IniFile.override().getIniString("quitDlg", Console.message("DYRWTQ.GIF"));
+ this.ib = new ImageButtons(quitGif, rects, this);
+ this.ready();
+ }
+
+ @Override
+ protected void build() {
+ this.add("Center", this.ib);
+ }
+
+ @Override
+ public Object imageButtonsCallback(Component who, int which) {
+ this.done(which == 0);
+ return null;
+ }
+
+ @Override
+ public boolean keyDown(Event event, int key) {
+ if (key == 27) {
+ return this.done(false);
+ } else {
+ return key == 10 ? this.done(true) : super.keyDown(event, key);
+ }
+ }
+}