Renamed bufferUsage -> bufferSize / Removed link name 'memory'

This commit is contained in:
Anuken
2025-07-10 13:34:46 -04:00
parent 26b349e5dd
commit 1283355f30
41 changed files with 55 additions and 69 deletions

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.\nLength of the content of a message.
laccess.buffersize = For messages: Length of the contents.\nFor displays: Number of unprocessed graphics commands.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID на единица/блок/предмет/течност.\nТази операция е обратната на търсенето.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Неизвестно

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = Identificador dunitat/bloc/element/líquid.\nÉs linvers de loperació lookup.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Desconegut

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Šířka displeje v pixelech.
laccess.displayheight = Výška displeje v pixelech.
laccess.bufferusage = Počet nezpracovaných příkazů ve vyrovnávací paměti displeje.
laccess.buffersize = Počet nezpracovaných příkazů ve vyrovnávací paměti displeje.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Neznámé

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID einer Einheit/eines Blocks/eines Materials/einer Flüssigkeit\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unbekannt

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Desconocido

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Tuntematon

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = L'ID d'une unité/bloc/ressource/liquide.\nCeci est l'inverse de l'instruction de recherche.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Inconnu

View File

@@ -2570,7 +2570,7 @@ laccess.size = Egy egység vagy épület mérete, vagy egy karakterlánc hossza.
laccess.id = Egy egység/blokk/nyersanyag/folyadék azonosítója.\nEz a keresési művelet fordítottja.
laccess.displaywidth = Egy kijelzőblokk szélessége pixelben.
laccess.displayheight = Egy kijelzőblokk magassága pixelben.
laccess.bufferusage = A kijelző grafikus pufferében lévő feldolgozatlan parancsok száma.\nEgy üzenet tartalmának hossza.
laccess.buffersize = A kijelző grafikus pufferében lévő feldolgozatlan parancsok száma.\nEgy üzenet tartalmának hossza.
laccess.operations = A blokkon végrehajtott műveletek száma.\nKijelzők esetén a drawflush-műveletek számát adja vissza.
lcategory.unknown = Ismeretlen

View File

@@ -2570,7 +2570,7 @@ laccess.size = Ukuran dari sebuah unit/bangunan atau panjang dari sebuah string.
laccess.id = ID suatu unit/blok/bahan/cairan.\nIni adalah kebalikan dari operasi pencarian.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Tak Diketahui

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = 不明

View File

@@ -2570,7 +2570,7 @@ laccess.size = 유닛/건물의 크기 또는 줄의 길이.
laccess.id = 유닛/블록/아이템/액체의 ID.\n이것은 조회 작업의 역순입니다.
laccess.displaywidth = 디스플레이 블록의 픽셀 단위 너비.
laccess.displayheight = 디스플레이 블록의 픽셀 단위 높이.
laccess.bufferusage = 디스플레이의 그래픽 버퍼에 있는 처리되지 않은 명령의 수.
laccess.buffersize = 디스플레이의 그래픽 버퍼에 있는 처리되지 않은 명령의 수.
laccess.operations = 블록에서 수행된 작업 수입니다.\n디스플레이의 경우, drawflush 작업 수를 반환합니다.
lcategory.unknown = 알 수 없음

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID jednostki/bloku/przedmiotu/płynu.\nOdwrotnośc operacji wyszukiwania.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Inne

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Desconhecido

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Desconhecido

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = Идентификатор единицы/блока/предмета/жидкости.\nЭто обратная операция поиска.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Неизвестно

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Nepoznato

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID ของยูนิต/บล็อก/ไอเท็ม/ของเหลว\nคำสั่งนี้จะตรงกันข้ามกับคำสั่ง lookup
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = ไม่ทราบ

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Unknown

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = Bir birim/blok/eşya/sıvı kimliği. \nBu arama operasyonun zıttıdır.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = ???

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = Ідентифікатор одиниці/блоку/предмету/рідини.\nЦе зворотна операція до операції пошуку.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Невідома категорія

