WTS/game/scripts/interface/calendar.rpy

57 lines
1.4 KiB
Plaintext

init python:
class Calendar(object):
def __init__(self):
pass
def get(self, span=35):
contents = {i: "" for i in range(span)}
# Add moon cycles
for i in range(span):
if (i % 7 == 0):
contents[i] += "🌕"
elif (i % 7 == 3):
contents[i] += "🌓"
# elif (game.day % 60 == 30) # Blood moon
# Add letters
letters = mailbox.get_letters(True)
for i in letters:
contents[game.day+i.wait] += "✉️"
# Add parcels
parcels = mailbox.get_parcels(True)
for i in parcels:
contents[game.day+i.wait] += "📦"
return contents
default calendar = Calendar()
label calendar:
call screen calendar
jump main_room_menu
screen calendar:
default contents = calendar.get().items()
grid 7 5:
style "empty"
align (0.5, 0.5)
for i, ev in contents:
fixed:
xysize (64, 64)
if i > 29:
add "#888888"
elif i == game.day:
add "#ff0000ff"
else:
add "#fff"
hbox:
text "[(i % 30) + 1]" size 10 color "#000"
text "[ev]" size 24
textbutton "Close" action Return() align (0.5, 0.9)