improved GameScreen
This commit is contained in:
@@ -52,16 +52,19 @@ abstract class TexturePackerTask : DefaultTask() {
|
||||
package eu.jonahbauer.wizard.client.libgdx;
|
||||
public class $name {
|
||||
public static final String ${'$'}PATH = "$path";
|
||||
|
||||
""".trimIndent())
|
||||
|
||||
val content = atlas.readText(Charsets.UTF_8)
|
||||
val matcher = Pattern.compile("(?m)^([^:]*?)\$\\n {2}").matcher(content)
|
||||
val fields = HashSet<String>()
|
||||
while (matcher.find()) {
|
||||
val texture = matcher.group(1)
|
||||
val field = texture.replace("-", "_").replace("/", "_").uppercase(Locale.ROOT)
|
||||
builder.append(" public static final String $field = \"$texture\";\n")
|
||||
fields.add(" public static final String $field = \"$texture\";\n")
|
||||
}
|
||||
|
||||
fields.forEach(builder::append)
|
||||
builder.append("}\n")
|
||||
|
||||
val out = generatedSourceOutput.file("eu/jonahbauer/wizard/client/libgdx/${name}.java").get().asFile
|
||||
|
Reference in New Issue
Block a user