Compare commits

..

1 Commits

Author SHA1 Message Date
OMGeeky
5d5ca15669 sample 2024-01-10 19:16:12 +01:00
22 changed files with 127 additions and 527 deletions

View File

@@ -1,61 +0,0 @@
name: Release Build
on:
release:
types: [created]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Install NSIS
uses: joncloud/makensis-action@v4
- name: Build JAR
shell: bash
run: |
cd ATCS/packaging
chmod +x package.sh
./package.sh -windows
- name: Create Installer
shell: bash
run: |
cd ATCS/packaging/Windows
makensis ATCS_Installer.nsi
- name: Get Version
id: get_version
shell: bash
run: |
VERSION=$(cat ATCS/packaging/ATCS_latest | sed 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Upload ZIP to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./ATCS/packaging/ATCS_${{ env.VERSION }}.zip
asset_name: ATCS_${{ env.VERSION }}.zip
asset_content_type: application/zip
- name: Upload Installer to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./ATCS/packaging/Windows/ATCS_v${{ env.VERSION }}_Setup.exe
asset_name: ATCS_v${{ env.VERSION }}_Setup.exe
asset_content_type: application/octet-stream

6
.gitignore vendored
View File

@@ -2,12 +2,6 @@
/Project
/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
View File

@@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -1,18 +0,0 @@
<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
View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" default="true" />
</project>

8
.idea/modules.xml generated
View File

@@ -1,8 +0,0 @@
<?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
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -1,117 +0,0 @@
<?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>

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

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

View File

@@ -1,127 +0,0 @@
@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

View File

@@ -1 +1 @@
v0.6.21
v0.6.19

View File

@@ -1,10 +1,8 @@
!include MUI2.nsh
!system 'for /f "delims=" %%a in ('type ..\ATCS_latest') do set "VERSION=%%a" && exit'
!define VERSION "$%VERSION:~1%"
!define VERSION "0.6.20"
!define TRAINER_VERSION "0.1.5"
!define JAVA_BIN "java"
!define ATCS_SOURCE_DIR "..\..\"
Name "Andor's Trail Content Studio v${VERSION}"
OutFile "ATCS_v${VERSION}_Setup.exe"
@@ -15,8 +13,8 @@ InstallDir "$PROGRAMFILES\ATCS\"
Var StartMenuFolder
!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}"
!define MUI_FINISHPAGE_TEXT "Andor's Trail Content Studio v${VERSION} - Install completed !"
!define MUI_WELCOMEPAGE_TEXT "This will install Andor's Trail Content Studio v${VERSION} installer"
!define MUI_FINISHPAGE_TEXT "Andor's Trail Content Studio v${VERSION} install completed !"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Andor's Trail Content Studio"
!define MUI_PAGE_HEADER_TEXT "Installing Andor's Trail Content Studio v${VERSION}"
@@ -48,33 +46,31 @@ Var StartMenuFolder
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;------------------------------------------------------------------------------------
Section install
;--- Create in ...\packaging\common\ ATCS.cmd ATCT.ico ATCS.jar
SetOutPath $INSTDIR
file "ATCS.ico"
file "${ATCS_SOURCE_DIR}\packaging\common\ATCS.jar"
Delete "$INSTDIR\lib\*"
Call GetJRE
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
FileWrite $9 '@echo off$\r$\n'
FileWrite $9 '$\r$\n'
FileWrite $9 'set "ATCS_DIR=%~dp0"$\r$\n'
FileWrite $9 'set "MAX_MEM=1024M"$\r$\n'
FileWrite $9 'set "MAX_MEM=512M"$\r$\n'
FileWrite $9 'set "CP=%ATCS_DIR%lib\*"$\r$\n'
FileWrite $9 'set "JAVA=$R0"$\r$\n'
FileWrite $9 'set "JAVA_OPTS="$\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 '$\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 ') else ($\r$\n'
FileWrite $9 ' echo REM set "MAX_MEM=%MAX_MEM%">"%ENV_FILE%"$\r$\n'
@@ -83,84 +79,96 @@ Section install
FileWrite $9 ' echo.>>"%ENV_FILE%"$\r$\n'
FileWrite $9 ')$\r$\n'
FileWrite $9 '$\r$\n'
FileWrite $9 'start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -jar ATCS.jar$\r$\n'
FileWrite $9 'start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -cp "%CP%" %MAIN_CLASS%$\r$\n'
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.20\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"
!insertmacro MUI_STARTMENU_WRITE_BEGIN "ATCS"
;--- Create shortcuts
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Andor's Trail Content Studio.lnk" "$INSTDIR\ATCS.cmd" "" "$INSTDIR\ATCS.ico"
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
;------------------------------------------------------------------------------------
Section uninstall
Delete "$INSTDIR\lib\jide-oss.jar"
Delete "$INSTDIR\lib\ui.jar"
Delete "$INSTDIR\lib\junit-4.10.jar"
Delete "$INSTDIR\lib\json_simple-1.1.jar"
Delete "$INSTDIR\lib\AndorsTrainer_v${TRAINER_VERSION}.jar"
Delete "$INSTDIR\lib\ATCS_v${VERSION}.jar"
Delete "$INSTDIR\lib\rsyntaxtextarea.jar"
Delete "$INSTDIR\lib\prefuse.jar"
Delete "$INSTDIR\lib\bsh-2.0b4.jar"
Delete "$INSTDIR\lib\jsoup-1.10.2.jar"
RMDir "$INSTDIR\lib\"
Delete "$INSTDIR\ATCS.ico"
Delete "$INSTDIR\ATCS.cmd"
Delete "$INSTDIR\ATCS.env.bat"
Delete "$INSTDIR\ATCS.jar"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
!insertmacro MUI_STARTMENU_GETFOLDER "ATCS" $StartMenuFolder
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
Delete "$SMPROGRAMS\$StartMenuFolder\Andor's Trail Content Studio.lnk"
RMDir "$SMPROGRAMS\$StartMenuFolder"
SectionEnd
;------------------------------------------------------------------------------------
Function GetJRE
;
; Find JRE (java.exe)
; Find JRE (javaw.exe)
; DISABLED 1 - in .\jre directory (JRE Installed with application)
; 2 - in JAVA_HOME environment variable
; 3 - in the registry
; 4 - assume java.exe in current dir or PATH
; 4 - assume javaw.exe in current dir or PATH
Push $R0
Push $R1
;ClearErrors
;StrCpy $R0 "$EXEDIR\jre\bin\java.exe"
;StrCpy $R0 "$EXEDIR\jre\bin\javaw.exe"
;IfFileExists $R0 JreFound
;StrCpy $R0 ""
ClearErrors
ReadEnvStr $R0 "JAVA_HOME"
StrCpy $R0 "$R0\bin\${JAVA_BIN}.exe"
IfErrors 0 JreFound
ClearErrors
ReadRegStr $R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$R1" "JavaHome"
StrCpy $R0 "$R0\bin\${JAVA_BIN}.exe"
IfErrors 0 JreFound
StrCpy $R0 "${JAVA_BIN}.exe"
JreFound:
Pop $R1
Exch $R0

