Skip to content

Commit

Permalink
Merge pull request #495 from coanghel/develop
Browse files Browse the repository at this point in the history
New Feature: Automatic naming for loadout EFT export (Issue #471)
  • Loading branch information
GoldenGnu authored Oct 27, 2024
2 parents 4d90aaa + 487f733 commit 707402f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,18 @@
<tests.to.skip>**/*OnlineTest.java</tests.to.skip>
</properties>
</profile>
<profile>
<id>skip-all-tests</id>
<activation>
<property>
<name>skip-all-tests</name>
<value>true</value>
</property>
</activation>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
<profile>
<id>skip-online-price-tests</id>
<activation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ private void exportEFT() {
if (exportAsset == null) {
return;
}
String buildName = getBuildName();
String buildName = getBuildName(exportAsset.getName());
if (buildName == null) {
return; //Cancel
}
Expand Down Expand Up @@ -459,16 +459,17 @@ private void writeCount(StringBuilder builder, Map<String, Long> modules) {
}
}

private String getBuildName() {
String buildName = JOptionInput.showInputDialog(program.getMainWindow().getFrame(), "Enter Build Name", "Export EFT", JOptionPane.PLAIN_MESSAGE);
private String getBuildName(String shipName) {
String defaultName = shipName.replaceFirst("\\s*\\([^)]*\\)\\s*$", "");
String buildName = (String) JOptionInput.showInputDialog(program.getMainWindow().getFrame(), "Enter Build Name", "Export EFT", JOptionPane.PLAIN_MESSAGE, null, null, defaultName);
if (buildName == null) {
return null; //Cancel
} else if (buildName.isEmpty()) {
JOptionPane.showMessageDialog(program.getMainWindow().getFrame(),
TabsLoadout.get().name1(),
TabsLoadout.get().empty(),
JOptionPane.PLAIN_MESSAGE);
return getBuildName();
return getBuildName(defaultName);
} else {
return buildName;
}
Expand Down

0 comments on commit 707402f

Please sign in to comment.