diff --git a/src/main/java/net/rptools/maptool/client/swing/PlayersLoadingStatusBar.java b/src/main/java/net/rptools/maptool/client/swing/PlayersLoadingStatusBar.java index a488df70d8..7ff44b0fe1 100644 --- a/src/main/java/net/rptools/maptool/client/swing/PlayersLoadingStatusBar.java +++ b/src/main/java/net/rptools/maptool/client/swing/PlayersLoadingStatusBar.java @@ -56,14 +56,24 @@ private void refreshCount() { new StringBuilder(I18N.getText("ConnectionStatusPanel.playersLoadedZone", loaded, total)); for (Player player : players) { - var zone = - player.getZoneId() == null ? null : MapTool.getCampaign().getZone(player.getZoneId()); - - var text = - I18N.getText( - player.getLoaded() ? "connections.playerIsInZone" : "connections.playerIsLoadingZone", - player.toString(), - zone == null ? null : zone.getDisplayName()); + // GMs can see everyone's zone, players can only see each other's. + var showZone = MapTool.getPlayer().isGM() || !player.isGM(); + + String text; + if (showZone) { + var zone = + player.getZoneId() == null ? null : MapTool.getCampaign().getZone(player.getZoneId()); + text = + I18N.getText( + player.getLoaded() + ? "connections.playerIsInZone" + : "connections.playerIsLoadingZone", + player.toString(), + zone == null ? null : zone.getDisplayName()); + } else { + text = player.toString(); + } + sb.append("\n"); sb.append(text); } diff --git a/src/main/java/net/rptools/maptool/client/ui/connections/PlayerListCellRenderer.java b/src/main/java/net/rptools/maptool/client/ui/connections/PlayerListCellRenderer.java index 65ff110126..fce6eb02b0 100644 --- a/src/main/java/net/rptools/maptool/client/ui/connections/PlayerListCellRenderer.java +++ b/src/main/java/net/rptools/maptool/client/ui/connections/PlayerListCellRenderer.java @@ -26,16 +26,26 @@ public class PlayerListCellRenderer extends DefaultListCellRenderer { public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean hasFocus) { if (value instanceof Player player) { - var zone = - player.getZoneId() == null ? null : MapTool.getCampaign().getZone(player.getZoneId()); + // GMs can see everyone's zone, players can only see each other's. + var showZone = MapTool.getPlayer().isGM() || !player.isGM(); - String text = - I18N.getText( - player.getLoaded() ? "connections.playerIsInZone" : "connections.playerIsLoadingZone", - player.toString(), - zone == null ? null : zone.getDisplayName()); + String text; + if (showZone) { + var zone = + player.getZoneId() == null ? null : MapTool.getCampaign().getZone(player.getZoneId()); + text = + I18N.getText( + player.getLoaded() + ? "connections.playerIsInZone" + : "connections.playerIsLoadingZone", + player.toString(), + zone == null ? null : zone.getDisplayName()); + } else { + text = player.toString(); + } return super.getListCellRendererComponent(list, text, index, isSelected, hasFocus); } + return super.getListCellRendererComponent(list, value, index, isSelected, hasFocus); } }