Skip to content

Commit

Permalink
Make Mapping IO the default
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Jun 18, 2023
1 parent 3296634 commit 4b5346f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class GuiController implements ClientPacketHandler {

private Path loadedMappingPath;
private MappingFormat loadedMappingFormat;
public boolean useMappingIo;
public boolean useMappingIo = true;

private ClassHandleProvider chp;

Expand Down
35 changes: 17 additions & 18 deletions enigma-swing/src/main/java/cuchaz/enigma/gui/elements/MenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,21 +412,20 @@ private static void prepareOpenMappingsMenu(JMenu openMappingsMenu, Gui gui) {
MappingFormat.TSRG_2_FILE,
MappingFormat.PROGUARD);

// Mapping IO readers
for (MappingFormat format : readableMappingIoFormats) {
addOpenMappingsMenuEntry(I18n.translate(format.getMappingIoCounterpart().name),
format, true, openMappingsMenu, gui);
}
openMappingsMenu.addSeparator();

// Enigma's own readers
for (MappingFormat format : MappingFormat.values()) {
if (format.getReader() != null) {
addOpenMappingsMenuEntry(I18n.translate("mapping_format." + format.name().toLowerCase(Locale.ROOT)),
addOpenMappingsMenuEntry(I18n.translate("mapping_format." + format.name().toLowerCase(Locale.ROOT)) + " (legacy)",
format, false, openMappingsMenu, gui);
}
}

openMappingsMenu.addSeparator();

// mapping-io readers
for (MappingFormat format : readableMappingIoFormats) {
addOpenMappingsMenuEntry(I18n.translate(format.getMappingIoCounterpart().name + " (via mapping-io, experimental)"),
format, true, openMappingsMenu, gui);
}
}

private static void addOpenMappingsMenuEntry(String text, MappingFormat format, boolean mappingIo, JMenu openMappingsMenu, Gui gui) {
Expand All @@ -452,21 +451,21 @@ private static void prepareSaveMappingsAsMenu(JMenu saveMappingsAsMenu, JMenuIte
MappingFormat.TINY_V2,
MappingFormat.PROGUARD);

// Mapping IO writers
for (MappingFormat format : writableMappingIoFormats) {
addSaveMappingsAsMenuEntry(format.getMappingIoCounterpart().name,
format, true, saveMappingsAsMenu, saveMappingsItem, gui);
}

saveMappingsAsMenu.addSeparator();

// Enigma's own writers
for (MappingFormat format : MappingFormat.values()) {
if (format.getWriter() != null) {
addSaveMappingsAsMenuEntry(I18n.translate("mapping_format." + format.name().toLowerCase(Locale.ROOT)),
addSaveMappingsAsMenuEntry(I18n.translate("mapping_format." + format.name().toLowerCase(Locale.ROOT)) + " (legacy)",
format, false, saveMappingsAsMenu, saveMappingsItem, gui);
}
}

saveMappingsAsMenu.addSeparator();

// mapping-io writers
for (MappingFormat format : writableMappingIoFormats) {
addSaveMappingsAsMenuEntry(format.getMappingIoCounterpart().name + " (via mapping-io, experimental)",
format, true, saveMappingsAsMenu, saveMappingsItem, gui);
}
}

private static void addSaveMappingsAsMenuEntry(String text, MappingFormat format, boolean mappingIo, JMenu saveMappingsAsMenu, JMenuItem saveMappingsItem, Gui gui) {
Expand Down

0 comments on commit 4b5346f

Please sign in to comment.