mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-24 23:50:47 +00:00
AS1/2: Few gui fixes
This commit is contained in:
@@ -191,7 +191,7 @@ public class MainFrame extends JFrame implements TreeSelectionListener, ActionLi
|
|||||||
|
|
||||||
public void valueChanged(TreeSelectionEvent e) {
|
public void valueChanged(TreeSelectionEvent e) {
|
||||||
if (Main.isWorking()) return;
|
if (Main.isWorking()) return;
|
||||||
Object obj = ((JTree) e.getSource()).getLastSelectedPathComponent();
|
Object obj = tagTree.getLastSelectedPathComponent();
|
||||||
if (obj instanceof TagTreeItem) {
|
if (obj instanceof TagTreeItem) {
|
||||||
obj = ((TagTreeItem) obj).tag;
|
obj = ((TagTreeItem) obj).tag;
|
||||||
if (obj instanceof ASMSource) {
|
if (obj instanceof ASMSource) {
|
||||||
@@ -268,16 +268,18 @@ public class MainFrame extends JFrame implements TreeSelectionListener, ActionLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.getActionCommand().equals("SAVEACTION")) {
|
if (e.getActionCommand().equals("SAVEACTION")) {
|
||||||
TagTreeItem ti = (TagTreeItem) tagTree.getLastSelectedPathComponent();
|
TagTreeItem ti = (TagTreeItem) tagTree.getLastSelectedPathComponent();
|
||||||
if (ti.tag instanceof ASMSource) {
|
if (ti.tag instanceof ASMSource) {
|
||||||
ASMSource dat = (ASMSource) ti.tag;
|
ASMSource dat = (ASMSource) ti.tag;
|
||||||
try {
|
try {
|
||||||
dat.setActions(ASMParser.parse(new ByteArrayInputStream(editor.getText().getBytes()), 10),10); //TODO:Ensure correct version here
|
dat.setActions(ASMParser.parse(new ByteArrayInputStream(editor.getText().getBytes()), 10),10); //TODO:Ensure correct version here
|
||||||
|
valueChanged(null);
|
||||||
|
JOptionPane.showMessageDialog(this, "Code successfully saved");
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
} catch (ParseException ex) {
|
} catch (ParseException ex) {
|
||||||
JOptionPane.showMessageDialog(this, "" + ex.text + " on line " + ex.line, "Error", JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(this, "" + ex.text + " on line " + ex.line, "Error", JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e.getActionCommand().equals("SAVE")) {
|
if (e.getActionCommand().equals("SAVE")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user