Skip to content

Commit

Permalink
Include party scripts (*.bs) in BCS text search
Browse files Browse the repository at this point in the history
Menu: Search > Text Search > BCS
  • Loading branch information
Argent77 committed Jan 17, 2025
1 parent 0bee49d commit 272384c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/org/infinity/gui/menu/SearchMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 272384c

Please sign in to comment.