feat: add star progress bar
This commit is contained in:
@@ -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)
|
||||
@@ -91,8 +92,12 @@ local function printStats(stats, selected)
|
||||
write(string.format("You have %d", stars))
|
||||
term.setTextColor(colors.orange)
|
||||
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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user