AS1/2 Improved direct editing

AS1/2 Improved decompilation of various global functions
This commit is contained in:
Jindra Pet��k
2013-07-15 23:07:36 +02:00
parent 61b3c13105
commit 49ef4c0961
175 changed files with 5356 additions and 2183 deletions
@@ -16,9 +16,11 @@
*/
package com.jpexs.decompiler.flash.action.treemodel;
import com.jpexs.decompiler.flash.action.swf4.ActionStartDrag;
import com.jpexs.decompiler.flash.ecma.*;
import com.jpexs.decompiler.flash.graph.GraphSourceItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import com.jpexs.decompiler.flash.graph.SourceGenerator;
import java.util.List;
public class StartDragTreeItem extends TreeItem {
@@ -64,4 +66,24 @@ public class StartDragTreeItem extends TreeItem {
ret.addAll(y2.getNeededSources());
return ret;
}
@Override
public List<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
boolean hasConstrains = true;
if (constrain instanceof DirectValueTreeItem) {
if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) {
hasConstrains = false;
}
}
if (hasConstrains) {
return toSourceMerge(localData, generator, x1, y1, x2, y2, constrain, lockCenter, target, new ActionStartDrag());
} else {
return toSourceMerge(localData, generator, constrain, lockCenter, target, new ActionStartDrag());
}
}
@Override
public boolean hasReturnValue() {
return false;
}
}