()
| 924 | } |
| 925 | |
| 926 | public void showOpenCharacterChooser() |
| 927 | { |
| 928 | GuiAssertions.assertIsNotJavaFXThread(); |
| 929 | PropertyContext context = PCGenSettings.getInstance(); |
| 930 | String path = lastCharacterPath; |
| 931 | if (path == null) |
| 932 | { |
| 933 | path = context.getProperty(PCGenSettings.PCG_SAVE_PATH); |
| 934 | } |
| 935 | |
| 936 | FileChooser fileChooser = new FileChooser(); |
| 937 | fileChooser.setTitle("Open PCGen Character"); |
| 938 | fileChooser.setInitialDirectory(new File(path)); |
| 939 | |
| 940 | FileChooser.ExtensionFilter extensionFilter = new FileChooser.ExtensionFilter( |
| 941 | "character files only", '*' + Constants.EXTENSION_CHARACTER_FILE |
| 942 | ); |
| 943 | fileChooser.getExtensionFilters().add(extensionFilter); |
| 944 | fileChooser.setSelectedExtensionFilter(extensionFilter); |
| 945 | |
| 946 | File file = GuiUtility.runOnJavaFXThreadNow(() -> |
| 947 | fileChooser.showOpenDialog(null)); |
| 948 | if (file != null) |
| 949 | { |
| 950 | lastCharacterPath = file.getAbsoluteFile().getParent(); |
| 951 | loadCharacterFromFile(file); |
| 952 | } |
| 953 | } |
| 954 | |
| 955 | void showOpenPartyChooser() |
| 956 | { |
no test coverage detected