update gradle, fixed overflow in wave display

This commit is contained in:
Sharlotte
2022-08-18 16:27:17 +09:00
parent 7b8479c16e
commit 1d33c26e93
5 changed files with 47 additions and 48 deletions

View File

@@ -1,10 +1,9 @@
@rem put this project path into PATH_FROM @rem put this project path into PATH_FROM
setlocal setlocal
set PATH_FROM=C:\Users\user\Documents\GitHub\Informatis set PATH_FROM=C:\Users\jun\Documents\GitHub\Informatis
@rem put your mindustry local path into PATH_TO @rem put your mindustry local path into PATH_TO
setlocal setlocal
set PATH_TO=C:\Users\user\AppData\Roaming\Mindustry set PATH_TO=C:\Users\jun\AppData\Roaming\Mindustry
if exist %PATH_TO%\mods\UnitInfo.jar del %PATH_TO%\mods\Informatis.jar if exist %PATH_TO%\mods\raw-Informatis.jar del %PATH_TO%\mods\raw-Informatis.jar
xcopy %PATH_FROM%\build\libs\Informatis.jar %PATH_TO%\mods\ /k /y xcopy %PATH_FROM%\build\libs\raw-Informatis.jar %PATH_TO%\mods\ /k /y
del %PATH_FROM%\build\libs\Informatis.jar

View File

@@ -2,8 +2,13 @@ plugins {
id 'java' id 'java'
} }
group pGroup ext{
version '1.0' sdkRoot = System.getenv("ANDROID_HOME")
sdkVersion = '30'
artifactFilename = "Informatis.jar"
}
group "sharlotte"
sourceSets.main { sourceSets.main {
java.srcDir("src/") java.srcDir("src/")
@@ -15,37 +20,41 @@ repositories {
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
} }
jar {
archiveFileName.set pArtifactFilename
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
dependencies { dependencies {
annotationProcessor 'com.github.Anuken:jabel:34e4c172e65b3928cd9eabe1993654ea79c409cd' annotationProcessor 'com.github.Anuken:jabel:0.8.0'
compileOnly "com.github.Anuken.MindustryJitpack:core:3ffa59efb6" compileOnly "com.github.Anuken.Mindustry:core:v137"
compileOnly "com.github.Anuken.Arc:arc-core:dfcb21ce56" compileOnly "com.github.Anuken.Arc:arc-core:dfcb21ce56"
} }
task dexify(type: Jar) { jar.archiveFileName.set("raw-$artifactFilename")
archiveName "dexed-$pArtifactFilename"
final File jarArtifact = new File(tasks.jar.archiveFile.get().asFile.parent, pArtifactFilename), def isWindows = System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows")
task dexify(type: Jar){
archiveFileName.set(artifactFilename)
final File jarArtifact = new File(tasks.jar.archiveFile.get().asFile.parent, "raw-$artifactFilename"),
dexedArtifact = new File(tasks.dexify.getTemporaryDir(), "dexed.jar") dexedArtifact = new File(tasks.dexify.getTemporaryDir(), "dexed.jar")
doFirst{ doFirst{
//collect dependencies needed for desugaring
def files = (configurations.compileClasspath.asList() + configurations.runtimeClasspath.asList() + [new File("$sdkRoot/platforms/android-$sdkVersion/android.jar")])
exec{ exec{
workingDir dexedArtifact.parent workingDir dexedArtifact.parent
def command = ["d8", "--min-api", pMinApi, "--output", dexedArtifact, jarArtifact] def command = ["d8", "--min-api", "14"]
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) for(def file : files){
commandLine("cmd", "/c", *command) command += "--classpath"
else command += file.path
commandLine(*command) }
command += ["--output", dexedArtifact, jarArtifact]
if(isWindows){
commandLine("cmd", "/c", *command)
}else{
commandLine(*command)
}
} }
} }
@@ -57,7 +66,7 @@ task buildDex dependsOn "build", "dexify"
task buildMove(dependsOn: build) { task buildMove(dependsOn: build) {
doLast { doLast {
copy { copy {
from "build/libs/Informatis.jar" from "build/libs/raw-Informatis.jar"
into System.getenv("destination") into System.getenv("destination")
} }
} }
@@ -65,12 +74,11 @@ task buildMove(dependsOn: build) {
tasks.withType(JavaCompile){ tasks.withType(JavaCompile){
targetCompatibility = 8 targetCompatibility = 8
sourceCompatibility = JavaVersion.VERSION_16 sourceCompatibility = JavaVersion.VERSION_17
options.encoding = "UTF-8" options.encoding = "UTF-8"
options.forkOptions.jvmArgs.addAll([ options.compilerArgs += ["-Xlint:deprecation"]
'--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED', if(JavaVersion.current() != JavaVersion.VERSION_1_8){
'--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED'
])
options.compilerArgs.addAll(['--release', '8']) options.compilerArgs.addAll(['--release', '8'])
}
compileJava.options.fork = true compileJava.options.fork = true
} }

View File

@@ -1,8 +0,0 @@
# Filename of output file (dexify prepends 'dexed-') (people will hate you if it isn't .jar)
pArtifactFilename = Informatis.jar
# Group of project (should line up with dirs in src/)
pGroup = sharlotte
# Version of Mindustry to use (if not working, consult jitpack.io)
pMindustryVersion = v136
# Minimum API level for d8 (if you don't know what this is, leave it unless d8 yells at you)
pMinApi = 26

View File

@@ -15,7 +15,7 @@ import static arc.Core.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
public class WaveInfoDisplay { public class WaveInfoDisplay {
public boolean waveShown; private boolean waveShown;
public void addWaveInfoTable() { public void addWaveInfoTable() {
Table waveInfoTable = new Table(Tex.buttonEdge4, table -> { Table waveInfoTable = new Table(Tex.buttonEdge4, table -> {

View File

@@ -155,7 +155,7 @@ public class WaveWindow extends Window implements Updatable {
ObjectIntMap<SpawnGroup> groups = getWaveGroup(index-1); ObjectIntMap<SpawnGroup> groups = getWaveGroup(index-1);
int row = 0; int row = 0;
int max = Math.max(1, Math.round(window.getWidth()/2/8)); int max = Math.max(1, Math.round(window.getWidth()/64)-5);
for (SpawnGroup group : groups.keys()) { for (SpawnGroup group : groups.keys()) {
int spawners = state.rules.waveTeam.cores().size + (group.type.flying ? spawner.countFlyerSpawns() : spawner.countGroundSpawns()); int spawners = state.rules.waveTeam.cores().size + (group.type.flying ? spawner.countFlyerSpawns() : spawner.countGroundSpawns());
int amount = groups.get(group); int amount = groups.get(group);