Patches in AT trainer. Added BeanShellView.

This commit is contained in:
Zukero
2015-08-10 17:37:47 +02:00
parent adf65b47db
commit e5747d2995
10 changed files with 156 additions and 24 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -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
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

View File

@@ -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
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

View File

@@ -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

View File

@@ -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

View File

@@ -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
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

View File

@@ -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
FunctionEnd

View File

@@ -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;
}

View File

@@ -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());
}
}
}