Skip to content

Commit

Permalink
Update DialogCloser.java
Browse files Browse the repository at this point in the history
Implements sleep bypass (screen dialog close only) for intervals of zero or less.
  • Loading branch information
riverwanderer authored Nov 21, 2024
1 parent de11faa commit 5d9aa05
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vassal-app/src/main/java/VASSAL/tools/swing/DialogCloser.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2008-2023 by The VASSAL Development Team
* Copyright (c) 2008-2024 by The VASSAL Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -29,15 +29,16 @@ public class DialogCloser implements Runnable {

public DialogCloser(JDialog dialog, int ms) {
this.dialog = dialog;
this.ms = ms < 0 ? 500 : ms;
this.ms = ms;
}

@Override
public void run() {
if (ms > 1) { // Zero means no sleep - refresh only
if (ms > 0) {
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
Expand Down

0 comments on commit 5d9aa05

Please sign in to comment.