feat: improve day selection list
This commit is contained in:
@@ -56,33 +56,36 @@ local function printStats(stats, selected)
|
|||||||
local date = {day=day, month=START_DATE.month, year=START_DATE.year}
|
local date = {day=day, month=START_DATE.month, year=START_DATE.year}
|
||||||
term.setTextColor(colors.lightBlue)
|
term.setTextColor(colors.lightBlue)
|
||||||
if selected == day then
|
if selected == day then
|
||||||
|
term.setBackgroundColor(colors.gray)
|
||||||
write("- ")
|
write("- ")
|
||||||
else
|
else
|
||||||
|
term.setBackgroundColor(colors.black)
|
||||||
write(" ")
|
write(" ")
|
||||||
end
|
end
|
||||||
if not dates.isBefore(date, today) then
|
if not dates.isBefore(date, today) then
|
||||||
term.setTextColor(colors.white)
|
term.setTextColor(colors.white)
|
||||||
else
|
else
|
||||||
term.setTextColor(colors.gray)
|
term.setTextColor(colors.lightGray)
|
||||||
end
|
end
|
||||||
write(string.format("Day %2s ", day))
|
write(string.format("Day %2s ", day))
|
||||||
if value.puzzle1 then
|
if value.puzzle1 then
|
||||||
term.setTextColor(colors.orange)
|
term.setTextColor(colors.orange)
|
||||||
stars = stars + 1
|
stars = stars + 1
|
||||||
else
|
else
|
||||||
term.setTextColor(colors.gray)
|
term.setTextColor(colors.lightGray)
|
||||||
end
|
end
|
||||||
write("\x04")
|
write("\x04")
|
||||||
if value.puzzle2 then
|
if value.puzzle2 then
|
||||||
term.setTextColor(colors.orange)
|
term.setTextColor(colors.orange)
|
||||||
stars = stars + 1
|
stars = stars + 1
|
||||||
else
|
else
|
||||||
term.setTextColor(colors.gray)
|
term.setTextColor(colors.lightGray)
|
||||||
end
|
end
|
||||||
write("\x04")
|
write("\x04")
|
||||||
term.setTextColor(colors.white)
|
term.setTextColor(colors.white)
|
||||||
print()
|
print(" ")
|
||||||
end
|
end
|
||||||
|
term.setBackgroundColor(colors.black)
|
||||||
|
|
||||||
term.setTextColor(colors.white)
|
term.setTextColor(colors.white)
|
||||||
write(string.format("You have %d", stars))
|
write(string.format("You have %d", stars))
|
||||||
|
|||||||
Reference in New Issue
Block a user