From 7f5095921aecdf45bd69af8cf1073ebfb40224c2 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 20 Sep 2022 21:50:44 -0400 Subject: [PATCH] Mod pregenerated meta option --- core/src/mindustry/graphics/Drawf.java | 4 +++- core/src/mindustry/mod/Mods.java | 8 +++++--- core/src/mindustry/type/CellLiquid.java | 2 +- core/src/mindustry/type/Planet.java | 2 +- gradle.properties | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/graphics/Drawf.java b/core/src/mindustry/graphics/Drawf.java index 4e01e5179b..63443900c7 100644 --- a/core/src/mindustry/graphics/Drawf.java +++ b/core/src/mindustry/graphics/Drawf.java @@ -21,7 +21,9 @@ public class Drawf{ /** Bleeds a mod pixmap if linear filtering is enabled. */ 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 diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 151796555d..bb14078c60 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -180,7 +180,7 @@ public class Mods implements Loadable{ } private void packSprites(Seq sprites, LoadedMod mod, boolean prefix, Seq> tasks){ - boolean linear = Core.settings.getBool("linear", true); + boolean bleed = Core.settings.getBool("linear", true) && !mod.meta.pregenerated; for(Fi file : sprites){ String name = file.nameWithoutExtension(); @@ -204,7 +204,7 @@ public class Mods implements Loadable{ try{ Pixmap pix = new Pixmap(file.readBytes()); //only bleeds when linear filtering is on at startup - if(linear){ + if(bleed){ Pixmaps.bleed(pix, 2); } //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){ u.load(); u.loadIcon(); - if(u.generateIcons){ + if(u.generateIcons && !c.minfo.mod.meta.pregenerated){ u.createIcons(packer); } } @@ -1141,6 +1141,8 @@ public class Mods implements Loadable{ public boolean java; /** If true, -outline regions for units are kept when packing. Only use if you know exactly what you are doing. */ public boolean keepOutlines; + /** If true, bleeding is skipped and no content icons are generated. */ + public boolean pregenerated; public String displayName(){ return displayName == null ? name : displayName; diff --git a/core/src/mindustry/type/CellLiquid.java b/core/src/mindustry/type/CellLiquid.java index 0eb19b01fd..3874cd3efd 100644 --- a/core/src/mindustry/type/CellLiquid.java +++ b/core/src/mindustry/type/CellLiquid.java @@ -19,7 +19,7 @@ public class CellLiquid extends Liquid{ public int cells = 8; 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){ super(name, color); diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index fe6acb2560..f42da7f475 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -123,7 +123,7 @@ public class Planet extends UnlockableContent{ public Seq children = new Seq<>(); /** Default root node shown when the tech tree is opened here. */ 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 launchCandidates = new Seq<>(); /** Items not available on this planet. */ public Seq hiddenItems = new Seq<>(); diff --git a/gradle.properties b/gradle.properties index f9adcd79e2..85c0be4d22 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ org.gradle.caching=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=829da164e7 +archash=1ecc58862e