This commit is contained in:
Anuken
2025-12-27 21:42:22 -05:00
parent 1a89fc9f8e
commit 8fb7aa34e3
4 changed files with 13 additions and 4 deletions

View File

@@ -6646,11 +6646,13 @@ public class Blocks{
liquidSource = new LiquidSource("liquid-source"){{ liquidSource = new LiquidSource("liquid-source"){{
requirements(Category.liquid, BuildVisibility.sandboxOnly, with()); requirements(Category.liquid, BuildVisibility.sandboxOnly, with());
alwaysUnlocked = true; alwaysUnlocked = true;
floating = true;
}}; }};
liquidVoid = new LiquidVoid("liquid-void"){{ liquidVoid = new LiquidVoid("liquid-void"){{
requirements(Category.liquid, BuildVisibility.sandboxOnly, with()); requirements(Category.liquid, BuildVisibility.sandboxOnly, with());
alwaysUnlocked = true; alwaysUnlocked = true;
floating = true;
}}; }};
payloadSource = new PayloadSource("payload-source"){{ payloadSource = new PayloadSource("payload-source"){{

View File

@@ -64,7 +64,7 @@ public class Rules{
public boolean fire = true; public boolean fire = true;
/** Whether units use and require ammo. */ /** Whether units use and require ammo. */
public boolean unitAmmo = false; public boolean unitAmmo = false;
/** EXPERIMENTAL! If true, air and ground units target random things each wave instead of only the core/generators. */ /** If true, air and ground units target random things each wave instead of only the core/generators. */
public boolean randomWaveAI = false; public boolean randomWaveAI = false;
/** EXPERIMENTAL! If true, blocks will update in units and share power. */ /** EXPERIMENTAL! If true, blocks will update in units and share power. */
public boolean unitPayloadUpdate = false; public boolean unitPayloadUpdate = false;

View File

@@ -950,7 +950,7 @@ public class LExecutor{
if(p1.obj() instanceof UnlockableContent u){ if(p1.obj() instanceof UnlockableContent u){
packed = (u.id << 5) | (u.getContentType().ordinal() & 31); packed = (u.id << 5) | (u.getContentType().ordinal() & 31);
}else if(p1.obj() instanceof LogicDisplayBuild d){ }else if(p1.obj() instanceof LogicDisplayBuild d){
packed = (d.index << 5) | 30; packed = (d.index << 5) | LogicDisplay.displayDrawType;
} }
num1 = packed & 0x3FF; num1 = packed & 0x3FF;
num4 = packed >> 10; num4 = packed >> 10;

View File

@@ -11,6 +11,7 @@ import arc.util.io.*;
import mindustry.*; import mindustry.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.ctype.*; import mindustry.ctype.*;
import mindustry.game.EventType.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.logic.*; import mindustry.logic.*;
@@ -42,6 +43,8 @@ public class LogicDisplay extends Block{
; ;
public static final Seq<LogicDisplayBuild> displays = new Seq<>(false); public static final Seq<LogicDisplayBuild> displays = new Seq<>(false);
/** When the content type of a draw command is this number, it counts as a display. */
public static final int displayDrawType = 30;
public static final float scaleStep = 0.05f; public static final float scaleStep = 0.05f;
@@ -50,6 +53,10 @@ public class LogicDisplay extends Block{
public int displaySize = 64; public int displaySize = 64;
public float scaleFactor = 1f; public float scaleFactor = 1f;
static{
Events.on(ResetEvent.class, e -> displays.clear());
}
public LogicDisplay(String name){ public LogicDisplay(String name){
super(name); super(name);
update = true; update = true;
@@ -173,8 +180,8 @@ public class LogicDisplay extends Block{
int packed = (DisplayCmd.p4(c) << 10) | DisplayCmd.p1(c); int packed = (DisplayCmd.p4(c) << 10) | DisplayCmd.p1(c);
int ctype = packed & 0x1F; int ctype = packed & 0x1F;
int id = packed >> 5; int id = packed >> 5;
if(ctype == 30){ if(ctype == displayDrawType){
if(id != index && id < displays.size && displays.get(id).buffer != null){ if(id != index && id < displays.size && id >= 0 && displays.get(id).buffer != null){
Tmp.tr1.set(displays.get(id).buffer.getTexture()); Tmp.tr1.set(displays.get(id).buffer.getTexture());
Draw.rect(Tmp.tr1, x, y, p2, p2, p3 + 90); Draw.rect(Tmp.tr1, x, y, p2, p2, p3 + 90);
} }