summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-07-13 15:48:40 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-07-13 15:48:40 +0100
commit5513d1399ffe1b0f08932667ba8efd3f2ead3769 (patch)
tree2b15dbb40acbfb4c81c4a3e5bd3d4086eb838afd
parentMake closures final (diff)
downloadtoy-5513d1399ffe1b0f08932667ba8efd3f2ead3769.zip
Select images of DOMME, not OWNER
-rw-r--r--scripts/toy.groovy3
-rw-r--r--scripts/toy/imagery.groovy18
2 files changed, 11 insertions, 10 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index 85988c7..507501c 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -58,7 +58,8 @@ return new Object() {
"$DATAFOLDER/images/toy/$domme/person.groovy",
"$DATAFOLDER/images/toy/$domme/$set/set.groovy" ]
.collect { readDomme(it) }
- .sum()
+ .sum();
+ DOMME.id = domme;
};
final loadModules = { toy ->
new File("$DATAFOLDER/scripts/toy")
diff --git a/scripts/toy/imagery.groovy b/scripts/toy/imagery.groovy
index 0a2c3a6..5dc79c3 100644
--- a/scripts/toy/imagery.groovy
+++ b/scripts/toy/imagery.groovy
@@ -44,9 +44,9 @@
toy.metaClass.showImage { spec ->
def outfit = loadString("toy.owner.outfit");
- def image = selectImage(OWNER, outfit, spec);
+ def image = selectImage(DOMME.id, outfit, spec);
if (image) {
- setImage("toy/$OWNER/$outfit/${image.image}.jpg");
+ setImage("toy/${DOMME.id}/$outfit/${image.image}.jpg");
return image.tags;
}
else {
@@ -112,27 +112,27 @@
def outfit = loadString("toy.owner.outfit");
def outfitTime = loadInteger("toy.owner.outfitTime");
if (outfitTime > getTime() - 7200) { // Recent, check
- def prev = IMAGEDATA[OWNER];
+ def prev = IMAGEDATA[DOMME.id];
if (prev) {
prev = prev.sets[outfit];
- if (prev && specs.every({ spec -> selectImage(OWNER, prev.set, spec)})) {
- loadDomme(OWNER, outfit);
+ if (prev && specs.every({ spec -> selectImage(DOMME.id, prev.set, spec)})) {
+ loadDomme(DOMME.id, outfit);
return outfit;
}
}
}
onChange();
- outfit = selectImageSet(OWNER, specs);
+ outfit = selectImageSet(DOMME.id, specs);
if (!outfit) {
- showPopup("No outfit for $OWNER : $specs");
+ showPopup("No outfit for ${DOMME.id} : $specs");
save("toy.owner.outfit", null);
save("toy.owner.outfitTime", null);
- loadDomme(OWNER, outfit);
+ loadDomme(DOMME.id, outfit);
return null;
}
save("toy.owner.outfit", outfit.set);
save("toy.owner.outfitTime", getTime());
- loadDomme(OWNER, outfit.set);
+ loadDomme(DOMME.id, outfit.set);
executeTrigger("ownerOutfitChange", outfit.set);
return outfit.set;
};