enabled sending atomic lists to other scenes

snap7
jmoenig 2021-10-21 12:04:58 +02:00
rodzic 69fbe439d3
commit 89a4fe410a
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -44,6 +44,7 @@
### 2021-10-21
* threads, objects: make "when I receive 'any message'" hat scripts threadsafe (uninterruptable by other messages)
* threads: enabled sending atomic lists to other scenes
### 2021-10-20
* blocks: enable sending green-flag events when switching scenes

Wyświetl plik

@ -4704,7 +4704,14 @@ Process.prototype.doSwitchToScene = function (id, transmission) {
message = this.inputOption(transmission.at(1)),
ide, scenes, num, scene;
this.assertAlive(rcvr);
this.assertType(message, ['text', 'number']);
this.assertType(message, ['text', 'number', 'list']);
if (message instanceof List && !message.canBeJSON()) {
// make sure only atomic leafs are inside the list
// don't actually encode the list as json, though
throw new Error(localize(
'can only send lists\nwith atomic data\nto another scene'
));
}
if (this.readyToTerminate) {
// let the user press "stop" or "esc",
// prevent "when this scene starts" hat blocks from directly