Calendar
* Add weekdays method and weekday display to the calendar * Bug fixes
This commit is contained in:
parent
0a213edac3
commit
2c9348be59
@ -84,7 +84,7 @@ label day_start:
|
||||
game.weather = "random"
|
||||
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
|
||||
random_gold = renpy.random.randint(8, 40)
|
||||
|
@ -3,7 +3,7 @@ init python:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def get(self, span=35):
|
||||
def get_schedule(self, span=35):
|
||||
contents = {i: "" for i in range(span)}
|
||||
|
||||
# Add moon cycles
|
||||
@ -26,6 +26,11 @@ init python:
|
||||
|
||||
return contents
|
||||
|
||||
def get_weekday(self, n):
|
||||
weekdays = ("Monday", "Tuesday", "Wednsday", "Thursday", "Friday", "Saturday", "Sunday")
|
||||
|
||||
return weekdays[n % 7]
|
||||
|
||||
default calendar = Calendar()
|
||||
|
||||
label calendar:
|
||||
@ -33,24 +38,31 @@ label calendar:
|
||||
jump main_room_menu
|
||||
|
||||
screen calendar:
|
||||
default contents = calendar.get().items()
|
||||
grid 7 5:
|
||||
default contents = calendar.get_schedule().items()
|
||||
grid 7 6:
|
||||
style "empty"
|
||||
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:
|
||||
fixed:
|
||||
xysize (64, 64)
|
||||
if i > 29:
|
||||
add "#888888"
|
||||
elif i == game.day:
|
||||
elif i == (game.day % 30):
|
||||
add "#ff0000ff"
|
||||
else:
|
||||
add "#fff"
|
||||
|
||||
hbox:
|
||||
vbox:
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user