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

Merged
merged 11 commits into from
Nov 12, 2024
4 changes: 1 addition & 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.List;
import java.util.concurrent.ConcurrentSkipListSet;
import javax.swing.*;
import net.rptools.maptool.client.AppConstants;
import net.rptools.maptool.client.AppPreferences;
import net.rptools.maptool.client.MapTool;
import net.rptools.maptool.client.MapToolExpressionParser;
Expand Down Expand Up @@ -260,7 +261,9 @@ private JsonObject getClientInfo() {
ConcurrentSkipListSet<HTMLOverlayManager> registeredOverlays =
MapTool.getFrame().getOverlayPanel().getOverlays();
for (HTMLOverlayManager o : registeredOverlays) {
overlays.add(o.getName(), o.getProperties());
if (!o.getName().startsWith(AppConstants.INTERNAL_FRAME_PREFIX)) {
overlays.add(o.getName(), o.getProperties());
}
}
cinfo.add("overlays", overlays);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ public void showOverlay(String name, int zOrder, String html, Object frameValue)
setVisible(true);
Platform.runLater(
() -> {
boolean needsSorting = false;
HTMLOverlayManager overlayManager = getOverlay(name);
if (overlayManager != null) {
if ("".equals(html)) {
Expand All @@ -257,7 +256,6 @@ public void showOverlay(String name, int zOrder, String html, Object frameValue)
overlays.remove(overlayManager);
overlayManager.setZOrder(zOrder);
overlays.add(overlayManager);
needsSorting = true;
}
} else {
overlayManager = new HTMLOverlayManager(name, zOrder);
Expand All @@ -266,12 +264,9 @@ public void showOverlay(String name, int zOrder, String html, Object frameValue)
root.getChildren().add(overlayManager.getWebView());
if (!HTMLFrameFactory.isInternalOnly(overlayManager.getName())) {
AppMenuBar.addToOverlayMenu(overlayManager);
needsSorting = true;
}
}
if (needsSorting) {
sortOverlays();
}
sortOverlays();
overlayManager.updateContents(html, true);
if (frameValue != null) {
overlayManager.setValue(frameValue);
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