1
# This contains code for the new day planner. You probably
2
# don't want to change this file, but it might make sense to
3
# change many of the variables or styles defined here from
10
# A window placed behind the day planner (empty).
11
style.create('dp_window', 'window')
12
style.dp_window.ypos = 120
13
style.dp_window.yanchor = 'top'
15
# The grid containing the three choices in the day planner.
16
style.create('dp_grid', 'default')
17
style.dp_grid.xfill = True
19
# Windows containing the groups of choices in the day planner.
20
style.create('dp_choice', 'default')
21
style.dp_choice.xpos = 0.5
22
style.dp_choice.xanchor = 'center'
25
style.create('dp_button', 'button')
26
style.create('dp_button_text', 'button_text')
28
style.create('dp_done_button', 'button')
29
style.create('dp_done_button_text', 'button_text')
31
style.dp_done_button.ypos = 0.95
32
style.dp_done_button.yanchor = 'bottom'
35
style.create('dp_label', 'default')
36
style.dp_label.xpos = 0.5
37
style.dp_label.xanchor = 'center'
39
# The amount of padding between the label and the action
43
# The amount of padding between the choices and done.
46
# The title of the done button.
47
dp_done_title = "Done Planning Day"
51
# A list of the periods of the day that are present in the
52
# day planner. This can be changed at runtime.
53
dp_period_names = [ "Morning", "Afternoon", "Evening" ]
55
# A list of variables that will take the selected choices
56
# for each of the periods named above.
57
dp_period_vars = [ "morning_act",
61
# A map from the period names to a list of the activities
62
# available for that period. This may be conputed before
63
# each call to day_planner. Each entry is a tuple, where
64
# the first element is the name shown to the user, and the
65
# second is the name assigned to the variable for that
69
( 'Attend Class', "class" ),
70
( 'Cut Class', "cut"),
75
( 'Hang Out', "hang" ),
79
( 'Exercise', "exercise" ),
80
( 'Play Games', "play" ),
86
# We assume that the various period variables have been assigned
87
# default values by this point.
90
call dp_callback from _call_dp_callback_1
94
renpy.choice_for_skipping()
96
ui.window(style='dp_window')
97
ui.vbox(dp_done_padding)
99
ui.grid(len(dp_period_names), 1, xfill=True, style='dp_grid')
101
# True iff every period has a valid value.
104
for period, var in zip(dp_period_names, dp_period_vars):
106
ui.window(style='dp_choice')
109
_label_factory(period, "dp")
110
ui.null(height=dp_padding)
114
for label, value in dp_period_acts[period]:
116
def clicked(var=var, value=value):
117
setattr(store, var, value)
120
valid_value |= getattr(store, var) == value
122
_button_factory(label, "dp",
123
selected = getattr(store, var) == value,
126
can_continue &= valid_value
133
clicked = lambda : False
137
_button_factory(dp_done_title, "dp_done",