* Add weekdays method and weekday display to the calendar
* Bug fixes
This commit is contained in:
LoafyLemon 2024-04-23 20:19:36 +01:00
parent 0a213edac3
commit 2c9348be59
2 changed files with 19 additions and 7 deletions

View File

@ -84,7 +84,7 @@ label day_start:
game.weather = "random" game.weather = "random"
game.daytime = True game.daytime = True
cupboard_OBJ.foreground = Transform(Text(str((game.day % 28) + 1), color="#fff", outlines=[(1, "#000", 0, 0)]), pos=(40, 100)) cupboard_OBJ.foreground = Transform(Text(str((game.day % 30) + 1), color="#fff", outlines=[(1, "#000", 0, 0)]), pos=(40, 100))
# Randomisers # Randomisers
random_gold = renpy.random.randint(8, 40) random_gold = renpy.random.randint(8, 40)

View File

@ -3,7 +3,7 @@ init python:
def __init__(self): def __init__(self):
pass pass
def get(self, span=35): def get_schedule(self, span=35):
contents = {i: "" for i in range(span)} contents = {i: "" for i in range(span)}
# Add moon cycles # Add moon cycles
@ -26,6 +26,11 @@ init python:
return contents return contents
def get_weekday(self, n):
weekdays = ("Monday", "Tuesday", "Wednsday", "Thursday", "Friday", "Saturday", "Sunday")
return weekdays[n % 7]
default calendar = Calendar() default calendar = Calendar()
label calendar: label calendar:
@ -33,24 +38,31 @@ label calendar:
jump main_room_menu jump main_room_menu
screen calendar: screen calendar:
default contents = calendar.get().items() default contents = calendar.get_schedule().items()
grid 7 5: grid 7 6:
style "empty" style "empty"
align (0.5, 0.5) align (0.5, 0.5)
for i in ("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"):
fixed:
xysize (64, 64)
add "#fff"
text "[i]"
for i, ev in contents: for i, ev in contents:
fixed: fixed:
xysize (64, 64) xysize (64, 64)
if i > 29: if i > 29:
add "#888888" add "#888888"
elif i == game.day: elif i == (game.day % 30):
add "#ff0000ff" add "#ff0000ff"
else: else:
add "#fff" add "#fff"
hbox: vbox:
text "[(i % 30) + 1]" size 10 color "#000" text "[(i % 30) + 1]" size 10 color "#000"
text "[ev]" size 24 text "[ev]" size 12
textbutton "Close" action Return() align (0.5, 0.9) textbutton "Close" action Return() align (0.5, 0.9)