mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 04:50:46 +00:00
using defined constant in TraitListItem
This commit is contained in:
@@ -89,7 +89,6 @@ public class TraitsList extends JList<Object> implements ListSelectionListener {
|
||||
lastSelected = getSelectedIndex();
|
||||
TraitsListItem sel = (TraitsListItem) getSelectedValue();
|
||||
abcPanel.decompiledTextArea.gotoTrait(sel == null ? -1 : sel.getGlobalTraitId());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import java.util.ArrayList;
|
||||
@@ -66,16 +67,13 @@ public class TraitsListItem {
|
||||
public int getGlobalTraitId() {
|
||||
if (type == Type.INITIALIZER) {
|
||||
if (!isStatic) {
|
||||
return -1;
|
||||
//return abc.class_info.get(classIndex).static_traits.traits.size() + abc.instance_info.get(classIndex).instance_traits.traits.size();
|
||||
return GraphTextWriter.TRAIT_INSTANCE_INITIALIZER;
|
||||
} else {
|
||||
return -2;
|
||||
//return abc.class_info.get(classIndex).static_traits.traits.size() + abc.instance_info.get(classIndex).instance_traits.traits.size() + 1;
|
||||
return GraphTextWriter.TRAIT_CLASS_INITIALIZER;
|
||||
}
|
||||
}
|
||||
if (type == Type.SCRIPT_INITIALIZER) {
|
||||
//return abc.class_info.get(classIndex).static_traits.traits.size() + abc.instance_info.get(classIndex).instance_traits.traits.size() + 2;
|
||||
return -3;
|
||||
return GraphTextWriter.TRAIT_SCRIPT_INITIALIZER;
|
||||
}
|
||||
if (isStatic) {
|
||||
return index;
|
||||
|
||||
Reference in New Issue
Block a user