mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 23:57:25 +01:00
Compare commits
59 Commits
v0.6.16
...
build-scri
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e60378ab64 | ||
|
|
4fa2409c24 | ||
|
|
b5aa453fd6 | ||
|
|
42f1c87278 | ||
|
|
9097b97316 | ||
|
|
7965ecb4f1 | ||
|
|
01963517ba | ||
|
|
30bef443d5 | ||
|
|
8d01716d93 | ||
|
|
fce5cd71ff | ||
|
|
0cddbb04e9 | ||
|
|
00ec5fe49f | ||
|
|
5cdb42ae07 | ||
|
|
c98f51744b | ||
|
|
89f764b62b | ||
|
|
d81233d470 | ||
|
|
e1685aa625 | ||
|
|
ae3ca5d50a | ||
|
|
a00b8fbc66 | ||
|
|
4d03c15e08 | ||
|
|
4571bea429 | ||
|
|
ecc9a35c69 | ||
|
|
c4d71df4b1 | ||
|
|
a13dac467a | ||
|
|
e305dfd7bf | ||
|
|
80984a43af | ||
|
|
2bc8b65264 | ||
|
|
b2584a24cc | ||
|
|
1626a8340f | ||
|
|
5fe2dfe148 | ||
|
|
abc1e7c912 | ||
|
|
317d6d4216 | ||
|
|
3628386019 | ||
|
|
ada352a02c | ||
|
|
fc0d97aa2f | ||
|
|
7451f582ce | ||
|
|
7b80bf5768 | ||
|
|
ddd98c5a8f | ||
|
|
0ef703d82e | ||
|
|
2339a9307c | ||
|
|
7dcdb90750 | ||
|
|
b638c31ebe | ||
|
|
862f4b7366 | ||
|
|
693de98212 | ||
|
|
3f4bf58375 | ||
|
|
7ae4d9d3f6 | ||
|
|
0f20f0cd6d | ||
|
|
481956cfa5 | ||
|
|
7c282aae53 | ||
|
|
1fd3e6253e | ||
|
|
70f61f0281 | ||
|
|
2f82fd13a6 | ||
|
|
f7e5785970 | ||
|
|
084b23f641 | ||
|
|
ff4d8a6b6c | ||
|
|
45aff3d25b | ||
|
|
28a1d0b09e | ||
|
|
b96568049f | ||
|
|
e125b0339c |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,3 +1,10 @@
|
|||||||
/ATCS_v*.jar
|
/ATCS_v*.jar
|
||||||
/Project
|
/Project
|
||||||
/bin
|
/bin
|
||||||
|
/packaging/tmp/
|
||||||
|
/out
|
||||||
|
packaging/common/lib
|
||||||
|
packaging/common/ATCS.jar
|
||||||
|
packaging/ATCS_*.zip
|
||||||
|
ATCS_v*.tar.gz
|
||||||
|
ATCS.jar
|
||||||
|
|||||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
18
.idea/artifacts/ATContentStudio_jar.xml
generated
Normal file
18
.idea/artifacts/ATContentStudio_jar.xml
generated
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact name="ATContentStudio:jar">
|
||||||
|
<output-path>$PROJECT_DIR$/out/artifacts/ATContentStudio_jar</output-path>
|
||||||
|
<root id="root">
|
||||||
|
<element id="archive" name="ATContentStudio.jar">
|
||||||
|
<element id="module-output" name="ATContentStudio" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/lib/bsh-2.0b4.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/lib/rsyntaxtextarea.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/lib/prefuse.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jsoup-1.10.2.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/lib/json_simple-1.1.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/lib/ui.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/lib/AndorsTrainer_v0.1.5.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/lib/jide-oss.jar" path-in-jar="/" />
|
||||||
|
</element>
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
4
.idea/misc.xml
generated
Normal file
4
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK" />
|
||||||
|
</project>
|
||||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/ATContentStudio.iml" filepath="$PROJECT_DIR$/ATContentStudio.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -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.16.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/>
|
||||||
|
|||||||
117
ATContentStudio.iml
Normal file
117
ATContentStudio.iml
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="EclipseModuleManager">
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/jide-oss.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/json_simple-1.1.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/junit-4.10.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/prefuse.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/rsyntaxtextarea.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/ui.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/bsh-2.0b4.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/jsoup-1.10.2.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/AndorsTrainer_v0.1.5.jar!/" />
|
||||||
|
<src_description expected_position="0">
|
||||||
|
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
|
||||||
|
<src_folder value="file://$MODULE_DIR$/res" expected_position="1" />
|
||||||
|
<src_folder value="file://$MODULE_DIR$/hacked-libtiled" expected_position="2" />
|
||||||
|
<src_folder value="file://$MODULE_DIR$/siphash-zackehh/src/main/java" expected_position="3" />
|
||||||
|
<src_folder value="file://$MODULE_DIR$/minify" expected_position="4" />
|
||||||
|
</src_description>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<output url="file://$MODULE_DIR$/bin" />
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/hacked-libtiled" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/minify" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/res" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/siphash-zackehh/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="jide-oss.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/jide-oss.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="json_simple-1.1.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/json_simple-1.1.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="junit-4.10.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/junit-4.10.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="prefuse.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/prefuse.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="rsyntaxtextarea.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/rsyntaxtextarea.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="ui.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/ui.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="bsh-2.0b4.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/bsh-2.0b4.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="jsoup-1.10.2.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/jsoup-1.10.2.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/jsoup-1.10.2-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="AndorsTrainer_v0.1.5.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/AndorsTrainer_v0.1.5.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
127
createProject.bat
Normal file
127
createProject.bat
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
@echo off
|
||||||
|
echo.
|
||||||
|
echo ***
|
||||||
|
echo *** createProject v1.0 (2024-08-24)
|
||||||
|
echo ***
|
||||||
|
echo *** This script will help to setup an ATCS project
|
||||||
|
echo *** and connect it to a repo on Github
|
||||||
|
echo ***
|
||||||
|
echo.
|
||||||
|
rem Save this script anywhere on your PC (e.g. C:\AT\createProject.bat)
|
||||||
|
rem Then open a command shell: CMD
|
||||||
|
rem and call the script in the shell.
|
||||||
|
|
||||||
|
if "%1"=="" goto :noParamError
|
||||||
|
|
||||||
|
echo You have entered:
|
||||||
|
echo.
|
||||||
|
echo ATCS-project: %1
|
||||||
|
echo in Directory: %2
|
||||||
|
echo Github user: %3
|
||||||
|
echo.
|
||||||
|
pause
|
||||||
|
if "%3"=="" goto :help
|
||||||
|
if not "%4"=="" goto :help
|
||||||
|
|
||||||
|
if not exist %2 md %2
|
||||||
|
|
||||||
|
rem --- Create ATCS project (if not already done)
|
||||||
|
:atcs
|
||||||
|
if not exist %2\%1\created\drawable\char_hero.png (
|
||||||
|
echo.
|
||||||
|
echo Do the following steps:
|
||||||
|
echo.
|
||||||
|
echo 1. Start ATCS
|
||||||
|
echo 2. Create your ATCS workspace in %2
|
||||||
|
echo 3. Add the new project %1
|
||||||
|
echo 4. Exit ATCS
|
||||||
|
echo.
|
||||||
|
pause
|
||||||
|
goto :atcs
|
||||||
|
) else (
|
||||||
|
echo ATCS Project exists
|
||||||
|
)
|
||||||
|
|
||||||
|
rem --- Create git repository
|
||||||
|
rem This is the really important part :)
|
||||||
|
rem -- go into project dir (even if we do not need to create the git repo)
|
||||||
|
echo cd %2\%1
|
||||||
|
cd %2\%1
|
||||||
|
|
||||||
|
if not exist %2\%1\readme.md (
|
||||||
|
echo creating readme
|
||||||
|
|
||||||
|
echo # %1 > readme.md
|
||||||
|
) else (
|
||||||
|
echo readme already exists
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exist %2\%1\.gitignore (
|
||||||
|
echo creating gitignore
|
||||||
|
|
||||||
|
echo .workspace > .gitignore
|
||||||
|
echo .project >> .gitignore
|
||||||
|
echo altered/drawable >> .gitignore
|
||||||
|
echo altered/drawable/* >> .gitignore
|
||||||
|
echo created/drawable >> .gitignore
|
||||||
|
echo created/drawable/* >> .gitignore
|
||||||
|
echo tmp/res/values/loadresources.xml >> .gitignore
|
||||||
|
) else (
|
||||||
|
echo gitignore already existed
|
||||||
|
)
|
||||||
|
|
||||||
|
:git
|
||||||
|
if not exist %2\%1\.git (
|
||||||
|
echo Initializing git
|
||||||
|
git init -b main || (
|
||||||
|
echo "failed to init git. Please make sure it is installed"
|
||||||
|
pause
|
||||||
|
goto :git
|
||||||
|
)
|
||||||
|
:git_commit
|
||||||
|
git add readme.md
|
||||||
|
git add .gitignore
|
||||||
|
git commit -m "Init project" || (
|
||||||
|
echo "failed to create the initial commit."
|
||||||
|
pause
|
||||||
|
goto :git_commit
|
||||||
|
)
|
||||||
|
echo Done initializing git
|
||||||
|
) else (
|
||||||
|
echo git was already initialized
|
||||||
|
)
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Now create your repo %1 on https://github.com/%3 (if not already done)
|
||||||
|
echo.
|
||||||
|
pause
|
||||||
|
echo pushing to git repo https://github.com/%3/%1.git
|
||||||
|
git remote add origin https://github.com/%3/%1.git
|
||||||
|
git push -u origin main
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo At last you have to find the repo in your git client:
|
||||||
|
echo - In Smartgit: Menu option: Repository / Search for repository
|
||||||
|
echo.
|
||||||
|
goto :end
|
||||||
|
|
||||||
|
:noParamError
|
||||||
|
echo.
|
||||||
|
echo You have given no parameter.
|
||||||
|
echo Maybe you have just double clicked it? That won't work.
|
||||||
|
echo I have opened a CMD shell for you. Enter the command in that shell.
|
||||||
|
start cmd
|
||||||
|
echo Please switch to the CMD shell
|
||||||
|
|
||||||
|
:help
|
||||||
|
echo.
|
||||||
|
echo Enter the command with 3 parameters:
|
||||||
|
echo %0 project path git-user
|
||||||
|
echo.
|
||||||
|
echo Example: %0 feygard_1 c:\AT\ATCS NutAndor
|
||||||
|
echo.
|
||||||
|
|
||||||
|
:end
|
||||||
|
echo.
|
||||||
|
echo *** End ***
|
||||||
|
pause
|
||||||
@@ -913,7 +913,8 @@ public class TMXMapReader
|
|||||||
private class MapEntityResolver implements EntityResolver
|
private class MapEntityResolver implements EntityResolver
|
||||||
{
|
{
|
||||||
public InputSource resolveEntity(String publicId, String systemId) {
|
public InputSource resolveEntity(String publicId, String systemId) {
|
||||||
if (systemId.equals("http://mapeditor.org/dtd/1.0/map.dtd")) {
|
if (systemId.equals("http://mapeditor.org/dtd/1.0/map.dtd") ||
|
||||||
|
systemId.equals("https://mapeditor.org/dtd/1.0/map.dtd")) {
|
||||||
return new InputSource(TMXMapReader.class.getResourceAsStream(
|
return new InputSource(TMXMapReader.class.getResourceAsStream(
|
||||||
"resources/map.dtd"));
|
"resources/map.dtd"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public class TMXMapWriter
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void writeMap(Map map, XMLWriter w, String wp) throws IOException {
|
private void writeMap(Map map, XMLWriter w, String wp) throws IOException {
|
||||||
w.writeDocType("map", null, "http://mapeditor.org/dtd/1.0/map.dtd");
|
w.writeDocType("map", null, "https://mapeditor.org/dtd/1.0/map.dtd");
|
||||||
w.startElement("map");
|
w.startElement("map");
|
||||||
|
|
||||||
w.writeAttribute("version", "1.0");
|
w.writeAttribute("version", "1.0");
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v0.6.16
|
v0.6.19
|
||||||
2
packaging/Manifest.txt
Normal file
2
packaging/Manifest.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Main-Class: com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
!include MUI2.nsh
|
!include MUI2.nsh
|
||||||
|
|
||||||
!define VERSION "0.6.16"
|
!define VERSION "0.6.20"
|
||||||
!define TRAINER_VERSION "0.1.5"
|
!define TRAINER_VERSION "0.1.5"
|
||||||
!define JAVA_BIN "javaw"
|
!define JAVA_BIN "java"
|
||||||
|
|
||||||
Name "Andor's Trail Content Studio v${VERSION}"
|
Name "Andor's Trail Content Studio v${VERSION}"
|
||||||
OutFile "ATCS_v${VERSION}_Setup.exe"
|
OutFile "ATCS_v${VERSION}_Setup.exe"
|
||||||
@@ -83,16 +83,16 @@ Section install
|
|||||||
FileClose $9
|
FileClose $9
|
||||||
|
|
||||||
SetOutPath "$INSTDIR\lib\"
|
SetOutPath "$INSTDIR\lib\"
|
||||||
file "jide-oss.jar"
|
file "C:\AT\ATCS_source\lib\jide-oss.jar"
|
||||||
file "ui.jar"
|
file "C:\AT\ATCS_source\lib\ui.jar"
|
||||||
file "AndorsTrainer_v${TRAINER_VERSION}.jar"
|
file "C:\AT\ATCS_source\lib\AndorsTrainer_v${TRAINER_VERSION}.jar"
|
||||||
file "junit-4.10.jar"
|
file "C:\AT\ATCS_source\lib\junit-4.10.jar"
|
||||||
file "json_simple-1.1.jar"
|
file "C:\AT\ATCS_source\lib\json_simple-1.1.jar"
|
||||||
file "ATCS_v${VERSION}.jar"
|
file "C:\AT\temp\ATCS_v0.6.20\ATCS_v${VERSION}.jar"
|
||||||
file "rsyntaxtextarea.jar"
|
file "C:\AT\ATCS_source\lib\rsyntaxtextarea.jar"
|
||||||
file "prefuse.jar"
|
file "C:\AT\ATCS_source\lib\prefuse.jar"
|
||||||
file "bsh-2.0b4.jar"
|
file "C:\AT\ATCS_source\lib\bsh-2.0b4.jar"
|
||||||
file "jsoup-1.10.2.jar"
|
file "C:\AT\ATCS_source\lib\jsoup-1.10.2.jar"
|
||||||
|
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
@@ -172,4 +172,4 @@ Function GetJRE
|
|||||||
JreFound:
|
JreFound:
|
||||||
Pop $R1
|
Pop $R1
|
||||||
Exch $R0
|
Exch $R0
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|||||||
18
packaging/common/ATCS.cmd
Normal file
18
packaging/common/ATCS.cmd
Normal 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"
|
||||||
4
packaging/common/ATCS.env
Normal file
4
packaging/common/ATCS.env
Normal 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
BIN
packaging/common/ATCS.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
21
packaging/common/ATCS.sh
Executable file
21
packaging/common/ATCS.sh
Executable 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
|
||||||
1
packaging/package-windows.sh
Normal file
1
packaging/package-windows.sh
Normal file
@@ -0,0 +1 @@
|
|||||||
|
sh ./package.sh -windows
|
||||||
119
packaging/package.sh
Executable file
119
packaging/package.sh
Executable file
@@ -0,0 +1,119 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to build ATCS.jar, replicating IntelliJ artifact definition
|
||||||
|
# Linux and Windows compatible
|
||||||
|
|
||||||
|
# --- Platform Detection ---
|
||||||
|
if [ "$1" = "-windows" ]; then
|
||||||
|
echo "Got '-windows' flag. Running Windows version"
|
||||||
|
PLATFORM="WINDOWS"
|
||||||
|
else
|
||||||
|
echo "No '-windows' flag. Running Linux version"
|
||||||
|
PLATFORM="LINUX"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- Configuration ---
|
||||||
|
PACKAGING_DIR=$(dirname "$(readlink -f "$0" || greadlink -f "$0" || stat -f "$0")")
|
||||||
|
ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}")
|
||||||
|
TEMP_DIR="${PACKAGING_DIR}/tmp"
|
||||||
|
JAR_LOCATION="${PACKAGING_DIR}/ATCS.jar" # Output JAR location as per script
|
||||||
|
MANIFEST_LOCATION="${PACKAGING_DIR}/Manifest.txt"
|
||||||
|
VERSION_FILE="${PACKAGING_DIR}/ATCS_latest"
|
||||||
|
SOURCE_BASE_DIR="${ATCS_SOURCE_DIR}/src" # Base directory for standard source code
|
||||||
|
LIB_BASE_DIR="${ATCS_SOURCE_DIR}/lib" # Base directory for libraries
|
||||||
|
OUTPUT_JAR_DIR="${PACKAGING_DIR}" # Directory where the final JAR will be placed - as per script
|
||||||
|
|
||||||
|
# --- **ADDITIONAL SOURCE CODE FOLDERS** ---
|
||||||
|
EXTRA_SOURCE_DIRS=(
|
||||||
|
"hacked-libtiled"
|
||||||
|
"minify"
|
||||||
|
"siphash-zackehh/src/main/java"
|
||||||
|
)
|
||||||
|
|
||||||
|
# --- Libraries to include (from IntelliJ artifact definition) ---
|
||||||
|
LIBRARIES=(
|
||||||
|
"AndorsTrainer_v0.1.5.jar"
|
||||||
|
"bsh-2.0b4.jar"
|
||||||
|
"jide-oss.jar"
|
||||||
|
"json_simple-1.1.jar"
|
||||||
|
"jsoup-1.10.2.jar"
|
||||||
|
"junit-4.10.jar"
|
||||||
|
"prefuse.jar"
|
||||||
|
"rsyntaxtextarea.jar"
|
||||||
|
"ui.jar"
|
||||||
|
)
|
||||||
|
|
||||||
|
# --- Get version ---
|
||||||
|
echo "Getting version"
|
||||||
|
VERSION=$(cat "${VERSION_FILE}")
|
||||||
|
echo "Got version ${VERSION}"
|
||||||
|
|
||||||
|
# --- Prepare temporary directory ---
|
||||||
|
echo "Removing tmp folder"
|
||||||
|
rm -rf "${TEMP_DIR}"
|
||||||
|
echo "Recreating tmp folder"
|
||||||
|
mkdir -p "${TEMP_DIR}"
|
||||||
|
|
||||||
|
# --- **EXTRACT lib files directly to TEMP_DIR** ---
|
||||||
|
echo 'Extracting lib files to TEMP_DIR'
|
||||||
|
for LIB in "${LIBRARIES[@]}"; do
|
||||||
|
echo "Extracting library: ${LIB}"
|
||||||
|
unzip -qo "${LIB_BASE_DIR}/${LIB}" -d "${TEMP_DIR}" # Extract JAR contents to TEMP_DIR root
|
||||||
|
done
|
||||||
|
|
||||||
|
# --- Set ClassPath ---
|
||||||
|
echo "Getting source files"
|
||||||
|
# Find all java files in source directories and compile them
|
||||||
|
SOURCE_FILES=$(find "${SOURCE_BASE_DIR}" "${EXTRA_SOURCE_DIRS[@]/#/${ATCS_SOURCE_DIR}/}" -name "*.java" -print)
|
||||||
|
#echo "SourceFiles: ${SOURCE_FILES}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# --- Build Java classes ---
|
||||||
|
echo 'Building java classes'
|
||||||
|
|
||||||
|
javac -cp "${TEMP_DIR}" -d "${TEMP_DIR}" ${SOURCE_FILES}
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Compilation failed. Please check errors above."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Compilation successful"
|
||||||
|
|
||||||
|
# --- Copy res stuff to temp folder ---
|
||||||
|
echo "Copying some stuff to temp folder"
|
||||||
|
cp -r "${ATCS_SOURCE_DIR}"/res/* "${TEMP_DIR}/"
|
||||||
|
mkdir -p "${TEMP_DIR}/com/gpl/rpg/atcontentstudio/img"
|
||||||
|
mkdir -p "${TEMP_DIR}/tiled/io/resources/"
|
||||||
|
cp -r "${ATCS_SOURCE_DIR}"/src/com/gpl/rpg/atcontentstudio/img/* "${TEMP_DIR}/com/gpl/rpg/atcontentstudio/img/" # some icons
|
||||||
|
cp -r "${ATCS_SOURCE_DIR}"/hacked-libtiled/tiled/io/resources/* "${TEMP_DIR}/tiled/io/resources/" # dtd file for tmx maps
|
||||||
|
|
||||||
|
# --- Create JAR file ---
|
||||||
|
echo ""
|
||||||
|
echo "Creating jar at location: ${JAR_LOCATION}"
|
||||||
|
|
||||||
|
cd "${TEMP_DIR}" || exit # Change to temp dir for JAR command
|
||||||
|
|
||||||
|
# JAR command WITHOUT lib directory
|
||||||
|
jar cfm "${JAR_LOCATION}" "${MANIFEST_LOCATION}" -C . .
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "JAR creation failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "${PACKAGING_DIR}" || exit # Go back to packaging dir
|
||||||
|
|
||||||
|
echo ''
|
||||||
|
echo "Done creating jar at ${JAR_LOCATION}"
|
||||||
|
cp -f "${JAR_LOCATION}" "${OUTPUT_JAR_DIR}/common/ATCS.jar" # Copy JAR to versioned name
|
||||||
|
|
||||||
|
# --- Create archive ---
|
||||||
|
if [ "$PLATFORM" = "LINUX" ]; then
|
||||||
|
cd "${OUTPUT_JAR_DIR}" || exit
|
||||||
|
echo "Creating archive"
|
||||||
|
tar caf "ATCS_${VERSION}.tar.gz" common/* # archive the 'common' folder which now contains the JAR and libs
|
||||||
|
echo "Created archive at ${OUTPUT_JAR_DIR}/ATCS_${VERSION}.tar.gz"
|
||||||
|
cd "${PACKAGING_DIR}" || exit
|
||||||
|
else
|
||||||
|
echo "Can't create zip files on windows yet. Please pack the content of the '${OUTPUT_JAR_DIR}/common/' folder yourself"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Script finished."
|
||||||
@@ -1,64 +1,92 @@
|
|||||||
atcs.spritesheet.actorconditions_1.category=actorcondition
|
atcs.spritesheet.actorconditions_1.category=actorcondition
|
||||||
atcs.spritesheet.actorconditions_2.category=actorcondition
|
atcs.spritesheet.actorconditions_2.category=actorcondition
|
||||||
atcs.spritesheet.actorconditions_japozero.category=actorcondition
|
atcs.spritesheet.actorconditions_japozero.category=actorcondition
|
||||||
|
atcs.spritesheet.actorconditions_omi1.category=actorcondition
|
||||||
|
atcs.spritesheet.actorconditions_omi2.category=actorcondition
|
||||||
|
|
||||||
|
atcs.spritesheet.effect_blood3.animate=true
|
||||||
|
atcs.spritesheet.effect_blood4.animate=true
|
||||||
|
atcs.spritesheet.effect_bluetentacle.animate=true
|
||||||
|
atcs.spritesheet.effect_heal2.animate=true
|
||||||
|
atcs.spritesheet.effect_miss1.animate=true
|
||||||
|
atcs.spritesheet.effect_poison1.animate=true
|
||||||
|
atcs.spritesheet.effect_tometik1.animate=true
|
||||||
|
atcs.spritesheet.effect_tometik2.animate=true
|
||||||
|
|
||||||
atcs.spritesheet.items_armours.category=item
|
atcs.spritesheet.items_armours.category=item
|
||||||
atcs.spritesheet.items_armours_2.category=item
|
atcs.spritesheet.items_armours_2.category=item
|
||||||
atcs.spritesheet.items_armours_3.category=item
|
atcs.spritesheet.items_armours_3.category=item
|
||||||
atcs.spritesheet.items_weapons.category=item
|
|
||||||
atcs.spritesheet.items_weapons_2.category=item
|
|
||||||
atcs.spritesheet.items_weapons_3.category=item
|
|
||||||
atcs.spritesheet.items_jewelry.category=item
|
|
||||||
atcs.spritesheet.items_rings_1.category=item
|
|
||||||
atcs.spritesheet.items_necklaces_1.category=item
|
|
||||||
atcs.spritesheet.items_consumables.category=item
|
|
||||||
atcs.spritesheet.items_japozero.category=item
|
|
||||||
atcs.spritesheet.items_books.category=item
|
atcs.spritesheet.items_books.category=item
|
||||||
|
atcs.spritesheet.items_consumables.category=item
|
||||||
|
atcs.spritesheet.items_consumables_omi1.category=item
|
||||||
|
atcs.spritesheet.items_feygard1.category=item
|
||||||
|
atcs.spritesheet.items_g03_package_omi1.category=item
|
||||||
|
atcs.spritesheet.items_japozero.category=item
|
||||||
|
atcs.spritesheet.items_jewelry.category=item
|
||||||
atcs.spritesheet.items_misc.category=item
|
atcs.spritesheet.items_misc.category=item
|
||||||
atcs.spritesheet.items_misc_2.category=item
|
atcs.spritesheet.items_misc_2.category=item
|
||||||
atcs.spritesheet.items_misc_3.category=item
|
atcs.spritesheet.items_misc_3.category=item
|
||||||
atcs.spritesheet.items_misc_4.category=item
|
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_newb.category=item
|
||||||
|
atcs.spritesheet.items_omgeeky.category=item
|
||||||
|
atcs.spritesheet.items_omi2.category=item
|
||||||
|
atcs.spritesheet.items_phoenix01.category=item
|
||||||
atcs.spritesheet.items_reterski_1.category=item
|
atcs.spritesheet.items_reterski_1.category=item
|
||||||
|
atcs.spritesheet.items_rijackson_1.category=item
|
||||||
|
atcs.spritesheet.items_rings_1.category=item
|
||||||
atcs.spritesheet.items_tometik1.category=item
|
atcs.spritesheet.items_tometik1.category=item
|
||||||
atcs.spritesheet.items_tometik2.category=item
|
atcs.spritesheet.items_tometik2.category=item
|
||||||
atcs.spritesheet.items_tometik3.category=item
|
atcs.spritesheet.items_tometik3.category=item
|
||||||
|
atcs.spritesheet.items_weapons.category=item
|
||||||
|
atcs.spritesheet.items_weapons_2.category=item
|
||||||
|
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_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
|
||||||
atcs.spritesheet.monsters_eye3.category=monster
|
atcs.spritesheet.monsters_eye3.category=monster
|
||||||
atcs.spritesheet.monsters_eye4.category=monster
|
atcs.spritesheet.monsters_eye4.category=monster
|
||||||
|
atcs.spritesheet.monsters_fatboy73.category=monster
|
||||||
atcs.spritesheet.monsters_ghost1.category=monster
|
atcs.spritesheet.monsters_ghost1.category=monster
|
||||||
atcs.spritesheet.monsters_hydra1.category=monster
|
|
||||||
atcs.spritesheet.monsters_hydra1.sizex=64
|
atcs.spritesheet.monsters_gisons.category=monster
|
||||||
atcs.spritesheet.monsters_hydra1.sizey=64
|
atcs.spritesheet.monsters_guynmart.category=monster
|
||||||
|
|
||||||
atcs.spritesheet.monsters_insects.category=monster
|
atcs.spritesheet.monsters_insects.category=monster
|
||||||
|
atcs.spritesheet.monsters_karvis1.category=monster
|
||||||
|
atcs.spritesheet.monsters_karvis2.category=monster
|
||||||
|
atcs.spritesheet.monsters_ld1.category=monster
|
||||||
|
atcs.spritesheet.monsters_ld2.category=monster
|
||||||
atcs.spritesheet.monsters_liches.category=monster
|
atcs.spritesheet.monsters_liches.category=monster
|
||||||
atcs.spritesheet.monsters_mage.category=monster
|
atcs.spritesheet.monsters_mage.category=monster
|
||||||
atcs.spritesheet.monsters_mage2.category=monster
|
atcs.spritesheet.monsters_mage2.category=monster
|
||||||
|
atcs.spritesheet.monsters_maksiu1.category=monster
|
||||||
atcs.spritesheet.monsters_man1.category=monster
|
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_b.category=monster
|
||||||
|
atcs.spritesheet.monsters_omi2.category=monster
|
||||||
|
atcs.spritesheet.monsters_phoenix01.category=monster
|
||||||
atcs.spritesheet.monsters_rats.category=monster
|
atcs.spritesheet.monsters_rats.category=monster
|
||||||
atcs.spritesheet.monsters_rogue1.category=monster
|
atcs.spritesheet.monsters_redshrike1.category=monster
|
||||||
atcs.spritesheet.monsters_skeleton1.category=monster
|
|
||||||
atcs.spritesheet.monsters_skeleton2.category=monster
|
|
||||||
atcs.spritesheet.monsters_snakes.category=monster
|
|
||||||
atcs.spritesheet.monsters_warrior1.category=monster
|
|
||||||
atcs.spritesheet.monsters_wraiths.category=monster
|
|
||||||
atcs.spritesheet.monsters_zombie1.category=monster
|
|
||||||
atcs.spritesheet.monsters_zombie2.category=monster
|
|
||||||
atcs.spritesheet.monsters_karvis1.category=monster
|
|
||||||
atcs.spritesheet.monsters_karvis2.category=monster
|
|
||||||
atcs.spritesheet.monsters_rltiles1.category=monster
|
atcs.spritesheet.monsters_rltiles1.category=monster
|
||||||
atcs.spritesheet.monsters_rltiles2.category=monster
|
atcs.spritesheet.monsters_rltiles2.category=monster
|
||||||
atcs.spritesheet.monsters_rltiles3.category=monster
|
atcs.spritesheet.monsters_rltiles3.category=monster
|
||||||
atcs.spritesheet.monsters_rltiles4.category=monster
|
atcs.spritesheet.monsters_rltiles4.category=monster
|
||||||
atcs.spritesheet.monsters_redshrike1.category=monster
|
atcs.spritesheet.monsters_rogue1.category=monster
|
||||||
atcs.spritesheet.monsters_ld1.category=monster
|
atcs.spritesheet.monsters_skeleton1.category=monster
|
||||||
atcs.spritesheet.monsters_ld2.category=monster
|
atcs.spritesheet.monsters_skeleton2.category=monster
|
||||||
|
atcs.spritesheet.monsters_snakes.category=monster
|
||||||
atcs.spritesheet.monsters_tometik1.category=monster
|
atcs.spritesheet.monsters_tometik1.category=monster
|
||||||
atcs.spritesheet.monsters_tometik2.category=monster
|
atcs.spritesheet.monsters_tometik2.category=monster
|
||||||
atcs.spritesheet.monsters_tometik3.category=monster
|
atcs.spritesheet.monsters_tometik3.category=monster
|
||||||
@@ -69,20 +97,36 @@ atcs.spritesheet.monsters_tometik7.category=monster
|
|||||||
atcs.spritesheet.monsters_tometik8.category=monster
|
atcs.spritesheet.monsters_tometik8.category=monster
|
||||||
atcs.spritesheet.monsters_tometik9.category=monster
|
atcs.spritesheet.monsters_tometik9.category=monster
|
||||||
atcs.spritesheet.monsters_tometik10.category=monster
|
atcs.spritesheet.monsters_tometik10.category=monster
|
||||||
|
atcs.spritesheet.monsters_warrior1.category=monster
|
||||||
|
atcs.spritesheet.monsters_unknown.category=monster
|
||||||
|
atcs.spritesheet.monsters_wraiths.category=monster
|
||||||
|
atcs.spritesheet.monsters_zombie1.category=monster
|
||||||
|
atcs.spritesheet.monsters_zombie2.category=monster
|
||||||
|
|
||||||
|
atcs.spritesheet.monsters_bosses_2x2.category=monster
|
||||||
|
atcs.spritesheet.monsters_bosses_2x2.sizex=64
|
||||||
|
atcs.spritesheet.monsters_bosses_2x2.sizey=64
|
||||||
|
atcs.spritesheet.monsters_cyclops.category=monster
|
||||||
|
atcs.spritesheet.monsters_cyclops.sizex=64
|
||||||
|
atcs.spritesheet.monsters_cyclops.sizey=96
|
||||||
atcs.spritesheet.monsters_demon1.category=monster
|
atcs.spritesheet.monsters_demon1.category=monster
|
||||||
atcs.spritesheet.monsters_demon1.sizex=64
|
atcs.spritesheet.monsters_demon1.sizex=64
|
||||||
atcs.spritesheet.monsters_demon1.sizey=64
|
atcs.spritesheet.monsters_demon1.sizey=64
|
||||||
atcs.spritesheet.monsters_demon2.category=monster
|
atcs.spritesheet.monsters_demon2.category=monster
|
||||||
atcs.spritesheet.monsters_demon2.sizex=64
|
atcs.spritesheet.monsters_demon2.sizex=64
|
||||||
atcs.spritesheet.monsters_demon2.sizey=64
|
atcs.spritesheet.monsters_demon2.sizey=64
|
||||||
atcs.spritesheet.monsters_cyclops.category=monster
|
atcs.spritesheet.monsters_giantbasilisk.category=monster
|
||||||
atcs.spritesheet.monsters_cyclops.sizex=64
|
atcs.spritesheet.monsters_giantbasilisk.sizex=64
|
||||||
atcs.spritesheet.monsters_cyclops.sizey=96
|
atcs.spritesheet.monsters_giantbasilisk.sizey=64
|
||||||
atcs.spritesheet.effect_blood3.animate=true
|
atcs.spritesheet.monsters_hydra1.category=monster
|
||||||
atcs.spritesheet.effect_blood4.animate=true
|
atcs.spritesheet.monsters_hydra1.sizex=64
|
||||||
atcs.spritesheet.effect_bluetentacle.animate=true
|
atcs.spritesheet.monsters_hydra1.sizey=64
|
||||||
atcs.spritesheet.effect_heal2.animate=true
|
atcs.spritesheet.monsters_newb_2.category=monster
|
||||||
atcs.spritesheet.effect_poison1.animate=true
|
atcs.spritesheet.monsters_newb_2.sizex=64
|
||||||
atcs.spritesheet.effect_tometik1.animate=true
|
atcs.spritesheet.monsters_newb_2.sizey=32
|
||||||
atcs.spritesheet.effect_tometik2.animate=true
|
atcs.spritesheet.monsters_newb_3.category=monster
|
||||||
atcs.spritesheet.monsters_guynmart.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
|
||||||
|
|||||||
6
src/META-INF/MANIFEST.MF
Normal file
6
src/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Main-Class: com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||||
|
Class-Path: jide-oss.jar jsoup-1.10.2.jar ui.jar junit-4.10.jar AndorsTr
|
||||||
|
ainer_v0.1.5.jar prefuse.jar rsyntaxtextarea.jar bsh-2.0b4.jar json_sim
|
||||||
|
ple-1.1.jar
|
||||||
|
|
||||||
@@ -1,227 +1,234 @@
|
|||||||
package com.gpl.rpg.atcontentstudio;
|
package com.gpl.rpg.atcontentstudio;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Desktop;
|
import java.awt.Desktop;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Toolkit;
|
import java.awt.Toolkit;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import javax.swing.JEditorPane;
|
import javax.swing.JEditorPane;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.UIDefaults;
|
import javax.swing.UIDefaults;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.UnsupportedLookAndFeelException;
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
import javax.swing.event.HyperlinkEvent;
|
import javax.swing.event.HyperlinkEvent;
|
||||||
import javax.swing.event.HyperlinkListener;
|
import javax.swing.event.HyperlinkListener;
|
||||||
import javax.swing.plaf.FontUIResource;
|
import javax.swing.plaf.FontUIResource;
|
||||||
|
|
||||||
import prefuse.data.expression.parser.ExpressionParser;
|
import prefuse.data.expression.parser.ExpressionParser;
|
||||||
|
|
||||||
import com.gpl.rpg.atcontentstudio.model.Workspace;
|
import com.gpl.rpg.atcontentstudio.model.Workspace;
|
||||||
import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
|
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.20";
|
||||||
public static final String APP_VERSION = "v0.6.16";
|
|
||||||
|
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
|
||||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset these loggers.
|
// 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
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String fontScaling = System.getProperty(FONT_SCALE_ENV_VAR_NAME);
|
String fontScaling = System.getProperty(FONT_SCALE_ENV_VAR_NAME);
|
||||||
Float fontScale = null;
|
Float fontScale = null;
|
||||||
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)
|
||||||
UIManager.setLookAndFeel(laf);
|
laf = UIManager.getSystemLookAndFeelClassName();
|
||||||
} catch (ClassNotFoundException e) {
|
UIManager.setLookAndFeel(laf);
|
||||||
e.printStackTrace();
|
} catch (ClassNotFoundException e) {
|
||||||
} catch (InstantiationException e) {
|
e.printStackTrace();
|
||||||
e.printStackTrace();
|
} catch (InstantiationException e) {
|
||||||
} catch (IllegalAccessException e) {
|
e.printStackTrace();
|
||||||
e.printStackTrace();
|
} catch (IllegalAccessException e) {
|
||||||
} catch (UnsupportedLookAndFeelException e) {
|
e.printStackTrace();
|
||||||
e.printStackTrace();
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
}
|
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
|
||||||
Logger l = Logger.getLogger(ExpressionParser.class.getName());
|
// reset this setting.
|
||||||
l.setLevel(Level.OFF);
|
Logger l = Logger.getLogger(ExpressionParser.class.getName());
|
||||||
configuredLoggers.add(l);
|
l.setLevel(Level.OFF);
|
||||||
|
configuredLoggers.add(l);
|
||||||
final WorkspaceSelector wsSelect = new WorkspaceSelector();
|
|
||||||
wsSelect.pack();
|
final WorkspaceSelector wsSelect = new WorkspaceSelector();
|
||||||
Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
|
wsSelect.pack();
|
||||||
Dimension wdim = wsSelect.getSize();
|
Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
wsSelect.setLocation((sdim.width - wdim.width)/2, (sdim.height - wdim.height)/2);
|
Dimension wdim = wsSelect.getSize();
|
||||||
wsSelect.setVisible(true);
|
wsSelect.setLocation((sdim.width - wdim.width) / 2, (sdim.height - wdim.height) / 2);
|
||||||
|
wsSelect.setVisible(true);
|
||||||
wsSelect.addWindowListener(new WindowAdapter() {
|
|
||||||
@Override
|
wsSelect.addWindowListener(new WindowAdapter() {
|
||||||
public synchronized void windowClosed(WindowEvent e) {
|
@Override
|
||||||
if (wsSelect.selected != null && !STARTED) {
|
public synchronized void windowClosed(WindowEvent e) {
|
||||||
ATContentStudio.STARTED = true;
|
if (wsSelect.selected != null && !STARTED) {
|
||||||
final File workspaceRoot = new File(wsSelect.selected);
|
ATContentStudio.STARTED = true;
|
||||||
WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable(){
|
final File workspaceRoot = new File(wsSelect.selected);
|
||||||
public void run() {
|
WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable() {
|
||||||
Workspace.setActive(workspaceRoot);
|
public void run() {
|
||||||
if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue() && Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
|
Workspace.setActive(workspaceRoot);
|
||||||
new Thread() {
|
if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue()
|
||||||
public void run() {checkUpdate();}
|
&& Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
|
||||||
}.start();
|
new Thread() {
|
||||||
}
|
public void run() {
|
||||||
frame = new StudioFrame(APP_NAME+" "+APP_VERSION);
|
checkUpdate();
|
||||||
frame.setVisible(true);
|
}
|
||||||
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
|
}.start();
|
||||||
};
|
}
|
||||||
});
|
frame = new StudioFrame(APP_NAME + " " + APP_VERSION);
|
||||||
for (File f : ConfigCache.getKnownWorkspaces()) {
|
frame.setVisible(true);
|
||||||
if (workspaceRoot.equals(f)) {
|
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
|
||||||
if (!workspaceRoot.equals(ConfigCache.getLatestWorkspace())) {
|
};
|
||||||
ConfigCache.setLatestWorkspace(f);
|
});
|
||||||
}
|
for (File f : ConfigCache.getKnownWorkspaces()) {
|
||||||
return;
|
if (workspaceRoot.equals(f)) {
|
||||||
}
|
if (!workspaceRoot.equals(ConfigCache.getLatestWorkspace())) {
|
||||||
}
|
ConfigCache.setLatestWorkspace(f);
|
||||||
ConfigCache.addWorkspace(workspaceRoot);
|
}
|
||||||
ConfigCache.setLatestWorkspace(workspaceRoot);
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
ConfigCache.addWorkspace(workspaceRoot);
|
||||||
});
|
ConfigCache.setLatestWorkspace(workspaceRoot);
|
||||||
}
|
|
||||||
|
}
|
||||||
private static void checkUpdate() {
|
}
|
||||||
BufferedReader in = null;
|
});
|
||||||
try {
|
}
|
||||||
URL url = new URL(CHECK_UPDATE_URL);
|
|
||||||
in = new BufferedReader(new InputStreamReader(url.openStream()));
|
private static void checkUpdate() {
|
||||||
|
BufferedReader in = null;
|
||||||
String inputLine, lastLine = null;
|
try {
|
||||||
while ((inputLine = in.readLine()) != null) {lastLine = inputLine;}
|
URL url = new URL(CHECK_UPDATE_URL);
|
||||||
if (lastLine != null && !lastLine.equals(APP_VERSION)) {
|
in = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||||
|
|
||||||
// for copying style
|
String inputLine, lastLine = null;
|
||||||
JLabel label = new JLabel();
|
while ((inputLine = in.readLine()) != null) {
|
||||||
Font font = label.getFont();
|
lastLine = inputLine;
|
||||||
Color color = label.getBackground();
|
}
|
||||||
|
if (lastLine != null && !lastLine.equals(APP_VERSION)) {
|
||||||
// create some css from the label's font
|
|
||||||
StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
|
// for copying style
|
||||||
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
|
JLabel label = new JLabel();
|
||||||
style.append("font-size:" + font.getSize() + "pt;");
|
Font font = label.getFont();
|
||||||
style.append("background-color: rgb("+color.getRed()+","+color.getGreen()+","+color.getBlue()+");");
|
Color color = label.getBackground();
|
||||||
|
|
||||||
JEditorPane ep = new JEditorPane("text/html", "<html><body style=\"" + style + "\">"
|
// create some css from the label's font
|
||||||
+ "You are not running the latest ATCS version.<br/>"
|
StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
|
||||||
+ "You can get the latest version ("+lastLine+") by clicking the link below.<br/>"
|
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
|
||||||
+ "<a href=\""+DOWNLOAD_URL+"\">"+DOWNLOAD_URL+"</a><br/>"
|
style.append("font-size:" + font.getSize() + "pt;");
|
||||||
+ "<br/>"
|
style.append("background-color: rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
|
||||||
+ "</body></html>");
|
+ ");");
|
||||||
|
|
||||||
ep.setEditable(false);
|
JEditorPane ep = new JEditorPane("text/html",
|
||||||
ep.setBorder(null);
|
"<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/>"
|
||||||
ep.addHyperlinkListener(new HyperlinkListener() {
|
+ "<a href=\"" + DOWNLOAD_URL + "\">" + DOWNLOAD_URL + "</a><br/>" + "<br/>"
|
||||||
|
+ "</body></html>");
|
||||||
@Override
|
|
||||||
public void hyperlinkUpdate(HyperlinkEvent e) {
|
ep.setEditable(false);
|
||||||
try {
|
ep.setBorder(null);
|
||||||
if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
|
|
||||||
Desktop.getDesktop().browse(e.getURL().toURI());
|
ep.addHyperlinkListener(new HyperlinkListener() {
|
||||||
}
|
|
||||||
} catch (IOException e1) {
|
@Override
|
||||||
e1.printStackTrace();
|
public void hyperlinkUpdate(HyperlinkEvent e) {
|
||||||
} catch (URISyntaxException e1) {
|
try {
|
||||||
e1.printStackTrace();
|
if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
|
||||||
}
|
Desktop.getDesktop().browse(e.getURL().toURI());
|
||||||
}
|
}
|
||||||
});
|
} catch (IOException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE);
|
} catch (URISyntaxException e1) {
|
||||||
}
|
e1.printStackTrace();
|
||||||
} catch (MalformedURLException e) {
|
}
|
||||||
e.printStackTrace();
|
}
|
||||||
} catch (IOException e) {
|
});
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE);
|
||||||
try {
|
}
|
||||||
if (in != null) in.close();
|
} catch (MalformedURLException e) {
|
||||||
} catch (IOException e) {
|
e.printStackTrace();
|
||||||
e.printStackTrace();
|
} catch (IOException e) {
|
||||||
}
|
e.printStackTrace();
|
||||||
}
|
} finally {
|
||||||
}
|
try {
|
||||||
|
if (in != null)
|
||||||
public static void scaleUIFont() {
|
in.close();
|
||||||
if (SCALING != 1.0f) {
|
} catch (IOException e) {
|
||||||
System.out.println("Scaling fonts to "+SCALING);
|
e.printStackTrace();
|
||||||
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
|
}
|
||||||
Map<Object, Object> newDefaults = new HashMap<Object, Object>();
|
}
|
||||||
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
|
}
|
||||||
Object key = e.nextElement();
|
|
||||||
Object value = defaults.get(key);
|
public static void scaleUIFont() {
|
||||||
if (value instanceof Font) {
|
if (SCALING != 1.0f) {
|
||||||
Font font = (Font) value;
|
System.out.println("Scaling fonts to " + SCALING);
|
||||||
int newSize = (int)(font.getSize() * SCALING);
|
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
|
||||||
if (value instanceof FontUIResource) {
|
Map<Object, Object> newDefaults = new HashMap<Object, Object>();
|
||||||
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
|
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
|
||||||
} else {
|
Object key = e.nextElement();
|
||||||
newDefaults.put(key, new Font(font.getName(), font.getStyle(), newSize));
|
Object value = defaults.get(key);
|
||||||
}
|
if (value instanceof Font) {
|
||||||
}
|
Font font = (Font) value;
|
||||||
}
|
int newSize = (int) (font.getSize() * SCALING);
|
||||||
for (Object key : newDefaults.keySet()) {
|
if (value instanceof FontUIResource) {
|
||||||
defaults.put(key, newDefaults.get(key));
|
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
|
||||||
}
|
} else {
|
||||||
}
|
newDefaults.put(key, new Font(font.getName(), font.getStyle(), newSize));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
for (Object key : newDefaults.keySet()) {
|
||||||
|
defaults.put(key, newDefaults.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
BIN
src/com/gpl/rpg/atcontentstudio/img/date.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/date.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 275 B |
BIN
src/com/gpl/rpg/atcontentstudio/img/time.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/time.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 703 B |
@@ -236,7 +236,12 @@ public class ActorCondition extends JSONElement {
|
|||||||
if (this.icon_id != null) {
|
if (this.icon_id != null) {
|
||||||
String spritesheetId = this.icon_id.split(":")[0];
|
String spritesheetId = this.icon_id.split(":")[0];
|
||||||
if (getProject().getSpritesheet(spritesheetId) == null) {
|
if (getProject().getSpritesheet(spritesheetId) == null) {
|
||||||
|
System.out.println("Actor Condition");
|
||||||
System.out.println(this.id);
|
System.out.println(this.id);
|
||||||
|
System.out.println("failed to load spritesheet:");
|
||||||
|
System.out.println(spritesheetId);
|
||||||
|
System.out.println("while creating backlink for icon_id:");
|
||||||
|
System.out.println(this.icon_id);
|
||||||
}
|
}
|
||||||
getProject().getSpritesheet(spritesheetId).addBacklink(this);
|
getProject().getSpritesheet(spritesheetId).addBacklink(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -38,10 +38,16 @@ public abstract class JSONElement extends GameDataElement {
|
|||||||
for (Object obj : gameDataElements) {
|
for (Object obj : gameDataElements) {
|
||||||
Map jsonObj = (Map)obj;
|
Map jsonObj = (Map)obj;
|
||||||
String id = (String) jsonObj.get("id");
|
String id = (String) jsonObj.get("id");
|
||||||
if (id != null && id.equals(this.id )) {
|
try {
|
||||||
this.parse(jsonObj);
|
if (id != null && id.equals(this.id )) {
|
||||||
this.state = State.parsed;
|
this.parse(jsonObj);
|
||||||
break;
|
this.state = State.parsed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception e){
|
||||||
|
System.out.println("Error in ID: " + id);
|
||||||
|
System.out.println(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
@@ -53,6 +59,10 @@ public abstract class JSONElement extends GameDataElement {
|
|||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
Notification.addError("Error while parsing JSON file "+jsonFile.getAbsolutePath()+": "+e.getMessage());
|
Notification.addError("Error while parsing JSON file "+jsonFile.getAbsolutePath()+": "+e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
System.out.println(id);
|
||||||
|
Notification.addError("Error while parsing JSON file "+jsonFile.getAbsolutePath()+": "+e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
if (reader != null)
|
if (reader != null)
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -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 {
|
||||||
@@ -85,6 +89,7 @@ public class Requirement extends JSONElement {
|
|||||||
,resistancePhysical // lowers chance to get negative active conditions by monsters (Physical Capacity like Minor fatigue)
|
,resistancePhysical // lowers chance to get negative active conditions by monsters (Physical Capacity like Minor fatigue)
|
||||||
,resistanceBlood // lowers chance to get negative active conditions by monsters (Blood Disorder like Weak Poison)
|
,resistanceBlood // lowers chance to get negative active conditions by monsters (Blood Disorder like Weak Poison)
|
||||||
,shadowBless
|
,shadowBless
|
||||||
|
,sporeImmunity
|
||||||
,crit1 // lowers atk ability
|
,crit1 // lowers atk ability
|
||||||
,crit2 // lowers def ability ,rejuvenation // Reduces magnitudes of conditions
|
,crit2 // lowers def ability ,rejuvenation // Reduces magnitudes of conditions
|
||||||
,rejuvenation // Reduces magnitudes of conditions
|
,rejuvenation // Reduces magnitudes of conditions
|
||||||
@@ -195,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);
|
||||||
|
|||||||
@@ -95,7 +95,9 @@ public class ReplaceArea extends MapObject {
|
|||||||
if (oldSchoolRequirement && Requirement.RequirementType.questProgress.equals(requirement.type) && (requirement.negated == null || !requirement.negated)) {
|
if (oldSchoolRequirement && Requirement.RequirementType.questProgress.equals(requirement.type) && (requirement.negated == null || !requirement.negated)) {
|
||||||
tmxObject.setName(requirement.required_obj_id+":"+((requirement.required_value == null) ? "" : Integer.toString(requirement.required_value)));
|
tmxObject.setName(requirement.required_obj_id+":"+((requirement.required_value == null) ? "" : Integer.toString(requirement.required_value)));
|
||||||
} else {
|
} else {
|
||||||
tmxObject.getProperties().setProperty("requireType", requirement.type.toString());
|
if (requirement.type != null) {
|
||||||
|
tmxObject.getProperties().setProperty("requireType", requirement.type.toString());
|
||||||
|
}
|
||||||
if (requirement.required_obj != null) {
|
if (requirement.required_obj != null) {
|
||||||
tmxObject.getProperties().setProperty("requireId", requirement.required_obj.id);
|
tmxObject.getProperties().setProperty("requireId", requirement.required_obj.id);
|
||||||
} else if (requirement.required_obj_id != null) {
|
} else if (requirement.required_obj_id != null) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import com.gpl.rpg.atcontentstudio.ui.DefaultIcons;
|
|||||||
public class SpawnArea extends MapObject {
|
public class SpawnArea extends MapObject {
|
||||||
|
|
||||||
public int quantity = 1;
|
public int quantity = 1;
|
||||||
public int spawnchance = 10;
|
public int respawnSpeed = 10;
|
||||||
public boolean active = true;
|
public boolean active = true;
|
||||||
public boolean ignoreAreas = false;
|
public boolean ignoreAreas = false;
|
||||||
public String spawngroup_id;
|
public String spawngroup_id;
|
||||||
@@ -21,8 +21,8 @@ public class SpawnArea extends MapObject {
|
|||||||
if (obj.getProperties().getProperty("quantity") != null) {
|
if (obj.getProperties().getProperty("quantity") != null) {
|
||||||
this.quantity = Integer.parseInt(obj.getProperties().getProperty("quantity"));
|
this.quantity = Integer.parseInt(obj.getProperties().getProperty("quantity"));
|
||||||
}
|
}
|
||||||
if (obj.getProperties().getProperty("spawnchance") != null) {
|
if (obj.getProperties().getProperty("respawnspeed") != null) {
|
||||||
this.spawnchance = Integer.parseInt(obj.getProperties().getProperty("spawnchance"));
|
this.respawnSpeed = Integer.parseInt(obj.getProperties().getProperty("respawnspeed"));
|
||||||
}
|
}
|
||||||
if (obj.getProperties().getProperty("active") != null) {
|
if (obj.getProperties().getProperty("active") != null) {
|
||||||
this.active = Boolean.parseBoolean(obj.getProperties().getProperty("active"));
|
this.active = Boolean.parseBoolean(obj.getProperties().getProperty("active"));
|
||||||
@@ -82,8 +82,8 @@ public class SpawnArea extends MapObject {
|
|||||||
if (quantity != 1) {
|
if (quantity != 1) {
|
||||||
tmxObject.getProperties().setProperty("quantity", Integer.toString(quantity));
|
tmxObject.getProperties().setProperty("quantity", Integer.toString(quantity));
|
||||||
}
|
}
|
||||||
if (spawnchance != 10) {
|
if (respawnSpeed != 10) {
|
||||||
tmxObject.getProperties().setProperty("spawnchance", Integer.toString(spawnchance));
|
tmxObject.getProperties().setProperty("respawnspeed", Integer.toString(respawnSpeed));
|
||||||
}
|
}
|
||||||
if (!this.active) {
|
if (!this.active) {
|
||||||
tmxObject.getProperties().setProperty("active", Boolean.toString(active));
|
tmxObject.getProperties().setProperty("active", Boolean.toString(active));
|
||||||
@@ -92,5 +92,4 @@ public class SpawnArea extends MapObject {
|
|||||||
tmxObject.getProperties().setProperty("ignoreAreas", Boolean.toString(ignoreAreas));
|
tmxObject.getProperties().setProperty("ignoreAreas", Boolean.toString(ignoreAreas));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,17 +37,17 @@ public class AboutEditor extends Editor {
|
|||||||
"<b>Right click on the left area or use the \"File\" menu to create a project.</b><br/>" +
|
"<b>Right click on the left area or use the \"File\" menu to create a project.</b><br/>" +
|
||||||
"<br/>" +
|
"<br/>" +
|
||||||
"Play <a href=\"https://play.google.com/store/apps/details?id=com.gpl.rpg.AndorsTrail\">Andor's Trail</a> for free on your Android device.<br/>" +
|
"Play <a href=\"https://play.google.com/store/apps/details?id=com.gpl.rpg.AndorsTrail\">Andor's Trail</a> for free on your Android device.<br/>" +
|
||||||
"Visit <a href=\"http://andorstrail.com/\">the official forum</a> to give or receive help.<br/>" +
|
"Visit <a href=\"https://andorstrail.com/\">the official forum</a> to give or receive help.<br/>" +
|
||||||
"Open the project's <a href=\"https://github.com/Zukero/andors-trail/\">GitHub project page</a> to check out the game's source code.<br/>" +
|
"Open the project's <a href=\"https://github.com/Zukero/andors-trail/\">GitHub project page</a> to check out the game's source code.<br/>" +
|
||||||
"<br/>" +
|
"<br/>" +
|
||||||
"For content creation help, make sure to use the following resources:<br/>" +
|
"For content creation help, make sure to use the following resources:<br/>" +
|
||||||
"<a href=\"http://andorstrail.com/viewtopic.php?f=6&t=4560\">The contribution guide on the forums</a><br/>" +
|
"<a href=\"https://andorstrail.com/viewtopic.php?f=6&t=4560\">The contribution guide on the forums</a><br/>" +
|
||||||
"<a href=\"http://andorstrail.com/wiki/doku.php?id=andors_trail_wiki:developer_section\">The developer section of the Andor's Trail wiki</a><br/>" +
|
"<a href=\"https://andorstrail.com/wiki/doku.php?id=andors_trail_wiki:developer_section\">The developer section of the Andor's Trail wiki</a><br/>" +
|
||||||
"<a href=\"https://docs.google.com/document/d/1BwWD1tLgPcmA2bwudrVnOc6f2dkPLFCjWdn7tXlIp5g\">The design outline document on Google Drive/Docs</a><br/>" +
|
"<a href=\"https://docs.google.com/document/d/1BwWD1tLgPcmA2bwudrVnOc6f2dkPLFCjWdn7tXlIp5g\">The design outline document on Google Drive/Docs</a><br/>" +
|
||||||
"<br/>" +
|
"<br/>" +
|
||||||
"<font size=+1>Credits:</font><br/>" +
|
"<font size=+1>Credits:</font><br/>" +
|
||||||
"<br/>" +
|
"<br/>" +
|
||||||
"Author: <a href=\"http://andorstrail.com/memberlist.php?mode=viewprofile&u=2875\">Zukero</a><br/>" +
|
"Author: <a href=\"https://andorstrail.com/memberlist.php?mode=viewprofile&u=2875\">Zukero</a><br/>" +
|
||||||
"Licence: <a href=\"http://www.gnu.org/licenses/gpl-3.0.html\">GPL v3</a><br/>" +
|
"Licence: <a href=\"http://www.gnu.org/licenses/gpl-3.0.html\">GPL v3</a><br/>" +
|
||||||
"Sources are included in this package and on <a href=\"https://github.com/Zukero/ATCS\">GitHub</a>.<br/>" +
|
"Sources are included in this package and on <a href=\"https://github.com/Zukero/ATCS\">GitHub</a>.<br/>" +
|
||||||
"<br/>" +
|
"<br/>" +
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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.");
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -521,16 +521,6 @@ public class WorldMapView extends JComponent implements Scrollable {
|
|||||||
}
|
}
|
||||||
worldmap.getProject().getMap(id).addBacklink(worldmap);
|
worldmap.getProject().getMap(id).addBacklink(worldmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> toRemove = new ArrayList<String>();
|
|
||||||
for (String s : worldmap.labels.keySet()) {
|
|
||||||
if (!mapLocations.containsKey(s)) {
|
|
||||||
toRemove.add(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (String s : toRemove) {
|
|
||||||
worldmap.labels.remove(s);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,43 +1,34 @@
|
|||||||
package com.gpl.rpg.atcontentstudio.ui.sprites;
|
package com.gpl.rpg.atcontentstudio.ui.sprites;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.*;
|
||||||
import java.awt.GridBagConstraints;
|
|
||||||
import java.awt.GridBagLayout;
|
|
||||||
import java.awt.Image;
|
|
||||||
import java.awt.Point;
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import javax.swing.*;
|
||||||
import javax.swing.ButtonGroup;
|
|
||||||
import javax.swing.ImageIcon;
|
|
||||||
import javax.swing.JDialog;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JScrollPane;
|
|
||||||
import javax.swing.JToggleButton;
|
|
||||||
import javax.swing.ScrollPaneConstants;
|
|
||||||
|
|
||||||
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||||
import com.gpl.rpg.atcontentstudio.model.Project;
|
import com.gpl.rpg.atcontentstudio.model.Project;
|
||||||
import com.gpl.rpg.atcontentstudio.model.sprites.Spritesheet;
|
import com.gpl.rpg.atcontentstudio.model.sprites.Spritesheet;
|
||||||
import com.gpl.rpg.atcontentstudio.model.sprites.Spritesheet.Category;
|
import com.gpl.rpg.atcontentstudio.model.sprites.Spritesheet.Category;
|
||||||
|
import com.gpl.rpg.atcontentstudio.utils.SpriteUtils;
|
||||||
|
|
||||||
|
|
||||||
public class SpriteChooser extends JDialog {
|
public class SpriteChooser extends JDialog {
|
||||||
|
|
||||||
private static final long serialVersionUID = -6018113265015159521L;
|
private static final long serialVersionUID = -6018113265015159521L;
|
||||||
|
|
||||||
private static final int STD_WIDTH = 32;
|
private static final int STD_WIDTH = 32;
|
||||||
private static final int STD_HEIGHT = 32;
|
private static final int STD_HEIGHT = 32;
|
||||||
private static final int MAX_PER_ROW = 10;
|
private static final int MAX_PER_ROW = 10;
|
||||||
|
|
||||||
public static Map<Project, Map<Spritesheet.Category, SpriteChooser>> cache = new LinkedHashMap<Project, Map<Spritesheet.Category,SpriteChooser>>();
|
public static Map<Project, Map<Spritesheet.Category, SpriteChooser>> cache = new LinkedHashMap<Project, Map<Spritesheet.Category, SpriteChooser>>();
|
||||||
public static Map<Project, Map<Spritesheet.Category, List<Spritesheet>>> cacheValidator = new LinkedHashMap<Project, Map<Category,List<Spritesheet>>>();
|
public static Map<Project, Map<Spritesheet.Category, List<Spritesheet>>> cacheValidator = new LinkedHashMap<Project, Map<Category, List<Spritesheet>>>();
|
||||||
|
|
||||||
|
|
||||||
public static SpriteChooser getChooser(Project proj, Spritesheet.Category category) {
|
public static SpriteChooser getChooser(Project proj, Spritesheet.Category category) {
|
||||||
if (cache.get(proj) == null) {
|
if (cache.get(proj) == null) {
|
||||||
cache.put(proj, new LinkedHashMap<Spritesheet.Category, SpriteChooser>());
|
cache.put(proj, new LinkedHashMap<Spritesheet.Category, SpriteChooser>());
|
||||||
@@ -46,13 +37,13 @@ public class SpriteChooser extends JDialog {
|
|||||||
cache.get(proj).put(category, new SpriteChooser(proj, category));
|
cache.get(proj).put(category, new SpriteChooser(proj, category));
|
||||||
} else {
|
} else {
|
||||||
List<Spritesheet> spritesheets = new ArrayList<Spritesheet>();
|
List<Spritesheet> spritesheets = new ArrayList<Spritesheet>();
|
||||||
for (int i=0; i<proj.getSpritesheetCount(); i++) {
|
for (int i = 0; i < proj.getSpritesheetCount(); i++) {
|
||||||
Spritesheet sheet = proj.getSpritesheet(i);
|
Spritesheet sheet = proj.getSpritesheet(i);
|
||||||
if (sheet.category == category) {
|
if (sheet.category == category) {
|
||||||
spritesheets.add(sheet);
|
spritesheets.add(sheet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !spritesheets.equals(cacheValidator.get(proj).get(category)) ) {
|
if (!spritesheets.equals(cacheValidator.get(proj).get(category))) {
|
||||||
cache.get(proj).put(category, new SpriteChooser(proj, category));
|
cache.get(proj).put(category, new SpriteChooser(proj, category));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,20 +56,20 @@ public class SpriteChooser extends JDialog {
|
|||||||
wanted.pack();
|
wanted.pack();
|
||||||
return wanted;
|
return wanted;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ButtonGroup group;
|
private ButtonGroup group;
|
||||||
// private IconButton selectedOne = null;
|
// private IconButton selectedOne = null;
|
||||||
// private JButton ok;
|
// private JButton ok;
|
||||||
// private JButton cancel;
|
// private JButton cancel;
|
||||||
|
|
||||||
public String selectedIconId = null;
|
public String selectedIconId = null;
|
||||||
|
|
||||||
public SpriteChooser(Project proj, Category category) {
|
public SpriteChooser(Project proj, Category category) {
|
||||||
super(ATContentStudio.frame);
|
super(ATContentStudio.frame);
|
||||||
setTitle("Select a sprite");
|
setTitle("Select a sprite");
|
||||||
setModalityType(ModalityType.APPLICATION_MODAL);
|
setModalityType(ModalityType.APPLICATION_MODAL);
|
||||||
List<Spritesheet> spritesheets = new ArrayList<Spritesheet>();
|
List<Spritesheet> spritesheets = new ArrayList<Spritesheet>();
|
||||||
for (int i=0; i<proj.getSpritesheetCount(); i++) {
|
for (int i = 0; i < proj.getSpritesheetCount(); i++) {
|
||||||
Spritesheet sheet = proj.getSpritesheet(i);
|
Spritesheet sheet = proj.getSpritesheet(i);
|
||||||
if (sheet.category == category) {
|
if (sheet.category == category) {
|
||||||
spritesheets.add(sheet);
|
spritesheets.add(sheet);
|
||||||
@@ -88,8 +79,8 @@ public class SpriteChooser extends JDialog {
|
|||||||
cacheValidator.put(proj, new LinkedHashMap<Spritesheet.Category, List<Spritesheet>>());
|
cacheValidator.put(proj, new LinkedHashMap<Spritesheet.Category, List<Spritesheet>>());
|
||||||
}
|
}
|
||||||
cacheValidator.get(proj).put(category, spritesheets);
|
cacheValidator.get(proj).put(category, spritesheets);
|
||||||
|
|
||||||
|
|
||||||
JPanel pane = new JPanel();
|
JPanel pane = new JPanel();
|
||||||
pane.setLayout(new GridBagLayout());
|
pane.setLayout(new GridBagLayout());
|
||||||
GridBagConstraints c = new GridBagConstraints();
|
GridBagConstraints c = new GridBagConstraints();
|
||||||
@@ -101,16 +92,20 @@ public class SpriteChooser extends JDialog {
|
|||||||
c.gridheight = 1;
|
c.gridheight = 1;
|
||||||
c.anchor = GridBagConstraints.NORTHWEST;
|
c.anchor = GridBagConstraints.NORTHWEST;
|
||||||
c.fill = GridBagConstraints.BOTH;
|
c.fill = GridBagConstraints.BOTH;
|
||||||
|
|
||||||
List<Point> reservedSlots = new ArrayList<Point>();
|
List<Point> reservedSlots = new ArrayList<Point>();
|
||||||
Point nextFreeSlot = new Point(0, 0);
|
Point nextFreeSlot = new Point(0, 0);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
Image img;
|
BufferedImage img;
|
||||||
group = new ButtonGroup();
|
group = new ButtonGroup();
|
||||||
|
//For every sprite find a free space in panel:
|
||||||
for (Spritesheet sheet : spritesheets) {
|
for (Spritesheet sheet : spritesheets) {
|
||||||
i = 0;
|
i = -1;
|
||||||
while ((img = sheet.getImage(i)) != null) {
|
while ((img = sheet.getImage(++i)) != null) {
|
||||||
|
if (SpriteUtils.checkIsImageEmpty(img)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
IconButton button = new IconButton(img, sheet.id, i);
|
IconButton button = new IconButton(img, sheet.id, i);
|
||||||
group.add(button);
|
group.add(button);
|
||||||
if (sheet.spriteWidth == STD_WIDTH && sheet.spriteHeight == STD_HEIGHT) {
|
if (sheet.spriteWidth == STD_WIDTH && sheet.spriteHeight == STD_HEIGHT) {
|
||||||
@@ -120,7 +115,7 @@ public class SpriteChooser extends JDialog {
|
|||||||
c.gridx = 0;
|
c.gridx = 0;
|
||||||
c.gridy++;
|
c.gridy++;
|
||||||
}
|
}
|
||||||
nextFreeSlot.setLocation(c.gridx, c.gridy);
|
nextFreeSlot.setLocation(c.gridx, c.gridy);
|
||||||
} else {
|
} else {
|
||||||
c.gridwidth = (sheet.spriteWidth / STD_WIDTH) + (sheet.spriteWidth % STD_WIDTH == 0 ? 0 : 1);
|
c.gridwidth = (sheet.spriteWidth / STD_WIDTH) + (sheet.spriteWidth % STD_WIDTH == 0 ? 0 : 1);
|
||||||
c.gridheight = (sheet.spriteHeight / STD_HEIGHT) + (sheet.spriteHeight % STD_HEIGHT == 0 ? 0 : 1);
|
c.gridheight = (sheet.spriteHeight / STD_HEIGHT) + (sheet.spriteHeight % STD_HEIGHT == 0 ? 0 : 1);
|
||||||
@@ -131,14 +126,20 @@ public class SpriteChooser extends JDialog {
|
|||||||
for (int y = c.gridy; y < c.gridy + c.gridwidth; y++) {
|
for (int y = c.gridy; y < c.gridy + c.gridwidth; y++) {
|
||||||
if (reservedSlots.contains(new Point(x, y))) {
|
if (reservedSlots.contains(new Point(x, y))) {
|
||||||
slotOk = false;
|
slotOk = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!slotOk) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (slotOk && c.gridx + c.gridwidth > MAX_PER_ROW) {
|
if (c.gridx + c.gridwidth > MAX_PER_ROW) {
|
||||||
c.gridx = 0;
|
c.gridx = 0;
|
||||||
c.gridy++;
|
c.gridy++;
|
||||||
slotOk = false;
|
slotOk = false;
|
||||||
}
|
} else if (!slotOk) {
|
||||||
|
c.gridx++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pane.add(button, c);
|
pane.add(button, c);
|
||||||
for (int x = c.gridx; x < c.gridx + c.gridwidth; x++) {
|
for (int x = c.gridx; x < c.gridx + c.gridwidth; x++) {
|
||||||
@@ -157,15 +158,14 @@ public class SpriteChooser extends JDialog {
|
|||||||
c.gridx = 0;
|
c.gridx = 0;
|
||||||
c.gridy++;
|
c.gridy++;
|
||||||
}
|
}
|
||||||
nextFreeSlot.setLocation(c.gridx, c.gridy);
|
nextFreeSlot.setLocation(c.gridx, c.gridy);
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ok = new JButton("Ok");
|
// ok = new JButton("Ok");
|
||||||
// cancel = new JButton("Cancel");
|
// cancel = new JButton("Cancel");
|
||||||
|
|
||||||
c.gridx = 0;
|
c.gridx = 0;
|
||||||
boolean emptyLine = false;
|
boolean emptyLine = false;
|
||||||
while (!emptyLine) {
|
while (!emptyLine) {
|
||||||
@@ -178,7 +178,7 @@ public class SpriteChooser extends JDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// JPanel buttonPane = new JPanel();
|
// JPanel buttonPane = new JPanel();
|
||||||
// buttonPane.add(cancel, BorderLayout.WEST);
|
// buttonPane.add(cancel, BorderLayout.WEST);
|
||||||
// buttonPane.add(ok, BorderLayout.EAST);
|
// buttonPane.add(ok, BorderLayout.EAST);
|
||||||
@@ -190,7 +190,7 @@ public class SpriteChooser extends JDialog {
|
|||||||
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
wrapper.add(scroller, BorderLayout.CENTER);
|
wrapper.add(scroller, BorderLayout.CENTER);
|
||||||
// wrapper.add(buttonPane, BorderLayout.SOUTH);
|
// wrapper.add(buttonPane, BorderLayout.SOUTH);
|
||||||
|
|
||||||
// ok.addActionListener(new ActionListener() {
|
// ok.addActionListener(new ActionListener() {
|
||||||
// @Override
|
// @Override
|
||||||
// public void actionPerformed(ActionEvent e) {
|
// public void actionPerformed(ActionEvent e) {
|
||||||
@@ -200,7 +200,7 @@ public class SpriteChooser extends JDialog {
|
|||||||
// if (listener != null) listener.iconSelected(selectedIconId);
|
// if (listener != null) listener.iconSelected(selectedIconId);
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// cancel.addActionListener(new ActionListener() {
|
// cancel.addActionListener(new ActionListener() {
|
||||||
// @Override
|
// @Override
|
||||||
// public void actionPerformed(ActionEvent e) {
|
// public void actionPerformed(ActionEvent e) {
|
||||||
@@ -210,21 +210,21 @@ public class SpriteChooser extends JDialog {
|
|||||||
// if (listener != null) listener.iconSelected(null);
|
// if (listener != null) listener.iconSelected(null);
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
setContentPane(wrapper);
|
setContentPane(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SpriteChooser.SelectionListener listener = null;
|
private SpriteChooser.SelectionListener listener = null;
|
||||||
|
|
||||||
public void setSelectionListener(SpriteChooser.SelectionListener l) {
|
public void setSelectionListener(SpriteChooser.SelectionListener l) {
|
||||||
listener = l;
|
listener = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class IconButton extends JToggleButton {
|
public class IconButton extends JToggleButton {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7559407153561178455L;
|
private static final long serialVersionUID = 7559407153561178455L;
|
||||||
|
|
||||||
public String sheetId;
|
public String sheetId;
|
||||||
public int spriteIndex;
|
public int spriteIndex;
|
||||||
|
|
||||||
@@ -232,12 +232,12 @@ public class SpriteChooser extends JDialog {
|
|||||||
super(new ImageIcon(img));
|
super(new ImageIcon(img));
|
||||||
this.sheetId = sheetId;
|
this.sheetId = sheetId;
|
||||||
this.spriteIndex = spriteIndex;
|
this.spriteIndex = spriteIndex;
|
||||||
setToolTipText(sheetId+":"+spriteIndex);
|
setToolTipText(sheetId + ":" + spriteIndex);
|
||||||
addActionListener(new ActionListener() {
|
addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (IconButton.this.isSelected()) {
|
if (IconButton.this.isSelected()) {
|
||||||
selectedIconId = IconButton.this.sheetId+":"+IconButton.this.spriteIndex;
|
selectedIconId = IconButton.this.sheetId + ":" + IconButton.this.spriteIndex;
|
||||||
SpriteChooser.this.setVisible(false);
|
SpriteChooser.this.setVisible(false);
|
||||||
SpriteChooser.this.dispose();
|
SpriteChooser.this.dispose();
|
||||||
if (listener != null) listener.iconSelected(selectedIconId);
|
if (listener != null) listener.iconSelected(selectedIconId);
|
||||||
@@ -246,9 +246,9 @@ public class SpriteChooser extends JDialog {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface SelectionListener {
|
public static interface SelectionListener {
|
||||||
public void iconSelected(String selected);
|
public void iconSelected(String selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
34
src/com/gpl/rpg/atcontentstudio/utils/SpriteUtils.java
Normal file
34
src/com/gpl/rpg/atcontentstudio/utils/SpriteUtils.java
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
package com.gpl.rpg.atcontentstudio.utils;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.awt.image.WritableRaster;
|
||||||
|
|
||||||
|
public final class SpriteUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the image is empty (transparent )
|
||||||
|
*
|
||||||
|
* @param img The image to check
|
||||||
|
* @return true if the image is empty
|
||||||
|
*/
|
||||||
|
public static boolean checkIsImageEmpty(BufferedImage img) {
|
||||||
|
int width = img.getWidth(null);
|
||||||
|
int height = img.getHeight(null);
|
||||||
|
WritableRaster raster = img.getAlphaRaster();
|
||||||
|
if (raster == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (int x = 0; x < width; x++) {
|
||||||
|
for (int y = 0; y < height; y++) {
|
||||||
|
//get pixel alpha value
|
||||||
|
int alpha = raster.getSample(x, y, 0);
|
||||||
|
//if alpha is not 0 then the pixel is not transparent
|
||||||
|
if (alpha != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//no non-transparent pixel found
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user