|
@@ -230,16 +230,21 @@ class Say {
|
|
} else if (seq == Say.RUN_PARAGRAPH_OFF) {
|
|
} else if (seq == Say.RUN_PARAGRAPH_OFF) {
|
|
this.skipbreaks = false;
|
|
this.skipbreaks = false;
|
|
} else if (typeof seq == "function") {
|
|
} else if (typeof seq == "function") {
|
|
- let fObj = (<(s: Say) => any> seq)(this);
|
|
|
|
- if (Array.isArray(fObj)) {
|
|
|
|
- for (let k = fObj.length - 1; k >= 0; k--) {
|
|
|
|
- this.sequence.splice(this.sequenceRunner + 1, 0, fObj[k]);
|
|
|
|
|
|
+ // not a function, but a class
|
|
|
|
+ if (seq.prototype != undefined) {
|
|
|
|
+ this.currentParagraph.push(document.createTextNode(seq.name));
|
|
|
|
+ } else {
|
|
|
|
+ let fObj = (<(s: Say) => any>seq)(this);
|
|
|
|
+ if (Array.isArray(fObj)) {
|
|
|
|
+ for (let k = fObj.length - 1; k >= 0; k--) {
|
|
|
|
+ this.sequence.splice(this.sequenceRunner + 1, 0, fObj[k]);
|
|
|
|
+ }
|
|
|
|
+ } else if (fObj != undefined) {
|
|
|
|
+ this.sequence.splice(this.sequenceRunner + 1, 0, fObj);
|
|
}
|
|
}
|
|
- } else if (fObj != undefined) {
|
|
|
|
- this.sequence.splice(this.sequenceRunner + 1, 0, fObj);
|
|
|
|
|
|
+ this.sequence.splice(this.sequenceRunner, 1);
|
|
|
|
+ this.sequenceRunner--;
|
|
}
|
|
}
|
|
- this.sequence.splice(this.sequenceRunner, 1);
|
|
|
|
- this.sequenceRunner--;
|
|
|
|
} else if (seq.constructor == this.constructor) {
|
|
} else if (seq.constructor == this.constructor) {
|
|
for (let k = (<Say> seq).sequence.length - 1; k >= 0; k--) {
|
|
for (let k = (<Say> seq).sequence.length - 1; k >= 0; k--) {
|
|
this.sequence.splice(this.sequenceRunner + 1, 0, (<Say> seq).sequence[k]);
|
|
this.sequence.splice(this.sequenceRunner + 1, 0, (<Say> seq).sequence[k]);
|