Skip to content

Commit

Permalink
Merge pull request #5007 from Jmr3366/j_develop_statsheet
Browse files Browse the repository at this point in the history
#4961 #5008 #4954 Bug Fixes
  • Loading branch information
kwvanderlinde authored Nov 12, 2024
2 parents e8c7ba9 + cb0c4d8 commit 1872708
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
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);
}
});
}
}

0 comments on commit 1872708

Please sign in to comment.