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

#4961 #5008 #4954 Bug Fixes #5007

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/main/java/net/rptools/maptool/client/MapTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@
import net.rptools.maptool.server.ServerConfig;
import net.rptools.maptool.server.ServerPolicy;
import net.rptools.maptool.transfer.AssetTransferManager;
import net.rptools.maptool.util.MessageUtil;
import net.rptools.maptool.util.StringUtil;
import net.rptools.maptool.util.UserJvmOptions;
import net.rptools.maptool.util.*;
import net.rptools.parser.ParserException;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
Expand Down Expand Up @@ -693,6 +691,7 @@ private static void initialize() {
chatAutoSave = new ChatAutoSave();
chatAutoSave.setTimeout(AppPreferences.chatAutoSaveTimeInMinutes.get());
AppPreferences.chatAutoSaveTimeInMinutes.onChange(chatAutoSave::setTimeout);
MapTool.getFrame().getOverlayPanel().init();

// TODO: make this more formal when we switch to mina
new ServerHeartBeatThread().start();
Expand Down Expand Up @@ -927,6 +926,7 @@ public static void setCampaign(Campaign campaign, GUID defaultRendererId) {
AssetManager.updateRepositoryList();
MapTool.getFrame().getCampaignPanel().reset();
MapTool.getFrame().getGmPanel().reset();
MapTool.getFrame().getOverlayPanel().init();
UserDefinedMacroFunctions.getInstance().handleCampaignLoadMacroEvent();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebView;
import javax.swing.*;
import net.rptools.maptool.client.AppConstants;
import net.rptools.maptool.client.MapTool;
import net.rptools.maptool.client.swing.MapToolEventQueue;
import net.rptools.maptool.client.swing.SwingUtil;
import net.rptools.maptool.client.tool.DefaultTool;
import net.rptools.maptool.client.tool.Tool;
Expand Down Expand Up @@ -117,6 +119,20 @@ public ConcurrentSkipListSet<HTMLOverlayManager> getOverlays() {
return overlays.clone();
}

public HTMLOverlayManager init() {
MapToolEventQueue.invokeLater(
() -> {
MapTool.getFrame()
.getOverlayPanel()
.showOverlay(
AppConstants.INTERNAL_MAP_UNDER_POINTER_HTML_OVERLAY_NAME,
Integer.MAX_VALUE,
"",
null);
});
return null;
}

/**
* Returns the overlay associated with the name.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void setContent(Token token, String content, URL entry, StatSheetLocation
.getOverlayPanel()
.showOverlay(
AppConstants.INTERNAL_MAP_UNDER_POINTER_HTML_OVERLAY_NAME,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
output,
null);
}
Expand All @@ -77,7 +77,9 @@ public void clearContent() {
MapTool.getFrame()
.getOverlayPanel()
.getOverlay(AppConstants.INTERNAL_MAP_UNDER_POINTER_HTML_OVERLAY_NAME);
overlay.updateContents("", true);
if (overlay != null) {
overlay.updateContents("", true);
}
});
}
}
Loading