From df7af57999cbe86857f55f64343cfbe879627669 Mon Sep 17 00:00:00 2001 From: Kenneth VanderLinde Date: Sat, 11 Nov 2023 13:53:18 -0800 Subject: [PATCH 1/2] Use the term "NPCs" in the Map Explorer window The group excludes PCs, so is not a general token group. --- .../client/ui/tokenpanel/TokenPanelTreeModel.java | 14 +++++++------- .../net/rptools/maptool/language/i18n.properties | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/rptools/maptool/client/ui/tokenpanel/TokenPanelTreeModel.java b/src/main/java/net/rptools/maptool/client/ui/tokenpanel/TokenPanelTreeModel.java index e184dff14a..ac1d0d97ae 100644 --- a/src/main/java/net/rptools/maptool/client/ui/tokenpanel/TokenPanelTreeModel.java +++ b/src/main/java/net/rptools/maptool/client/ui/tokenpanel/TokenPanelTreeModel.java @@ -47,7 +47,7 @@ public class TokenPanelTreeModel implements TreeModel { private static final Logger log = LogManager.getLogger(TokenPanelTreeModel.class); - private static final String _TOKENS = "panel.MapExplorer.View.TOKENS"; + private static final String _NPCS = "panel.MapExplorer.View.NPCS"; private static final String _PLAYERS = "panel.MapExplorer.View.PLAYERS"; private static final String _GROUPS = "panel.MapExplorer.View.GROUPS"; private static final String _GM = "panel.MapExplorer.View.GM"; @@ -59,7 +59,7 @@ public class TokenPanelTreeModel implements TreeModel { public enum View { // @formatter:off // I18N key Zone.Layer Req'd? isAdmin? - TOKENS(_TOKENS, Zone.Layer.TOKEN, false, false), + NPCS(_NPCS, Zone.Layer.TOKEN, false, false), PLAYERS(_PLAYERS, Zone.Layer.TOKEN, false, false), GROUPS(_GROUPS, Zone.Layer.TOKEN, false, false), GM(_GM, Zone.Layer.GM, false, true), @@ -116,7 +116,7 @@ public TokenPanelTreeModel(JTree tree) { // It would be useful to have this list be static, but it's really not that big of a memory // footprint // TODO: refactor to more tightly couple the View enum and the corresponding filter - filterList.add(new TokenTokenFilter()); + filterList.add(new NPCTokenFilter()); filterList.add(new PlayerTokenFilter()); filterList.add(new GMFilter()); filterList.add(new ObjectFilter()); @@ -264,7 +264,7 @@ private void updateInternal() { this, new Object[] {getRoot()}, new int[] {currentViewList.size() - 1}, - new Object[] {View.TOKENS})); + new Object[] {View.NPCS})); // @formatter:on while (expandedPaths != null && expandedPaths.hasMoreElements()) { tree.expandPath(expandedPaths.nextElement()); @@ -408,10 +408,10 @@ protected boolean accept(Token token) { *
  • Otherwise, return true. * */ - private class TokenTokenFilter extends TokenFilter { + private class NPCTokenFilter extends TokenFilter { /** Accepts only NPC tokens (GM) or tokens owned by current player. */ - public TokenTokenFilter() { - super(View.TOKENS); + public NPCTokenFilter() { + super(View.NPCS); } @Override diff --git a/src/main/resources/net/rptools/maptool/language/i18n.properties b/src/main/resources/net/rptools/maptool/language/i18n.properties index 8bf52854c9..0f22ce7c51 100644 --- a/src/main/resources/net/rptools/maptool/language/i18n.properties +++ b/src/main/resources/net/rptools/maptool/language/i18n.properties @@ -2318,7 +2318,7 @@ panel.MapExplorer.View.GROUPS = Groups panel.MapExplorer.View.LIGHT_SOURCES = Light Sources panel.MapExplorer.View.OBJECTS = Objects panel.MapExplorer.View.PLAYERS = Players -panel.MapExplorer.View.TOKENS = Tokens +panel.MapExplorer.View.NPCS = NPCs panel.NewGroupName = New Group Name panel.Selected = Selected panel.Selected.description = Dockable window showing the macros on the currently selected token(s). From 746fb8a574a6000fb639e1b986331f82c664ed91 Mon Sep 17 00:00:00 2001 From: Kenneth VanderLinde Date: Sat, 11 Nov 2023 13:54:44 -0800 Subject: [PATCH 2/2] Put Players group ahead of NPCs in the Map Explorer --- .../maptool/client/ui/tokenpanel/TokenPanelTreeModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/rptools/maptool/client/ui/tokenpanel/TokenPanelTreeModel.java b/src/main/java/net/rptools/maptool/client/ui/tokenpanel/TokenPanelTreeModel.java index ac1d0d97ae..ef07586bec 100644 --- a/src/main/java/net/rptools/maptool/client/ui/tokenpanel/TokenPanelTreeModel.java +++ b/src/main/java/net/rptools/maptool/client/ui/tokenpanel/TokenPanelTreeModel.java @@ -116,8 +116,8 @@ public TokenPanelTreeModel(JTree tree) { // It would be useful to have this list be static, but it's really not that big of a memory // footprint // TODO: refactor to more tightly couple the View enum and the corresponding filter - filterList.add(new NPCTokenFilter()); filterList.add(new PlayerTokenFilter()); + filterList.add(new NPCTokenFilter()); filterList.add(new GMFilter()); filterList.add(new ObjectFilter()); filterList.add(new BackgroundFilter());