From 272384c93b76a8305b56a67d38e5ce87c1242ee7 Mon Sep 17 00:00:00 2001 From: Argent77 <4519923+Argent77@users.noreply.github.com> Date: Fri, 17 Jan 2025 19:21:55 +0100 Subject: [PATCH] Include party scripts (*.bs) in BCS text search Menu: Search > Text Search > BCS --- src/org/infinity/gui/menu/SearchMenu.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/org/infinity/gui/menu/SearchMenu.java b/src/org/infinity/gui/menu/SearchMenu.java index 17e032d3b..367d9e2d8 100644 --- a/src/org/infinity/gui/menu/SearchMenu.java +++ b/src/org/infinity/gui/menu/SearchMenu.java @@ -7,6 +7,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; +import java.util.regex.Pattern; import javax.swing.JMenu; import javax.swing.JMenuItem; @@ -115,8 +116,12 @@ public void actionPerformed(ActionEvent event) { } else { for (final String type : TEXTSEARCH) { if (event.getActionCommand().equals(type)) { - if (event.getActionCommand().equals("DLG")) { + if (type.equals("DLG")) { new DialogSearcher(ResourceFactory.getResources(type), getTopLevelAncestor()); + } else if (type.equals("BCS")) { + // include party scripts + final Pattern pattern = Pattern.compile("^.*\\.BC?S$", Pattern.CASE_INSENSITIVE); + new TextResourceSearcher(ResourceFactory.getResources(pattern), getTopLevelAncestor()); } else { new TextResourceSearcher(ResourceFactory.getResources(type), getTopLevelAncestor()); }