Mod pregenerated meta option

This commit is contained in:
Anuken 2022-09-20 21:50:44 -04:00
parent ac93539a5c
commit 7f5095921a
5 changed files with 11 additions and 7 deletions

View File

@ -21,7 +21,9 @@ public class Drawf{
/** Bleeds a mod pixmap if linear filtering is enabled. */ /** Bleeds a mod pixmap if linear filtering is enabled. */
public static void checkBleed(Pixmap pixmap){ public static void checkBleed(Pixmap pixmap){
if(Core.settings.getBool("linear", true)) Pixmaps.bleed(pixmap); if(Core.settings.getBool("linear", true)){
Pixmaps.bleed(pixmap);
}
} }
//TODO offset unused //TODO offset unused

View File

@ -180,7 +180,7 @@ public class Mods implements Loadable{
} }
private void packSprites(Seq<Fi> sprites, LoadedMod mod, boolean prefix, Seq<Future<Runnable>> tasks){ private void packSprites(Seq<Fi> sprites, LoadedMod mod, boolean prefix, Seq<Future<Runnable>> tasks){
boolean linear = Core.settings.getBool("linear", true); boolean bleed = Core.settings.getBool("linear", true) && !mod.meta.pregenerated;
for(Fi file : sprites){ for(Fi file : sprites){
String name = file.nameWithoutExtension(); String name = file.nameWithoutExtension();
@ -204,7 +204,7 @@ public class Mods implements Loadable{
try{ try{
Pixmap pix = new Pixmap(file.readBytes()); Pixmap pix = new Pixmap(file.readBytes());
//only bleeds when linear filtering is on at startup //only bleeds when linear filtering is on at startup
if(linear){ if(bleed){
Pixmaps.bleed(pix, 2); Pixmaps.bleed(pix, 2);
} }
//this returns a *runnable* which actually packs the resulting pixmap; this has to be done synchronously outside the method //this returns a *runnable* which actually packs the resulting pixmap; this has to be done synchronously outside the method
@ -336,7 +336,7 @@ public class Mods implements Loadable{
if(c instanceof UnlockableContent u && c.minfo.mod != null){ if(c instanceof UnlockableContent u && c.minfo.mod != null){
u.load(); u.load();
u.loadIcon(); u.loadIcon();
if(u.generateIcons){ if(u.generateIcons && !c.minfo.mod.meta.pregenerated){
u.createIcons(packer); u.createIcons(packer);
} }
} }
@ -1141,6 +1141,8 @@ public class Mods implements Loadable{
public boolean java; public boolean java;
/** If true, -outline regions for units are kept when packing. Only use if you know exactly what you are doing. */ /** If true, -outline regions for units are kept when packing. Only use if you know exactly what you are doing. */
public boolean keepOutlines; public boolean keepOutlines;
/** If true, bleeding is skipped and no content icons are generated. */
public boolean pregenerated;
public String displayName(){ public String displayName(){
return displayName == null ? name : displayName; return displayName == null ? name : displayName;

View File

@ -19,7 +19,7 @@ public class CellLiquid extends Liquid{
public int cells = 8; public int cells = 8;
public @Nullable Liquid spreadTarget; public @Nullable Liquid spreadTarget;
public float maxSpread = 0.5f, spreadConversion = 1f, spreadDamage = 0.1f, removeScaling = 0.25f; public float maxSpread = 0.75f, spreadConversion = 1f, spreadDamage = 0.1f, removeScaling = 0.25f;
public CellLiquid(String name, Color color){ public CellLiquid(String name, Color color){
super(name, color); super(name, color);

View File

@ -123,7 +123,7 @@ public class Planet extends UnlockableContent{
public Seq<Planet> children = new Seq<>(); public Seq<Planet> children = new Seq<>();
/** Default root node shown when the tech tree is opened here. */ /** Default root node shown when the tech tree is opened here. */
public @Nullable TechNode techTree; public @Nullable TechNode techTree;
/** Planets that can be launched to from this one. Made mutual in init(). */ /** TODO remove? Planets that can be launched to from this one. Made mutual in init(). */
public Seq<Planet> launchCandidates = new Seq<>(); public Seq<Planet> launchCandidates = new Seq<>();
/** Items not available on this planet. */ /** Items not available on this planet. */
public Seq<Item> hiddenItems = new Seq<>(); public Seq<Item> hiddenItems = new Seq<>();

View File

@ -25,4 +25,4 @@ org.gradle.caching=true
#used for slow jitpack builds; TODO see if this actually works #used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000 org.gradle.internal.http.connectionTimeout=100000
archash=829da164e7 archash=1ecc58862e