mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-15 15:28:25 +00:00
Issue #584 commandline script export - select whole packages
This commit is contained in:
@@ -848,10 +848,13 @@ public final class SWF implements TreeItem, Timelined {
|
||||
abcTags.add(cnt);
|
||||
}
|
||||
}
|
||||
|
||||
boolean exported = false;
|
||||
|
||||
for (int i = 0; i < abcTags.size(); i++) {
|
||||
ABC abc = abcTags.get(i).getABC();
|
||||
ScriptPack scr = abc.findScriptPackByPath(className);
|
||||
if (scr != null) {
|
||||
List<ScriptPack> scrs = abc.findScriptPacksByPath(className);
|
||||
for(ScriptPack scr:scrs) {
|
||||
String cnt = "";
|
||||
if (abc.script_info.size() > 1) {
|
||||
cnt = "script " + (i + 1) + "/" + abc.script_info.size() + " ";
|
||||
@@ -860,11 +863,11 @@ public final class SWF implements TreeItem, Timelined {
|
||||
informListeners("exporting", exStr);
|
||||
scr.export(outdir, abcTags, exportMode, parallel);
|
||||
exStr = "Exported " + "tag " + (i + 1) + "/" + abcTags.size() + " " + cnt + scr.getPath() + " ...";
|
||||
informListeners("exported", exStr);
|
||||
return true;
|
||||
}
|
||||
informListeners("exported", exStr);
|
||||
exported = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return exported;
|
||||
}
|
||||
|
||||
private List<MyEntry<ClassPath, ScriptPack>> uniqueAS3Packs(List<MyEntry<ClassPath, ScriptPack>> packs) {
|
||||
|
||||
@@ -947,6 +947,37 @@ public class ABC {
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public List<ScriptPack> findScriptPacksByPath(String name) {
|
||||
List<ScriptPack> ret = new ArrayList<>();
|
||||
List<MyEntry<ClassPath, ScriptPack>> allPacks = getScriptPacks();
|
||||
if(name.endsWith(".**")||name.equals("**")||name.endsWith(".++") || name.equals("++")){
|
||||
name = name.substring(0,name.length()-2);
|
||||
|
||||
for (MyEntry<ClassPath, ScriptPack> en : allPacks) {
|
||||
if (en.key.toString().startsWith(name)) {
|
||||
ret.add(en.value);
|
||||
}
|
||||
}
|
||||
} else if(name.endsWith(".*")||name.equals("*")||name.endsWith(".+")||name.equals("+")){
|
||||
name = name.substring(0,name.length()-1);
|
||||
for (MyEntry<ClassPath, ScriptPack> en : allPacks) {
|
||||
if (en.key.toString().startsWith(name)) {
|
||||
String rem = name.isEmpty()?en.key.toString():en.key.toString().substring(name.length());
|
||||
if(!rem.contains(".")){
|
||||
ret.add(en.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ScriptPack p = findScriptPackByPath(name);
|
||||
if(p!=null){
|
||||
ret.add(p);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
public ScriptPack findScriptPackByPath(String name) {
|
||||
List<MyEntry<ClassPath, ScriptPack>> packs = getScriptPacks();
|
||||
|
||||
Reference in New Issue
Block a user