Add compressionlevel batch to Item

This commit is contained in:
Max
2026-06-01 20:34:26 +02:00
parent 5907cd8f27
commit 4c00d3b232
+16 -2
View File
@@ -744,7 +744,7 @@ local function assertBufferValid(frame)
end
end
local function drawItem(img, cellX, cellY, count, offsetY)
local function drawItem(img, cellX, cellY, count, offsetY, item)
-- Convert normal monitor cells into Pine3D teletext pixels.
local x = cellToPixelX(cellX)
local y = cellToPixelY(cellY) + (offsetY or 0)
@@ -761,6 +761,19 @@ local function drawItem(img, cellX, cellY, count, offsetY)
end
end
local compressionLevel = item and tonumber(item.compression_level) or 0
if compressionLevel > 0 and y <= frame.buffer.height and y + 8 >= 1 then
mf.writeOn(frame, tostring(compressionLevel), colors.red, x + 15, y, {
font = "fonts/3x3",
textAlign = "right",
anchorHor = "right",
anchorVer = "top",
condense = true,
scale = 1,
})
end
local text = formatCount(count)
local rightX = x + 16 -- x + math.max(imgW * scaleX - 1, 7)
@@ -899,7 +912,8 @@ local function runScrollableGrid(options)
baseCellX + colStepCells * col,
baseCellY + rowStepCells * row,
counts[options.getId(entry)] or 0,
rowOffsetPixels
rowOffsetPixels,
entry
)
end