Code cleanup
This commit is contained in:
@@ -14,14 +14,14 @@ def textureFolder = "../core/assets-raw/sprites/generated/"
|
||||
task swapColors(){
|
||||
doLast{
|
||||
if (project.hasProperty("colors")) {
|
||||
def carr = new File(getProperty("colors")).text.split("\n");
|
||||
def carr = new File(getProperty("colors")).text.split("\n")
|
||||
def map = [:]
|
||||
def swaps = 0
|
||||
carr.each {str -> map[Color.argb8888(Color.valueOf(str.split("=")[0]))] = Color.argb8888(Color.valueOf(str.split("=")[1]))}
|
||||
def tmpc = new Color()
|
||||
|
||||
fileTree(dir: '../core/assets-raw/sprites', include: "**/*.png").visit { file ->
|
||||
if(file.isDirectory()) return;
|
||||
if(file.isDirectory()) return
|
||||
swaps ++
|
||||
|
||||
def img = ImageIO.read(file.file)
|
||||
@@ -39,7 +39,7 @@ task swapColors(){
|
||||
}
|
||||
println "Swapped $swaps images."
|
||||
}else{
|
||||
throw new InvalidUserDataException("No replacement colors specified. Use -Pcolors=\"<path to color file>\"");
|
||||
throw new InvalidUserDataException("No replacement colors specified. Use -Pcolors=\"<path to color file>\"")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user