show the common attributes for sprites in the OF-dropdown by default

pull/95/head
jmoenig 2020-11-21 11:03:43 +01:00
rodzic 79ef41891e
commit ce0d2216e1
3 zmienionych plików z 28 dodań i 27 usunięć

Wyświetl plik

@ -5,6 +5,7 @@
* **Notable Changes:**
* added "loadProjectXML" method to the api
* hyperized "atrribute OF sprite" reporter primitive in the sensing category
* show the common attributes for sprites in the OF-dropdown by default
* **Documentation Updates:**
* API update for "loadProjectXML"
@ -13,6 +14,7 @@
* api: new loadProjectXML() method
* updated api documentation
* threads: hyperized "atrribute OF sprite" reporter primitive
* blocks: show the common attributes for sprites in the OF-dropdown by default
## 6.3.6
* **Notable Changes:**

Wyświetl plik

@ -8,7 +8,7 @@
<script src="src/morphic.js?version=2020-11-12"></script>
<script src="src/symbols.js?version=2020-10-07"></script>
<script src="src/widgets.js?version=2020-10-06"></script>
<script src="src/blocks.js?version=2020-11-17"></script>
<script src="src/blocks.js?version=2020-11-21"></script>
<script src="src/threads.js?version=2020-11-21"></script>
<script src="src/objects.js?version=2020-11-20"></script>
<script src="src/gui.js?version=2020-11-21"></script>

Wyświetl plik

@ -158,7 +158,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2020-November-17';
modules.blocks = '2020-November-21';
var SyntaxElementMorph;
var BlockMorph;
@ -9417,10 +9417,20 @@ InputSlotMorph.prototype.attributesMenu = function () {
morph => morph.name === objName
);
}
if (!obj) {
return dict;
}
if (obj instanceof SpriteMorph) {
if (obj instanceof StageMorph) {
dict = {
'costume #' : ['costume #'],
'costume name' : ['costume name'],
'volume' : ['volume'],
'balance' : ['balance'],
'width': ['width'],
'height': ['height'],
'left' : ['left'],
'right' : ['right'],
'top' : ['top'],
'bottom' : ['bottom']
};
} else { // assume a sprite
dict = {
'x position' : ['x position'],
'y position' : ['y position'],
@ -9437,30 +9447,19 @@ InputSlotMorph.prototype.attributesMenu = function () {
'volume' : ['volume'],
'balance' : ['balance']
};
} else { // the stage
dict = {
'costume #' : ['costume #'],
'costume name' : ['costume name'],
'volume' : ['volume'],
'balance' : ['balance'],
'width': ['width'],
'height': ['height'],
'left' : ['left'],
'right' : ['right'],
'top' : ['top'],
'bottom' : ['bottom']
};
}
varNames = obj.variables.names();
if (varNames.length > 0) {
dict['~'] = null;
varNames.forEach(name =>
dict[name] = name
if (obj) {
varNames = obj.variables.names();
if (varNames.length > 0) {
dict['~'] = null;
varNames.forEach(name =>
dict[name] = name
);
}
obj.allBlocks(true).forEach((def, i) =>
dict['§_def' + i] = def.blockInstance(true) // include translations
);
}
obj.allBlocks(true).forEach((def, i) =>
dict['§_def' + i] = def.blockInstance(true) // include translations
);
return dict;
};