Compare commits

..

9 Commits

Author SHA1 Message Date
OMGeeky
5d5ca15669 sample 2024-01-10 19:16:12 +01:00
OMGeeky
4571bea429 fix missing " 2024-01-09 00:18:36 +01:00
OMGeeky
ecc9a35c69 Allow it to be ran on windows
(via Git-Bash)
2024-01-01 10:47:50 -08:00
OMGeeky
c4d71df4b1 Create a packaging script
This should create the zip file to distribute it
2023-12-31 14:06:31 +01:00
Nut.andor
a13dac467a Merge branch 'v0.6.20' 2023-12-26 00:43:43 +01:00
Nut.andor
e305dfd7bf new cats sprite 2023-12-26 00:35:59 +01:00
Nut.andor
80984a43af new Sprites (engine PR 59) 2023-10-03 21:20:32 +02:00
Nut.andor
2bc8b65264 version nbr 6.20
new requirements: date, dateEquals, time, timeEquals
new rewards: mapchange
2023-10-03 21:20:32 +02:00
Nut.andor
b2584a24cc export default 2023-09-24 00:25:29 +02:00
24 changed files with 286 additions and 68 deletions

4
.gitignore vendored
View File

@@ -1,3 +1,7 @@
/ATCS_v*.jar /ATCS_v*.jar
/Project /Project
/bin /bin
/packaging/tmp/
packaging/common/lib
packaging/common/ATCS.jar
packaging/ATCS_*.zip

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc> <jardesc>
<jar path="ATContentStudio/ATCS_v0.6.19.jar"/> <jar path="ATContentStudio/ATCS_v0.6.20.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/ATContentStudio/ATCS_JAR.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/> <options buildIfNeeded="true" compress="true" descriptionLocation="/ATContentStudio/ATCS_JAR.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/> <storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/> <selectedProjects/>

4
build-and-run.sh Executable file
View File

@@ -0,0 +1,4 @@
export MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio
export CP="lib/*:src:res:hacked-libtiled:siphash-zackehh/src/main/java/:."
javac -cp $CP ./src/com/gpl/rpg/atcontentstudio/ATContentStudio.java
java -cp $CP $MAIN_CLASS

2
packaging/Manifest.txt Normal file
View File

@@ -0,0 +1,2 @@
Manifest-Version: 1.0
Main-Class: com.gpl.rpg.atcontentstudio.ATContentStudio

View File

@@ -1,6 +1,6 @@
!include MUI2.nsh !include MUI2.nsh
!define VERSION "0.6.19" !define VERSION "0.6.20"
!define TRAINER_VERSION "0.1.5" !define TRAINER_VERSION "0.1.5"
!define JAVA_BIN "java" !define JAVA_BIN "java"
@@ -88,7 +88,7 @@ Section install
file "C:\AT\ATCS_source\lib\AndorsTrainer_v${TRAINER_VERSION}.jar" file "C:\AT\ATCS_source\lib\AndorsTrainer_v${TRAINER_VERSION}.jar"
file "C:\AT\ATCS_source\lib\junit-4.10.jar" file "C:\AT\ATCS_source\lib\junit-4.10.jar"
file "C:\AT\ATCS_source\lib\json_simple-1.1.jar" file "C:\AT\ATCS_source\lib\json_simple-1.1.jar"
file "C:\AT\temp\ATCS_v0.6.19\ATCS_v${VERSION}.jar" file "C:\AT\temp\ATCS_v0.6.20\ATCS_v${VERSION}.jar"
file "C:\AT\ATCS_source\lib\rsyntaxtextarea.jar" file "C:\AT\ATCS_source\lib\rsyntaxtextarea.jar"
file "C:\AT\ATCS_source\lib\prefuse.jar" file "C:\AT\ATCS_source\lib\prefuse.jar"
file "C:\AT\ATCS_source\lib\bsh-2.0b4.jar" file "C:\AT\ATCS_source\lib\bsh-2.0b4.jar"

18
packaging/common/ATCS.cmd Normal file
View File

@@ -0,0 +1,18 @@
@echo off
set "ATCS_DIR=%~dp0"
set "MAX_MEM=512M"
set "JAVA=javaw.exe"
set "JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true"
set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"
if exist "%ENV_FILE%" (
call "%ENV_FILE%"
) else (
echo REM set "MAX_MEM=%MAX_MEM%">"%ENV_FILE%"
echo REM set "JAVA=%JAVA%">>"%ENV_FILE%"
echo REM set "JAVA_OPTS=%JAVA_OPTS%">>"%ENV_FILE%"
echo.>>"%ENV_FILE%"
)
start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -jar "%ATCS_DIR%\ATCS.jar"

