diff --git a/lib/AndorsTrainer_v0.1.1.jar b/lib/AndorsTrainer_v0.1.1.jar deleted file mode 100644 index 130917d..0000000 Binary files a/lib/AndorsTrainer_v0.1.1.jar and /dev/null differ diff --git a/lib/AndorsTrainer_v0.1.2.jar b/lib/AndorsTrainer_v0.1.2.jar new file mode 100644 index 0000000..766cff9 Binary files /dev/null and b/lib/AndorsTrainer_v0.1.2.jar differ diff --git a/packaging/Linux/ATCS/ATCS.cmd b/packaging/Linux/ATCS/ATCS.cmd index 5cae4ba..08c1f66 100644 --- a/packaging/Linux/ATCS/ATCS.cmd +++ b/packaging/Linux/ATCS/ATCS.cmd @@ -1 +1 @@ -start "" "javaw.exe" -Xmx512M -cp "lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\ATCS_v0.3.3.jar;lib\AndorsTrainer_v0.1.1.jar" com.gpl.rpg.atcontentstudio.ATContentStudio \ No newline at end of file +start "" "javaw.exe" -Xmx512M -cp "lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\ATCS_v0.4.0.jar;lib\AndorsTrainer_v0.1.2.jar;lib\bsh-2.0b4.jar" com.gpl.rpg.atcontentstudio.ATContentStudio diff --git a/packaging/Linux/ATCS/ATCS.sh b/packaging/Linux/ATCS/ATCS.sh index a200387..2b5b7b0 100644 --- a/packaging/Linux/ATCS/ATCS.sh +++ b/packaging/Linux/ATCS/ATCS.sh @@ -1,2 +1,2 @@ #!/bin/bash -java -Xmx512M -cp lib/AndorsTrainer_v0.1.1.jar:lib/ATCS_v0.3.3.jar:lib/prefuse.jar:lib/json_simple-1.1.jar:lib/jide-oss.jar:lib/ui.jar:lib/junit-4.10.jar:lib/rsyntaxtextarea.jar com.gpl.rpg.atcontentstudio.ATContentStudio \ No newline at end of file +java -Xmx512M -cp lib/AndorsTrainer_v0.1.2.jar:lib/ATCS_v0.4.0.jar:lib/prefuse.jar:lib/json_simple-1.1.jar:lib/jide-oss.jar:lib/ui.jar:lib/junit-4.10.jar:lib/rsyntaxtextarea.jar:lib/bsh-2.0b4.jar com.gpl.rpg.atcontentstudio.ATContentStudio diff --git a/packaging/Linux/ATCS/lib/.gitignore b/packaging/Linux/ATCS/lib/.gitignore index 9503d0f..0557829 100644 --- a/packaging/Linux/ATCS/lib/.gitignore +++ b/packaging/Linux/ATCS/lib/.gitignore @@ -1,8 +1 @@ -/AndorsTrainer_v0.1.1.jar -/ATCS_v0.3.3.jar -/jide-oss.jar -/json_simple-1.1.jar -/junit-4.10.jar -/prefuse.jar -/rsyntaxtextarea.jar -/ui.jar +/*.jar diff --git a/packaging/Windows/.gitignore b/packaging/Windows/.gitignore index f5bd428..66ec5e4 100644 --- a/packaging/Windows/.gitignore +++ b/packaging/Windows/.gitignore @@ -1,10 +1,4 @@ -/prefuse.jar -/rsyntaxtextarea.jar -/ui.jar -/jide-oss.jar -/json_simple-1.1.jar -/junit-4.10.jar +/*.jar /ATCS_v*_Setup.exe /ATCS_v*_Setup.exe.rename -/ATCS_v*.jar -/AndorsTrainer_v0.1.1.jar + diff --git a/packaging/Windows/ATCS.cmd b/packaging/Windows/ATCS.cmd index 1fec81e..66269eb 100644 --- a/packaging/Windows/ATCS.cmd +++ b/packaging/Windows/ATCS.cmd @@ -1 +1 @@ -start "" "D:\Programs\jdk1.6.0_24\\bin\javaw.exe" -Xmx512M -cp "lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\ATCS_v0.0.4.jar" com.gpl.rpg.atcontentstudio.ATContentStudio \ No newline at end of file +start "" "D:\Programs\jdk1.6.0_24\\bin\javaw.exe" -Xmx512M -cp "lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\ATCS_v0.0.4.jar;lib\AndorsTrainer_V0.1.2.jar" com.gpl.rpg.atcontentstudio.ATContentStudio \ No newline at end of file diff --git a/packaging/Windows/ATCS_Installer.nsi b/packaging/Windows/ATCS_Installer.nsi index e4ed0d5..f777242 100644 --- a/packaging/Windows/ATCS_Installer.nsi +++ b/packaging/Windows/ATCS_Installer.nsi @@ -1,6 +1,6 @@ !include MUI2.nsh -!define VERSION "0.3.3" +!define VERSION "0.4.0" !define JAVA_BIN "java" Name "Andor's Trail Content Studio v${VERSION}" @@ -57,18 +57,19 @@ Section install Call GetJRE Pop $R0 FileOpen $9 "ATCS.cmd" w - FileWrite $9 'start "" "$R0" -Xmx512M -cp "lib\AndorsTrainer_v0.1.1.jar;lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\ATCS_v${VERSION}.jar" com.gpl.rpg.atcontentstudio.ATContentStudio' + FileWrite $9 'start "" "$R0" -Xmx512M -cp "lib\AndorsTrainer_v0.1.1.jar;lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\bsh-2.0b4.jar;lib\ATCS_v${VERSION}.jar" com.gpl.rpg.atcontentstudio.ATContentStudio' FileClose $9 SetOutPath "$INSTDIR\lib\" file "jide-oss.jar" file "ui.jar" - file "AndorsTrainer_v0.1.1.jar" + file "AndorsTrainer_v0.1.2.jar" file "junit-4.10.jar" file "json_simple-1.1.jar" file "ATCS_v${VERSION}.jar" file "rsyntaxtextarea.jar" file "prefuse.jar" + file "bsh-2.0b4.jar" SetOutPath $INSTDIR @@ -92,7 +93,7 @@ Section uninstall Delete "$INSTDIR\lib\ui.jar" Delete "$INSTDIR\lib\junit-4.10.jar" Delete "$INSTDIR\lib\json_simple-1.1.jar" - Delete "$INSTDIR\lib\AndorsTrainer_v0.1.1.jar" + Delete "$INSTDIR\lib\AndorsTrainer_v0.1.2.jar" Delete "$INSTDIR\lib\ATCS_v${VERSION}.jar" Delete "$INSTDIR\lib\rsyntaxtextarea.jar" Delete "$INSTDIR\lib\prefuse.jar" @@ -145,4 +146,4 @@ Function GetJRE JreFound: Pop $R1 Exch $R0 -FunctionEnd \ No newline at end of file +FunctionEnd diff --git a/src/com/gpl/rpg/atcontentstudio/model/Project.java b/src/com/gpl/rpg/atcontentstudio/model/Project.java index 494ded4..73e04c2 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/Project.java +++ b/src/com/gpl/rpg/atcontentstudio/model/Project.java @@ -849,6 +849,11 @@ public class Project implements ProjectTreeNode, Serializable { } alreadyAdded = false; } + if (result.isEmpty()) { + //Fallback case. A single NPC does not declare a spawn group, but is referred by its ID in maps' spawn areas. + NPC npc = getNPC(spawngroup_id); + if (npc != null) result.add(npc); + } return result; } diff --git a/src/com/gpl/rpg/atcontentstudio/ui/tools/BeanShellView.java b/src/com/gpl/rpg/atcontentstudio/ui/tools/BeanShellView.java new file mode 100644 index 0000000..4984898 --- /dev/null +++ b/src/com/gpl/rpg/atcontentstudio/ui/tools/BeanShellView.java @@ -0,0 +1,139 @@ +package com.gpl.rpg.atcontentstudio.ui.tools; + +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.JTextArea; + +import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; +import org.fife.ui.rsyntaxtextarea.SyntaxConstants; + +import bsh.EvalError; +import bsh.Interpreter; + +import com.gpl.rpg.atcontentstudio.ui.DefaultIcons; +import com.jidesoft.swing.JideBoxLayout; + +public class BeanShellView extends JFrame { + + /** + * + */ + private static final long serialVersionUID = 8399265342746690313L; + + public BeanShellView() { + super("ATCS BeanShell script pad"); + setIconImage(DefaultIcons.getMainIconImage()); + JSplitPane splitter = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + + JPanel shPane = new JPanel(); + shPane.setLayout(new JideBoxLayout(shPane, JideBoxLayout.PAGE_AXIS)); + final RSyntaxTextArea shArea = new RSyntaxTextArea(30,80); + shArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); + shPane.add(new JScrollPane(shArea), JideBoxLayout.VARY); + + JPanel shButtonPane = new JPanel(); + shButtonPane.setLayout(new JideBoxLayout(shButtonPane, JideBoxLayout.LINE_AXIS)); + shButtonPane.add(new JPanel(), JideBoxLayout.VARY); + JButton run = new JButton("Run"); + shButtonPane.add(run, JideBoxLayout.FIX); + shPane.add(shButtonPane, JideBoxLayout.FIX); + splitter.setTopComponent(shPane); + + final RSyntaxTextArea outArea = new RSyntaxTextArea(20,40); + outArea.setEditable(false); + JPanel outPane = new JPanel(); + outPane.setLayout(new JideBoxLayout(outPane, JideBoxLayout.PAGE_AXIS)); + JPanel outButtonPane = new JPanel(); + outButtonPane.setLayout(new JideBoxLayout(outButtonPane, JideBoxLayout.LINE_AXIS)); + outButtonPane.add(new JLabel("Output"), JideBoxLayout.FIX); + outButtonPane.add(new JPanel(), JideBoxLayout.VARY); + JButton outClear = new JButton("Clear"); + outButtonPane.add(outClear, JideBoxLayout.FIX); + outPane.add(outButtonPane, JideBoxLayout.FIX); + outPane.add(new JScrollPane(outArea), JideBoxLayout.VARY); + + final RSyntaxTextArea errArea = new RSyntaxTextArea(20,40); + errArea.setEditable(false); + JPanel errPane = new JPanel(); + errPane.setLayout(new JideBoxLayout(errPane, JideBoxLayout.PAGE_AXIS)); + JPanel errButtonPane = new JPanel(); + errButtonPane.setLayout(new JideBoxLayout(errButtonPane, JideBoxLayout.LINE_AXIS)); + errButtonPane.add(new JLabel("Errors"), JideBoxLayout.FIX); + errButtonPane.add(new JPanel(), JideBoxLayout.VARY); + JButton errClear = new JButton("Clear"); + errButtonPane.add(errClear, JideBoxLayout.FIX); + errPane.add(errButtonPane, JideBoxLayout.FIX); + errPane.add(new JScrollPane(errArea), JideBoxLayout.VARY); + + + JSplitPane errOut = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + errOut.setLeftComponent(outPane); + errOut.setRightComponent(errPane); + splitter.setBottomComponent(errOut); + + run.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + Interpreter shInt = new Interpreter(); + PrintStream printOut = new PrintStream(new AreaOutputStream(outArea)); + shInt.setOut(printOut); + PrintStream printErr = new PrintStream(new AreaOutputStream(errArea)); + shInt.setErr(printErr); + + try { + shInt.eval(shArea.getText()); + } catch (EvalError e1) { + e1.printStackTrace(printErr); + } + } + }); + + outClear.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + outArea.setText(""); + } + }); + + errClear.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + errArea.setText(""); + } + }); + + + getContentPane().setLayout(new BorderLayout()); + getContentPane().add(splitter, BorderLayout.CENTER); + pack(); + setVisible(true); + } + + public static class AreaOutputStream extends OutputStream { + + private JTextArea textArea; + + public AreaOutputStream(JTextArea area) { + this.textArea = area; + } + + @Override + public void write(int b) throws IOException { + textArea.append(String.valueOf((char)b)); + textArea.setCaretPosition(textArea.getDocument().getLength()); + } + + } + +}