kopia lustrzana https://github.com/backface/turtlestitch
changed reportVideo() to be hyper-monadic
rodzic
d5a7ba9094
commit
a4bb2ecaf0
|
@ -8,6 +8,7 @@
|
|||
* **Notable Changes:**
|
||||
* searching for blocks and keyboard entry now includes the contents of dropdown menus
|
||||
* disabled dropping reporters into certain dropdowns (monadic functions, types, costume attributees, graphic effects, layers, audio attributes, pen attributes, dates, relation, keys, video attributes)
|
||||
* changed VIDEOP _ ON _ reporter primitive to be hyper-monadic (second slot)
|
||||
* **Notable Fixes:**
|
||||
* keep internal linked-list organization intact for hyperblocks
|
||||
|
||||
|
@ -19,6 +20,7 @@
|
|||
* blocks: made audio attributes menu static
|
||||
* blocks: made pen attributes menus static
|
||||
* blocks: made sensing attributes menus largely static
|
||||
* threads: changed reportVideo() to be hyper-monadic
|
||||
|
||||
### 2020-11-30
|
||||
* threads: keep internal linked-list organization intact for hyperblocks
|
||||
|
|
|
@ -5306,8 +5306,11 @@ Process.prototype.doSetVideoTransparency = function(factor) {
|
|||
};
|
||||
|
||||
Process.prototype.reportVideo = function(attribute, name) {
|
||||
// hyper-dyadic
|
||||
var stage = this.blockReceiver().parentThatIsA(StageMorph);
|
||||
// hyper-monadic
|
||||
var thisObj = this.blockReceiver(),
|
||||
stage = thisObj.parentThatIsA(StageMorph),
|
||||
thatObj;
|
||||
|
||||
if (!stage.projectionSource || !stage.projectionSource.stream) {
|
||||
// wait until video is turned on
|
||||
if (!this.context.accumulator) {
|
||||
|
@ -5318,17 +5321,13 @@ Process.prototype.reportVideo = function(attribute, name) {
|
|||
this.pushContext();
|
||||
return;
|
||||
}
|
||||
return this.hyperDyadic(
|
||||
(att, obj) => this.reportBasicVideo(att, obj),
|
||||
attribute,
|
||||
name
|
||||
);
|
||||
};
|
||||
|
||||
Process.prototype.reportBasicVideo = function(attribute, name) {
|
||||
var thisObj = this.blockReceiver(),
|
||||
stage = thisObj.parentThatIsA(StageMorph),
|
||||
thatObj = this.getOtherObject(name, thisObj, stage);
|
||||
if (this.enableHyperOps) {
|
||||
if (name instanceof List) {
|
||||
return name.map(each => this.reportVideo(attribute, each));
|
||||
}
|
||||
}
|
||||
thatObj = this.getOtherObject(name, thisObj, stage);
|
||||
switch (this.inputOption(attribute)) {
|
||||
case 'motion':
|
||||
if (thatObj instanceof SpriteMorph) {
|
||||
|
|
Ładowanie…
Reference in New Issue