diff options
| -rw-r--r-- | enigma-swing/src/main/java/cuchaz/enigma/gui/panels/IdentifierPanel.java | 25 | ||||
| -rw-r--r-- | enigma/src/main/resources/lang/en_us.json | 1 |
2 files changed, 25 insertions, 1 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/IdentifierPanel.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/IdentifierPanel.java index 8384cb71..4d8ceea4 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/IdentifierPanel.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/IdentifierPanel.java | |||
| @@ -49,7 +49,7 @@ public class IdentifierPanel { | |||
| 49 | this.gui = gui; | 49 | this.gui = gui; |
| 50 | 50 | ||
| 51 | this.ui.setLayout(new GridBagLayout()); | 51 | this.ui.setLayout(new GridBagLayout()); |
| 52 | this.ui.setPreferredSize(ScaleUtil.getDimension(0, 120)); | 52 | this.ui.setPreferredSize(ScaleUtil.getDimension(0, 135)); |
| 53 | this.ui.setBorder(BorderFactory.createTitledBorder(I18n.translate("info_panel.identifier"))); | 53 | this.ui.setBorder(BorderFactory.createTitledBorder(I18n.translate("info_panel.identifier"))); |
| 54 | this.ui.setEnabled(false); | 54 | this.ui.setEnabled(false); |
| 55 | } | 55 | } |
| @@ -96,15 +96,26 @@ public class IdentifierPanel { | |||
| 96 | this.ui.setEnabled(false); | 96 | this.ui.setEnabled(false); |
| 97 | } else { | 97 | } else { |
| 98 | this.ui.setEnabled(true); | 98 | this.ui.setEnabled(true); |
| 99 | boolean renamed = gui.getController().project.getMapper().getDeobfMapping(entry).targetName() != null; | ||
| 99 | 100 | ||
| 100 | if (deobfEntry instanceof ClassEntry) { | 101 | if (deobfEntry instanceof ClassEntry) { |
| 101 | ClassEntry ce = (ClassEntry) deobfEntry; | 102 | ClassEntry ce = (ClassEntry) deobfEntry; |
| 102 | String name = ce.isInnerClass() ? ce.getName() : ce.getFullName(); | 103 | String name = ce.isInnerClass() ? ce.getName() : ce.getFullName(); |
| 103 | this.nameField = th.addRenameTextField(EditableType.CLASS, name); | 104 | this.nameField = th.addRenameTextField(EditableType.CLASS, name); |
| 105 | |||
| 106 | if (renamed) { | ||
| 107 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.original_name"), entry.getName()); | ||
| 108 | } | ||
| 109 | |||
| 104 | th.addModifierRow(I18n.translate("info_panel.identifier.modifier"), EditableType.CLASS, this::onModifierChanged); | 110 | th.addModifierRow(I18n.translate("info_panel.identifier.modifier"), EditableType.CLASS, this::onModifierChanged); |
| 105 | } else if (deobfEntry instanceof FieldEntry) { | 111 | } else if (deobfEntry instanceof FieldEntry) { |
| 106 | FieldEntry fe = (FieldEntry) deobfEntry; | 112 | FieldEntry fe = (FieldEntry) deobfEntry; |
| 107 | this.nameField = th.addRenameTextField(EditableType.FIELD, fe.getName()); | 113 | this.nameField = th.addRenameTextField(EditableType.FIELD, fe.getName()); |
| 114 | |||
| 115 | if (renamed) { | ||
| 116 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.original_name"), entry.getName()); | ||
| 117 | } | ||
| 118 | |||
| 108 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.class"), fe.getParent().getFullName()); | 119 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.class"), fe.getParent().getFullName()); |
| 109 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.type_descriptor"), fe.getDesc().toString()); | 120 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.type_descriptor"), fe.getDesc().toString()); |
| 110 | th.addModifierRow(I18n.translate("info_panel.identifier.modifier"), EditableType.FIELD, this::onModifierChanged); | 121 | th.addModifierRow(I18n.translate("info_panel.identifier.modifier"), EditableType.FIELD, this::onModifierChanged); |
| @@ -120,6 +131,13 @@ public class IdentifierPanel { | |||
| 120 | } | 131 | } |
| 121 | } else { | 132 | } else { |
| 122 | this.nameField = th.addRenameTextField(EditableType.METHOD, me.getName()); | 133 | this.nameField = th.addRenameTextField(EditableType.METHOD, me.getName()); |
| 134 | } | ||
| 135 | |||
| 136 | if (renamed) { | ||
| 137 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.original_name"), entry.getName()); | ||
| 138 | } | ||
| 139 | |||
| 140 | if (!me.isConstructor()) { | ||
| 123 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.class"), me.getParent().getFullName()); | 141 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.class"), me.getParent().getFullName()); |
| 124 | } | 142 | } |
| 125 | 143 | ||
| @@ -136,6 +154,11 @@ public class IdentifierPanel { | |||
| 136 | } | 154 | } |
| 137 | 155 | ||
| 138 | this.nameField = th.addRenameTextField(type, lve.getName()); | 156 | this.nameField = th.addRenameTextField(type, lve.getName()); |
| 157 | |||
| 158 | if (renamed) { | ||
| 159 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.original_name"), entry.getName()); | ||
| 160 | } | ||
| 161 | |||
| 139 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.class"), lve.getContainingClass().getFullName()); | 162 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.class"), lve.getContainingClass().getFullName()); |
| 140 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.method"), lve.getParent().getName()); | 163 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.method"), lve.getParent().getName()); |
| 141 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.index"), Integer.toString(lve.getIndex())); | 164 | th.addCopiableStringRow(I18n.translate("info_panel.identifier.index"), Integer.toString(lve.getIndex())); |
diff --git a/enigma/src/main/resources/lang/en_us.json b/enigma/src/main/resources/lang/en_us.json index 3919b9e2..5d7ee258 100644 --- a/enigma/src/main/resources/lang/en_us.json +++ b/enigma/src/main/resources/lang/en_us.json | |||
| @@ -106,6 +106,7 @@ | |||
| 106 | "info_panel.identifier.method": "Method", | 106 | "info_panel.identifier.method": "Method", |
| 107 | "info_panel.identifier.constructor": "Constructor", | 107 | "info_panel.identifier.constructor": "Constructor", |
| 108 | "info_panel.identifier.class": "Class", | 108 | "info_panel.identifier.class": "Class", |
| 109 | "info_panel.identifier.original_name": "Original Name", | ||
| 109 | "info_panel.identifier.type_descriptor": "Type Descriptor", | 110 | "info_panel.identifier.type_descriptor": "Type Descriptor", |
| 110 | "info_panel.identifier.method_descriptor": "Method Descriptor", | 111 | "info_panel.identifier.method_descriptor": "Method Descriptor", |
| 111 | "info_panel.identifier.modifier": "Modifier", | 112 | "info_panel.identifier.modifier": "Modifier", |