refactored and unified default values for block templates

pull/95/head
jmoenig 2020-11-17 11:35:55 +01:00
rodzic 5fbfea5dcb
commit 1f6744defc
4 zmienionych plików z 26 dodań i 38 usunięć

Wyświetl plik

@ -8,6 +8,9 @@
* fixed a costume fitting issue, thanks, Joan!
* fixed keyboard formula input for "power of", "neg", "lg" and "id"
### 2020-11-1/
* blocks, objects: refactored and unified default values for block templates
### 2020-11-15
* new dev version
* objects: fixed costume fitting, thanks, Joan!

Wyświetl plik

@ -8,9 +8,9 @@
<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-02"></script>
<script src="src/blocks.js?version=2020-11-17"></script>
<script src="src/threads.js?version=2020-11-15"></script>
<script src="src/objects.js?version=2020-11-15"></script>
<script src="src/objects.js?version=2020-11-17"></script>
<script src="src/gui.js?version=2020-11-15"></script>
<script src="src/paint.js?version=2020-05-17"></script>
<script src="src/lists.js?version=2020-07-01"></script>

Wyświetl plik

@ -158,7 +158,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2020-November-02';
modules.blocks = '2020-November-17';
var SyntaxElementMorph;
var BlockMorph;
@ -840,7 +840,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['pen trails']);
break;
case '%inputs':
part = new MultiArgMorph('%s', 'with inputs');
@ -960,7 +959,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
'random' : ['random']
}
);
part.setContents(90);
break;
case '%note':
part = new InputSlotMorph(
@ -981,7 +979,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
'(4) triangle' : 4
}
);
part.setContents(1);
break;
case '%audio':
part = new InputSlotMorph(
@ -1031,7 +1028,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
'96 kHz' : 96000
}
);
part.setContents(1);
break;
case '%interaction':
part = new InputSlotMorph(
@ -1067,7 +1063,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true // read-only
);
part.setContents(['date']);
break;
case '%delim':
part = new InputSlotMorph(
@ -1100,7 +1095,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
all : ['all']
}
);
part.setContents(1);
break;
case '%idx':
part = new InputSlotMorph(
@ -1112,7 +1106,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
any : ['any']
}
);
part.setContents(1);
break;
case '%dim':
part = new InputSlotMorph(
@ -1122,7 +1115,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
current : ['current']
}
);
// part.setContents( ['current']);
break;
case '%rel':
part = new InputSlotMorph(
@ -1220,7 +1212,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['ghost']);
break;
case '%snd':
part = new InputSlotMorph(
@ -1282,7 +1273,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['space']);
break;
case '%keyHat':
part = this.labelPart('%key');
@ -1340,7 +1330,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['sqrt']);
break;
case '%layer':
part = new InputSlotMorph(
@ -1352,7 +1341,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['front']);
break;
case '%hsva':
part = new InputSlotMorph(
@ -1366,7 +1354,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['hue']);
break;
case '%pen':
part = new InputSlotMorph(
@ -1381,7 +1368,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['hue']);
break;
case '%asp': // aspect
part = new InputSlotMorph(
@ -1398,7 +1384,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['hue']);
break;
case '%txtfun':
part = new InputSlotMorph(
@ -1415,7 +1400,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['encode URI']);
break;
case '%stopChoices':
part = new InputSlotMorph(
@ -1430,7 +1414,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['all']);
part.isStatic = true;
break;
case '%setting':
@ -1446,7 +1429,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['turbo mode']);
part.isStatic = true;
break;
case '%typ':
@ -1456,7 +1438,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
'typesMenu',
true
);
part.setContents(['number']);
break;
case '%mapValue':
part = new InputSlotMorph(
@ -1470,7 +1451,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['String']);
part.isStatic = true;
break;
case '%var':
@ -1501,7 +1481,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true
);
part.setContents(['code']);
break;
case '%l':
part = new ArgMorph('list');
@ -1722,7 +1701,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
},
true // read-only
);
part.setContents(['motion']);
break;
case '%on':
part = new InputSlotMorph(

Wyświetl plik

@ -84,7 +84,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, BooleanSlotMorph,
localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph,
AlignmentMorph, Process, WorldMap, copyCanvas, useBlurredShadows*/
modules.objects = '2020-November-15';
modules.objects = '2020-November-17';
var SpriteMorph;
var StageMorph;
@ -209,7 +209,8 @@ SpriteMorph.prototype.initBlocks = function () {
only: SpriteMorph,
type: 'command',
category: 'motion',
spec: 'point in direction %dir'
spec: 'point in direction %dir',
defaults: [90]
},
doFaceTowards: {
only: SpriteMorph,
@ -357,18 +358,19 @@ SpriteMorph.prototype.initBlocks = function () {
type: 'command',
category: 'looks',
spec: 'change %eff effect by %n',
defaults: [null, 25]
defaults: [['ghost'], 25]
},
setEffect: {
type: 'command',
category: 'looks',
spec: 'set %eff effect to %n',
defaults: [null, 0]
defaults: [['ghost'], 0]
},
getEffect: {
type: 'reporter',
category: 'looks',
spec: '%eff effect'
spec: '%eff effect',
defaults: [['ghost']]
},
clearEffects: {
type: 'command',
@ -715,7 +717,8 @@ SpriteMorph.prototype.initBlocks = function () {
receiveKey: {
type: 'hat',
category: 'control',
spec: 'when %keyHat key pressed'
spec: 'when %keyHat key pressed',
defaults: [['space']]
},
receiveInteraction: {
type: 'hat',
@ -804,7 +807,8 @@ SpriteMorph.prototype.initBlocks = function () {
doStopThis: {
type: 'command',
category: 'control',
spec: 'stop %stopChoices'
spec: 'stop %stopChoices',
defaults: [['all']]
},
doRun: {
type: 'command',
@ -965,7 +969,8 @@ SpriteMorph.prototype.initBlocks = function () {
reportKeyPressed: {
type: 'predicate',
category: 'sensing',
spec: 'key %key pressed?'
spec: 'key %key pressed?',
defaults: [['space']]
},
reportRelationTo: {
only: SpriteMorph,
@ -1023,7 +1028,8 @@ SpriteMorph.prototype.initBlocks = function () {
reportDate: {
type: 'reporter',
category: 'sensing',
spec: 'current %dates'
spec: 'current %dates',
defaults: [['date']]
},
reportGet: {
type: 'reporter',
@ -1088,7 +1094,7 @@ SpriteMorph.prototype.initBlocks = function () {
type: 'reporter',
category: 'operators',
spec: '%fun of %n',
defaults: [null, 10]
defaults: [['sqrt'], 10]
},
reportPower: {
type: 'reporter',
@ -1183,7 +1189,7 @@ SpriteMorph.prototype.initBlocks = function () {
type: 'predicate',
category: 'operators',
spec: 'is %s a %typ ?',
defaults: [5]
defaults: [5, ['number']]
},
reportIsIdentical: {
type: 'predicate',
@ -1213,7 +1219,7 @@ SpriteMorph.prototype.initBlocks = function () {
type: 'reporter',
category: 'operators',
spec: '%txtfun of %s',
defaults: [null, "Abelson & Sussman"]
defaults: [['encode URI'], "Abelson & Sussman"]
},
reportCompiled: { // experimental
type: 'reporter',
@ -1406,7 +1412,8 @@ SpriteMorph.prototype.initBlocks = function () {
doMapCodeOrHeader: {
type: 'command',
category: 'other',
spec: 'map %cmdRing to %codeKind %code'
spec: 'map %cmdRing to %codeKind %code',
defaults: [null, ['code']]
},
doMapValueCode: {
type: 'command',