diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 0922ce7f00..0000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -patreon: hexworks diff --git a/TODO.md b/TODO.md index f36a359b76..edd396641c 100644 --- a/TODO.md +++ b/TODO.md @@ -2,18 +2,21 @@ ## Must have +- [ ] Implement Rexpaint loading +- [ ] Implement animation loading - [ ] Add remaining tilesets to app config and test them - [ ] Retrofit code examples - [ ] Implement texture transform modifiers (crossed-out, underline, border) - [ ] Refactor the Markov modifier -- [ ] Fix the text input component +- [ ] Fix the buggy components + - [ ] radio box won't do the `o` when selected without focus (first click) + - [ ] `TextBox` will do an interaction recoloring when `` is pressed + - [ ] `TextBox` cursor is drawn outside the box + - [ ] if `CheckBox` is clicked quickly it won't check - [ ] Use all code examples to check for bugs - ## Nice to have -- [ ] Implement Rexpaint loading -- [ ] Implement animation loading - [x] Refactor java-sytle builders to kotlin builder dsls - [ ] Check the rest of the code for Javaesque patterns and refactor them - [ ] Make life easier for Java users diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 3d0e56b50a..2ab0246496 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -10,6 +10,6 @@ repositories { } dependencies { - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21") - implementation("com.soywiz.korlibs.korge.plugins:korge-gradle-plugin:4.0.7") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22") + implementation("com.soywiz.korlibs.korge.plugins:korge-gradle-plugin:5.3.0") } diff --git a/gradle.properties b/gradle.properties index 06180fbee4..f1eda0ee11 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,9 @@ group=org.hexworks.zircon -version=2022.1.0-RELEASE +version=2024.0.0-RELEASE kotlin.mpp.stability.nowarn=true kotlin.js.compiler=ir -org.gradle.parallel=true -org.gradle.daemon=true -org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=1g -org.gradle.configureondemand=true - POM_PACKAGING=jar POM_URL=https://github.com/Hexworks/zircon POM_SCM_URL=https://github.com/Hexworks/zircon.git diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f0..7f93135c49 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 31cca49130..3fa8f862f7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6c2..1aa94a4269 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index f127cfd49d..93e3f59f13 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/zircon.core/build.gradle.kts b/zircon.core/build.gradle.kts index b5b1b3a747..e2b10e3100 100644 --- a/zircon.core/build.gradle.kts +++ b/zircon.core/build.gradle.kts @@ -24,9 +24,9 @@ kotlin { withJava() compilations.all { kotlinOptions { - apiVersion = "1.5" - languageVersion = "1.5" - jvmTarget = "11" + apiVersion = "1.9" + languageVersion = "1.9" + jvmTarget = "15" } } } diff --git a/zircon.examples/src/commonMain/kotlin/main.kt b/zircon.examples/src/commonMain/kotlin/main.kt index 6b39610786..6cdcb57322 100644 --- a/zircon.examples/src/commonMain/kotlin/main.kt +++ b/zircon.examples/src/commonMain/kotlin/main.kt @@ -1,6 +1,10 @@ +import korlibs.io.file.std.openAsZip import org.hexworks.zircon.api.builder.application.appConfig import org.hexworks.zircon.api.builder.application.withSize import org.hexworks.zircon.api.createApplication +import org.hexworks.zircon.api.resource.Resource +import org.hexworks.zircon.api.resource.ResourceType +import org.hexworks.zircon.api.resource.loadResource import org.hexworks.zircon.internal.resource.BuiltInCP437TilesetResource suspend fun main() { @@ -8,23 +12,16 @@ suspend fun main() { val gridCols = 1920 / tileSize val gridRows = 1080 / tileSize -// loadResource(Resource.create("rex_files/xptest.xp", ResourceType.PROJECT)).openAsZip() -// -// println("ok") + loadResource(Resource.create("rex_files/xptest.zip", ResourceType.PROJECT)) -// Applications.createApplication(appConfig { -// size = Size.create(gridCols, gridRows) + +// createApplication(appConfig { +// withSize { +// width = gridCols +// height = gridRows +// } // defaultTileset = BuiltInCP437TilesetResource.valueOf("REX_PAINT_${tileSize}X${tileSize}") // debugMode = true -// }).rex().start() - - createApplication(appConfig { - withSize { - width = gridCols - height = gridRows - } - defaultTileset = BuiltInCP437TilesetResource.valueOf("REX_PAINT_${tileSize}X${tileSize}") - debugMode = true - }).components().start() +// }).components().start() } \ No newline at end of file diff --git a/zircon.examples/src/commonMain/resources/rex_files/BOT.xp b/zircon.examples/src/commonMain/resources/rex_files/BOT.xp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/zircon.examples/src/commonMain/resources/rex_files/BOT.zip b/zircon.examples/src/commonMain/resources/rex_files/BOT.zip new file mode 100644 index 0000000000..6821f37f17 Binary files /dev/null and b/zircon.examples/src/commonMain/resources/rex_files/BOT.zip differ diff --git a/zircon.examples/src/commonMain/resources/rex_files/Buildings.xp b/zircon.examples/src/commonMain/resources/rex_files/Buildings.xp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/zircon.examples/src/commonMain/resources/rex_files/Buildings.zip b/zircon.examples/src/commonMain/resources/rex_files/Buildings.zip new file mode 100644 index 0000000000..9270ef4840 Binary files /dev/null and b/zircon.examples/src/commonMain/resources/rex_files/Buildings.zip differ diff --git a/zircon.examples/src/commonMain/resources/rex_files/cp437_table.xp b/zircon.examples/src/commonMain/resources/rex_files/cp437_table.xp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/zircon.examples/src/commonMain/resources/rex_files/cp437_table.zip b/zircon.examples/src/commonMain/resources/rex_files/cp437_table.zip new file mode 100644 index 0000000000..aee278cd59 Binary files /dev/null and b/zircon.examples/src/commonMain/resources/rex_files/cp437_table.zip differ diff --git a/zircon.examples/src/commonMain/resources/rex_files/glyphs_w_transp_bg.xp b/zircon.examples/src/commonMain/resources/rex_files/glyphs_w_transp_bg.xp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/zircon.examples/src/commonMain/resources/rex_files/glyphs_w_transp_bg.zip b/zircon.examples/src/commonMain/resources/rex_files/glyphs_w_transp_bg.zip new file mode 100644 index 0000000000..deed791a4a Binary files /dev/null and b/zircon.examples/src/commonMain/resources/rex_files/glyphs_w_transp_bg.zip differ diff --git a/zircon.examples/src/commonMain/resources/rex_files/xptest.xp b/zircon.examples/src/commonMain/resources/rex_files/xptest.xp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/zircon.examples/src/commonMain/resources/rex_files/xptest.zip b/zircon.examples/src/commonMain/resources/rex_files/xptest.zip new file mode 100644 index 0000000000..d65aa5cc96 Binary files /dev/null and b/zircon.examples/src/commonMain/resources/rex_files/xptest.zip differ diff --git a/zircon.examples/src/commonMain/resources/rex_files/zircon_logo.xp b/zircon.examples/src/commonMain/resources/rex_files/zircon_logo.xp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/zircon.examples/src/commonMain/resources/rex_files/zircon_logo.zip b/zircon.examples/src/commonMain/resources/rex_files/zircon_logo.zip new file mode 100644 index 0000000000..461e55a7ec Binary files /dev/null and b/zircon.examples/src/commonMain/resources/rex_files/zircon_logo.zip differ diff --git a/zircon.examples/src/commonMain/resources/rex_files/zircon_logo_nosubtitle_rex.xp b/zircon.examples/src/commonMain/resources/rex_files/zircon_logo_nosubtitle_rex.xp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/zircon.examples/src/commonMain/resources/rex_files/zircon_logo_nosubtitle_rex.zip b/zircon.examples/src/commonMain/resources/rex_files/zircon_logo_nosubtitle_rex.zip new file mode 100644 index 0000000000..89f360065d Binary files /dev/null and b/zircon.examples/src/commonMain/resources/rex_files/zircon_logo_nosubtitle_rex.zip differ