summaryrefslogtreecommitdiff
path: root/scripts/toy.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/toy.groovy')
-rw-r--r--scripts/toy.groovy31
1 files changed, 17 insertions, 14 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index e09b5a7..57b720e 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -1082,22 +1082,25 @@ else {
final cycleTime = 6;
while (true) {
+ setImage(null);
+ show(null);
if (showButton("Please, Miss?", cycleTime) < cycleTime) {
- switch (getSelectedValue("Yes, toy?", [
- "Status",
- "Calendar",
- "Play",
- "Plan begin",
- "Confess",
- "Back"
- ])) {
- case 0: setupShowState(); break;
- case 1: setupShowCalendar(); break;
- case 2: playtime(); break;
- case 3: beginPlan(LUNCH); break;
- case 4: confess(); break;
- case 5: return "toy";
+ def opts = [
+ [ lbl: "Status", act: setupShowState ],
+ [ lbl: "Calendar", act: setupShowCalendar ],
+ [ lbl: "Confess", act: confess ],
+ [ lbl: "Back", act: null ],
+ ];
+ if (is("DEBUG")) {
+ opts.push([ lbl: "Play", act: playtime ]);
+ opts.push([ lbl: "Begin plan", act: beginPlan, arg: LUNCH ]);
}
+ def opt = getSelectedValue("Yes, toy?", opts.collect { it.lbl });
+ def act = opts[opt].act;
+ if (act)
+ act(opts[opt].arg);
+ else
+ return "toy";
}
else if (localTime() > 25.75) { // 1:45am
bedtime();