kopia lustrzana https://github.com/backface/turtlestitch
added ASK-menu data representation for Booleans
rodzic
6b983a8ffe
commit
2bc395fe14
|
@ -30,6 +30,9 @@
|
|||
* **Translation Updates:**
|
||||
* German
|
||||
|
||||
### 2022-04-01
|
||||
* objects: added ASK-menu data representation for Booleans
|
||||
|
||||
### 2022-03-31
|
||||
* threads, objects: new menu functionality for ASK command, when passing a list
|
||||
* objects: support various data types inside menus (sprites, costumes, blocks)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<script src="src/widgets.js?version=2021-17-09"></script>
|
||||
<script src="src/blocks.js?version=2022-03-31"></script>
|
||||
<script src="src/threads.js?version=2022-03-31"></script>
|
||||
<script src="src/objects.js?version=2022-03-31"></script>
|
||||
<script src="src/objects.js?version=2022-04-01"></script>
|
||||
<script src="src/scenes.js?version=2022-03-03"></script>
|
||||
<script src="src/gui.js?version=2022-03-17"></script>
|
||||
<script src="src/paint.js?version=2021-07-05"></script>
|
||||
|
|
|
@ -93,7 +93,7 @@ BlockVisibilityDialogMorph, CostumeIconMorph, SoundIconMorph, MenuItemMorph*/
|
|||
|
||||
/*jshint esversion: 6*/
|
||||
|
||||
modules.objects = '2022-March-31';
|
||||
modules.objects = '2022-April-01';
|
||||
|
||||
var SpriteMorph;
|
||||
var StageMorph;
|
||||
|
@ -12914,6 +12914,7 @@ StagePickerMorph.prototype.isSubmenu = function (options) {
|
|||
};
|
||||
|
||||
StagePickerMorph.prototype.dataRepresentation = function (data) {
|
||||
var sym;
|
||||
switch (Process.prototype.reportTypeOf(data)) {
|
||||
case 'costume':
|
||||
case 'sprite':
|
||||
|
@ -12923,11 +12924,48 @@ StagePickerMorph.prototype.dataRepresentation = function (data) {
|
|||
case 'reporter':
|
||||
case 'predicate':
|
||||
return data.image();
|
||||
case 'Boolean':
|
||||
sym = new BooleanSlotMorph(data);
|
||||
sym.fontSize *= this.scale;
|
||||
sym.edge *= this.scale;
|
||||
sym.fixLayout();
|
||||
return sym.fullImage();
|
||||
default:
|
||||
return data.toString();
|
||||
}
|
||||
};
|
||||
|
||||
StagePickerMorph.prototype.addItem = function (
|
||||
labelString,
|
||||
action,
|
||||
hint,
|
||||
color,
|
||||
bold, // bool
|
||||
italic, // bool
|
||||
doubleClickAction, // optional, when used as list contents
|
||||
shortcut, // optional string, icon (Morph or Canvas) or tuple [icon, string]
|
||||
verbatim // optional bool, don't translate if true
|
||||
) {
|
||||
/*
|
||||
labelString is normally a single-line string. But it can also be one
|
||||
of the following:
|
||||
|
||||
* a multi-line string (containing line breaks)
|
||||
* an icon (either a Morph or a Canvas)
|
||||
* a tuple of format: [icon, string]
|
||||
*/
|
||||
this.items.push([
|
||||
verbatim ? labelString : localize(labelString),
|
||||
action === 0 ? 0 : action || nop,
|
||||
hint,
|
||||
color,
|
||||
bold || false,
|
||||
italic || false,
|
||||
doubleClickAction,
|
||||
shortcut,
|
||||
verbatim]);
|
||||
};
|
||||
|
||||
// StagePickerMorph popping up
|
||||
|
||||
StagePickerMorph.prototype.popup = function (stage, pos) {
|
||||
|
|
Ładowanie…
Reference in New Issue