mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-08 11:58:15 +00:00
Displaying changed AS3 scripts in GUI as bold
This commit is contained in:
@@ -542,6 +542,7 @@ public class ABC {
|
||||
si.traits = ais.readTraits("traits");
|
||||
script_info.add(si);
|
||||
ais.endDumpLevel();
|
||||
si.setModified(false);
|
||||
}
|
||||
|
||||
int bodies_count = ais.readU30("bodies_count");
|
||||
@@ -1228,7 +1229,7 @@ public class ABC {
|
||||
method_info.remove(index);
|
||||
}
|
||||
|
||||
public void replaceSciptPack(ScriptPack pack, String as) throws AVM2ParseException, CompilationException, IOException, InterruptedException {
|
||||
public void replaceScriptPack(ScriptPack pack, String as) throws AVM2ParseException, CompilationException, IOException, InterruptedException {
|
||||
String scriptName = pack.getPathScriptName() + ".as";
|
||||
int oldIndex = pack.scriptIndex;
|
||||
int newIndex = script_info.size();
|
||||
@@ -1248,6 +1249,7 @@ public class ABC {
|
||||
// Move newly added script to its position
|
||||
script_info.set(oldIndex, script_info.get(newIndex));
|
||||
script_info.remove(newIndex);
|
||||
script_info.get(oldIndex).setModified(true);
|
||||
pack(); // removes old classes/methods
|
||||
((Tag) parentTag).setModified(true);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,19 @@ import java.util.List;
|
||||
|
||||
public class ScriptInfo {
|
||||
|
||||
@Internal
|
||||
private boolean modified = true;
|
||||
|
||||
public void setModified(boolean modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
public boolean isModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Internal
|
||||
public boolean deleted;
|
||||
|
||||
@@ -35,7 +48,7 @@ public class ScriptInfo {
|
||||
public Traits traits;
|
||||
|
||||
public ScriptInfo() {
|
||||
traits = new Traits();
|
||||
traits = new Traits();
|
||||
}
|
||||
|
||||
public ScriptInfo(Traits traits) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ABCInputStream;
|
||||
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
|
||||
import com.jpexs.decompiler.flash.abc.types.ScriptInfo;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.HideInRawEdit;
|
||||
@@ -139,4 +140,15 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setModified(boolean value) {
|
||||
super.setModified(value);
|
||||
if (value == false && !isModified()) {
|
||||
ABC abc = getABC();
|
||||
for (ScriptInfo si : abc.script_info) {
|
||||
si.setModified(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ABCInputStream;
|
||||
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
|
||||
import com.jpexs.decompiler.flash.abc.types.ScriptInfo;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.types.annotations.HideInRawEdit;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFField;
|
||||
@@ -111,4 +112,16 @@ public class DoABCTag extends Tag implements ABCContainerTag {
|
||||
public int compareTo(ABCContainerTag o) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setModified(boolean value) {
|
||||
super.setModified(value);
|
||||
if (value == false && !isModified()) {
|
||||
ABC abc = getABC();
|
||||
for (ScriptInfo si : abc.script_info) {
|
||||
si.setModified(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user