Logic icon support for all blocks

This commit is contained in:
Anuken
2024-06-16 01:11:54 -04:00
parent 5c23abf2d8
commit 7f9eb87313
5 changed files with 18 additions and 34 deletions

View File

@@ -10,6 +10,7 @@ import arc.util.*;
import arc.util.io.*;
import mindustry.*;
import mindustry.annotations.Annotations.*;
import mindustry.ctype.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.ui.*;
@@ -120,8 +121,10 @@ public class LogicDisplay extends Block{
case commandColor -> Draw.color(this.color = Color.toFloatBits(x, y, p1, p2));
case commandStroke -> Lines.stroke(this.stroke = x);
case commandImage -> {
var icon = Fonts.logicIcon(p1);
Draw.rect(Fonts.logicIcon(p1), x, y, p2, p2 / icon.ratio(), p3);
if(p4 >= 0 && p4 < ContentType.all.length && Vars.content.getByID(ContentType.all[p4], p1) instanceof UnlockableContent u){
var icon = u.fullIcon;
Draw.rect(icon, x, y, p2, p2 / icon.ratio(), p3);
}
}
case commandPrint -> {
var glyph = Fonts.logic.getData().getGlyph((char)p1);