From 4c00d3b2325d12a2c07814f5c56b7503b9177eae Mon Sep 17 00:00:00 2001 From: Max <33982882+maxboeer@users.noreply.github.com> Date: Mon, 1 Jun 2026 20:34:26 +0200 Subject: [PATCH] Add compressionlevel batch to Item --- compcount.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/compcount.lua b/compcount.lua index dd1b1ad..9ddea77 100644 --- a/compcount.lua +++ b/compcount.lua @@ -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