Skip to content

Commit

Permalink
Merge pull request #4393 from kwvanderlinde/feature/4360-rename-token…
Browse files Browse the repository at this point in the history
…-group-in-map-explorer

Use the term "NPCs" in the Map Explorer window
  • Loading branch information
cwisniew authored Nov 15, 2023
2 parents 0b41d65 + 746fb8a commit 10b1345
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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),
Expand Down Expand Up @@ -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 TokenTokenFilter());
filterList.add(new PlayerTokenFilter());
filterList.add(new NPCTokenFilter());
filterList.add(new GMFilter());
filterList.add(new ObjectFilter());
filterList.add(new BackgroundFilter());
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -408,10 +408,10 @@ protected boolean accept(Token token) {
* <li>Otherwise, return true.
* </ol>
*/
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 10b1345

Please sign in to comment.