kopia lustrzana https://github.com/backface/turtlestitch
added "draggable" selector to attributes accessors
rodzic
6b805a855a
commit
5b7d215cc9
|
@ -623,6 +623,8 @@ SyntaxElementMorph.prototype.getVarNamesDict = function () {
|
|||
'parent' : ['parent'],
|
||||
// 'temporary?' : ['temporary?'],
|
||||
'dangling?' : ['dangling?'],
|
||||
'draggable?' : ['draggable?'], // +++
|
||||
'rotation style' : ['rotation style'], // +++
|
||||
'rotation x' : ['rotation x'],
|
||||
'rotation y' : ['rotation y']
|
||||
};
|
||||
|
@ -8755,6 +8757,8 @@ InputSlotMorph.prototype.gettablesMenu = function () {
|
|||
dict.costumes = ['costumes'];
|
||||
dict.sounds = ['sounds'];
|
||||
dict['dangling?'] = ['dangling?'];
|
||||
dict['draggable?'] = ['draggable?']; // +++
|
||||
dict['rotation style'] = ['rotation style']; // +++
|
||||
dict['rotation x'] = ['rotation x'];
|
||||
dict['rotation y'] = ['rotation y'];
|
||||
dict['center x'] = ['center x'];
|
||||
|
|
|
@ -3584,6 +3584,8 @@ Process.prototype.reportGet = function (query) {
|
|||
);
|
||||
case 'dangling?':
|
||||
return !thisObj.rotatesWithAnchor;
|
||||
case 'draggable?':
|
||||
return thisObj.isDraggable; // +++
|
||||
case 'rotation x':
|
||||
return thisObj.xPosition();
|
||||
case 'rotation y':
|
||||
|
@ -3627,7 +3629,7 @@ Process.prototype.reportObject = function (name) {
|
|||
|
||||
Process.prototype.doSet = function (attribute, value) {
|
||||
// experimental, manipulate sprites' attributes
|
||||
var name, rcvr;
|
||||
var name, rcvr, ide;
|
||||
rcvr = this.blockReceiver();
|
||||
this.assertAlive(rcvr);
|
||||
if (!(attribute instanceof Context || attribute instanceof Array) ||
|
||||
|
@ -3680,6 +3682,21 @@ Process.prototype.doSet = function (attribute, value) {
|
|||
rcvr.rotatesWithAnchor = !value;
|
||||
rcvr.version = Date.now();
|
||||
break;
|
||||
case 'draggable?':
|
||||
this.assertType(rcvr, 'sprite');
|
||||
this.assertType(value, 'Boolean');
|
||||
rcvr.isDraggable = value;
|
||||
// update padlock symbol in the IDE:
|
||||
ide = rcvr.parentThatIsA(IDE_Morph);
|
||||
if (ide) {
|
||||
ide.spriteBar.children.forEach(function (each) {
|
||||
if (each.refresh) {
|
||||
each.refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
rcvr.version = Date.now();
|
||||
break;
|
||||
case 'rotation x':
|
||||
this.assertType(rcvr, 'sprite');
|
||||
this.assertType(value, 'number');
|
||||
|
|
Ładowanie…
Reference in New Issue