mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 23:57:25 +01:00
Compare commits
61 Commits
actor-cond
...
v0.6.21-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9cccf9eb2 | ||
|
|
5191f56a01 | ||
|
|
becf45f249 | ||
|
|
c950324cd9 | ||
|
|
b58d080f4d | ||
|
|
a2640c2da0 | ||
|
|
4fe7e71a43 | ||
|
|
9a162ac58d | ||
|
|
93718230a5 | ||
|
|
4fbf7de85a | ||
|
|
f0be1a8135 | ||
|
|
104d3db5ad | ||
|
|
f154efcecc | ||
|
|
00e9e3b2a7 | ||
|
|
92436d3ce9 | ||
|
|
b6cfe349c0 | ||
|
|
1e2daa56a4 | ||
|
|
2caaaeb474 | ||
|
|
0e8ed1a25d | ||
|
|
e2fdf08fec | ||
|
|
b5dceb9fd1 | ||
|
|
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 | ||
|
|
89f764b62b | ||
|
|
d81233d470 | ||
|
|
e1685aa625 | ||
|
|
ae3ca5d50a | ||
|
|
a00b8fbc66 | ||
|
|
4d03c15e08 | ||
|
|
4571bea429 | ||
|
|
ecc9a35c69 | ||
|
|
c4d71df4b1 | ||
|
|
a13dac467a | ||
|
|
e305dfd7bf | ||
|
|
80984a43af | ||
|
|
2bc8b65264 | ||
|
|
b2584a24cc |
57
.github/workflows/release.yml
vendored
Normal file
57
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Release Build
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Get Version
|
||||
id: get_version
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Reading version from file:"
|
||||
cat packaging/ATCS_latest
|
||||
VERSION=$(cat packaging/ATCS_latest)
|
||||
echo "Processed version: $VERSION"
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "Environment variable set to: $VERSION"
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
||||
- name: Build JAR
|
||||
shell: bash
|
||||
run: |
|
||||
cd packaging
|
||||
chmod +x package.sh
|
||||
echo "Building JAR and ZIP for version: ${{ env.VERSION }}"
|
||||
./package.sh -windows
|
||||
echo "Created artifacts:"
|
||||
ls -la common/ATCS.jar
|
||||
ls -la ATCS_${{ env.VERSION }}.zip
|
||||
|
||||
- name: Install NSIS
|
||||
uses: joncloud/makensis-action@v4
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
with:
|
||||
script-file: packaging/Windows/ATCS_Installer.nsi
|
||||
arguments: /DVERSION="${{ env.VERSION }}"
|
||||
|
||||
- name: Upload Release Assets
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: |
|
||||
./packaging/ATCS_${{ env.VERSION }}.zip
|
||||
./packaging/ATCS_${{ env.VERSION }}_Setup.exe
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,3 +1,13 @@
|
||||
/ATCS_v*.jar
|
||||
/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
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"?>
|
||||
<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"/>
|
||||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
||||
<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 +0,0 @@
|
||||
v0.6.19
|
||||
2
packaging/Manifest.txt
Normal file
2
packaging/Manifest.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||
@@ -1,11 +1,12 @@
|
||||
!include MUI2.nsh
|
||||
|
||||
!define VERSION "0.6.19"
|
||||
; Version will be passed as /DVERSION=vx.x.x
|
||||
!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"
|
||||
Name "Andor's Trail Content Studio ${VERSION}"
|
||||
OutFile "..\ATCS_${VERSION}_Setup.exe"
|
||||
InstallDir "$PROGRAMFILES\ATCS\"
|
||||
|
||||
;SetCompressor /SOLID /FINAL lzma
|
||||
@@ -13,10 +14,10 @@ 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} installer"
|
||||
!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 ${VERSION}"
|
||||
!define MUI_FINISHPAGE_TEXT "Andor's Trail Content Studio ${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}"
|
||||
!define MUI_PAGE_HEADER_TEXT "Installing Andor's Trail Content Studio ${VERSION}"
|
||||
|
||||
|
||||
;Start Menu Folder Page Configuration
|
||||
@@ -46,31 +47,33 @@ 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"
|
||||
|
||||
Delete "$INSTDIR\lib\*"
|
||||
|
||||
file "${ATCS_SOURCE_DIR}\packaging\common\ATCS.jar"
|
||||
|
||||
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=512M"$\r$\n'
|
||||
FileWrite $9 'set "MAX_MEM=1024M"$\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'
|
||||
@@ -79,96 +82,84 @@ 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% -cp "%CP%" %MAIN_CLASS%$\r$\n'
|
||||
FileWrite $9 'start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -jar ATCS.jar$\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.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"
|
||||
|
||||
|
||||
|
||||
|
||||
!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 (javaw.exe)
|
||||
; Find JRE (java.exe)
|
||||
; DISABLED 1 - in .\jre directory (JRE Installed with application)
|
||||
; 2 - in JAVA_HOME environment variable
|
||||
; 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 $R1
|
||||
|
||||
|
||||
;ClearErrors
|
||||
;StrCpy $R0 "$EXEDIR\jre\bin\javaw.exe"
|
||||
;StrCpy $R0 "$EXEDIR\jre\bin\java.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
|
||||
|
||||
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
|
||||
121
packaging/package.sh
Executable file
121
packaging/package.sh
Executable file
@@ -0,0 +1,121 @@
|
||||
#!/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="${ATCS_SOURCE_DIR}/res/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
|
||||
|
||||
# --- **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
|
||||
cp "${PACKAGING_DIR}"/ATCS_latest "${TEMP_DIR}/" # Copy version file
|
||||
|
||||
# --- 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}" "${PACKAGING_DIR}/common/ATCS.jar" # Copy JAR to versioned name
|
||||
|
||||
# --- 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"
|
||||
else
|
||||
# Use zip command on Linux
|
||||
zip -r "ATCS_${VERSION}.zip" common/* # archive the 'common' folder which now contains the JAR and libs
|
||||
fi
|
||||
echo "Created archive at ${PACKAGING_DIR}/ATCS_${VERSION}.zip"
|
||||
cd "${PACKAGING_DIR}" || exit
|
||||
|
||||
echo "Script finished."
|
||||
1
res/ATCS_latest
Normal file
1
res/ATCS_latest
Normal file
@@ -0,0 +1 @@
|
||||
v0.6.21
|
||||
@@ -1,6 +1,7 @@
|
||||
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
|
||||
|
||||
@@ -30,6 +31,7 @@ atcs.spritesheet.items_misc_4.category=item
|
||||
atcs.spritesheet.items_misc_5.category=item
|
||||
atcs.spritesheet.items_misc_6.category=item
|
||||
atcs.spritesheet.items_necklaces_1.category=item
|
||||
atcs.spritesheet.items_newb.category=item
|
||||
atcs.spritesheet.items_omgeeky.category=item
|
||||
atcs.spritesheet.items_omi2.category=item
|
||||
atcs.spritesheet.items_phoenix01.category=item
|
||||
@@ -46,6 +48,7 @@ atcs.spritesheet.items_weapons_3.category=item
|
||||
atcs.spritesheet.monsters_armor1.category=monster
|
||||
atcs.spritesheet.monsters_arulirs.category=monster
|
||||
|
||||
atcs.spritesheet.monsters_cats.category=monster
|
||||
atcs.spritesheet.monsters_dogs.category=monster
|
||||
atcs.spritesheet.monsters_eye1.category=monster
|
||||
atcs.spritesheet.monsters_eye2.category=monster
|
||||
@@ -58,6 +61,7 @@ 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
|
||||
@@ -70,6 +74,7 @@ atcs.spritesheet.monsters_man1.category=monster
|
||||
atcs.spritesheet.monsters_men.category=monster
|
||||
atcs.spritesheet.monsters_men2.category=monster
|
||||
atcs.spritesheet.monsters_misc.category=monster
|
||||
atcs.spritesheet.monsters_newb_1.category=monster
|
||||
atcs.spritesheet.monsters_omi1.category=monster
|
||||
atcs.spritesheet.monsters_omi1_b.category=monster
|
||||
atcs.spritesheet.monsters_omi2.category=monster
|
||||
@@ -118,3 +123,12 @@ atcs.spritesheet.monsters_giantbasilisk.sizey=64
|
||||
atcs.spritesheet.monsters_hydra1.category=monster
|
||||
atcs.spritesheet.monsters_hydra1.sizex=64
|
||||
atcs.spritesheet.monsters_hydra1.sizey=64
|
||||
atcs.spritesheet.monsters_newb_2.category=monster
|
||||
atcs.spritesheet.monsters_newb_2.sizex=64
|
||||
atcs.spritesheet.monsters_newb_2.sizey=32
|
||||
atcs.spritesheet.monsters_newb_3.category=monster
|
||||
atcs.spritesheet.monsters_newb_3.sizex=64
|
||||
atcs.spritesheet.monsters_newb_3.sizey=64
|
||||
atcs.spritesheet.monsters_newb_4.category=monster
|
||||
atcs.spritesheet.monsters_newb_4.sizex=32
|
||||
atcs.spritesheet.monsters_newb_4.sizey=64
|
||||
|
||||
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
|
||||
|
||||
@@ -14,11 +14,7 @@ import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -39,24 +35,23 @@ import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
|
||||
import com.gpl.rpg.atcontentstudio.ui.WorkerDialog;
|
||||
import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
|
||||
|
||||
|
||||
public class ATContentStudio {
|
||||
|
||||
public static final String APP_NAME = "Andor's Trail Content Studio";
|
||||
public static final String APP_VERSION = "v0.6.19";
|
||||
|
||||
public static final String APP_VERSION = readVersionFromFile();
|
||||
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
|
||||
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
|
||||
|
||||
|
||||
public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
|
||||
|
||||
public static boolean STARTED = false;
|
||||
public static float SCALING=1.0f;
|
||||
public static float SCALING = 1.0f;
|
||||
public static StudioFrame frame = null;
|
||||
|
||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset these loggers.
|
||||
// Need to keep a strong reference to it, to avoid garbage collection that'll
|
||||
// reset these loggers.
|
||||
public static final List<Logger> configuredLoggers = new LinkedList<Logger>();
|
||||
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
@@ -66,18 +61,19 @@ public class ATContentStudio {
|
||||
if (fontScaling != null) {
|
||||
try {
|
||||
fontScale = Float.parseFloat(fontScaling);
|
||||
SCALING=fontScale;
|
||||
SCALING = fontScale;
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("Failed to parse font scaling parameter. Using default.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ConfigCache.init();
|
||||
|
||||
|
||||
try {
|
||||
String laf = ConfigCache.getFavoriteLaFClassName();
|
||||
if (laf == null) laf = UIManager.getSystemLookAndFeelClassName();
|
||||
if (laf == null)
|
||||
laf = UIManager.getSystemLookAndFeelClassName();
|
||||
UIManager.setLookAndFeel(laf);
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
@@ -88,37 +84,40 @@ public class ATContentStudio {
|
||||
} catch (UnsupportedLookAndFeelException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
scaleUIFont();
|
||||
|
||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset this setting.
|
||||
// Need to keep a strong reference to it, to avoid garbage collection that'll
|
||||
// reset this setting.
|
||||
Logger l = Logger.getLogger(ExpressionParser.class.getName());
|
||||
l.setLevel(Level.OFF);
|
||||
configuredLoggers.add(l);
|
||||
|
||||
configuredLoggers.add(l);
|
||||
|
||||
final WorkspaceSelector wsSelect = new WorkspaceSelector();
|
||||
wsSelect.pack();
|
||||
Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
Dimension wdim = wsSelect.getSize();
|
||||
wsSelect.setLocation((sdim.width - wdim.width)/2, (sdim.height - wdim.height)/2);
|
||||
wsSelect.setLocation((sdim.width - wdim.width) / 2, (sdim.height - wdim.height) / 2);
|
||||
wsSelect.setVisible(true);
|
||||
|
||||
|
||||
wsSelect.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public synchronized void windowClosed(WindowEvent e) {
|
||||
if (wsSelect.selected != null && !STARTED) {
|
||||
ATContentStudio.STARTED = true;
|
||||
final File workspaceRoot = new File(wsSelect.selected);
|
||||
WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable(){
|
||||
WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable() {
|
||||
public void run() {
|
||||
Workspace.setActive(workspaceRoot);
|
||||
if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue() && Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
|
||||
if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue()
|
||||
&& Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
|
||||
new Thread() {
|
||||
public void run() {checkUpdate();}
|
||||
public void run() {
|
||||
checkUpdate();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
frame = new StudioFrame(APP_NAME+" "+APP_VERSION);
|
||||
frame = new StudioFrame(APP_NAME + " " + APP_VERSION);
|
||||
frame.setVisible(true);
|
||||
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
|
||||
};
|
||||
@@ -138,7 +137,7 @@ public class ATContentStudio {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private static void checkUpdate() {
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
@@ -146,32 +145,34 @@ public class ATContentStudio {
|
||||
in = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||
|
||||
String inputLine, lastLine = null;
|
||||
while ((inputLine = in.readLine()) != null) {lastLine = inputLine;}
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
lastLine = inputLine;
|
||||
}
|
||||
if (lastLine != null && !lastLine.equals(APP_VERSION)) {
|
||||
|
||||
// for copying style
|
||||
JLabel label = new JLabel();
|
||||
Font font = label.getFont();
|
||||
Color color = label.getBackground();
|
||||
|
||||
// create some css from the label's font
|
||||
StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
|
||||
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
|
||||
style.append("font-size:" + font.getSize() + "pt;");
|
||||
style.append("background-color: rgb("+color.getRed()+","+color.getGreen()+","+color.getBlue()+");");
|
||||
|
||||
JEditorPane ep = new JEditorPane("text/html", "<html><body style=\"" + style + "\">"
|
||||
+ "You are not running the latest ATCS version.<br/>"
|
||||
+ "You can get the latest version ("+lastLine+") by clicking the link below.<br/>"
|
||||
+ "<a href=\""+DOWNLOAD_URL+"\">"+DOWNLOAD_URL+"</a><br/>"
|
||||
+ "<br/>"
|
||||
+ "</body></html>");
|
||||
|
||||
// for copying style
|
||||
JLabel label = new JLabel();
|
||||
Font font = label.getFont();
|
||||
Color color = label.getBackground();
|
||||
|
||||
// create some css from the label's font
|
||||
StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
|
||||
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
|
||||
style.append("font-size:" + font.getSize() + "pt;");
|
||||
style.append("background-color: rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
|
||||
+ ");");
|
||||
|
||||
JEditorPane ep = new JEditorPane("text/html",
|
||||
"<html><body style=\"" + style + "\">" + "You are not running the latest ATCS version.<br/>"
|
||||
+ "You can get the latest version (" + lastLine + ") by clicking the link below.<br/>"
|
||||
+ "<a href=\"" + DOWNLOAD_URL + "\">" + DOWNLOAD_URL + "</a><br/>" + "<br/>"
|
||||
+ "</body></html>");
|
||||
|
||||
ep.setEditable(false);
|
||||
ep.setBorder(null);
|
||||
|
||||
|
||||
ep.addHyperlinkListener(new HyperlinkListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void hyperlinkUpdate(HyperlinkEvent e) {
|
||||
try {
|
||||
@@ -185,7 +186,7 @@ public class ATContentStudio {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
@@ -194,16 +195,17 @@ public class ATContentStudio {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) in.close();
|
||||
if (in != null)
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void scaleUIFont() {
|
||||
if (SCALING != 1.0f) {
|
||||
System.out.println("Scaling fonts to "+SCALING);
|
||||
System.out.println("Scaling fonts to " + SCALING);
|
||||
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
|
||||
Map<Object, Object> newDefaults = new HashMap<Object, Object>();
|
||||
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
|
||||
@@ -211,7 +213,7 @@ public class ATContentStudio {
|
||||
Object value = defaults.get(key);
|
||||
if (value instanceof Font) {
|
||||
Font font = (Font) value;
|
||||
int newSize = (int)(font.getSize() * SCALING);
|
||||
int newSize = (int) (font.getSize() * SCALING);
|
||||
if (value instanceof FontUIResource) {
|
||||
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
|
||||
} else {
|
||||
@@ -224,4 +226,13 @@ public class ATContentStudio {
|
||||
}
|
||||
}
|
||||
}
|
||||
private static String readVersionFromFile() {
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||
Objects.requireNonNull(ATContentStudio.class.getResourceAsStream("/ATCS_latest"))))) {
|
||||
return reader.readLine();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 |
@@ -238,7 +238,12 @@ 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);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,8 @@ public class Dialogue extends JSONElement {
|
||||
deactivateSpawnArea,
|
||||
activateMapObjectGroup,
|
||||
deactivateMapObjectGroup,
|
||||
changeMapFilter
|
||||
changeMapFilter,
|
||||
mapchange
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,6 +250,7 @@ public class Dialogue extends JSONElement {
|
||||
case removeSpawnArea:
|
||||
case deactivateSpawnArea:
|
||||
case changeMapFilter:
|
||||
case mapchange:
|
||||
reward.map = reward.map_name != null ? proj.getMap(reward.map_name) : null;
|
||||
break;
|
||||
case actorCondition:
|
||||
|
||||
@@ -39,14 +39,15 @@ public abstract class JSONElement extends GameDataElement {
|
||||
Map jsonObj = (Map)obj;
|
||||
String id = (String) jsonObj.get("id");
|
||||
try {
|
||||
if (id != null && id.equals(this.id )) {
|
||||
this.parse(jsonObj);
|
||||
this.state = State.parsed;
|
||||
break;
|
||||
}
|
||||
if (id != null && id.equals(this.id )) {
|
||||
this.parse(jsonObj);
|
||||
this.state = State.parsed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch(Exception e){
|
||||
System.out.println("Error in ID: " + id);
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
|
||||
@@ -60,7 +60,11 @@ public class Requirement extends JSONElement {
|
||||
factionScore,
|
||||
random,
|
||||
factionScoreEquals,
|
||||
wearRemove
|
||||
wearRemove,
|
||||
date,
|
||||
dateEquals,
|
||||
time,
|
||||
timeEquals
|
||||
}
|
||||
|
||||
public enum SkillID {
|
||||
@@ -196,6 +200,10 @@ public class Requirement extends JSONElement {
|
||||
case factionScore:
|
||||
case factionScoreEquals:
|
||||
case random:
|
||||
case date:
|
||||
case dateEquals:
|
||||
case time:
|
||||
case timeEquals:
|
||||
break;
|
||||
}
|
||||
if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent);
|
||||
|
||||
@@ -260,6 +260,14 @@ public class DefaultIcons {
|
||||
public static Image getTimerImage() { return getImage(TIMER_RES); }
|
||||
public static Image getTimerIcon() { return getIcon(TIMER_RES); }
|
||||
|
||||
private static String DATE_RES = "/com/gpl/rpg/atcontentstudio/img/date.png";
|
||||
public static Image getDateImage() { return getImage(DATE_RES); }
|
||||
public static Image getDateIcon() { return getIcon(DATE_RES); }
|
||||
|
||||
private static String TIME_RES = "/com/gpl/rpg/atcontentstudio/img/date.png";
|
||||
public static Image getTimeImage() { return getImage(TIME_RES); }
|
||||
public static Image getTimeIcon() { return getIcon(TIME_RES); }
|
||||
|
||||
private static String ALIGNMENT_RES = "/com/gpl/rpg/atcontentstudio/img/alignment.png";
|
||||
public static Image getAlignmentImage() { return getImage(ALIGNMENT_RES); }
|
||||
public static Image getAlignmentIcon() { return getIcon(ALIGNMENT_RES); }
|
||||
@@ -273,7 +281,7 @@ public class DefaultIcons {
|
||||
public static Image getStatusOrangeIcon() { return getIcon(STATUS_ORANGE_RES); }
|
||||
|
||||
private static String STATUS_GREEN_RES = "/com/gpl/rpg/atcontentstudio/img/status_green.png";
|
||||
public static Image getStatusGreenImage() { return getImage(STATUS_GREEN_RES); }
|
||||
public static Image getStatusGreenImage() { return getImage(STATUS_GREEN_RES); }
|
||||
public static Image getStatusGreenIcon() { return getIcon(STATUS_GREEN_RES); }
|
||||
|
||||
private static String STATUS_BLUE_RES = "/com/gpl/rpg/atcontentstudio/img/status_blue.png";
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ExportProjectWizard extends JDialog {
|
||||
radioGroup.add(asZip);
|
||||
overSources = new JRadioButton("... into a game source folder");
|
||||
radioGroup.add(overSources);
|
||||
asZip.setSelected(true);
|
||||
overSources.setSelected(true);
|
||||
|
||||
pane.add(asZip, JideBoxLayout.FIX);
|
||||
pane.add(overSources, JideBoxLayout.FIX);
|
||||
|
||||
@@ -384,6 +384,13 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
rewardObj = null;
|
||||
rewardValue = null;
|
||||
break;
|
||||
case mapchange:
|
||||
rewardMap = addMapBox(pane, ((Dialogue)target).getProject(), "Map Name: ", reward.map, writable, listener);
|
||||
rewardObjId = addTextField(pane, "Place: ", reward.reward_obj_id, writable, listener);
|
||||
rewardObjIdCombo = null;
|
||||
rewardObj = null;
|
||||
rewardValue = null;
|
||||
break;
|
||||
case deactivateSpawnArea:
|
||||
case removeSpawnArea:
|
||||
case spawnAll:
|
||||
@@ -777,6 +784,26 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case date:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Minimum date value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case dateEquals:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact date value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case time:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Minimum time value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case timeEquals:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
}
|
||||
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
|
||||
}
|
||||
@@ -943,6 +970,10 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
label.setText("Change map filter to "+rewardObjDesc+" on map "+reward.map_name);
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getReplaceIcon()));
|
||||
break;
|
||||
case mapchange:
|
||||
label.setText("Teleport to "+rewardObjDesc+" on map "+reward.map_name);
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getMapchangeIcon()));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
label.setText("New, undefined reward");
|
||||
@@ -1178,6 +1209,9 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getTimerIcon()));
|
||||
} else if (req.type == Requirement.RequirementType.factionScore || req.type == Requirement.RequirementType.factionScoreEquals) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getAlignmentIcon()));
|
||||
} else if (req.type == Requirement.RequirementType.date || req.type == Requirement.RequirementType.dateEquals ||
|
||||
req.type == Requirement.RequirementType.time || req.type == Requirement.RequirementType.timeEquals) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getDateIcon()));
|
||||
}
|
||||
if (req.type == null) {
|
||||
label.setText("New, undefined requirement.");
|
||||
|
||||
@@ -731,6 +731,26 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case date:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Minimum date value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case dateEquals:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Date type YYYYMMTT:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact date value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case time:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Minimum time value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case timeEquals:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
}
|
||||
}
|
||||
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
|
||||
|
||||
Reference in New Issue
Block a user