You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the "Select Resource Pack" dialogue to add mods, I suspect as intended (because it works, really cool actually love that)
Issue is, there's a great many mods in some modpacks. So I was wondering, if the dialogue can be changed to allow multi-select. I'm not used to Java anymore and after wading through the 300 line settings function, I found it, and as far as I can tell it should be fairly trivial to support in this case:
JFileChooserjfc = newJFileChooser(MainWindow.settings.getLastExportPath());
// Only files currently supported, remove when support for directories added//jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);jfc.setMultiSelectionEnabled(true);
jfc.addChoosableFileFilter(newFileFilter() {
@OverridepublicStringgetDescription() {return"Extracted pack.mcmeta";}
@Overridepublicbooleanaccept(Filef) {returnf.isDirectory() || f.getName().equals("pack.mcmeta");}
});
jfc.setFileFilter(newFileNameExtensionFilter("Zip & Jar files", "zip", "ZIP", "Zip", "jar", "JAR", "Jar"));
jfc.setCurrentDirectory(Filesystem.getMinecraftDir());
jfc.showDialog(Settings.this, Messages.getString("TexsplitDialog.SEL_RP"));
File[] selectedFiles = jfc.getSelectedFiles();
for (FileselectedFile : selectedFiles) {
if (selectedFile == null) {
continue;
}
listPacks.getModel().add(0, selectedFile);
}
listPacks.setSelectedIndex(0);
saveSettings();
updateResourcePacks(true);
It (kind of) works, except there seems to be a limitation on how many resource packs you can add due to java prefs only allowing 8192 characters in a preference. This limitation is already there, just less likely to be encountered due to how boring it'd be to include that many files one by one
Still think it'd be an improvement, maybe there's a workaround or a inherently better solution. I'd even go as far as suggesting an external tool to extract mod resources, or even extracting them into a local folder, maybe as a seperate feature, but that's a way larger change that I'm not qualified to make I think. Mainly to not contaminate the code base with my restricted Java capabilties
Not making a PR because I wanna gauge interest, if this is a no no feature, I'll just use my own build to do it, if you think it's not bad and have an idea on working around javas pref restrictions, I'll look into that and make a PR
Best, Lena
The text was updated successfully, but these errors were encountered:
I was aware of the 8192 limit and it is quite annoying I did think that I could maybe skirt that by using additional preference keys as needed but that seemed like too much work for a fairly rare use case. There's probably not a great reason to not allow adding multiple at once, I did actually implement drag and drop so you can just drop all the files into that box and it will add them all that way.
I'm using the "Select Resource Pack" dialogue to add mods, I suspect as intended (because it works, really cool actually love that)
Issue is, there's a great many mods in some modpacks. So I was wondering, if the dialogue can be changed to allow multi-select. I'm not used to Java anymore and after wading through the 300 line settings function, I found it, and as far as I can tell it should be fairly trivial to support in this case:
It (kind of) works, except there seems to be a limitation on how many resource packs you can add due to java prefs only allowing 8192 characters in a preference. This limitation is already there, just less likely to be encountered due to how boring it'd be to include that many files one by one
Still think it'd be an improvement, maybe there's a workaround or a inherently better solution. I'd even go as far as suggesting an external tool to extract mod resources, or even extracting them into a local folder, maybe as a seperate feature, but that's a way larger change that I'm not qualified to make I think. Mainly to not contaminate the code base with my restricted Java capabilties
Not making a PR because I wanna gauge interest, if this is a no no feature, I'll just use my own build to do it, if you think it's not bad and have an idea on working around javas pref restrictions, I'll look into that and make a PR
Best, Lena
The text was updated successfully, but these errors were encountered: