show all own vars and attributes in INHERIT drop-down when inside a ring

upd4.1
Jens Mönig 2017-10-17 10:12:29 +02:00
rodzic f2bbff3d54
commit be0285268b
2 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -8559,7 +8559,24 @@ InputSlotMorph.prototype.shadowedVariablesMenu = function () {
if (!block) {return dict; }
rcvr = block.scriptTarget();
if (rcvr && rcvr.exemplar) {
if (this.parentThatIsA(RingMorph)) {
// show own local vars and attributes, because this is likely to be
// inside TELL, ASK or OF
vars = rcvr.variables.names();
vars.forEach(function (name) {
dict[name] = name;
});
attribs = rcvr.attributes;
/*
if (vars.length && attribs.length) {
dict['~'] = null; // add line
}
*/
attribs.forEach(function (name) {
dict[name] = [name];
});
} else if (rcvr && rcvr.exemplar) {
// only show shadowed vars and attributes
vars = rcvr.inheritedVariableNames(true);
vars.forEach(function (name) {
dict[name] = name;

Wyświetl plik

@ -3708,6 +3708,8 @@ Fixes:
* Blocks: keep “undo” and “redo” buttons at the same location
* Objects, Threads: added "with inpus" to TELL and ASK prims, changed TELL's C-shape to command-style input
* Objects: moved TELL and ASK templates in the palette up underneath RUN CALL
* Blocks: show all own vars and attributes in INHERIT drop-down when inside a ring
v4.1 Features:
* polymorphic sprite-local custom blocks