* Added a slider to the preferences to adjust the delay for the card tooltip window appearance.

This commit is contained in:
LevelX2 2015-12-08 18:39:47 +01:00
parent 0488da6b22
commit af793c30fe
4 changed files with 144 additions and 108 deletions

View file

@ -74,6 +74,7 @@ public class MageActionCallback implements ActionCallback {
private TransferData popupData;
private JComponent cardInfoPane;
private volatile boolean popupTextWindowOpen = false;
private int tooltipDelay;
enum EnlargedWindowState {
@ -140,8 +141,8 @@ public class MageActionCallback implements ActionCallback {
private void showTooltipPopup(final TransferData data, final Component parentComponent, final Point parentPoint) {
if (data.component != null) {
String showTooltips = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true");
if (showTooltips.equals("false")) {
tooltipDelay = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_DELAY, 300);
if (tooltipDelay == 0) {
return;
}
}
@ -169,7 +170,7 @@ public class MageActionCallback implements ActionCallback {
ThreadUtils.threadPool2.submit(new Runnable() {
@Override
public void run() {
ThreadUtils.sleep(300);
ThreadUtils.sleep(tooltipDelay);
if (tooltipCard == null || !tooltipCard.equals(data.card) || session == null || !popupTextWindowOpen || !enlargedWindowState.equals(EnlargedWindowState.CLOSED)) {
return;