View File

@@ -2570,7 +2570,7 @@ laccess.size = Kích thước của đơn vị/công trình hoặc độ dài c
laccess.id = Định danh của một đơn vị/khối/vật phẩm/chất lỏng.\nViệc này làm ngược lại với thao tác tra cứu.
laccess.displaywidth = Độ rộng của một khối hiển thị tính bằng pixel.
laccess.displayheight = Độ cao của một khối hiển thị tính bằng pixel.
laccess.bufferusage = Số lệnh chưa xử lý trong bộ đệm đồ họa của một hiển thị.
laccess.buffersize = Số lệnh chưa xử lý trong bộ đệm đồ họa của một hiển thị.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = Không xác định

View File

@@ -2570,7 +2570,7 @@ laccess.size = 单位/建筑的大小或字符串的长度
laccess.id = 单位/块/物品/液体的 ID。\n这是 Lookup 的反向操作。
laccess.displaywidth = 显示屏的宽度(以像素为单位)。
laccess.displayheight = 显示屏的高度(以像素为单位)。
laccess.bufferusage = 显示器图形缓冲区中未处理的命令数。
laccess.buffersize = 显示器图形缓冲区中未处理的命令数。
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = 未知

View File

@@ -2570,7 +2570,7 @@ laccess.size = Size of a unit/building or the length of a string.
laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup operation.
laccess.displaywidth = Width of a display block in pixels.
laccess.displayheight = Height of a display block in pixels.
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
laccess.buffersize = Number of unprocessed commands in the graphics buffer of a display.
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
lcategory.unknown = 未知

View File

