diff options
author | tom-overton <tom.overton@outlook.com> | 2021-07-20 17:55:36 -0700 |
---|---|---|
committer | tom-overton <tom.overton@outlook.com> | 2021-07-20 17:55:36 -0700 |
commit | 85374fb06a336356e1209693e4fd5e8108e964d6 (patch) | |
tree | 26977474df073e98e5425c3a18eda211d6e9c650 /src/com/dabomstew/pkrandom/newgui | |
parent | 4579b9bb2c6ba48a4883bab42e02bc8a69e3a236 (diff) |
Give a better error message when users supply bad game updates
Diffstat (limited to 'src/com/dabomstew/pkrandom/newgui')
-rw-r--r-- | src/com/dabomstew/pkrandom/newgui/Bundle.properties | 1 | ||||
-rw-r--r-- | src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/com/dabomstew/pkrandom/newgui/Bundle.properties b/src/com/dabomstew/pkrandom/newgui/Bundle.properties index a2f55c6..a28568a 100644 --- a/src/com/dabomstew/pkrandom/newgui/Bundle.properties +++ b/src/com/dabomstew/pkrandom/newgui/Bundle.properties @@ -564,6 +564,7 @@ GUI.paWeighDuplicatesTogetherCheckBox.toolTipText=<html>This setting causes abil GUI.applyGameUpdateMenuItem.text=Load Game Update GUI.gameUpdateApplied=<html>Update saved for game: %s.<br />Note that if the update file is moved or renamed, you will have to reapply it. GUI.nonMatchingGameUpdate=<html>Supplied file %s is not a valid game update for %s.<br />Please check your game updates and try again. +GUI.invalidGameUpdate=<html>Supplied file %s does not appear to be a valid game update.</br />Please check if the file is a valid game update. GUI.savingWithGameUpdate=<html>You've supplied a game update, so your game can only be output as a LayeredFS directory.<br /><b>Make sure you have this same game update installed in Citra or on your 3DS!</b> GUI.removeGameUpdateMenuItem.text=Unload Game Update GUI.keepGameLoadedAfterRandomizingMenuItem.text=Keep Game Loaded After Randomizing diff --git a/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java b/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java index d8aaab7..0ff487d 100644 --- a/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java +++ b/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java @@ -1100,6 +1100,11 @@ public class NewRandomizerGUI { // On the 3DS, the update has the same title ID as the base game, save for the 8th character, // which is 'E' instead of '0'. We can use this to detect if the update matches the game. String actualUpdateTitleId = Abstract3DSRomHandler.getTitleIdFromFile(fh.getAbsolutePath()); + if (actualUpdateTitleId == null) { + // Error: couldn't find a title ID in the update + JOptionPane.showMessageDialog(frame, String.format(bundle.getString("GUI.invalidGameUpdate"), fh.getName())); + return; + } Abstract3DSRomHandler ctrRomHandler = (Abstract3DSRomHandler) romHandler; String baseGameTitleId = ctrRomHandler.getTitleIdFromLoadedROM(); char[] baseGameTitleIdChars = baseGameTitleId.toCharArray(); |