From 595c4e6fcc95f148e89e9aa364d616d5e261778b Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sat, 29 Nov 2025 14:41:13 +0100 Subject: [PATCH] fix: commit progress.lua --- src/lib/progress.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/lib/progress.lua diff --git a/src/lib/progress.lua b/src/lib/progress.lua new file mode 100644 index 0000000..6bde1cc --- /dev/null +++ b/src/lib/progress.lua @@ -0,0 +1,12 @@ +local utils = require("utils") +local progress = {} + +function progress.bar(x, y, width, value, max, fg, bg) + local fgWidth = utils.round(value * width / max) + fgWidth = math.max(0, math.min(width, fgWidth)) + paintutils.drawLine(x, y, x + width - 1, y, bg) + paintutils.drawLine(x, y, x + fgWidth - 1, y, fg) + term.setBackgroundColor(colors.black) +end + +return progress \ No newline at end of file