Updated gdx-teavm and added new preload screen using the java based solution instead of directly altering the index.html file
@@ -27,7 +27,7 @@ allprojects {
|
||||
gdxControllersVersion = '2.2.4'
|
||||
robovmVersion = '2.3.23'
|
||||
|
||||
gdxTeaVMVersion = '1.2.4'
|
||||
gdxTeaVMVersion = '1.3.1'
|
||||
teaVMVersion = '0.12.3'
|
||||
}
|
||||
version = appVersionName
|
||||
|
||||
@@ -29,17 +29,50 @@ tasks.register('compileClient', JavaExec) {
|
||||
|
||||
task modifyHtml {
|
||||
doLast {
|
||||
def htmlFile = file("../release/webapp/index.html")
|
||||
def destinationDir = file("../release/webapp/assets")
|
||||
def rootFS = file("../release/webapp")
|
||||
def htmlFile = new File(rootFS, "index.html")
|
||||
def assetsDir = new File(rootFS, "assets")
|
||||
def faviconDest = new File(rootFS, "favicon.ico")
|
||||
def sourceFavicon = file("../desktop/src/main/assets/icons/windows.ico")
|
||||
def sourceGif = file("../html/src/main/assets/logo.gif")
|
||||
def destinationStartupLogo = file("../release/webapp/startup-logo.png")
|
||||
def startupLogo = new File(assetsDir, "startup-logo.png")
|
||||
def assetsTxt = new File(assetsDir, "assets.txt")
|
||||
|
||||
// copy windows.ico
|
||||
// delete placeholder startup-logo.png
|
||||
if (startupLogo.exists()) {
|
||||
if (startupLogo.delete()) {
|
||||
println "Deleted startup-logo.png from assets folder."
|
||||
} else {
|
||||
println "Failed to delete startup-logo.png. Check permissions."
|
||||
}
|
||||
} else {
|
||||
println "startup-logo.png not found in assets folder. Nothing to delete."
|
||||
}
|
||||
|
||||
// remove lines containing the word 'frame' (case-insensitive) from assets.txt
|
||||
if (assetsTxt.exists()) {
|
||||
def originalLines = assetsTxt.readLines('UTF-8')
|
||||
def filteredLines = originalLines.findAll { line ->
|
||||
!(line =~ /(?i)frame/)
|
||||
}
|
||||
if (filteredLines.size() != originalLines.size()) {
|
||||
assetsTxt.withWriter('UTF-8') { writer ->
|
||||
filteredLines.eachWithIndex { l, i ->
|
||||
writer.write(l)
|
||||
if (i < filteredLines.size() - 1) writer.newLine()
|
||||
}
|
||||
}
|
||||
println "Removed lines containing 'frame' from assets.txt."
|
||||
} else {
|
||||
println "No lines containing 'frame' found in assets.txt. No changes made."
|
||||
}
|
||||
} else {
|
||||
println "assets.txt not found in assets folder. Skipping assets.txt cleanup."
|
||||
}
|
||||
|
||||
// copy windows.ico to favicon.ico
|
||||
if (sourceFavicon.exists()) {
|
||||
def destinationFile = new File(destinationDir, "windows.ico")
|
||||
sourceFavicon.withInputStream { input ->
|
||||
destinationFile.withOutputStream { output ->
|
||||
faviconDest.withOutputStream { output ->
|
||||
output << input
|
||||
}
|
||||
}
|
||||
@@ -48,28 +81,9 @@ task modifyHtml {
|
||||
println "windows.ico does not exist. Skipping copy step."
|
||||
}
|
||||
|
||||
if (sourceGif.exists()) {
|
||||
destinationStartupLogo.parentFile.mkdirs()
|
||||
sourceGif.withInputStream { input ->
|
||||
destinationStartupLogo.withOutputStream { output ->
|
||||
output << input
|
||||
}
|
||||
}
|
||||
println "Replaced startup-logo.png with a gif."
|
||||
} else {
|
||||
println "Gif does not exist. Skipping replacement step."
|
||||
}
|
||||
|
||||
if (htmlFile.exists()) {
|
||||
def faviconLink = '<link rel="icon" href="assets/windows.ico" type="image/x-icon">'
|
||||
def content = htmlFile.text
|
||||
|
||||
// add a link for the favicon
|
||||
if (content.contains("</head>")) {
|
||||
content = content.replace("</head>", faviconLink + "\n</head>")
|
||||
println "Favicon link added to index.html."
|
||||
}
|
||||
|
||||
// Change page title
|
||||
if (content.contains("<title>")) {
|
||||
content = content.replaceFirst("<title>.*?</title>", "<title>Shattered Pixel Dungeon</title>")
|
||||
@@ -78,62 +92,6 @@ task modifyHtml {
|
||||
println "No <title> tag found in index.html. Skipping title update."
|
||||
}
|
||||
|
||||
if (content.contains("<style>") && content.contains("</style>")) {
|
||||
content = content.replaceAll(
|
||||
"(?s)<style>.*?</style>",
|
||||
"""<style>
|
||||
body {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #000;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
#progress {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
#progress-img {
|
||||
display: flex;
|
||||
width: 850px;
|
||||
height: auto;
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
#progress-box {
|
||||
background: rgba(255,255,255,0.1);
|
||||
border: 2px solid #fff;
|
||||
display: flex;
|
||||
margin-top: -20px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
height: 30px;
|
||||
width: 600px;
|
||||
}
|
||||
#progress-bar {
|
||||
display: block;
|
||||
background: #44FF82;
|
||||
height: 20px;
|
||||
width: 0%;
|
||||
}
|
||||
</style>"""
|
||||
)
|
||||
|
||||
println "Successfully replaced the <style> block in index.html."
|
||||
} else {
|
||||
println "No <style> block found in index.html. Skipping style replacement."
|
||||
}
|
||||
|
||||
htmlFile.text = content
|
||||
} else {
|
||||
println "index.html does not exist. Skipping favicon injection."
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# ./gradlew clean html:build --refresh-dependencies --no-daemon
|
||||
|
||||
../gradlew :html:build
|
||||
wait
|
||||
if [[ -d ../release/webapp/ ]]; then
|
||||
|
||||
BIN
html/src/main/assets/ezgif-split.zip
Normal file
BIN
html/src/main/assets/frames/frame_00_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
html/src/main/assets/frames/frame_01_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
html/src/main/assets/frames/frame_02_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
html/src/main/assets/frames/frame_03_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
html/src/main/assets/frames/frame_04_delay-0.05s.gif
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
html/src/main/assets/frames/frame_05_delay-0.03s.gif
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
html/src/main/assets/frames/frame_06_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
html/src/main/assets/frames/frame_07_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
html/src/main/assets/frames/frame_08_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
html/src/main/assets/frames/frame_09_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
html/src/main/assets/frames/frame_10_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
html/src/main/assets/frames/frame_11_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
html/src/main/assets/frames/frame_12_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
html/src/main/assets/frames/frame_13_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
html/src/main/assets/frames/frame_14_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
html/src/main/assets/frames/frame_15_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
html/src/main/assets/frames/frame_16_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
html/src/main/assets/frames/frame_17_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_18_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_19_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_20_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_21_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_22_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_23_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
html/src/main/assets/frames/frame_24_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_25_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_26_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_27_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_28_delay-0.05s.gif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
html/src/main/assets/frames/frame_29_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_30_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_31_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_32_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_33_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
html/src/main/assets/frames/frame_34_delay-0.05s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_35_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_36_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_37_delay-0.05s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_38_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_39_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_40_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_41_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_42_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_43_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_44_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
html/src/main/assets/frames/frame_45_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_46_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_47_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_48_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
html/src/main/assets/frames/frame_49_delay-0.05s.gif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
html/src/main/assets/frames/frame_50_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
html/src/main/assets/frames/frame_51_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
html/src/main/assets/frames/frame_52_delay-0.05s.gif
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
html/src/main/assets/frames/frame_53_delay-0.03s.gif
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
html/src/main/assets/frames/frame_54_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_55_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_56_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_57_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
html/src/main/assets/frames/frame_58_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
html/src/main/assets/frames/frame_59_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_60_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_61_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_62_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_63_delay-0.05s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_64_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_65_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_66_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_67_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_68_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
html/src/main/assets/frames/frame_69_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
html/src/main/assets/frames/frame_70_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_71_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
html/src/main/assets/frames/frame_72_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_73_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_74_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_75_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_76_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_77_delay-0.05s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_78_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_79_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_80_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_81_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
html/src/main/assets/frames/frame_82_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_83_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
html/src/main/assets/frames/frame_84_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
html/src/main/assets/frames/frame_85_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
html/src/main/assets/frames/frame_86_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
html/src/main/assets/frames/frame_87_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
html/src/main/assets/frames/frame_88_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
html/src/main/assets/frames/frame_89_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
html/src/main/assets/frames/frame_90_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
html/src/main/assets/frames/frame_91_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
html/src/main/assets/frames/frame_92_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
html/src/main/assets/frames/frame_93_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
html/src/main/assets/frames/frame_94_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
html/src/main/assets/frames/frame_95_delay-0.04s.gif
Normal file
|
After Width: | Height: | Size: 7.4 KiB |