mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-27 14:58:55 +01:00
Compare commits
1 Commits
misc-error
...
actor-cond
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38a3ad85c8 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,7 +1,3 @@
|
||||
/ATCS_v*.jar
|
||||
/Project
|
||||
/bin
|
||||
/packaging/tmp/
|
||||
packaging/common/lib
|
||||
packaging/common/ATCS.jar
|
||||
packaging/ATCS_*.zip
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<jardesc>
|
||||
<jar path="ATContentStudio/ATCS_v0.6.20.jar"/>
|
||||
<jar path="ATContentStudio/ATCS_v0.6.19.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"/>
|
||||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
||||
<selectedProjects/>
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||
@@ -1,6 +1,6 @@
|
||||
!include MUI2.nsh
|
||||
|
||||
!define VERSION "0.6.20"
|
||||
!define VERSION "0.6.19"
|
||||
!define TRAINER_VERSION "0.1.5"
|
||||
!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\junit-4.10.jar"
|
||||
file "C:\AT\ATCS_source\lib\json_simple-1.1.jar"
|
||||
file "C:\AT\temp\ATCS_v0.6.20\ATCS_v${VERSION}.jar"
|
||||
file "C:\AT\temp\ATCS_v0.6.19\ATCS_v${VERSION}.jar"
|
||||
file "C:\AT\ATCS_source\lib\rsyntaxtextarea.jar"
|
||||
file "C:\AT\ATCS_source\lib\prefuse.jar"
|
||||
file "C:\AT\ATCS_source\lib\bsh-2.0b4.jar"
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
@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"
|
||||
@@ -1,4 +0,0 @@
|
||||
#MAX_MEM=512M
|
||||
#JAVA=java
|
||||
#JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
@@ -1,21 +0,0 @@
|
||||
#!/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
|
||||
@@ -1 +0,0 @@
|
||||
sh ./package.sh -windows
|
||||
@@ -1,84 +0,0 @@
|
||||
#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
|
||||
@@ -30,7 +30,6 @@ atcs.spritesheet.items_misc_4.category=item
|
||||
atcs.spritesheet.items_misc_5.category=item
|
||||
atcs.spritesheet.items_misc_6.category=item
|
||||
atcs.spritesheet.items_necklaces_1.category=item
|
||||
atcs.spritesheet.items_newb.category=item
|
||||
atcs.spritesheet.items_omgeeky.category=item
|
||||
atcs.spritesheet.items_omi2.category=item
|
||||
atcs.spritesheet.items_phoenix01.category=item
|
||||
@@ -47,7 +46,6 @@ atcs.spritesheet.items_weapons_3.category=item
|
||||
atcs.spritesheet.monsters_armor1.category=monster
|
||||
atcs.spritesheet.monsters_arulirs.category=monster
|
||||
|
||||
atcs.spritesheet.monsters_cats.category=monster
|
||||
atcs.spritesheet.monsters_dogs.category=monster
|
||||
atcs.spritesheet.monsters_eye1.category=monster
|
||||
atcs.spritesheet.monsters_eye2.category=monster
|
||||
@@ -72,7 +70,6 @@ atcs.spritesheet.monsters_man1.category=monster
|
||||
atcs.spritesheet.monsters_men.category=monster
|
||||
atcs.spritesheet.monsters_men2.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_b.category=monster
|
||||
atcs.spritesheet.monsters_omi2.category=monster
|
||||
@@ -121,12 +118,3 @@ atcs.spritesheet.monsters_giantbasilisk.sizey=64
|
||||
atcs.spritesheet.monsters_hydra1.category=monster
|
||||
atcs.spritesheet.monsters_hydra1.sizex=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
|
||||
|
||||
@@ -39,24 +39,24 @@ import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
|
||||
import com.gpl.rpg.atcontentstudio.ui.WorkerDialog;
|
||||
import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
|
||||
|
||||
|
||||
public class ATContentStudio {
|
||||
|
||||
public static final String APP_NAME = "Andor's Trail Content Studio";
|
||||
public static final String APP_VERSION = "v0.6.20";
|
||||
|
||||
public static final String APP_VERSION = "v0.6.19";
|
||||
|
||||
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 FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
|
||||
|
||||
public static boolean STARTED = false;
|
||||
public static float SCALING = 1.0f;
|
||||
public static float SCALING=1.0f;
|
||||
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>();
|
||||
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
@@ -66,19 +66,18 @@ public class ATContentStudio {
|
||||
if (fontScaling != null) {
|
||||
try {
|
||||
fontScale = Float.parseFloat(fontScaling);
|
||||
SCALING = fontScale;
|
||||
SCALING=fontScale;
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("Failed to parse font scaling parameter. Using default.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ConfigCache.init();
|
||||
|
||||
|
||||
try {
|
||||
String laf = ConfigCache.getFavoriteLaFClassName();
|
||||
if (laf == null)
|
||||
laf = UIManager.getSystemLookAndFeelClassName();
|
||||
if (laf == null) laf = UIManager.getSystemLookAndFeelClassName();
|
||||
UIManager.setLookAndFeel(laf);
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
@@ -89,40 +88,37 @@ public class ATContentStudio {
|
||||
} catch (UnsupportedLookAndFeelException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
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());
|
||||
l.setLevel(Level.OFF);
|
||||
configuredLoggers.add(l);
|
||||
|
||||
configuredLoggers.add(l);
|
||||
|
||||
final WorkspaceSelector wsSelect = new WorkspaceSelector();
|
||||
wsSelect.pack();
|
||||
Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
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.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public synchronized void windowClosed(WindowEvent e) {
|
||||
if (wsSelect.selected != null && !STARTED) {
|
||||
ATContentStudio.STARTED = true;
|
||||
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() {
|
||||
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() {
|
||||
public void run() {
|
||||
checkUpdate();
|
||||
}
|
||||
public void run() {checkUpdate();}
|
||||
}.start();
|
||||
}
|
||||
frame = new StudioFrame(APP_NAME + " " + APP_VERSION);
|
||||
frame = new StudioFrame(APP_NAME+" "+APP_VERSION);
|
||||
frame.setVisible(true);
|
||||
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
|
||||
};
|
||||
@@ -142,7 +138,7 @@ public class ATContentStudio {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private static void checkUpdate() {
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
@@ -150,34 +146,32 @@ public class ATContentStudio {
|
||||
in = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||
|
||||
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)) {
|
||||
|
||||
|
||||
// for copying style
|
||||
JLabel label = new JLabel();
|
||||
Font font = label.getFont();
|
||||
Color color = label.getBackground();
|
||||
|
||||
// create some css from the label's font
|
||||
StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
|
||||
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
|
||||
style.append("font-size:" + font.getSize() + "pt;");
|
||||
style.append("background-color: rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
|
||||
+ ");");
|
||||
|
||||
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>");
|
||||
JLabel label = new JLabel();
|
||||
Font font = label.getFont();
|
||||
Color color = label.getBackground();
|
||||
|
||||
// create some css from the label's font
|
||||
StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
|
||||
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
|
||||
style.append("font-size:" + font.getSize() + "pt;");
|
||||
style.append("background-color: rgb("+color.getRed()+","+color.getGreen()+","+color.getBlue()+");");
|
||||
|
||||
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.setBorder(null);
|
||||
|
||||
|
||||
ep.addHyperlinkListener(new HyperlinkListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void hyperlinkUpdate(HyperlinkEvent e) {
|
||||
try {
|
||||
@@ -191,7 +185,7 @@ public class ATContentStudio {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
@@ -200,17 +194,16 @@ public class ATContentStudio {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (in != null)
|
||||
in.close();
|
||||
if (in != null) in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void scaleUIFont() {
|
||||
if (SCALING != 1.0f) {
|
||||
System.out.println("Scaling fonts to " + SCALING);
|
||||
System.out.println("Scaling fonts to "+SCALING);
|
||||
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
|
||||
Map<Object, Object> newDefaults = new HashMap<Object, Object>();
|
||||
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
|
||||
@@ -218,7 +211,7 @@ public class ATContentStudio {
|
||||
Object value = defaults.get(key);
|
||||
if (value instanceof Font) {
|
||||
Font font = (Font) value;
|
||||
int newSize = (int) (font.getSize() * SCALING);
|
||||
int newSize = (int)(font.getSize() * SCALING);
|
||||
if (value instanceof FontUIResource) {
|
||||
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
|
||||
} else {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 275 B |
Binary file not shown.
|
Before Width: | Height: | Size: 703 B |
@@ -29,7 +29,8 @@ public class ActorCondition extends JSONElement {
|
||||
//public String id; inherited.
|
||||
public String icon_id;
|
||||
public String display_name;
|
||||
|
||||
public String description;
|
||||
|
||||
// Available from parsed state
|
||||
public ACCategory category = null;
|
||||
public Integer positive = null;
|
||||
@@ -157,6 +158,7 @@ public class ActorCondition extends JSONElement {
|
||||
@Override
|
||||
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"));
|
||||
this.positive = JSONElement.getInteger((Number) aCondJson.get("isPositive"));
|
||||
Map abilityEffect = (Map) aCondJson.get("abilityEffect");
|
||||
@@ -236,12 +238,7 @@ public class ActorCondition extends JSONElement {
|
||||
if (this.icon_id != null) {
|
||||
String spritesheetId = this.icon_id.split(":")[0];
|
||||
if (getProject().getSpritesheet(spritesheetId) == null) {
|
||||
System.out.println("Actor Condition");
|
||||
System.out.println(this.id);
|
||||
System.out.println("failed to load spritesheet");
|
||||
System.out.println(spritesheetId);
|
||||
System.out.println("while creating backling for icon_id");
|
||||
System.out.println(this.icon_id);
|
||||
}
|
||||
getProject().getSpritesheet(spritesheetId).addBacklink(this);
|
||||
}
|
||||
@@ -271,6 +268,7 @@ public class ActorCondition extends JSONElement {
|
||||
clone.state = this.state;
|
||||
clone.id = this.id;
|
||||
clone.display_name = this.display_name;
|
||||
clone.description = this.description;
|
||||
clone.icon_id = this.icon_id;
|
||||
clone.category = this.category;
|
||||
clone.positive = this.positive;
|
||||
@@ -299,6 +297,7 @@ public class ActorCondition extends JSONElement {
|
||||
jsonAC.put("id", this.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.description != null) jsonAC.put("description", this.description);
|
||||
if (this.category != null) jsonAC.put("category", this.category.toString());
|
||||
if (this.positive != null && this.positive == 1) jsonAC.put("isPositive", this.positive);
|
||||
if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking);
|
||||
|
||||
@@ -68,8 +68,7 @@ public class Dialogue extends JSONElement {
|
||||
deactivateSpawnArea,
|
||||
activateMapObjectGroup,
|
||||
deactivateMapObjectGroup,
|
||||
changeMapFilter,
|
||||
mapchange
|
||||
changeMapFilter
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +249,6 @@ public class Dialogue extends JSONElement {
|
||||
case removeSpawnArea:
|
||||
case deactivateSpawnArea:
|
||||
case changeMapFilter:
|
||||
case mapchange:
|
||||
reward.map = reward.map_name != null ? proj.getMap(reward.map_name) : null;
|
||||
break;
|
||||
case actorCondition:
|
||||
|
||||
@@ -39,15 +39,14 @@ public abstract class JSONElement extends GameDataElement {
|
||||
Map jsonObj = (Map)obj;
|
||||
String id = (String) jsonObj.get("id");
|
||||
try {
|
||||
if (id != null && id.equals(this.id )) {
|
||||
this.parse(jsonObj);
|
||||
this.state = State.parsed;
|
||||
break;
|
||||
}
|
||||
if (id != null && id.equals(this.id )) {
|
||||
this.parse(jsonObj);
|
||||
this.state = State.parsed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch(Exception e){
|
||||
System.out.println("Error in ID: " + id);
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
|
||||
@@ -60,11 +60,7 @@ public class Requirement extends JSONElement {
|
||||
factionScore,
|
||||
random,
|
||||
factionScoreEquals,
|
||||
wearRemove,
|
||||
date,
|
||||
dateEquals,
|
||||
time,
|
||||
timeEquals
|
||||
wearRemove
|
||||
}
|
||||
|
||||
public enum SkillID {
|
||||
@@ -200,10 +196,6 @@ public class Requirement extends JSONElement {
|
||||
case factionScore:
|
||||
case factionScoreEquals:
|
||||
case random:
|
||||
case date:
|
||||
case dateEquals:
|
||||
case time:
|
||||
case timeEquals:
|
||||
break;
|
||||
}
|
||||
if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent);
|
||||
|
||||
@@ -28,6 +28,7 @@ public class PotGenerator {
|
||||
|
||||
for (ActorCondition ac : gsrc.gameData.actorConditions) {
|
||||
pushString(stringsResources, resourcesStrings, ac.display_name, getPotContextComment(ac));
|
||||
pushString(stringsResources, resourcesStrings, ac.description, getPotContextComment(ac)+":description");
|
||||
}
|
||||
|
||||
for (Dialogue d : gsrc.gameData.dialogues ) {
|
||||
|
||||
@@ -260,14 +260,6 @@ public class DefaultIcons {
|
||||
public static Image getTimerImage() { return getImage(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";
|
||||
public static Image getAlignmentImage() { return getImage(ALIGNMENT_RES); }
|
||||
public static Image getAlignmentIcon() { return getIcon(ALIGNMENT_RES); }
|
||||
@@ -281,7 +273,7 @@ public class DefaultIcons {
|
||||
public static Image getStatusOrangeIcon() { return getIcon(STATUS_ORANGE_RES); }
|
||||
|
||||
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); }
|
||||
|
||||
private static String STATUS_BLUE_RES = "/com/gpl/rpg/atcontentstudio/img/status_blue.png";
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ExportProjectWizard extends JDialog {
|
||||
radioGroup.add(asZip);
|
||||
overSources = new JRadioButton("... into a game source folder");
|
||||
radioGroup.add(overSources);
|
||||
overSources.setSelected(true);
|
||||
asZip.setSelected(true);
|
||||
|
||||
pane.add(asZip, JideBoxLayout.FIX);
|
||||
pane.add(overSources, JideBoxLayout.FIX);
|
||||
|
||||
@@ -30,6 +30,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
private JButton acIcon;
|
||||
private JTextField idField;
|
||||
private JTextField nameField;
|
||||
private JTextField descriptionField;
|
||||
@SuppressWarnings("rawtypes")
|
||||
private JComboBox categoryBox;
|
||||
private IntegerBasedCheckBox positiveBox;
|
||||
@@ -81,6 +82,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
|
||||
idField = addTextField(pane, "Internal ID: ", ac.id, 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);
|
||||
positiveBox = addIntegerBasedCheckBox(pane, "Positive", ac.positive, ac.writable, listener);
|
||||
stackingBox = addIntegerBasedCheckBox(pane, "Stacking", ac.stacking, ac.writable, listener);
|
||||
@@ -172,6 +174,10 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
ActorConditionEditor.this.name = aCond.getDesc();
|
||||
aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||
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) {
|
||||
aCond.icon_id = (String) value;
|
||||
aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||
|
||||
@@ -384,13 +384,6 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
rewardObj = null;
|
||||
rewardValue = null;
|
||||
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 removeSpawnArea:
|
||||
case spawnAll:
|
||||
@@ -784,26 +777,6 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener);
|
||||
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);
|
||||
}
|
||||
@@ -970,10 +943,6 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
label.setText("Change map filter to "+rewardObjDesc+" on map "+reward.map_name);
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getReplaceIcon()));
|
||||
break;
|
||||
case mapchange:
|
||||
label.setText("Teleport to "+rewardObjDesc+" on map "+reward.map_name);
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getMapchangeIcon()));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
label.setText("New, undefined reward");
|
||||
@@ -1209,9 +1178,6 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getTimerIcon()));
|
||||
} else if (req.type == Requirement.RequirementType.factionScore || req.type == Requirement.RequirementType.factionScoreEquals) {
|
||||
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) {
|
||||
label.setText("New, undefined requirement.");
|
||||
|
||||
@@ -731,26 +731,6 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user