summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-06-23 20:52:20 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-06-23 21:18:22 +0100
commit487813b6de6d17649cce562d6a0b007afdc07427 (patch)
tree4ec28c71ff8577c496ae820d83723b940c8f841b
parentExtract play into a module (diff)
downloadtoy-487813b6de6d17649cce562d6a0b007afdc07427.zip
Conditional requestables and move clothing request
-rw-r--r--scripts/toy.groovy11
-rw-r--r--scripts/toy/humiliation.groovy3
2 files changed, 8 insertions, 6 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index 5c3ab02..16df507 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -341,8 +341,8 @@ return new Object() {
def requestables = [
faq: [ lbl: "FAQ (webpage)", act: showFaq ],
];
- final addRequestable = { String name, String label, func ->
- requestables[name] = [lbl: label, act: func];
+ final addRequestable = { String name, String label, func, cond = null ->
+ requestables[name] = [lbl: label, act: func, cond: cond];
};
final removeRequestable = { String name ->
requestables.remove(name);
@@ -417,15 +417,14 @@ return new Object() {
final waitTime = Math.min(cycleTime, e.event.time - getTime());
final clickTime = showButton("Please, ${dommeTitle()}?", waitTime);
if (clickTime < waitTime) {
- def opts = requestables.values().toList();
+ def opts = requestables.values().toList().findAll {
+ it -> !it.cond || it.cond()
+ };
if (stateIs("DEBUG")) {
opts.push([ lbl: "Status", act: setupShowState ]);
opts.push([ lbl: "Play", act: { playEvent() }, arg: true ]);
opts.push([ lbl: "Activity", act: playActivity ]);
}
- if (stateIs(NAKED)) {
- opts.push([ lbl: "May I wear clothes", act: { requestClothes() } ]);
- }
TOYTOYS.findAll { stateIs(it) }.each {
opts.push([ lbl: "May I be un-$it".toString(), act: { requestRelease() }, arg: it ]);
};
diff --git a/scripts/toy/humiliation.groovy b/scripts/toy/humiliation.groovy
index 8050145..06e422d 100644
--- a/scripts/toy/humiliation.groovy
+++ b/scripts/toy/humiliation.groovy
@@ -165,4 +165,7 @@
toy.addActivity("preStrip", { toy.preStrip() });
toy.addActivity("playKneel", { toy.playKneel() });
toy.addActivity("playSuck", { toy.playSuck() });
+ toy.addRequestable("clothes", "May I wear clothes",
+ { toy.requestClothes() },
+ { toy.stateIs(toy.NAKED) });
}