Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Beanshell Sleep(0) (and equivalent Audit or Alert calls) should only refresh the screen. #13707

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 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,16 +29,18 @@ 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() {
try {
Thread.sleep(ms);
}
catch (InterruptedException e) {
throw new RuntimeException(e);
if (ms > 0) {
try {
Thread.sleep(ms);
}
catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
dialog.setVisible(false);
dialog.dispose();
Expand Down