mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-27 23:07:41 +01:00
Compare commits
53 Commits
spawnchanc
...
version-ch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85e0a1fd28 | ||
|
|
e2fdf08fec | ||
|
|
1555bd63db | ||
|
|
56fff8a730 | ||
|
|
dd7b3d5300 | ||
|
|
68affdde8c | ||
|
|
6cec8b835e | ||
|
|
aa43382296 | ||
|
|
ec346e9c98 | ||
|
|
61d5af822c | ||
|
|
c2d05b2bff | ||
|
|
e60378ab64 | ||
|
|
6578236775 | ||
|
|
4fa2409c24 | ||
|
|
b5aa453fd6 | ||
|
|
42f1c87278 | ||
|
|
9097b97316 | ||
|
|
7965ecb4f1 | ||
|
|
01963517ba | ||
|
|
30bef443d5 | ||
|
|
8d01716d93 | ||
|
|
fce5cd71ff | ||
|
|
0cddbb04e9 | ||
|
|
00ec5fe49f | ||
|
|
5cdb42ae07 | ||
|
|
c98f51744b | ||
|
|
5550b257ca | ||
|
|
619aa1075f | ||
|
|
38a3ad85c8 | ||
|
|
89f764b62b | ||
|
|
d81233d470 | ||
|
|
e1685aa625 | ||
|
|
ae3ca5d50a | ||
|
|
a00b8fbc66 | ||
|
|
4d03c15e08 | ||
|
|
4571bea429 | ||
|
|
ecc9a35c69 | ||
|
|
c4d71df4b1 | ||
|
|
a13dac467a | ||
|
|
e305dfd7bf | ||
|
|
80984a43af | ||
|
|
2bc8b65264 | ||
|
|
b2584a24cc | ||
|
|
1626a8340f | ||
|
|
5fe2dfe148 | ||
|
|
abc1e7c912 | ||
|
|
317d6d4216 | ||
|
|
3628386019 | ||
|
|
ada352a02c | ||
|
|
fc0d97aa2f | ||
|
|
7451f582ce | ||
|
|
7b80bf5768 | ||
|
|
ddd98c5a8f |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,3 +1,13 @@
|
|||||||
/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
|
||||||
|
/packaging/common/ATCS.env.bat
|
||||||
|
/packaging/common/ATCS.env
|
||||||
|
/packaging/common/ATCS_v*.zip
|
||||||
|
|||||||
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" default="true" />
|
||||||
|
</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.19.jar"/>
|
<jar path="ATContentStudio/ATCS_v0.6.20.jar"/>
|
||||||
<options buildIfNeeded="true" compress="true" descriptionLocation="/ATContentStudio/ATCS_JAR.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
|
<options buildIfNeeded="true" compress="true" descriptionLocation="/ATContentStudio/ATCS_JAR.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
|
||||||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
||||||
<selectedProjects/>
|
<selectedProjects/>
|
||||||
|
|||||||
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
|
||||||
@@ -1 +1 @@
|
|||||||
v0.6.19
|
v0.6.21
|
||||||
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,9 @@
|
|||||||
!include MUI2.nsh
|
!include MUI2.nsh
|
||||||
|
|
||||||
!define VERSION "0.6.19"
|
!define VERSION "0.6.21"
|
||||||
!define TRAINER_VERSION "0.1.5"
|
!define TRAINER_VERSION "0.1.5"
|
||||||
!define JAVA_BIN "javaw"
|
!define JAVA_BIN "java"
|
||||||
|
!define ATCS_SOURCE_DIR "C:\ATCS"
|
||||||
|
|
||||||
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"
|
||||||
@@ -13,8 +14,8 @@ InstallDir "$PROGRAMFILES\ATCS\"
|
|||||||
Var StartMenuFolder
|
Var StartMenuFolder
|
||||||
|
|
||||||
!define MUI_WELCOMEPAGE_TITLE "Welcome to Andor's Trail Content Studio installer"
|
!define MUI_WELCOMEPAGE_TITLE "Welcome to Andor's Trail Content Studio installer"
|
||||||
!define MUI_WELCOMEPAGE_TEXT "This will install Andor's Trail Content Studio v${VERSION} installer"
|
!define MUI_WELCOMEPAGE_TEXT "This will install Andor's Trail Content Studio v${VERSION}"
|
||||||
!define MUI_FINISHPAGE_TEXT "Andor's Trail Content Studio v${VERSION} install completed !"
|
!define MUI_FINISHPAGE_TEXT "Andor's Trail Content Studio v${VERSION} - Install completed !"
|
||||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Andor's Trail Content Studio"
|
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Andor's Trail Content Studio"
|
||||||
!define MUI_PAGE_HEADER_TEXT "Installing Andor's Trail Content Studio v${VERSION}"
|
!define MUI_PAGE_HEADER_TEXT "Installing Andor's Trail Content Studio v${VERSION}"
|
||||||
|
|
||||||
@@ -46,31 +47,33 @@ Var StartMenuFolder
|
|||||||
!insertmacro MUI_UNPAGE_CONFIRM
|
!insertmacro MUI_UNPAGE_CONFIRM
|
||||||
!insertmacro MUI_UNPAGE_INSTFILES
|
!insertmacro MUI_UNPAGE_INSTFILES
|
||||||
|
|
||||||
|
|
||||||
!insertmacro MUI_LANGUAGE "English"
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------------
|
||||||
Section install
|
Section install
|
||||||
|
|
||||||
|
;--- Create in ...\packaging\common\ ATCS.cmd ATCT.ico ATCS.jar
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
file "ATCS.ico"
|
file "ATCS.ico"
|
||||||
|
file "${ATCS_SOURCE_DIR}\packaging\common\ATCS.jar"
|
||||||
Delete "$INSTDIR\lib\*"
|
|
||||||
|
|
||||||
Call GetJRE
|
Call GetJRE
|
||||||
Pop $R0
|
Pop $R0
|
||||||
|
; file "${ATCS_SOURCE_DIR}\packaging\common\ATCS.cmd"
|
||||||
|
; !insertmacro _ReplaceInFile "ATCS.cmd" "java.exe" "$R0" (It was too much work this way)
|
||||||
FileOpen $9 "ATCS.cmd" w
|
FileOpen $9 "ATCS.cmd" w
|
||||||
FileWrite $9 '@echo off$\r$\n'
|
FileWrite $9 '@echo off$\r$\n'
|
||||||
FileWrite $9 '$\r$\n'
|
FileWrite $9 '$\r$\n'
|
||||||
FileWrite $9 'set "ATCS_DIR=%~dp0"$\r$\n'
|
FileWrite $9 'set "ATCS_DIR=%~dp0"$\r$\n'
|
||||||
FileWrite $9 'set "MAX_MEM=512M"$\r$\n'
|
FileWrite $9 'set "MAX_MEM=1024M"$\r$\n'
|
||||||
FileWrite $9 'set "CP=%ATCS_DIR%lib\*"$\r$\n'
|
FileWrite $9 'set "CP=%ATCS_DIR%lib\*"$\r$\n'
|
||||||
FileWrite $9 'set "JAVA=$R0"$\r$\n'
|
FileWrite $9 'set "JAVA=$R0"$\r$\n'
|
||||||
FileWrite $9 'set "JAVA_OPTS="$\r$\n'
|
FileWrite $9 'set "JAVA_OPTS="$\r$\n'
|
||||||
FileWrite $9 'set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"$\r$\n'
|
FileWrite $9 'set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"$\r$\n'
|
||||||
FileWrite $9 'set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"$\r$\n'
|
FileWrite $9 'set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"$\r$\n'
|
||||||
FileWrite $9 '$\r$\n'
|
FileWrite $9 '$\r$\n'
|
||||||
FileWrite $9 'if exist "%ENV_FILE%" ($\r$\n'
|
FileWrite $9 'if exist "%ENV_FILE%" ($\r$\n'
|
||||||
FileWrite $9 ' call "%ENV_FILE%"$\r$\n'
|
FileWrite $9 ' call "%ENV_FILE%"$\r$\n'
|
||||||
FileWrite $9 ') else ($\r$\n'
|
FileWrite $9 ') else ($\r$\n'
|
||||||
FileWrite $9 ' echo REM set "MAX_MEM=%MAX_MEM%">"%ENV_FILE%"$\r$\n'
|
FileWrite $9 ' echo REM set "MAX_MEM=%MAX_MEM%">"%ENV_FILE%"$\r$\n'
|
||||||
@@ -79,29 +82,15 @@ Section install
|
|||||||
FileWrite $9 ' echo.>>"%ENV_FILE%"$\r$\n'
|
FileWrite $9 ' echo.>>"%ENV_FILE%"$\r$\n'
|
||||||
FileWrite $9 ')$\r$\n'
|
FileWrite $9 ')$\r$\n'
|
||||||
FileWrite $9 '$\r$\n'
|
FileWrite $9 '$\r$\n'
|
||||||
FileWrite $9 'start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -cp "%CP%" %MAIN_CLASS%$\r$\n'
|
FileWrite $9 'start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -jar ATCS.jar$\r$\n'
|
||||||
FileClose $9
|
FileClose $9
|
||||||
|
|
||||||
SetOutPath "$INSTDIR\lib\"
|
|
||||||
file "C:\AT\ATCS_source\lib\jide-oss.jar"
|
|
||||||
file "C:\AT\ATCS_source\lib\ui.jar"
|
|
||||||
file "C:\AT\ATCS_source\lib\AndorsTrainer_v${TRAINER_VERSION}.jar"
|
|
||||||
file "C:\AT\ATCS_source\lib\junit-4.10.jar"
|
|
||||||
file "C:\AT\ATCS_source\lib\json_simple-1.1.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"
|
|
||||||
file "C:\AT\ATCS_source\lib\jsoup-1.10.2.jar"
|
|
||||||
|
|
||||||
SetOutPath $INSTDIR
|
|
||||||
|
|
||||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
|
|
||||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN "ATCS"
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN "ATCS"
|
||||||
|
|
||||||
;Create shortcuts
|
;--- Create shortcuts
|
||||||
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
||||||
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Andor's Trail Content Studio.lnk" "$INSTDIR\ATCS.cmd" "" "$INSTDIR\ATCS.ico"
|
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Andor's Trail Content Studio.lnk" "$INSTDIR\ATCS.cmd" "" "$INSTDIR\ATCS.ico"
|
||||||
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||||
@@ -110,6 +99,8 @@ Section install
|
|||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------------
|
||||||
Section uninstall
|
Section uninstall
|
||||||
|
|
||||||
Delete "$INSTDIR\lib\jide-oss.jar"
|
Delete "$INSTDIR\lib\jide-oss.jar"
|
||||||
@@ -117,18 +108,17 @@ Section uninstall
|
|||||||
Delete "$INSTDIR\lib\junit-4.10.jar"
|
Delete "$INSTDIR\lib\junit-4.10.jar"
|
||||||
Delete "$INSTDIR\lib\json_simple-1.1.jar"
|
Delete "$INSTDIR\lib\json_simple-1.1.jar"
|
||||||
Delete "$INSTDIR\lib\AndorsTrainer_v${TRAINER_VERSION}.jar"
|
Delete "$INSTDIR\lib\AndorsTrainer_v${TRAINER_VERSION}.jar"
|
||||||
Delete "$INSTDIR\lib\ATCS_v${VERSION}.jar"
|
|
||||||
Delete "$INSTDIR\lib\rsyntaxtextarea.jar"
|
Delete "$INSTDIR\lib\rsyntaxtextarea.jar"
|
||||||
Delete "$INSTDIR\lib\prefuse.jar"
|
Delete "$INSTDIR\lib\prefuse.jar"
|
||||||
Delete "$INSTDIR\lib\bsh-2.0b4.jar"
|
Delete "$INSTDIR\lib\bsh-2.0b4.jar"
|
||||||
Delete "$INSTDIR\lib\jsoup-1.10.2.jar"
|
Delete "$INSTDIR\lib\jsoup-1.10.2.jar"
|
||||||
RMDir "$INSTDIR\lib\"
|
RMDir "$INSTDIR\lib\"
|
||||||
|
|
||||||
Delete "$INSTDIR\ATCS.ico"
|
Delete "$INSTDIR\ATCS.ico"
|
||||||
Delete "$INSTDIR\ATCS.cmd"
|
Delete "$INSTDIR\ATCS.cmd"
|
||||||
Delete "$INSTDIR\ATCS.env.bat"
|
Delete "$INSTDIR\ATCS.env.bat"
|
||||||
|
Delete "$INSTDIR\ATCS.jar"
|
||||||
Delete "$INSTDIR\Uninstall.exe"
|
Delete "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
RMDir "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
|
|
||||||
!insertmacro MUI_STARTMENU_GETFOLDER "ATCS" $StartMenuFolder
|
!insertmacro MUI_STARTMENU_GETFOLDER "ATCS" $StartMenuFolder
|
||||||
@@ -140,19 +130,20 @@ Section uninstall
|
|||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------------
|
||||||
Function GetJRE
|
Function GetJRE
|
||||||
;
|
;
|
||||||
; Find JRE (javaw.exe)
|
; Find JRE (java.exe)
|
||||||
; DISABLED 1 - in .\jre directory (JRE Installed with application)
|
; DISABLED 1 - in .\jre directory (JRE Installed with application)
|
||||||
; 2 - in JAVA_HOME environment variable
|
; 2 - in JAVA_HOME environment variable
|
||||||
; 3 - in the registry
|
; 3 - in the registry
|
||||||
; 4 - assume javaw.exe in current dir or PATH
|
; 4 - assume java.exe in current dir or PATH
|
||||||
|
|
||||||
Push $R0
|
Push $R0
|
||||||
Push $R1
|
Push $R1
|
||||||
|
|
||||||
;ClearErrors
|
;ClearErrors
|
||||||
;StrCpy $R0 "$EXEDIR\jre\bin\javaw.exe"
|
;StrCpy $R0 "$EXEDIR\jre\bin\java.exe"
|
||||||
;IfFileExists $R0 JreFound
|
;IfFileExists $R0 JreFound
|
||||||
;StrCpy $R0 ""
|
;StrCpy $R0 ""
|
||||||
|
|
||||||
|
|||||||
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=1024M"
|
||||||
|
set "JAVA=java.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"
|
||||||
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,6 +1,7 @@
|
|||||||
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_newb.category=actorcondition
|
||||||
atcs.spritesheet.actorconditions_omi1.category=actorcondition
|
atcs.spritesheet.actorconditions_omi1.category=actorcondition
|
||||||
atcs.spritesheet.actorconditions_omi2.category=actorcondition
|
atcs.spritesheet.actorconditions_omi2.category=actorcondition
|
||||||
|
|
||||||
@@ -30,7 +31,10 @@ atcs.spritesheet.items_misc_4.category=item
|
|||||||
atcs.spritesheet.items_misc_5.category=item
|
atcs.spritesheet.items_misc_5.category=item
|
||||||
atcs.spritesheet.items_misc_6.category=item
|
atcs.spritesheet.items_misc_6.category=item
|
||||||
atcs.spritesheet.items_necklaces_1.category=item
|
atcs.spritesheet.items_necklaces_1.category=item
|
||||||
|
atcs.spritesheet.items_newb.category=item
|
||||||
|
atcs.spritesheet.items_omgeeky.category=item
|
||||||
atcs.spritesheet.items_omi2.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_rijackson_1.category=item
|
||||||
atcs.spritesheet.items_rings_1.category=item
|
atcs.spritesheet.items_rings_1.category=item
|
||||||
@@ -42,17 +46,22 @@ atcs.spritesheet.items_weapons_2.category=item
|
|||||||
atcs.spritesheet.items_weapons_3.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_gisons.category=monster
|
atcs.spritesheet.monsters_gisons.category=monster
|
||||||
atcs.spritesheet.monsters_guynmart.category=monster
|
atcs.spritesheet.monsters_guynmart.category=monster
|
||||||
|
|
||||||
atcs.spritesheet.monsters_insects.category=monster
|
atcs.spritesheet.monsters_insects.category=monster
|
||||||
|
atcs.spritesheet.monsters_johny.category=monster
|
||||||
atcs.spritesheet.monsters_karvis1.category=monster
|
atcs.spritesheet.monsters_karvis1.category=monster
|
||||||
atcs.spritesheet.monsters_karvis2.category=monster
|
atcs.spritesheet.monsters_karvis2.category=monster
|
||||||
atcs.spritesheet.monsters_ld1.category=monster
|
atcs.spritesheet.monsters_ld1.category=monster
|
||||||
@@ -65,9 +74,11 @@ atcs.spritesheet.monsters_man1.category=monster
|
|||||||
atcs.spritesheet.monsters_men.category=monster
|
atcs.spritesheet.monsters_men.category=monster
|
||||||
atcs.spritesheet.monsters_men2.category=monster
|
atcs.spritesheet.monsters_men2.category=monster
|
||||||
atcs.spritesheet.monsters_misc.category=monster
|
atcs.spritesheet.monsters_misc.category=monster
|
||||||
|
atcs.spritesheet.monsters_newb_1.category=monster
|
||||||
atcs.spritesheet.monsters_omi1.category=monster
|
atcs.spritesheet.monsters_omi1.category=monster
|
||||||
atcs.spritesheet.monsters_omi1_b.category=monster
|
atcs.spritesheet.monsters_omi1_b.category=monster
|
||||||
atcs.spritesheet.monsters_omi2.category=monster
|
atcs.spritesheet.monsters_omi2.category=monster
|
||||||
|
atcs.spritesheet.monsters_phoenix01.category=monster
|
||||||
atcs.spritesheet.monsters_rats.category=monster
|
atcs.spritesheet.monsters_rats.category=monster
|
||||||
atcs.spritesheet.monsters_redshrike1.category=monster
|
atcs.spritesheet.monsters_redshrike1.category=monster
|
||||||
atcs.spritesheet.monsters_rltiles1.category=monster
|
atcs.spritesheet.monsters_rltiles1.category=monster
|
||||||
@@ -79,7 +90,6 @@ atcs.spritesheet.monsters_skeleton1.category=monster
|
|||||||
atcs.spritesheet.monsters_skeleton2.category=monster
|
atcs.spritesheet.monsters_skeleton2.category=monster
|
||||||
atcs.spritesheet.monsters_snakes.category=monster
|
atcs.spritesheet.monsters_snakes.category=monster
|
||||||
atcs.spritesheet.monsters_tometik1.category=monster
|
atcs.spritesheet.monsters_tometik1.category=monster
|
||||||
atcs.spritesheet.monsters_tometik10.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
|
||||||
atcs.spritesheet.monsters_tometik4.category=monster
|
atcs.spritesheet.monsters_tometik4.category=monster
|
||||||
@@ -88,6 +98,7 @@ atcs.spritesheet.monsters_tometik6.category=monster
|
|||||||
atcs.spritesheet.monsters_tometik7.category=monster
|
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_warrior1.category=monster
|
atcs.spritesheet.monsters_warrior1.category=monster
|
||||||
atcs.spritesheet.monsters_unknown.category=monster
|
atcs.spritesheet.monsters_unknown.category=monster
|
||||||
atcs.spritesheet.monsters_wraiths.category=monster
|
atcs.spritesheet.monsters_wraiths.category=monster
|
||||||
@@ -112,3 +123,12 @@ atcs.spritesheet.monsters_giantbasilisk.sizey=64
|
|||||||
atcs.spritesheet.monsters_hydra1.category=monster
|
atcs.spritesheet.monsters_hydra1.category=monster
|
||||||
atcs.spritesheet.monsters_hydra1.sizex=64
|
atcs.spritesheet.monsters_hydra1.sizex=64
|
||||||
atcs.spritesheet.monsters_hydra1.sizey=64
|
atcs.spritesheet.monsters_hydra1.sizey=64
|
||||||
|
atcs.spritesheet.monsters_newb_2.category=monster
|
||||||
|
atcs.spritesheet.monsters_newb_2.sizex=64
|
||||||
|
atcs.spritesheet.monsters_newb_2.sizey=32
|
||||||
|
atcs.spritesheet.monsters_newb_3.category=monster
|
||||||
|
atcs.spritesheet.monsters_newb_3.sizex=64
|
||||||
|
atcs.spritesheet.monsters_newb_3.sizey=64
|
||||||
|
atcs.spritesheet.monsters_newb_4.category=monster
|
||||||
|
atcs.spritesheet.monsters_newb_4.sizex=32
|
||||||
|
atcs.spritesheet.monsters_newb_4.sizey=64
|
||||||
|
|||||||
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
|
||||||
|
|
||||||
@@ -39,24 +39,24 @@ import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
|
|||||||
import com.gpl.rpg.atcontentstudio.ui.WorkerDialog;
|
import com.gpl.rpg.atcontentstudio.ui.WorkerDialog;
|
||||||
import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
|
import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
|
||||||
|
|
||||||
|
|
||||||
public class ATContentStudio {
|
public class ATContentStudio {
|
||||||
|
|
||||||
public static final String APP_NAME = "Andor's Trail Content Studio";
|
public static final String APP_NAME = "Andor's Trail Content Studio";
|
||||||
public static final String APP_VERSION = "v0.6.19";
|
public static final String APP_VERSION = "v0.6.21";
|
||||||
|
|
||||||
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
|
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
|
||||||
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
|
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
|
||||||
|
|
||||||
public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
|
public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
|
||||||
|
|
||||||
public static boolean STARTED = false;
|
public static boolean STARTED = false;
|
||||||
public static float SCALING=1.0f;
|
public static float SCALING = 1.0f;
|
||||||
public static StudioFrame frame = null;
|
public static StudioFrame frame = null;
|
||||||
|
|
||||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset these loggers.
|
// Need to keep a strong reference to it, to avoid garbage collection that'll
|
||||||
|
// reset these loggers.
|
||||||
public static final List<Logger> configuredLoggers = new LinkedList<Logger>();
|
public static final List<Logger> configuredLoggers = new LinkedList<Logger>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
@@ -66,18 +66,19 @@ public class ATContentStudio {
|
|||||||
if (fontScaling != null) {
|
if (fontScaling != null) {
|
||||||
try {
|
try {
|
||||||
fontScale = Float.parseFloat(fontScaling);
|
fontScale = Float.parseFloat(fontScaling);
|
||||||
SCALING=fontScale;
|
SCALING = fontScale;
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
System.err.println("Failed to parse font scaling parameter. Using default.");
|
System.err.println("Failed to parse font scaling parameter. Using default.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigCache.init();
|
ConfigCache.init();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String laf = ConfigCache.getFavoriteLaFClassName();
|
String laf = ConfigCache.getFavoriteLaFClassName();
|
||||||
if (laf == null) laf = UIManager.getSystemLookAndFeelClassName();
|
if (laf == null)
|
||||||
|
laf = UIManager.getSystemLookAndFeelClassName();
|
||||||
UIManager.setLookAndFeel(laf);
|
UIManager.setLookAndFeel(laf);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -88,37 +89,40 @@ public class ATContentStudio {
|
|||||||
} catch (UnsupportedLookAndFeelException e) {
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scaleUIFont();
|
scaleUIFont();
|
||||||
|
|
||||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset this setting.
|
// Need to keep a strong reference to it, to avoid garbage collection that'll
|
||||||
|
// reset this setting.
|
||||||
Logger l = Logger.getLogger(ExpressionParser.class.getName());
|
Logger l = Logger.getLogger(ExpressionParser.class.getName());
|
||||||
l.setLevel(Level.OFF);
|
l.setLevel(Level.OFF);
|
||||||
configuredLoggers.add(l);
|
configuredLoggers.add(l);
|
||||||
|
|
||||||
final WorkspaceSelector wsSelect = new WorkspaceSelector();
|
final WorkspaceSelector wsSelect = new WorkspaceSelector();
|
||||||
wsSelect.pack();
|
wsSelect.pack();
|
||||||
Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
|
Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
Dimension wdim = wsSelect.getSize();
|
Dimension wdim = wsSelect.getSize();
|
||||||
wsSelect.setLocation((sdim.width - wdim.width)/2, (sdim.height - wdim.height)/2);
|
wsSelect.setLocation((sdim.width - wdim.width) / 2, (sdim.height - wdim.height) / 2);
|
||||||
wsSelect.setVisible(true);
|
wsSelect.setVisible(true);
|
||||||
|
|
||||||
wsSelect.addWindowListener(new WindowAdapter() {
|
wsSelect.addWindowListener(new WindowAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public synchronized void windowClosed(WindowEvent e) {
|
public synchronized void windowClosed(WindowEvent e) {
|
||||||
if (wsSelect.selected != null && !STARTED) {
|
if (wsSelect.selected != null && !STARTED) {
|
||||||
ATContentStudio.STARTED = true;
|
ATContentStudio.STARTED = true;
|
||||||
final File workspaceRoot = new File(wsSelect.selected);
|
final File workspaceRoot = new File(wsSelect.selected);
|
||||||
WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable(){
|
WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
Workspace.setActive(workspaceRoot);
|
Workspace.setActive(workspaceRoot);
|
||||||
if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue() && Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
|
if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue()
|
||||||
|
&& Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
|
||||||
new Thread() {
|
new Thread() {
|
||||||
public void run() {checkUpdate();}
|
public void run() {
|
||||||
|
checkUpdate();
|
||||||
|
}
|
||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
frame = new StudioFrame(APP_NAME+" "+APP_VERSION);
|
frame = new StudioFrame(APP_NAME + " " + APP_VERSION);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
|
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
|
||||||
};
|
};
|
||||||
@@ -138,7 +142,7 @@ public class ATContentStudio {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkUpdate() {
|
private static void checkUpdate() {
|
||||||
BufferedReader in = null;
|
BufferedReader in = null;
|
||||||
try {
|
try {
|
||||||
@@ -146,32 +150,33 @@ public class ATContentStudio {
|
|||||||
in = new BufferedReader(new InputStreamReader(url.openStream()));
|
in = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||||
|
|
||||||
String inputLine, lastLine = null;
|
String inputLine, lastLine = null;
|
||||||
while ((inputLine = in.readLine()) != null) {lastLine = inputLine;}
|
while ((inputLine = in.readLine()) != null) {
|
||||||
if (lastLine != null && !lastLine.equals(APP_VERSION)) {
|
lastLine = inputLine;
|
||||||
|
}
|
||||||
|
if (lastLine != null && compareVersions(lastLine) < 0) {
|
||||||
// for copying style
|
// for copying style
|
||||||
JLabel label = new JLabel();
|
JLabel label = new JLabel();
|
||||||
Font font = label.getFont();
|
Font font = label.getFont();
|
||||||
Color color = label.getBackground();
|
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>");
|
||||||
|
|
||||||
// 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.setEditable(false);
|
||||||
ep.setBorder(null);
|
ep.setBorder(null);
|
||||||
|
|
||||||
ep.addHyperlinkListener(new HyperlinkListener() {
|
ep.addHyperlinkListener(new HyperlinkListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hyperlinkUpdate(HyperlinkEvent e) {
|
public void hyperlinkUpdate(HyperlinkEvent e) {
|
||||||
try {
|
try {
|
||||||
@@ -185,7 +190,7 @@ public class ATContentStudio {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
}
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
@@ -194,16 +199,17 @@ public class ATContentStudio {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (in != null) in.close();
|
if (in != null)
|
||||||
|
in.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void scaleUIFont() {
|
public static void scaleUIFont() {
|
||||||
if (SCALING != 1.0f) {
|
if (SCALING != 1.0f) {
|
||||||
System.out.println("Scaling fonts to "+SCALING);
|
System.out.println("Scaling fonts to " + SCALING);
|
||||||
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
|
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
|
||||||
Map<Object, Object> newDefaults = new HashMap<Object, Object>();
|
Map<Object, Object> newDefaults = new HashMap<Object, Object>();
|
||||||
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
|
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
|
||||||
@@ -211,7 +217,7 @@ public class ATContentStudio {
|
|||||||
Object value = defaults.get(key);
|
Object value = defaults.get(key);
|
||||||
if (value instanceof Font) {
|
if (value instanceof Font) {
|
||||||
Font font = (Font) value;
|
Font font = (Font) value;
|
||||||
int newSize = (int)(font.getSize() * SCALING);
|
int newSize = (int) (font.getSize() * SCALING);
|
||||||
if (value instanceof FontUIResource) {
|
if (value instanceof FontUIResource) {
|
||||||
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
|
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
|
||||||
} else {
|
} else {
|
||||||
@@ -224,4 +230,19 @@ public class ATContentStudio {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// returns The difference between the the latest version and the current one (CURRENT - LATEST)
|
||||||
|
private static int compareVersions(String latest) {
|
||||||
|
String[] levels1 = ATContentStudio.APP_VERSION.substring(1).split("\\.");
|
||||||
|
String[] levels2 = latest.substring(1).split("\\.");
|
||||||
|
int length = Math.max(levels1.length, levels2.length);
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
int v1 = i < levels1.length ? Integer.parseInt(levels1[i]) : 0;
|
||||||
|
int v2 = i < levels2.length ? Integer.parseInt(levels2[i]) : 0;
|
||||||
|
if (v1 != v2) {
|
||||||
|
return v1 - v2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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 |
@@ -29,7 +29,8 @@ public class ActorCondition extends JSONElement {
|
|||||||
//public String id; inherited.
|
//public String id; inherited.
|
||||||
public String icon_id;
|
public String icon_id;
|
||||||
public String display_name;
|
public String display_name;
|
||||||
|
public String description;
|
||||||
|
|
||||||
// Available from parsed state
|
// Available from parsed state
|
||||||
public ACCategory category = null;
|
public ACCategory category = null;
|
||||||
public Integer positive = null;
|
public Integer positive = null;
|
||||||
@@ -157,6 +158,7 @@ public class ActorCondition extends JSONElement {
|
|||||||
@Override
|
@Override
|
||||||
public void parse(Map aCondJson) {
|
public void parse(Map aCondJson) {
|
||||||
|
|
||||||
|
if (aCondJson.get("description") != null) this.description = (String) aCondJson.get("description");
|
||||||
if (aCondJson.get("category") != null) this.category = ACCategory.valueOf((String) aCondJson.get("category"));
|
if (aCondJson.get("category") != null) this.category = ACCategory.valueOf((String) aCondJson.get("category"));
|
||||||
this.positive = JSONElement.getInteger((Number) aCondJson.get("isPositive"));
|
this.positive = JSONElement.getInteger((Number) aCondJson.get("isPositive"));
|
||||||
Map abilityEffect = (Map) aCondJson.get("abilityEffect");
|
Map abilityEffect = (Map) aCondJson.get("abilityEffect");
|
||||||
@@ -236,7 +238,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);
|
||||||
}
|
}
|
||||||
@@ -266,6 +273,7 @@ public class ActorCondition extends JSONElement {
|
|||||||
clone.state = this.state;
|
clone.state = this.state;
|
||||||
clone.id = this.id;
|
clone.id = this.id;
|
||||||
clone.display_name = this.display_name;
|
clone.display_name = this.display_name;
|
||||||
|
clone.description = this.description;
|
||||||
clone.icon_id = this.icon_id;
|
clone.icon_id = this.icon_id;
|
||||||
clone.category = this.category;
|
clone.category = this.category;
|
||||||
clone.positive = this.positive;
|
clone.positive = this.positive;
|
||||||
@@ -294,6 +302,7 @@ public class ActorCondition extends JSONElement {
|
|||||||
jsonAC.put("id", this.id);
|
jsonAC.put("id", this.id);
|
||||||
if (this.icon_id != null) jsonAC.put("iconID", this.icon_id);
|
if (this.icon_id != null) jsonAC.put("iconID", this.icon_id);
|
||||||
if (this.display_name != null) jsonAC.put("name", this.display_name);
|
if (this.display_name != null) jsonAC.put("name", this.display_name);
|
||||||
|
if (this.description != null) jsonAC.put("description", this.description);
|
||||||
if (this.category != null) jsonAC.put("category", this.category.toString());
|
if (this.category != null) jsonAC.put("category", this.category.toString());
|
||||||
if (this.positive != null && this.positive == 1) jsonAC.put("isPositive", this.positive);
|
if (this.positive != null && this.positive == 1) jsonAC.put("isPositive", this.positive);
|
||||||
if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking);
|
if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking);
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -39,14 +39,15 @@ public abstract class JSONElement extends GameDataElement {
|
|||||||
Map jsonObj = (Map)obj;
|
Map jsonObj = (Map)obj;
|
||||||
String id = (String) jsonObj.get("id");
|
String id = (String) jsonObj.get("id");
|
||||||
try {
|
try {
|
||||||
if (id != null && id.equals(this.id )) {
|
if (id != null && id.equals(this.id )) {
|
||||||
this.parse(jsonObj);
|
this.parse(jsonObj);
|
||||||
this.state = State.parsed;
|
this.state = State.parsed;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e){
|
catch(Exception e){
|
||||||
System.out.println("Error in ID: " + id);
|
System.out.println("Error in ID: " + id);
|
||||||
|
System.out.println(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
|
|||||||
@@ -60,7 +60,11 @@ public class Requirement extends JSONElement {
|
|||||||
factionScore,
|
factionScore,
|
||||||
random,
|
random,
|
||||||
factionScoreEquals,
|
factionScoreEquals,
|
||||||
wearRemove
|
wearRemove,
|
||||||
|
date,
|
||||||
|
dateEquals,
|
||||||
|
time,
|
||||||
|
timeEquals
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SkillID {
|
public enum SkillID {
|
||||||
@@ -196,6 +200,10 @@ public class Requirement extends JSONElement {
|
|||||||
case factionScore:
|
case factionScore:
|
||||||
case factionScoreEquals:
|
case factionScoreEquals:
|
||||||
case random:
|
case random:
|
||||||
|
case date:
|
||||||
|
case dateEquals:
|
||||||
|
case time:
|
||||||
|
case timeEquals:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent);
|
if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent);
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class PotGenerator {
|
|||||||
|
|
||||||
for (ActorCondition ac : gsrc.gameData.actorConditions) {
|
for (ActorCondition ac : gsrc.gameData.actorConditions) {
|
||||||
pushString(stringsResources, resourcesStrings, ac.display_name, getPotContextComment(ac));
|
pushString(stringsResources, resourcesStrings, ac.display_name, getPotContextComment(ac));
|
||||||
|
pushString(stringsResources, resourcesStrings, ac.description, getPotContextComment(ac)+":description");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Dialogue d : gsrc.gameData.dialogues ) {
|
for (Dialogue d : gsrc.gameData.dialogues ) {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
private JButton acIcon;
|
private JButton acIcon;
|
||||||
private JTextField idField;
|
private JTextField idField;
|
||||||
private JTextField nameField;
|
private JTextField nameField;
|
||||||
|
private JTextField descriptionField;
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
private JComboBox categoryBox;
|
private JComboBox categoryBox;
|
||||||
private IntegerBasedCheckBox positiveBox;
|
private IntegerBasedCheckBox positiveBox;
|
||||||
@@ -81,6 +82,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
|
|
||||||
idField = addTextField(pane, "Internal ID: ", ac.id, ac.writable, listener);
|
idField = addTextField(pane, "Internal ID: ", ac.id, ac.writable, listener);
|
||||||
nameField = addTranslatableTextField(pane, "Display name: ", ac.display_name, ac.writable, listener);
|
nameField = addTranslatableTextField(pane, "Display name: ", ac.display_name, ac.writable, listener);
|
||||||
|
descriptionField = addTranslatableTextField(pane, "Description: ", ac.description, ac.writable, listener);
|
||||||
categoryBox = addEnumValueBox(pane, "Category: ", ActorCondition.ACCategory.values(), ac.category, ac.writable, listener);
|
categoryBox = addEnumValueBox(pane, "Category: ", ActorCondition.ACCategory.values(), ac.category, ac.writable, listener);
|
||||||
positiveBox = addIntegerBasedCheckBox(pane, "Positive", ac.positive, ac.writable, listener);
|
positiveBox = addIntegerBasedCheckBox(pane, "Positive", ac.positive, ac.writable, listener);
|
||||||
stackingBox = addIntegerBasedCheckBox(pane, "Stacking", ac.stacking, ac.writable, listener);
|
stackingBox = addIntegerBasedCheckBox(pane, "Stacking", ac.stacking, ac.writable, listener);
|
||||||
@@ -172,6 +174,10 @@ public class ActorConditionEditor extends JSONElementEditor {
|
|||||||
ActorConditionEditor.this.name = aCond.getDesc();
|
ActorConditionEditor.this.name = aCond.getDesc();
|
||||||
aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
|
aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||||
ATContentStudio.frame.editorChanged(ActorConditionEditor.this);
|
ATContentStudio.frame.editorChanged(ActorConditionEditor.this);
|
||||||
|
}else if (source == descriptionField) {
|
||||||
|
aCond.description = (String) value;
|
||||||
|
aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||||
|
ATContentStudio.frame.editorChanged(ActorConditionEditor.this);
|
||||||
} else if (source == acIcon) {
|
} else if (source == acIcon) {
|
||||||
aCond.icon_id = (String) value;
|
aCond.icon_id = (String) value;
|
||||||
aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
|
aCond.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||||
|
|||||||
@@ -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.");
|
||||||
|
|||||||
@@ -731,6 +731,26 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
|||||||
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||||
requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener);
|
requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener);
|
||||||
break;
|
break;
|
||||||
|
case date:
|
||||||
|
requirementObj = null;
|
||||||
|
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
|
||||||
|
requirementValue = addIntegerField(pane, "Minimum date value: ", requirement.required_value, true, writable, listener);
|
||||||
|
break;
|
||||||
|
case dateEquals:
|
||||||
|
requirementObj = null;
|
||||||
|
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
|
||||||
|
requirementValue = addIntegerField(pane, "Exact date value: ", requirement.required_value, true, writable, listener);
|
||||||
|
break;
|
||||||
|
case time:
|
||||||
|
requirementObj = null;
|
||||||
|
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
|
||||||
|
requirementValue = addIntegerField(pane, "Minimum time value: ", requirement.required_value, true, writable, listener);
|
||||||
|
break;
|
||||||
|
case timeEquals:
|
||||||
|
requirementObj = null;
|
||||||
|
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
|
||||||
|
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
|
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
|
||||||
@@ -2052,7 +2072,8 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
|||||||
area.quantity = (Integer) value;
|
area.quantity = (Integer) value;
|
||||||
}
|
}
|
||||||
} else if (source == respawnSpeedField) {
|
} else if (source == respawnSpeedField) {
|
||||||
if (selectedMapObject instanceof SpawnArea area) {
|
if (selectedMapObject instanceof SpawnArea) {
|
||||||
|
SpawnArea area = (SpawnArea) selectedMapObject;
|
||||||
area.respawnSpeed = (Integer) value;
|
area.respawnSpeed = (Integer) value;
|
||||||
}
|
}
|
||||||
} else if (source == spawnActiveForNewGame) {
|
} else if (source == spawnActiveForNewGame) {
|
||||||
|
|||||||
@@ -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