feat: add star progress bar

This commit is contained in:
2025-11-28 22:42:54 +01:00
parent 1378b7100a
commit b4445da204
2 changed files with 10 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ END_DATE = {day=12, month=12, year=2025}
local json = require("json")
local dates = require("dates")
local days = require("days")
local progress = require "progress"
local today = os.date("*t")
local function loadStats(path)
@@ -90,9 +91,13 @@ local function printStats(stats, selected)
term.setTextColor(colors.white)
write(string.format("You have %d", stars))
term.setTextColor(colors.orange)
write("\x04")
write("\x04 ")
local x, y = term.getCursorPos()
progress.bar(x, y, 20, stars, 24, colors.orange, colors.gray)
term.setTextColor(colors.white)
print()
print()
print("Press END to quit")
end
local function printBanner()

View File

@@ -86,4 +86,8 @@ function utils.splitLines(data)
return t
end
function utils.round(x)
return x >= 0 and math.floor(x + 0.5) or math.ceil(x - 0.5)
end
return utils