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

Wyświetl plik

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

Wyświetl plik

@ -158,7 +158,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2020-November-17'; modules.blocks = '2020-November-21';
var SyntaxElementMorph; var SyntaxElementMorph;
var BlockMorph; var BlockMorph;
@ -9417,10 +9417,20 @@ InputSlotMorph.prototype.attributesMenu = function () {
morph => morph.name === objName morph => morph.name === objName
); );
} }
if (!obj) { if (obj instanceof StageMorph) {
return dict; dict = {
} 'costume #' : ['costume #'],
if (obj instanceof SpriteMorph) { '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 = { dict = {
'x position' : ['x position'], 'x position' : ['x position'],
'y position' : ['y position'], 'y position' : ['y position'],
@ -9437,30 +9447,19 @@ InputSlotMorph.prototype.attributesMenu = function () {
'volume' : ['volume'], 'volume' : ['volume'],
'balance' : ['balance'] '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 (obj) {
if (varNames.length > 0) { varNames = obj.variables.names();
dict['~'] = null; if (varNames.length > 0) {
varNames.forEach(name => dict['~'] = null;
dict[name] = name 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; return dict;
}; };