View File

@@ -0,0 +1,4 @@
#MAX_MEM=512M
#JAVA=java
#JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true

BIN
packaging/common/ATCS.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

21
packaging/common/ATCS.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
ATCS_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
MAX_MEM=512M
JAVA=java
JAVA_OPTS='-DFONT_SCALE=1.0 -Dswing.aatext=true'
ENV_FILE=${ATCS_DIR}/ATCS.env
if [ -f ${ENV_FILE} ]; then
source ${ENV_FILE}
else
echo "#MAX_MEM=${MAX_MEM}" >${ENV_FILE}
echo "#JAVA=${JAVA}" >>${ENV_FILE}
echo "#JAVA_OPTS=${JAVA_OPTS}" >>${ENV_FILE}
echo "" >>${ENV_FILE}
fi
export ENV_FILE
$JAVA ${JAVA_OPTS} -Xmx${MAX_MEM} -jar ${ATCS_DIR}/ATCS.jar

View File

@@ -0,0 +1 @@
sh ./package.sh -windows

84
packaging/package.sh Executable file
View File

@@ -0,0 +1,84 @@
#windows or linux
if [ "$1" = "-windows" ] ; then
echo "Got '-windows' flag. Running Windows version"
LINUX=false
else
echo "No '-windows' flag. Running linux version"
LINUX=true
fi
#read the folder this script should be in (should be the packaging folder inside the ATCS source)
PACKAGING_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}")
TEMP_DIR=${PACKAGING_DIR}/tmp
echo "Packaging dir: ${PACKAGING_DIR}"
echo "ATCS_SOURCE_DIR: ${ATCS_SOURCE_DIR}"
#ATContentStudio
JAR_LOCATION="${PACKAGING_DIR}/common/ATCS.jar"
MANIFEST_LOCATION=${PACKAGING_DIR}/Manifest.txt
echo ""
echo "Getting version"
VERSION=$(cat ${PACKAGING_DIR}/ATCS_latest)
echo "Got version ${VERSION}"
echo "Removing tmp folder"
rm -rf ${PACKAGING_DIR}/tmp/
echo "recreating tmp folder"
mkdir ${PACKAGING_DIR}/tmp/
#ATCS_SOURCE_DIR="${PACKAGING_DIR}/.."
echo ""
#copy manifest to temp folder for editing
cp ${MANIFEST_LOCATION} ${TEMP_DIR}
MANIFEST_LOCATION=${TEMP_DIR}/Manifest.txt
#copy lib files to packaged folder?
echo 'copying lib files'
mkdir -p ${PACKAGING_DIR}/common/lib/
cp ${ATCS_SOURCE_DIR}/lib/* ${PACKAGING_DIR}/common/lib/
cd $ATCS_SOURCE_DIR
#set ClassPath variable to use in the building etc.
echo 'setting class path'
#linux needs a : as seperator while windows needs ;
if [ "$LINUX" = true ] ; then
CP="lib/*:src:hacked-libtiled:siphash-zackehh/src/main/java"
else
CP="lib/*;src;hacked-libtiled;siphash-zackehh/src/main/java"
fi
echo "ClassPath: "
echo ${CP}
echo ""
#set build the classes
echo 'building java classes'
#javac -cp $CP *.java
javac -cp $CP ${ATCS_SOURCE_DIR}/src/com/gpl/rpg/atcontentstudio/*.java -d ${TEMP_DIR}
echo javac -cp $CP ${ATCS_SOURCE_DIR}/src/com/gpl/rpg/atcontentstudio/*.java -d ${TEMP_DIR}
echo ""
LIB_PATHS=$(find lib -name '*.jar' | paste -sd' ')
echo "LIB_PATHS: ${LIB_PATHS}"
# add all lib files to the class path in the temp Manifest
echo "Class-Path: . lib/* ${LIB_PATHS}" >>${MANIFEST_LOCATION}
echo ""
echo "creating jar at location: ${JAR_LOCATION}"
# create the jar file
# the command with those parameters requires this format:
# jar vmfc <Manifest file> <Jar file (target location)> <all things to add to the jar file>
# the things to add always use the whole relative path from the current dir,
# so when that is not wanted, the -C <location> thing will change to that dir
jar mfc ${MANIFEST_LOCATION} ${JAR_LOCATION} -C ${PACKAGING_DIR}/tmp/ com/gpl/rpg/atcontentstudio/ -C res . -C ${ATCS_SOURCE_DIR}/src .
echo ''
echo "Done creating jar"
if [ "$LINUX" = true ] ; then
cd ${PACKAGING_DIR}
echo "Creating archive"
tar caf "ATCS_${VERSION}.tar.gz" "common"
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.tar.gz"
else
echo "Can't create zip files on windows yet. Please pack the content of the '${PACKAGING_DIR}/common/' folder yourself"
fi

View File

@@ -30,6 +30,7 @@ atcs.spritesheet.items_misc_4.category=item
atcs.spritesheet.items_misc_5.category=item atcs.spritesheet.items_misc_5.category=item
atcs.spritesheet.items_misc_6.category=item atcs.spritesheet.items_misc_6.category=item
atcs.spritesheet.items_necklaces_1.category=item atcs.spritesheet.items_necklaces_1.category=item
atcs.spritesheet.items_newb.category=item
atcs.spritesheet.items_omgeeky.category=item atcs.spritesheet.items_omgeeky.category=item
atcs.spritesheet.items_omi2.category=item atcs.spritesheet.items_omi2.category=item
atcs.spritesheet.items_phoenix01.category=item atcs.spritesheet.items_phoenix01.category=item
@@ -46,6 +47,7 @@ atcs.spritesheet.items_weapons_3.category=item
atcs.spritesheet.monsters_armor1.category=monster atcs.spritesheet.monsters_armor1.category=monster
atcs.spritesheet.monsters_arulirs.category=monster atcs.spritesheet.monsters_arulirs.category=monster
atcs.spritesheet.monsters_cats.category=monster
atcs.spritesheet.monsters_dogs.category=monster atcs.spritesheet.monsters_dogs.category=monster
atcs.spritesheet.monsters_eye1.category=monster atcs.spritesheet.monsters_eye1.category=monster
atcs.spritesheet.monsters_eye2.category=monster atcs.spritesheet.monsters_eye2.category=monster
@@ -70,6 +72,7 @@ atcs.spritesheet.monsters_man1.category=monster
atcs.spritesheet.monsters_men.category=monster atcs.spritesheet.monsters_men.category=monster
atcs.spritesheet.monsters_men2.category=monster atcs.spritesheet.monsters_men2.category=monster
atcs.spritesheet.monsters_misc.category=monster atcs.spritesheet.monsters_misc.category=monster
atcs.spritesheet.monsters_newb_1.category=monster
atcs.spritesheet.monsters_omi1.category=monster atcs.spritesheet.monsters_omi1.category=monster
atcs.spritesheet.monsters_omi1_b.category=monster atcs.spritesheet.monsters_omi1_b.category=monster
atcs.spritesheet.monsters_omi2.category=monster atcs.spritesheet.monsters_omi2.category=monster
@@ -118,3 +121,12 @@ atcs.spritesheet.monsters_giantbasilisk.sizey=64
atcs.spritesheet.monsters_hydra1.category=monster atcs.spritesheet.monsters_hydra1.category=monster
atcs.spritesheet.monsters_hydra1.sizex=64 atcs.spritesheet.monsters_hydra1.sizex=64
atcs.spritesheet.monsters_hydra1.sizey=64 atcs.spritesheet.monsters_hydra1.sizey=64
atcs.spritesheet.monsters_newb_2.category=monster
atcs.spritesheet.monsters_newb_2.sizex=64
atcs.spritesheet.monsters_newb_2.sizey=32
atcs.spritesheet.monsters_newb_3.category=monster
atcs.spritesheet.monsters_newb_3.sizex=64
atcs.spritesheet.monsters_newb_3.sizey=64
atcs.spritesheet.monsters_newb_4.category=monster
atcs.spritesheet.monsters_newb_4.sizex=32
atcs.spritesheet.monsters_newb_4.sizey=64

View File

@@ -39,24 +39,24 @@ import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
import com.gpl.rpg.atcontentstudio.ui.WorkerDialog; import com.gpl.rpg.atcontentstudio.ui.WorkerDialog;
import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector; import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
public class ATContentStudio { public class ATContentStudio {
public static final String APP_NAME = "Andor's Trail Content Studio"; public static final String APP_NAME = "Andor's Trail Content Studio";
public static final String APP_VERSION = "v0.6.19"; public static final String APP_VERSION = "v0.6.20";
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest"; public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806"; public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE"; public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
public static boolean STARTED = false; public static boolean STARTED = false;
public static float SCALING=1.0f; public static float SCALING = 1.0f;
public static StudioFrame frame = null; public static StudioFrame frame = null;
//Need to keep a strong reference to it, to avoid garbage collection that'll reset these loggers. // Need to keep a strong reference to it, to avoid garbage collection that'll
// reset these loggers.
public static final List<Logger> configuredLoggers = new LinkedList<Logger>(); public static final List<Logger> configuredLoggers = new LinkedList<Logger>();
/** /**
* @param args * @param args
*/ */
@@ -66,18 +66,19 @@ public class ATContentStudio {
if (fontScaling != null) { if (fontScaling != null) {
try { try {
fontScale = Float.parseFloat(fontScaling); fontScale = Float.parseFloat(fontScaling);
SCALING=fontScale; SCALING = fontScale;
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
System.err.println("Failed to parse font scaling parameter. Using default."); System.err.println("Failed to parse font scaling parameter. Using default.");
e.printStackTrace(); e.printStackTrace();
} }
} }
ConfigCache.init(); ConfigCache.init();
try { try {
String laf = ConfigCache.getFavoriteLaFClassName(); String laf = ConfigCache.getFavoriteLaFClassName();
if (laf == null) laf = UIManager.getSystemLookAndFeelClassName(); if (laf == null)
laf = UIManager.getSystemLookAndFeelClassName();
UIManager.setLookAndFeel(laf); UIManager.setLookAndFeel(laf);
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
@@ -88,37 +89,40 @@ public class ATContentStudio {
} catch (UnsupportedLookAndFeelException e) { } catch (UnsupportedLookAndFeelException e) {
e.printStackTrace(); e.printStackTrace();
} }
scaleUIFont(); scaleUIFont();
//Need to keep a strong reference to it, to avoid garbage collection that'll reset this setting. // Need to keep a strong reference to it, to avoid garbage collection that'll
// reset this setting.
Logger l = Logger.getLogger(ExpressionParser.class.getName()); Logger l = Logger.getLogger(ExpressionParser.class.getName());
l.setLevel(Level.OFF); l.setLevel(Level.OFF);
configuredLoggers.add(l); configuredLoggers.add(l);
final WorkspaceSelector wsSelect = new WorkspaceSelector(); final WorkspaceSelector wsSelect = new WorkspaceSelector();
wsSelect.pack(); wsSelect.pack();
Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize(); Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
Dimension wdim = wsSelect.getSize(); Dimension wdim = wsSelect.getSize();
wsSelect.setLocation((sdim.width - wdim.width)/2, (sdim.height - wdim.height)/2); wsSelect.setLocation((sdim.width - wdim.width) / 2, (sdim.height - wdim.height) / 2);
wsSelect.setVisible(true); wsSelect.setVisible(true);
wsSelect.addWindowListener(new WindowAdapter() { wsSelect.addWindowListener(new WindowAdapter() {
@Override @Override
public synchronized void windowClosed(WindowEvent e) { public synchronized void windowClosed(WindowEvent e) {
if (wsSelect.selected != null && !STARTED) { if (wsSelect.selected != null && !STARTED) {
ATContentStudio.STARTED = true; ATContentStudio.STARTED = true;
final File workspaceRoot = new File(wsSelect.selected); final File workspaceRoot = new File(wsSelect.selected);
WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable(){ WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable() {
public void run() { public void run() {
Workspace.setActive(workspaceRoot); Workspace.setActive(workspaceRoot);
if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue() && Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) { if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue()
&& Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
new Thread() { new Thread() {
public void run() {checkUpdate();} public void run() {
checkUpdate();
}
}.start(); }.start();
} }
frame = new StudioFrame(APP_NAME+" "+APP_VERSION); frame = new StudioFrame(APP_NAME + " " + APP_VERSION);
frame.setVisible(true); frame.setVisible(true);
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE); frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
}; };
@@ -138,7 +142,7 @@ public class ATContentStudio {
} }
}); });
} }
private static void checkUpdate() { private static void checkUpdate() {
BufferedReader in = null; BufferedReader in = null;
try { try {
@@ -146,32 +150,34 @@ public class ATContentStudio {
in = new BufferedReader(new InputStreamReader(url.openStream())); in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine, lastLine = null; String inputLine, lastLine = null;
while ((inputLine = in.readLine()) != null) {lastLine = inputLine;} while ((inputLine = in.readLine()) != null) {
lastLine = inputLine;
}
if (lastLine != null && !lastLine.equals(APP_VERSION)) { if (lastLine != null && !lastLine.equals(APP_VERSION)) {
// for copying style
JLabel label = new JLabel();
Font font = label.getFont();
Color color = label.getBackground();
// create some css from the label's font // for copying style
StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";"); JLabel label = new JLabel();
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";"); Font font = label.getFont();
style.append("font-size:" + font.getSize() + "pt;"); Color color = label.getBackground();
style.append("background-color: rgb("+color.getRed()+","+color.getGreen()+","+color.getBlue()+");");
// create some css from the label's font
JEditorPane ep = new JEditorPane("text/html", "<html><body style=\"" + style + "\">" StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
+ "You are not running the latest ATCS version.<br/>" style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
+ "You can get the latest version ("+lastLine+") by clicking the link below.<br/>" style.append("font-size:" + font.getSize() + "pt;");
+ "<a href=\""+DOWNLOAD_URL+"\">"+DOWNLOAD_URL+"</a><br/>" style.append("background-color: rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
+ "<br/>" + ");");
+ "</body></html>");
JEditorPane ep = new JEditorPane("text/html",
"<html><body style=\"" + style + "\">" + "You are not running the latest ATCS version.<br/>"
+ "You can get the latest version (" + lastLine + ") by clicking the link below.<br/>"
+ "<a href=\"" + DOWNLOAD_URL + "\">" + DOWNLOAD_URL + "</a><br/>" + "<br/>"
+ "</body></html>");
ep.setEditable(false); ep.setEditable(false);
ep.setBorder(null); ep.setBorder(null);
ep.addHyperlinkListener(new HyperlinkListener() { ep.addHyperlinkListener(new HyperlinkListener() {
@Override @Override
public void hyperlinkUpdate(HyperlinkEvent e) { public void hyperlinkUpdate(HyperlinkEvent e) {
try { try {
@@ -185,7 +191,7 @@ public class ATContentStudio {
} }
} }
}); });
JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE);
} }
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
@@ -194,16 +200,17 @@ public class ATContentStudio {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
try { try {
if (in != null) in.close(); if (in != null)
in.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
public static void scaleUIFont() { public static void scaleUIFont() {
if (SCALING != 1.0f) { if (SCALING != 1.0f) {
System.out.println("Scaling fonts to "+SCALING); System.out.println("Scaling fonts to " + SCALING);
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); UIDefaults defaults = UIManager.getLookAndFeelDefaults();
Map<Object, Object> newDefaults = new HashMap<Object, Object>(); Map<Object, Object> newDefaults = new HashMap<Object, Object>();
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) { for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
@@ -211,7 +218,7 @@ public class ATContentStudio {
Object value = defaults.get(key); Object value = defaults.get(key);
if (value instanceof Font) { if (value instanceof Font) {
Font font = (Font) value; Font font = (Font) value;
int newSize = (int)(font.getSize() * SCALING); int newSize = (int) (font.getSize() * SCALING);
if (value instanceof FontUIResource) { if (value instanceof FontUIResource) {
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize)); newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
} else { } else {

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

View File

@@ -29,8 +29,7 @@ public class ActorCondition extends JSONElement {
//public String id; inherited. //public String id; inherited.
public String icon_id; public String icon_id;
public String display_name; public String display_name;
public String description;
// Available from parsed state // Available from parsed state
public ACCategory category = null; public ACCategory category = null;
public Integer positive = null; public Integer positive = null;
@@ -158,7 +157,6 @@ public class ActorCondition extends JSONElement {
@Override @Override
public void parse(Map aCondJson) { public void parse(Map aCondJson) {
if (aCondJson.get("description") != null) this.description = (String) aCondJson.get("description");
if (aCondJson.get("category") != null) this.category = ACCategory.valueOf((String) aCondJson.get("category")); if (aCondJson.get("category") != null) this.category = ACCategory.valueOf((String) aCondJson.get("category"));
this.positive = JSONElement.getInteger((Number) aCondJson.get("isPositive")); this.positive = JSONElement.getInteger((Number) aCondJson.get("isPositive"));
Map abilityEffect = (Map) aCondJson.get("abilityEffect"); Map abilityEffect = (Map) aCondJson.get("abilityEffect");
@@ -268,7 +266,6 @@ public class ActorCondition extends JSONElement {
clone.state = this.state; clone.state = this.state;
clone.id = this.id; clone.id = this.id;
clone.display_name = this.display_name; clone.display_name = this.display_name;
clone.description = this.description;
clone.icon_id = this.icon_id; clone.icon_id = this.icon_id;
clone.category = this.category; clone.category = this.category;
clone.positive = this.positive; clone.positive = this.positive;
@@ -297,7 +294,6 @@ public class ActorCondition extends JSONElement {
jsonAC.put("id", this.id); jsonAC.put("id", this.id);
if (this.icon_id != null) jsonAC.put("iconID", this.icon_id); if (this.icon_id != null) jsonAC.put("iconID", this.icon_id);
if (this.display_name != null) jsonAC.put("name", this.display_name); if (this.display_name != null) jsonAC.put("name", this.display_name);
if (this.description != null) jsonAC.put("description", this.description);
if (this.category != null) jsonAC.put("category", this.category.toString()); if (this.category != null) jsonAC.put("category", this.category.toString());
if (this.positive != null && this.positive == 1) jsonAC.put("isPositive", this.positive); if (this.positive != null && this.positive == 1) jsonAC.put("isPositive", this.positive);
if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking); if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking);

View File

@@ -68,7 +68,8 @@ public class Dialogue extends JSONElement {
deactivateSpawnArea, deactivateSpawnArea,
activateMapObjectGroup, activateMapObjectGroup,
deactivateMapObjectGroup, deactivateMapObjectGroup,
changeMapFilter changeMapFilter,
mapchange
} }
} }
@@ -249,6 +250,7 @@ public class Dialogue extends JSONElement {
case removeSpawnArea: case removeSpawnArea:
case deactivateSpawnArea: case deactivateSpawnArea:
case changeMapFilter: case changeMapFilter:
case mapchange:
reward.map = reward.map_name != null ? proj.getMap(reward.map_name) : null; reward.map = reward.map_name != null ? proj.getMap(reward.map_name) : null;
break; break;
case actorCondition: case actorCondition:

View File

@@ -60,7 +60,11 @@ public class Requirement extends JSONElement {
factionScore, factionScore,
random, random,
factionScoreEquals, factionScoreEquals,
wearRemove wearRemove,
date,
dateEquals,
time,
timeEquals
} }
public enum SkillID { public enum SkillID {
@@ -196,6 +200,10 @@ public class Requirement extends JSONElement {
case factionScore: case factionScore:
case factionScoreEquals: case factionScoreEquals:
case random: case random:
case date:
case dateEquals:
case time:
case timeEquals:
break; break;
} }
if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent); if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent);

View File

@@ -28,7 +28,6 @@ public class PotGenerator {
for (ActorCondition ac : gsrc.gameData.actorConditions) { for (ActorCondition ac : gsrc.gameData.actorConditions) {
pushString(stringsResources, resourcesStrings, ac.display_name, getPotContextComment(ac)); pushString(stringsResources, resourcesStrings, ac.display_name, getPotContextComment(ac));
pushString(stringsResources, resourcesStrings, ac.description, getPotContextComment(ac)+":description");
} }
for (Dialogue d : gsrc.gameData.dialogues ) { for (Dialogue d : gsrc.gameData.dialogues ) {

View File

@@ -260,6 +260,14 @@ public class DefaultIcons {
public static Image getTimerImage() { return getImage(TIMER_RES); } public static Image getTimerImage() { return getImage(TIMER_RES); }
public static Image getTimerIcon() { return getIcon(TIMER_RES); } public static Image getTimerIcon() { return getIcon(TIMER_RES); }
private static String DATE_RES = "/com/gpl/rpg/atcontentstudio/img/date.png";
public static Image getDateImage() { return getImage(DATE_RES); }
public static Image getDateIcon() { return getIcon(DATE_RES); }
private static String TIME_RES = "/com/gpl/rpg/atcontentstudio/img/date.png";
public static Image getTimeImage() { return getImage(TIME_RES); }
public static Image getTimeIcon() { return getIcon(TIME_RES); }
private static String ALIGNMENT_RES = "/com/gpl/rpg/atcontentstudio/img/alignment.png"; private static String ALIGNMENT_RES = "/com/gpl/rpg/atcontentstudio/img/alignment.png";
public static Image getAlignmentImage() { return getImage(ALIGNMENT_RES); } public static Image getAlignmentImage() { return getImage(ALIGNMENT_RES); }
public static Image getAlignmentIcon() { return getIcon(ALIGNMENT_RES); } public static Image getAlignmentIcon() { return getIcon(ALIGNMENT_RES); }
@@ -273,7 +281,7 @@ public class DefaultIcons {
public static Image getStatusOrangeIcon() { return getIcon(STATUS_ORANGE_RES); } public static Image getStatusOrangeIcon() { return getIcon(STATUS_ORANGE_RES); }
private static String STATUS_GREEN_RES = "/com/gpl/rpg/atcontentstudio/img/status_green.png"; private static String STATUS_GREEN_RES = "/com/gpl/rpg/atcontentstudio/img/status_green.png";
public static Image getStatusGreenImage() { return getImage(STATUS_GREEN_RES); } public static Image getStatusGreenImage() { return getImage(STATUS_GREEN_RES); }
public static Image getStatusGreenIcon() { return getIcon(STATUS_GREEN_RES); } public static Image getStatusGreenIcon() { return getIcon(STATUS_GREEN_RES); }
private static String STATUS_BLUE_RES = "/com/gpl/rpg/atcontentstudio/img/status_blue.png"; private static String STATUS_BLUE_RES = "/com/gpl/rpg/atcontentstudio/img/status_blue.png";

View File

@@ -57,7 +57,7 @@ public class ExportProjectWizard extends JDialog {
radioGroup.add(asZip); radioGroup.add(asZip);
overSources = new JRadioButton("... into a game source folder"); overSources = new JRadioButton("... into a game source folder");
radioGroup.add(overSources); radioGroup.add(overSources);
asZip.setSelected(true); overSources.setSelected(true);
pane.add(asZip, JideBoxLayout.FIX); pane.add(asZip, JideBoxLayout.FIX);
pane.add(overSources, JideBoxLayout.FIX); pane.add(overSources, JideBoxLayout.FIX);

View File

@@ -30,7 +30,6 @@ public class ActorConditionEditor extends JSONElementEditor {
private JButton acIcon; private JButton acIcon;
private JTextField idField; private JTextField idField;
private JTextField nameField; private JTextField nameField;
private JTextField descriptionField;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
private JComboBox categoryBox; private JComboBox categoryBox;
private IntegerBasedCheckBox positiveBox; private IntegerBasedCheckBox positiveBox;
@@ -82,7 +81,6 @@ public class ActorConditionEditor extends JSONElementEditor {
idField = addTextField(pane, "Internal ID: ", ac.id, ac.writable, listener); idField = addTextField(pane, "Internal ID: ", ac.id, ac.writable, listener);
nameField = addTranslatableTextField(pane, "Display name: ", ac.display_name, ac.writable, listener); nameField = addTranslatableTextField(pane, "Display name: ", ac.display_name, ac.writable, listener);
descriptionField = addTranslatableTextField(pane, "Description: ", ac.description, ac.writable, listener);
categoryBox = addEnumValueBox(pane, "Category: ", ActorCondition.ACCategory.values(), ac.category, ac.writable, listener); categoryBox = addEnumValueBox(pane, "Category: ", ActorCondition.ACCategory.values(), ac.category, ac.writable, listener);
positiveBox = addIntegerBasedCheckBox(pane, "Positive", ac.positive, ac.writable, listener); positiveBox = addIntegerBasedCheckBox(pane, "Positive", ac.positive, ac.writable, listener);
stackingBox = addIntegerBasedCheckBox(pane, "Stacking", ac.stacking, ac.writable, listener); stackingBox = addIntegerBasedCheckBox(pane, "Stacking", ac.stacking, ac.writable, listener);
@@ -174,10 +172,6 @@ public class ActorConditionEditor extends JSONElementEditor {
ActorConditionEditor.this.name = aCond.getDesc(); ActorConditionEditor.this.name = aCond.getDesc();
aCond.childrenChanged(new ArrayList<ProjectTreeNode>()); aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
ATContentStudio.frame.editorChanged(ActorConditionEditor.this); ATContentStudio.frame.editorChanged(ActorConditionEditor.this);
}else if (source == descriptionField) {
aCond.description = (String) value;
aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
ATContentStudio.frame.editorChanged(ActorConditionEditor.this);
} else if (source == acIcon) { } else if (source == acIcon) {
aCond.icon_id = (String) value; aCond.icon_id = (String) value;
aCond.childrenChanged(new ArrayList<ProjectTreeNode>()); aCond.childrenChanged(new ArrayList<ProjectTreeNode>());

View File

@@ -384,6 +384,13 @@ public class DialogueEditor extends JSONElementEditor {
rewardObj = null; rewardObj = null;
rewardValue = null; rewardValue = null;
break; break;
case mapchange:
rewardMap = addMapBox(pane, ((Dialogue)target).getProject(), "Map Name: ", reward.map, writable, listener);
rewardObjId = addTextField(pane, "Place: ", reward.reward_obj_id, writable, listener);
rewardObjIdCombo = null;
rewardObj = null;
rewardValue = null;
break;
case deactivateSpawnArea: case deactivateSpawnArea:
case removeSpawnArea: case removeSpawnArea:
case spawnAll: case spawnAll:
@@ -777,6 +784,26 @@ public class DialogueEditor extends JSONElementEditor {
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener); requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener); requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener);
break; break;
case date:
requirementObj = null;
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Minimum date value: ", requirement.required_value, true, writable, listener);
break;
case dateEquals:
requirementObj = null;
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Exact date value: ", requirement.required_value, true, writable, listener);
break;
case time:
requirementObj = null;
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Minimum time value: ", requirement.required_value, true, writable, listener);
break;
case timeEquals:
requirementObj = null;
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
break;
} }
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener); requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
} }
@@ -943,6 +970,10 @@ public class DialogueEditor extends JSONElementEditor {
label.setText("Change map filter to "+rewardObjDesc+" on map "+reward.map_name); label.setText("Change map filter to "+rewardObjDesc+" on map "+reward.map_name);
label.setIcon(new ImageIcon(DefaultIcons.getReplaceIcon())); label.setIcon(new ImageIcon(DefaultIcons.getReplaceIcon()));
break; break;
case mapchange:
label.setText("Teleport to "+rewardObjDesc+" on map "+reward.map_name);
label.setIcon(new ImageIcon(DefaultIcons.getMapchangeIcon()));
break;
} }
} else { } else {
label.setText("New, undefined reward"); label.setText("New, undefined reward");
@@ -1178,6 +1209,9 @@ public class DialogueEditor extends JSONElementEditor {
label.setIcon(new ImageIcon(DefaultIcons.getTimerIcon())); label.setIcon(new ImageIcon(DefaultIcons.getTimerIcon()));
} else if (req.type == Requirement.RequirementType.factionScore || req.type == Requirement.RequirementType.factionScoreEquals) { } else if (req.type == Requirement.RequirementType.factionScore || req.type == Requirement.RequirementType.factionScoreEquals) {
label.setIcon(new ImageIcon(DefaultIcons.getAlignmentIcon())); label.setIcon(new ImageIcon(DefaultIcons.getAlignmentIcon()));
} else if (req.type == Requirement.RequirementType.date || req.type == Requirement.RequirementType.dateEquals ||
req.type == Requirement.RequirementType.time || req.type == Requirement.RequirementType.timeEquals) {
label.setIcon(new ImageIcon(DefaultIcons.getDateIcon()));
} }
if (req.type == null) { if (req.type == null) {
label.setText("New, undefined requirement."); label.setText("New, undefined requirement.");

View File

@@ -731,6 +731,26 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener); requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener); requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener);
break; break;
case date:
requirementObj = null;
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Minimum date value: ", requirement.required_value, true, writable, listener);
break;
case dateEquals:
requirementObj = null;
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Exact date value: ", requirement.required_value, true, writable, listener);
break;
case time:
requirementObj = null;
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Minimum time value: ", requirement.required_value, true, writable, listener);
break;
case timeEquals:
requirementObj = null;
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
break;
} }
} }
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener); requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);