Eliminated 8 characters
This commit is contained in:
@@ -62,7 +62,7 @@ public class ScriptStubGenerator{
|
||||
ObjectSet<String> used = ObjectSet.with();
|
||||
|
||||
StringBuilder result = new StringBuilder("//Generated class. Do not modify.\n");
|
||||
result.append("\n").append(new FileHandle("core/assets/scripts/base.js").readString()).append("\n");
|
||||
result.append("\n").append(new Fi("core/assets/scripts/base.js").readString()).append("\n");
|
||||
for(Class type : classes){
|
||||
if(used.contains(type.getPackage().getName()) || nopackage.contains(s -> type.getName().startsWith(s))) continue;
|
||||
result.append("importPackage(Packages.").append(type.getPackage().getName()).append(")\n");
|
||||
@@ -71,8 +71,8 @@ public class ScriptStubGenerator{
|
||||
|
||||
//Log.info(result);
|
||||
|
||||
new FileHandle("core/assets/scripts/global.js").writeString(result.toString());
|
||||
new FileHandle("core/src/io/anuke/mindustry/mod/ClassAccess.java").writeString(fileTemplate
|
||||
new Fi("core/assets/scripts/global.js").writeString(result.toString());
|
||||
new Fi("core/src/io/anuke/mindustry/mod/ClassAccess.java").writeString(fileTemplate
|
||||
.replace("$ALLOWED_CLASSES$", classes.toString(", ", type -> type.getName() + ".class"))
|
||||
.replace("$ALLOWED_CLASS_NAMES$", classes.toString(", ", type -> "\"" + type.getName() + "\"")));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.anuke.mindustry.tools;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.files.FileHandle;
|
||||
import io.anuke.arc.files.Fi;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.Pixmap;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
@@ -19,7 +19,7 @@ public class SquareMarcher{
|
||||
this.buffer = new FrameBuffer(resolution, resolution);
|
||||
}
|
||||
|
||||
void render(Pixmap pixmap, FileHandle file){
|
||||
void render(Pixmap pixmap, Fi file){
|
||||
boolean[][] grid = new boolean[pixmap.getWidth()][pixmap.getHeight()];
|
||||
|
||||
for(int x = 0; x < pixmap.getWidth(); x++){
|
||||
|
||||
@@ -24,17 +24,17 @@ public class Upscaler{
|
||||
Core.batch = new SpriteBatch();
|
||||
Core.atlas = new TextureAtlas();
|
||||
Core.atlas.addRegion("white", Pixmaps.blankTextureRegion());
|
||||
FileHandle file = Core.files.local("");
|
||||
Fi file = Core.files.local("");
|
||||
|
||||
Log.info("Upscaling icons...");
|
||||
Time.mark();
|
||||
FileHandle[] list = file.list();
|
||||
Fi[] list = file.list();
|
||||
|
||||
for(IconSize size : IconSize.values()){
|
||||
String suffix = size == IconSize.def ? "" : "-" + size.name();
|
||||
SquareMarcher marcher = new SquareMarcher(size.size);
|
||||
|
||||
for(FileHandle img : list){
|
||||
for(Fi img : list){
|
||||
if(img.extension().equals("png")){
|
||||
marcher.render(new Pixmap(img), img.sibling(img.nameWithoutExtension() + suffix + ".png"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user