kopia lustrzana https://github.com/backface/turtlestitch
morphic tweaks
rodzic
3dad1b403e
commit
582b7c83de
|
@ -4,13 +4,13 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Snap! Build Your Own Blocks 6.0.1 - dev -</title>
|
||||
<link rel="shortcut icon" href="src/favicon.ico">
|
||||
<script src="src/morphic.js?version=2020-07-15"></script>
|
||||
<script src="src/morphic.js?version=2020-07-16"></script>
|
||||
<script src="src/symbols.js?version=2020-07-01"></script>
|
||||
<script src="src/widgets.js?version=2020-07-13"></script>
|
||||
<script src="src/blocks.js?version=2020-07-15"></script>
|
||||
<script src="src/threads.js?version=2020-07-09"></script>
|
||||
<script src="src/objects.js?version=2020-07-13"></script>
|
||||
<script src="src/gui.js?version=2020-07-15"></script>
|
||||
<script src="src/gui.js?version=2020-07-16"></script>
|
||||
<script src="src/paint.js?version=2020-05-17"></script>
|
||||
<script src="src/lists.js?version=2020-07-01"></script>
|
||||
<script src="src/byob.js?version=2020-07-01"></script>
|
||||
|
|
32
src/gui.js
32
src/gui.js
|
@ -78,7 +78,7 @@ Animation, BoxMorph, BlockEditorMorph, BlockDialogMorph, Note, ZERO, BLACK*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.gui = '2020-July-15';
|
||||
modules.gui = '2020-July-16';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -1629,7 +1629,7 @@ IDE_Morph.prototype.createSpriteEditor = function () {
|
|||
if (morph instanceof BlockMorph) {
|
||||
this.spriteBar.tabBar.tabTo('scripts');
|
||||
}
|
||||
}
|
||||
};
|
||||
} else if (this.currentTab === 'sounds') {
|
||||
this.spriteEditor = new JukeboxMorph(
|
||||
this.currentSprite,
|
||||
|
@ -1645,7 +1645,7 @@ IDE_Morph.prototype.createSpriteEditor = function () {
|
|||
if (morph instanceof BlockMorph) {
|
||||
this.spriteBar.tabBar.tabTo('scripts');
|
||||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
this.spriteEditor = new Morph();
|
||||
this.spriteEditor.color = this.groupColor;
|
||||
|
@ -3124,6 +3124,32 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
'before it picks up an object',
|
||||
new Color(100, 0, 0)
|
||||
);
|
||||
/*
|
||||
menu.addItem(
|
||||
"Block alpha...",
|
||||
() => {
|
||||
world.prompt(
|
||||
'Block alpha',
|
||||
alpha => {
|
||||
SyntaxElementMorph.prototype.setAlphaScaled(alpha);
|
||||
this.rerender();
|
||||
},
|
||||
this,
|
||||
(SyntaxElementMorph.prototype.alpha * 100).toString(),
|
||||
null,
|
||||
0,
|
||||
100,
|
||||
true,
|
||||
alpha => {
|
||||
SyntaxElementMorph.prototype.setAlphaScaled(alpha);
|
||||
this.rerender();
|
||||
},
|
||||
);
|
||||
},
|
||||
'set the blocks\'\nalpha value',
|
||||
new Color(100, 0, 0)
|
||||
);
|
||||
*/
|
||||
}
|
||||
menu.addItem(
|
||||
'Microphone resolution...',
|
||||
|
|
|
@ -1276,7 +1276,7 @@
|
|||
|
||||
/*global window, HTMLCanvasElement, FileReader, Audio, FileList, Map*/
|
||||
|
||||
var morphicVersion = '2020-July-15';
|
||||
var morphicVersion = '2020-July-16';
|
||||
var modules = {}; // keep track of additional loaded modules
|
||||
var useBlurredShadows = true;
|
||||
|
||||
|
@ -4166,7 +4166,8 @@ Morph.prototype.prompt = function (
|
|||
width,
|
||||
floorNum,
|
||||
ceilingNum,
|
||||
isRounded
|
||||
isRounded,
|
||||
action = nop
|
||||
) {
|
||||
var menu, entryField, slider, isNumeric;
|
||||
if (ceilingNum) {
|
||||
|
@ -4210,6 +4211,7 @@ Morph.prototype.prompt = function (
|
|||
entryField.text.fixLayout();
|
||||
entryField.text.changed();
|
||||
entryField.text.edit();
|
||||
action(Math.round(num));
|
||||
};
|
||||
} else {
|
||||
slider.action = (num) => {
|
||||
|
@ -4217,6 +4219,7 @@ Morph.prototype.prompt = function (
|
|||
entryField.text.text = num.toString();
|
||||
entryField.text.fixLayout();
|
||||
entryField.text.changed();
|
||||
action(num);
|
||||
};
|
||||
}
|
||||
menu.items.push(slider);
|
||||
|
@ -4224,7 +4227,13 @@ Morph.prototype.prompt = function (
|
|||
|
||||
menu.addLine(2);
|
||||
menu.addItem('Ok', () => entryField.string());
|
||||
menu.addItem('Cancel', () => null);
|
||||
menu.addItem(
|
||||
'Cancel',
|
||||
() => {
|
||||
action(defaultContents);
|
||||
return null;
|
||||
}
|
||||
);
|
||||
menu.isDraggable = true;
|
||||
menu.popUpAtHand(this.world());
|
||||
entryField.text.edit();
|
||||
|
@ -4444,12 +4453,12 @@ Morph.prototype.setAlphaScaled = function (alpha) {
|
|||
var newAlpha, unscaled;
|
||||
if (typeof alpha === 'number') {
|
||||
unscaled = alpha / 100;
|
||||
this.alpha = Math.min(Math.max(unscaled, 0.1), 1);
|
||||
this.alpha = Math.min(Math.max(unscaled, 0), 1);
|
||||
} else {
|
||||
newAlpha = parseFloat(alpha);
|
||||
if (!isNaN(newAlpha)) {
|
||||
unscaled = newAlpha / 100;
|
||||
this.alpha = Math.min(Math.max(unscaled, 0.1), 1);
|
||||
this.alpha = Math.min(Math.max(unscaled, 0), 1);
|
||||
}
|
||||
}
|
||||
this.changed();
|
||||
|
@ -6971,9 +6980,9 @@ SliderMorph.uber = CircleBoxMorph.prototype;
|
|||
|
||||
function SliderMorph(start, stop, value, size, orientation, color) {
|
||||
this.init(
|
||||
start || 1,
|
||||
start || 0,
|
||||
stop || 100,
|
||||
value || 50,
|
||||
value || 0,
|
||||
size || 10,
|
||||
orientation || 'vertical',
|
||||
color
|
||||
|
|
Ładowanie…
Reference in New Issue