2024-04-23 18:26:24 +00:00
|
|
|
init python:
|
2024-04-25 15:33:49 +00:00
|
|
|
class Calendar():
|
|
|
|
periods = ("Janemar", "Aprimju", "Juliasep", "Octobrinde")
|
|
|
|
weekdays = ("Monday", "Tuesday", "Wednsday", "Thursday", "Friday", "Saturday", "Sunday")
|
|
|
|
_day = 0
|
2024-04-23 18:26:24 +00:00
|
|
|
|
2024-04-25 15:33:49 +00:00
|
|
|
@staticmethod
|
|
|
|
def get_schedule(span=35):
|
2024-04-23 18:26:24 +00:00
|
|
|
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
|
|
|
|
|
2024-04-25 15:33:49 +00:00
|
|
|
forecast = Weather.forecast(span)
|
|
|
|
for i, v in forecast.items():
|
|
|
|
if v == "clear":
|
|
|
|
contents[i] += "☀️"
|
|
|
|
elif v == "cloudy":
|
|
|
|
contents[i] += "⛅"
|
|
|
|
elif v == "overcast":
|
|
|
|
contents[i] += "☁️"
|
|
|
|
elif v in ("blizzard", "snow"):
|
|
|
|
contents[i] += "🌨️"
|
|
|
|
elif v == "rain":
|
|
|
|
contents[i] += "🌧️"
|
|
|
|
elif v == "storm":
|
|
|
|
contents[i] += "🌩️"
|
|
|
|
|
2024-04-23 18:26:24 +00:00
|
|
|
# Add letters
|
|
|
|
letters = mailbox.get_letters(True)
|
|
|
|
for i in letters:
|
2024-04-25 15:33:49 +00:00
|
|
|
if (day := game.day+i.wait) < span+1:
|
|
|
|
contents[day] += "✉️"
|
2024-04-23 18:26:24 +00:00
|
|
|
|
|
|
|
# Add parcels
|
|
|
|
parcels = mailbox.get_parcels(True)
|
|
|
|
for i in parcels:
|
2024-04-25 15:33:49 +00:00
|
|
|
if (day := game.day+i.wait) < span+1:
|
|
|
|
contents[day] += "📦"
|
|
|
|
|
2024-04-23 18:26:24 +00:00
|
|
|
|
|
|
|
return contents
|
|
|
|
|
2024-04-25 15:33:49 +00:00
|
|
|
@staticmethod
|
|
|
|
def get_weekday(n=None):
|
|
|
|
if n is None:
|
|
|
|
n = game.day
|
|
|
|
|
|
|
|
return Calendar.weekdays[n % 7]
|
2024-04-23 19:19:36 +00:00
|
|
|
|
2024-04-25 15:33:49 +00:00
|
|
|
@staticmethod
|
|
|
|
def get_period(n=None):
|
2024-04-23 19:19:36 +00:00
|
|
|
|
2024-04-25 15:33:49 +00:00
|
|
|
if n is None:
|
|
|
|
n = game.day
|
|
|
|
|
|
|
|
return Calendar.periods[(n // 30) % 4]
|
2024-04-23 18:26:24 +00:00
|
|
|
|
|
|
|
label calendar:
|
|
|
|
call screen calendar
|
|
|
|
jump main_room_menu
|
|
|
|
|
|
|
|
screen calendar:
|
2024-04-25 15:33:49 +00:00
|
|
|
default contents = Calendar.get_schedule().items()
|
|
|
|
default period = Calendar.get_period()
|
|
|
|
|
|
|
|
text "[period]" align (0.5, 0.1) color "#fff" size 24
|
2024-04-23 19:19:36 +00:00
|
|
|
grid 7 6:
|
2024-04-23 18:26:24 +00:00
|
|
|
style "empty"
|
|
|
|
align (0.5, 0.5)
|
|
|
|
|
2024-04-23 19:19:36 +00:00
|
|
|
for i in ("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"):
|
|
|
|
fixed:
|
|
|
|
xysize (64, 64)
|
|
|
|
add "#fff"
|
|
|
|
text "[i]"
|
|
|
|
|
|
|
|
|
2024-04-23 18:26:24 +00:00
|
|
|
for i, ev in contents:
|
|
|
|
fixed:
|
|
|
|
xysize (64, 64)
|
|
|
|
if i > 29:
|
|
|
|
add "#888888"
|
2024-04-23 19:19:36 +00:00
|
|
|
elif i == (game.day % 30):
|
2024-04-23 18:26:24 +00:00
|
|
|
add "#ff0000ff"
|
|
|
|
else:
|
|
|
|
add "#fff"
|
|
|
|
|
2024-04-23 19:19:36 +00:00
|
|
|
vbox:
|
2024-04-23 18:26:24 +00:00
|
|
|
text "[(i % 30) + 1]" size 10 color "#000"
|
2024-04-23 19:19:36 +00:00
|
|
|
text "[ev]" size 12
|
2024-04-23 18:26:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
textbutton "Close" action Return() align (0.5, 0.9)
|