View File

@@ -1,8 +1,8 @@
@echo off
set "ATCS_DIR=%~dp0"
set "MAX_MEM=1024M"
set "JAVA=java.exe"
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"

View File

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

View File

@@ -1,120 +1,84 @@
#!/bin/bash
# Script to build ATCS.jar, replicating IntelliJ artifact definition
# Linux and Windows compatible
# --- Platform Detection ---
if [ "$1" = "-windows" ]; then
#windows or linux
if [ "$1" = "-windows" ] ; then
echo "Got '-windows' flag. Running Windows version"
PLATFORM="WINDOWS"
LINUX=false
else
echo "No '-windows' flag. Running Linux version"
PLATFORM="LINUX"
echo "No '-windows' flag. Running linux version"
LINUX=true
fi
# --- Configuration ---
PACKAGING_DIR=$(dirname "$(readlink -f "$0" || greadlink -f "$0" || stat -f "$0")")
#read the folder this script should be in (should be the packaging folder inside the ATCS source)
PACKAGING_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}")
TEMP_DIR="${PACKAGING_DIR}/tmp"
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
TEMP_DIR=${PACKAGING_DIR}/tmp
echo "Packaging dir: ${PACKAGING_DIR}"
echo "ATCS_SOURCE_DIR: ${ATCS_SOURCE_DIR}"
#ATContentStudio
JAR_LOCATION="${PACKAGING_DIR}/common/ATCS.jar"
MANIFEST_LOCATION=${PACKAGING_DIR}/Manifest.txt
echo ""
# --- **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}")
VERSION=$(cat ${PACKAGING_DIR}/ATCS_latest)
echo "Got version ${VERSION}"
# --- Prepare temporary directory ---
echo "Removing tmp folder"
rm -rf "${TEMP_DIR}"
echo "Recreating tmp folder"
mkdir -p "${TEMP_DIR}"
rm -rf ${PACKAGING_DIR}/tmp/
echo "recreating tmp folder"
mkdir ${PACKAGING_DIR}/tmp/
#ATCS_SOURCE_DIR="${PACKAGING_DIR}/.."
echo ""
#copy manifest to temp folder for editing
cp ${MANIFEST_LOCATION} ${TEMP_DIR}
MANIFEST_LOCATION=${TEMP_DIR}/Manifest.txt
# --- **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
#copy lib files to packaged folder?
echo 'copying lib files'
mkdir -p ${PACKAGING_DIR}/common/lib/
cp ${ATCS_SOURCE_DIR}/lib/* ${PACKAGING_DIR}/common/lib/
# --- 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}"
cd $ATCS_SOURCE_DIR
#set ClassPath variable to use in the building etc.
echo 'setting class path'
#linux needs a : as seperator while windows needs ;
if [ "$LINUX" = true ] ; then
CP="lib/*:src:hacked-libtiled:siphash-zackehh/src/main/java"
else
CP="lib/*;src;hacked-libtiled;siphash-zackehh/src/main/java"
fi
echo "ClassPath: "
echo ${CP}
echo ""
# --- 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 ---
#set build the classes
echo 'building java classes'
#javac -cp $CP *.java
javac -cp $CP ${ATCS_SOURCE_DIR}/src/com/gpl/rpg/atcontentstudio/*.java -d ${TEMP_DIR}
echo javac -cp $CP ${ATCS_SOURCE_DIR}/src/com/gpl/rpg/atcontentstudio/*.java -d ${TEMP_DIR}
echo ""
echo "Creating jar at location: ${JAR_LOCATION}"
LIB_PATHS=$(find lib -name '*.jar' | paste -sd' ')
echo "LIB_PATHS: ${LIB_PATHS}"
# add all lib files to the class path in the temp Manifest
echo "Class-Path: . lib/* ${LIB_PATHS}" >>${MANIFEST_LOCATION}
cd "${TEMP_DIR}" || exit # Change to temp dir for JAR command
echo ""
echo "creating jar at location: ${JAR_LOCATION}"
# 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
# create the jar file
# the command with those parameters requires this format:
# jar vmfc <Manifest file> <Jar file (target location)> <all things to add to the jar file>
# the things to add always use the whole relative path from the current dir,
# so when that is not wanted, the -C <location> thing will change to that dir
jar mfc ${MANIFEST_LOCATION} ${JAR_LOCATION} -C ${PACKAGING_DIR}/tmp/ com/gpl/rpg/atcontentstudio/ -C res . -C ${ATCS_SOURCE_DIR}/src .
echo ''
echo "Done creating jar at ${JAR_LOCATION}"
cp -f "${JAR_LOCATION}" "${PACKAGING_DIR}/common/ATCS.jar" # Copy JAR to versioned name
echo "Done creating jar"
# --- Create archive ---
cd "${PACKAGING_DIR}" || exit
echo "Creating archive"
if [ "$PLATFORM" = "WINDOWS" ]; then
# Use PowerShell's Compress-Archive which is available by default on Windows
powershell.exe -Command "Compress-Archive -Path './common/*' -DestinationPath './ATCS_${VERSION}.zip' -Force"
if [ "$LINUX" = true ] ; then
cd ${PACKAGING_DIR}
echo "Creating archive"
tar caf "ATCS_${VERSION}.tar.gz" "common"
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.tar.gz"
else
# Use zip command on Linux
zip -r "ATCS_${VERSION}.zip" common/* # archive the 'common' folder which now contains the JAR and libs
echo "Can't create zip files on windows yet. Please pack the content of the '${PACKAGING_DIR}/common/' folder yourself"
fi
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.zip"
cd "${PACKAGING_DIR}" || exit
echo "Script finished."

View File

@@ -1,7 +1,6 @@
atcs.spritesheet.actorconditions_1.category=actorcondition
atcs.spritesheet.actorconditions_2.category=actorcondition
atcs.spritesheet.actorconditions_japozero.category=actorcondition
atcs.spritesheet.actorconditions_newb.category=actorcondition
atcs.spritesheet.actorconditions_omi1.category=actorcondition
atcs.spritesheet.actorconditions_omi2.category=actorcondition
@@ -61,7 +60,6 @@ atcs.spritesheet.monsters_gisons.category=monster
atcs.spritesheet.monsters_guynmart.category=monster
atcs.spritesheet.monsters_insects.category=monster
atcs.spritesheet.monsters_johny.category=monster
atcs.spritesheet.monsters_karvis1.category=monster
atcs.spritesheet.monsters_karvis2.category=monster
atcs.spritesheet.monsters_ld1.category=monster

View File

@@ -1,6 +0,0 @@
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

View File

@@ -42,7 +42,7 @@ import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
public class ATContentStudio {
public static final String APP_NAME = "Andor's Trail Content Studio";
public static final String APP_VERSION = "v0.6.21";
public static final String APP_VERSION = "v0.6.20";
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";

View File

@@ -29,8 +29,7 @@ public class ActorCondition extends JSONElement {
//public String id; inherited.
public String icon_id;
public String display_name;
public String description;
// Available from parsed state
public ACCategory category = null;
public Integer positive = null;
@@ -158,7 +157,6 @@ public class ActorCondition extends JSONElement {
@Override
public void parse(Map aCondJson) {
if (aCondJson.get("description") != null) this.description = (String) aCondJson.get("description");
if (aCondJson.get("category") != null) this.category = ACCategory.valueOf((String) aCondJson.get("category"));
this.positive = JSONElement.getInteger((Number) aCondJson.get("isPositive"));
Map abilityEffect = (Map) aCondJson.get("abilityEffect");
@@ -238,12 +236,7 @@ public class ActorCondition extends JSONElement {
if (this.icon_id != null) {
String spritesheetId = this.icon_id.split(":")[0];
if (getProject().getSpritesheet(spritesheetId) == null) {
System.out.println("Actor Condition");
System.out.println(this.id);
System.out.println("failed to load spritesheet:");
System.out.println(spritesheetId);
System.out.println("while creating backlink for icon_id:");
System.out.println(this.icon_id);
}
getProject().getSpritesheet(spritesheetId).addBacklink(this);
}
@@ -273,7 +266,6 @@ public class ActorCondition extends JSONElement {
clone.state = this.state;
clone.id = this.id;
clone.display_name = this.display_name;
clone.description = this.description;
clone.icon_id = this.icon_id;
clone.category = this.category;
clone.positive = this.positive;
@@ -302,7 +294,6 @@ public class ActorCondition extends JSONElement {
jsonAC.put("id", this.id);
if (this.icon_id != null) jsonAC.put("iconID", this.icon_id);
if (this.display_name != null) jsonAC.put("name", this.display_name);
if (this.description != null) jsonAC.put("description", this.description);
if (this.category != null) jsonAC.put("category", this.category.toString());
if (this.positive != null && this.positive == 1) jsonAC.put("isPositive", this.positive);
if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking);

View File

@@ -39,15 +39,14 @@ public abstract class JSONElement extends GameDataElement {
Map jsonObj = (Map)obj;
String id = (String) jsonObj.get("id");
try {
if (id != null && id.equals(this.id )) {
this.parse(jsonObj);
this.state = State.parsed;
break;
}
if (id != null && id.equals(this.id )) {
this.parse(jsonObj);
this.state = State.parsed;
break;
}
}
catch(Exception e){
System.out.println("Error in ID: " + id);
System.out.println(e.getMessage());
}
}
} catch (FileNotFoundException e) {

View File

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

View File

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