diff --git a/HenLoader/src/org/bdj/InitXlet.java b/HenLoader/src/org/bdj/InitXlet.java index 0ecb3d4..dc69a9d 100644 --- a/HenLoader/src/org/bdj/InitXlet.java +++ b/HenLoader/src/org/bdj/InitXlet.java @@ -82,7 +82,7 @@ public void run() console = new PrintStream(new MessagesOutputStream(messages, scene)); //InputStream is = getClass().getResourceAsStream("/program.data.bin"); //CRunTime.init(is); - + console.println("Hen Loader LP v1.0, based on:"); console.println("- GoldHEN 2.4b18.7 by SiSTR0"); console.println("- poops code by theflow0"); @@ -112,11 +112,39 @@ public void run() } else { console.println("* X = Poops"); } - + console.println("(Auto-selecting in 1 second...)"); + + long startTime = System.currentTimeMillis(); + long timeout = 1000; // 1 second + boolean autoSelected = false; + while ((c != BUTTON_O || !lapseSupported) && c != BUTTON_X) { c = pollInput(); + long currentTime = System.currentTimeMillis(); + if (currentTime - startTime >= timeout && c == 0) + { + c = BUTTON_X; + autoSelected = true; + break; + } + if (c == 0) { + try { + Thread.sleep(10); // Small sleep to avoid busy waiting + } catch (InterruptedException e) { + break; + } + } + } + + if (autoSelected) { + if (lapseSupported) { + console.println("Auto-selected: Lapse"); + } else { + console.println("Auto-selected: Poops"); + } } + if (c == BUTTON_X && lapseSupported) { int result = org.bdj.external.Lapse.main(console);