@@ -40,7 +40,7 @@ public enum LAccess{
cameraHeight,
displayWidth,
displayHeight,
bufferUsage,
bufferSize,
operations,
size,
solid,

View File

@@ -25,10 +25,8 @@ import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.environment.*;
import mindustry.world.blocks.logic.*;
import mindustry.world.blocks.logic.CanvasBlock.*;
import mindustry.world.blocks.logic.LogicBlock.*;
import mindustry.world.blocks.logic.LogicDisplay.*;
import mindustry.world.blocks.logic.MemoryBlock.*;
import mindustry.world.blocks.logic.MessageBlock.*;
import mindustry.world.blocks.payloads.*;
import mindustry.world.meta.*;
@@ -641,7 +639,7 @@ public class LExecutor{
}
}
}else{
if(target instanceof CharSequence seq && (sense == LAccess.size || sense == LAccess.bufferUsage)){
if(target instanceof CharSequence seq && (sense == LAccess.size || sense == LAccess.bufferSize)){
to.setnum(seq.length());
return;
}

View File

@@ -32,6 +32,7 @@ import static mindustry.Vars.*;
public class LogicBlock extends Block{
private static final int maxByteLen = 1024 * 100;
private static final int maxLinks = 6000;
public static final int maxNameLength = 32;
public int maxInstructionScale = 5;
@@ -81,17 +82,11 @@ public class LogicBlock extends Block{
int x = lbuild.tileX(), y = lbuild.tileY();
LogicLink link = entity.links.find(l -> l.x == x && l.y == y);
String bname = getLinkName(lbuild.block);
if(link != null){
link.active = !link.active;
//find a name when the base name differs (new block type)
if(!link.name.startsWith(bname)){
link.name = "";
link.name = entity.findLinkName(lbuild.block);
}
entity.links.remove(link);
//disable when unlinking
if(!link.active && lbuild.block.autoResetEnabled && lbuild.lastDisabler == entity){
if(lbuild.block.autoResetEnabled && lbuild.lastDisabler == entity){
lbuild.enabled = true;
}
}else{
@@ -147,12 +142,8 @@ public class LogicBlock extends Block{
stream.writeInt(bytes.length);
stream.write(bytes);
int actives = links.count(l -> l.active);
stream.writeInt(actives);
stream.writeInt(links.size);
for(LogicLink link : links){
if(!link.active) continue;
stream.writeUTF(link.name);
stream.writeShort(link.x);
stream.writeShort(link.y);
@@ -198,7 +189,7 @@ public class LogicBlock extends Block{
byte[] bytes = new byte[bytelen];
stream.readFully(bytes);
int total = stream.readInt();
int total = Math.min(stream.readInt(), maxLinks);
Seq<LogicLink> links = new Seq<>();
@@ -219,7 +210,7 @@ public class LogicBlock extends Block{
}
public static class LogicLink{
public boolean active = true, valid;
public boolean valid;
public int x, y;
public String name;
public Building lastBuild;
@@ -232,9 +223,7 @@ public class LogicBlock extends Block{
}
public LogicLink copy(){
LogicLink out = new LogicLink(x, y, name, valid);
out.active = active;
return out;
return new LogicLink(x, y, name, valid);
}
}
@@ -270,7 +259,7 @@ public class LogicBlock extends Block{
links.clear();
int total = stream.readInt();
int total = Math.min(stream.readInt(), maxLinks);
if(version == 0){
//old version just had links, ignore those
@@ -352,18 +341,19 @@ public class LogicBlock extends Block{
//store connections
for(LogicLink link : links){
if(link.active && (link.valid = validLink(world.build(link.x, link.y)))){
link.valid = validLink(world.build(link.x, link.y));
if(link.valid){
asm.putConst(link.name, world.build(link.x, link.y));
}
}
//store link objects
executor.links = new Building[links.count(l -> l.valid && l.active)];
executor.links = new Building[links.count(l -> l.valid)];
executor.linkIds.clear();
int index = 0;
for(LogicLink link : links){
if(link.active && link.valid){
if(link.valid){
Building build = world.build(link.x, link.y);
executor.links[index ++] = build;
if(build != null) executor.linkIds.add(build.id);
@@ -490,8 +480,6 @@ public class LogicBlock extends Block{
for(int i = 0; i < links.size; i++){
LogicLink l = links.get(i);
if(!l.active) continue;
var cur = world.build(l.x, l.y);
boolean valid = validLink(cur);
@@ -561,7 +549,7 @@ public class LogicBlock extends Block{
output.set(ret);
}
}
@Override
public boolean writable(LExecutor exec){
return exec.privileged || (this.team == exec.team && !this.block.privileged);
@@ -602,7 +590,7 @@ public class LogicBlock extends Block{
for(LogicLink l : links){
Building build = world.build(l.x, l.y);
if(l.active && validLink(build)){
if(validLink(build)){
Drawf.square(build.x, build.y, build.block.size * tilesize / 2f + 1f, Pal.place);
}
}
@@ -610,7 +598,7 @@ public class LogicBlock extends Block{
//draw top text on separate layer
for(LogicLink l : links){
Building build = world.build(l.x, l.y);
if(l.active && validLink(build)){
if(validLink(build)){
build.block.drawPlaceText(l.name, build.tileX(), build.tileY(), true);
}
}

View File

@@ -111,7 +111,7 @@ public class LogicDisplay extends Block{
public double sense(LAccess sensor){
return switch(sensor){
case displayWidth, displayHeight -> displaySize;
case bufferUsage -> commands.size;
case bufferSize -> commands.size;
case operations -> operations;
default -> super.sense(sensor);
};

View File

@@ -180,7 +180,7 @@ public class MessageBlock extends Block{
@Override
public double sense(LAccess sensor){
return switch(sensor){
case bufferUsage -> message.length();
case bufferSize -> message.length();
default -> super.sense(sensor);
};
}

View File

@@ -26,4 +26,4 @@ org.gradle.caching=true
org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000
android.enableR8.fullMode=false
archash=9b55a5d628
archash=bd8d9520a4