Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoenig committed Jan 22, 2025
2 parents 9c4a572 + 579171f commit 2cc6f6c
Show file tree
Hide file tree
Showing 14 changed files with 334 additions and 136 deletions.
76 changes: 76 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,82 @@
# Snap! (BYOB) History

## in development:
* **Notable Changes:**
* "Quicksteps" Evaluation - Dynamic Scheduling: Keep stepping non-animating processes between animation frames, makes "warp" and "turbo mode" largely obsolete and improves musical thread synching
* Floating point precision random numbers - pick a random float by entering an integer with a decimal point into at least one of the "pick random" reporter's input slots
* reduced animation speed from 67 fps to 60 fps
* disabled santa hats until next Christmas, still loadable as extension
* **Notable Fixes:**
* SciSnap file reader, thanks, Eckart!
* fixed Beetle extension for extrusion and scaling, thanks, Bernat and Joan!
* handle more cases of circularity in data structures more gracefully, thanks, blockpointstudios, for the report!
* fixed #3429: Previously hidden generic WHEN hat blocks reappeared in v10.3
* fixed a series of glitches handling customized primitives
* fixed morphic Pen demo and "doIt" for inspectors

### 2025-01-21
* morphic: fixed Pen demo and "doIt" for inspectors
* v10.4 rc9

### 2025-01-13
* blocks: removed option to ringify prototype hat blocks inside block editors
* gui, objects: fixed a block zooming / ide refreshing glitch
* v10.4 rc7
* Beetle extension fixes to extrusion and scaling, thanks, Bernat and Joan!
* v10.4 rc8

### 2025-01-12
* gui: tweaked capturing and restoring global settings when serializing scenes
* v10.4 rc5
* gui: tweaked capturing and restoring global settingd when serializing scenes for cloud storage
* v10.4 rc6

### 2025-01-11
* gui: tweaked loading libraries from the cloud to bypass resetting customized primitives
* v10.4 rc4

### 2025-01-10
* store, gui: fixed loading customized primitives in different scenes
* v10.4 rc3

### 2025-01-09
* extensions: added "snap_quicksteps" extension blocks, mostly for debugging purposes
* v10.4 rc1
* fixed #3429: Previously hidden generic WHEN hat blocks reappeared in v10.3
* fixed #3428
* v10.4 rc2

### 2025-01-08
* gui, objects: hidden "Dynamic scheduling" setting for analyzing and debugging (the Snap! source code, not your projects, folks)
* updated version

### 2025-01-07
* objects: refactored Twostep event evaluation
* objects: refactored Quickstep frame scheduling
* disabled santa hats, still loadable as extension
* updated version
* objects: reduced animation speed from 67 fps to 60 fps
* lists: handle more cases of circularity in data structures more gracefully
* objects, threads: tweaked quickstepping

### 2025-01-06
* threads: optimized rapid evaluation of generic conditions & custom hat blocks
* objects, threads: harmonized Quickstep / Twostep interaction
* updated version

### 2025-01-04
* objects: enabled "quicksteps" to capture atomic custom events
* updated version
* objects, threads: tweaked "quicksteps" performance for rule hats

### 2025-01-03
* objects, threads: "quicksteps" - keep scheduling non-animating processes between animation ticks
* updated version
* integrated SciSnap file reader fix, thanks, Eckart!

### 2025-01-02
* new dev version
* blocks, threads: added the capability to pick a random float by entering an integer with a decimal point into at least one of the "pick random" reporter's input slots

## 10.3.6:
* **Notable Fixes:**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The definitive source of how to use Snap! is the [Snap! Manual](help/SnapManual.
_Please read the [Contribution Guidelines](docs/CONTRIBUTING.md) before making an issue or pull request. Thanks!_

## License
Copyright (C) 2008-2024 by Jens Mönig and Brian Harvey
Copyright (C) 2008-2025 by Jens Mönig and Brian Harvey

Snap! is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down
2 changes: 1 addition & 1 deletion libraries/SciSnap3Extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ SnapExtensions.primitives.set('SciS_selectFileWithFilepicker(choice)',
//read file as BLOB --------------------------------------------------------------------------------------------------------------------------------------
SnapExtensions.primitives.set('SciS_readFileAsBLOB(source)',
function (source) {
var result = 0, done = false, isFITS = false, header, properties, min = 100000, max = -100000, typeOfData = 'undefined', filename = 'unknown', sum = 0;
var result = 0, done = false, isFITS = false, header, properties, min = 100000, max = -100000, typeOfData = 'undefined', filename = 'unknown', sum = 0, ide = this.parent.parent;
function setCursor(val) {
document.body.style.cursor = val;
top.window.document.body.style.cursor = val;
Expand Down
11 changes: 5 additions & 6 deletions libraries/beetle/beetle.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ BeetleDialogMorph.uber = DialogBoxMorph.prototype;

function BeetleDialogMorph(stage, controller, onAccept) {
this.init(controller, onAccept);
}
};

BeetleDialogMorph.prototype.init = function (controller, onAccept) {
this.controller = controller;
Expand Down Expand Up @@ -1157,7 +1157,6 @@ Beetle.prototype.newExtrusionShape = function (selector) {
}
}


return path;
};

Expand Down Expand Up @@ -1493,17 +1492,17 @@ Beetle.prototype.pointTo = function (x, y, z) {

Beetle.prototype.setScale = function (scale, which) {
if (which == 'shape') {
if (typeof scale === 'number') {
scale = new BABYLON.Vector2(scale, scale);
} else if (scale instanceof List) {
if (scale instanceof List) {
scale = new BABYLON.Vector2(
Number(scale.itemsArray()[0]), Number(scale.itemsArray()[1])
);
} else {
scale = new BABYLON.Vector2(Number(scale), Number(scale));
}
this.shapeScale = scale;
this.updateExtrusionShapeOutline();
} else {
this.movementScale = scale;
this.movementScale = Number(scale);
}
};

Expand Down
19 changes: 9 additions & 10 deletions snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,34 @@
<meta name="mobile-web-app-title" content="Snap!">
<meta name="msapplication-TileImage" content="img/snap-icon-144.png">
<meta name="msapplication-TileColor" content="#FFFFFF">
<script src="src/morphic.js?version=2024-10-09"></script>
<script src="src/morphic.js?version=2025-01-21"></script>
<script src="src/symbols.js?version=2024-11-24"></script>
<script src="src/widgets.js?version=2024-07-24"></script>
<script src="src/blocks.js?version=2024-12-07"></script>
<script src="src/threads.js?version=2024-12-23"></script>
<script src="src/objects.js?version=2024-12-04"></script>
<script src="src/blocks.js?version=2025-01-13"></script>
<script src="src/threads.js?version=2025-01-09"></script>
<script src="src/objects.js?version=2025-01-13"></script>
<script src="src/scenes.js?version=2024-05-28"></script>
<script src="src/gui.js?version=2024-12-30"></script>
<script src="src/gui.js?version=2025-01-21"></script>
<script src="src/paint.js?version=2023-05-24"></script>
<script src="src/lists.js?version=2024-11-14"></script>
<script src="src/lists.js?version=2025-01-07"></script>
<script src="src/byob.js?version=2024-12-18"></script>
<script src="src/tables.js?version=2023-08-17"></script>
<script src="src/sketch.js?version=2023-05-24"></script>
<script src="src/video.js?version=2019-06-27"></script>
<script src="src/maps.js?version=2021-06-15"></script>
<script src="src/extensions.js?version=2024-12-07"></script>
<script src="src/extensions.js?version=2025-01-09"></script>
<script src="src/xml.js?version=2021-07-05"></script>
<script src="src/store.js?version=2024-12-30"></script>
<script src="src/store.js?version=2025-01-10"></script>
<script src="src/locale.js?version=2024-12-30"></script>
<script src="src/cloud.js?version=2023-04-12"></script>
<script src="src/api.js?version=2024-02-22"></script>
<script src="src/embroider.js?version=2024-05-09"></script>
<script src="src/sha512.js?version=2019-06-27"></script>
<script src="src/FileSaver.min.js?version=2019-06-27"></script>
<script src="src/santa.js?version=2024-12-07"></script>
<script>
var world;
window.onload = function () {
var FPS = 67,
var FPS = 60,
lastTime = 0,

loop = (timestamp) => {
Expand Down
34 changes: 11 additions & 23 deletions src/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
written by Jens Mönig
[email protected]

Copyright (C) 2024 by Jens Mönig
Copyright (C) 2025 by Jens Mönig

This file is part of Snap!.

Expand Down Expand Up @@ -162,7 +162,7 @@ CustomHatBlockMorph*/

// Global stuff ////////////////////////////////////////////////////////

modules.blocks = '2024-December-07';
modules.blocks = '2025-January-13';

var SyntaxElementMorph;
var BlockMorph;
Expand Down Expand Up @@ -3781,11 +3781,12 @@ BlockMorph.prototype.userMenu = function () {
) {
return menu;
}

if (!hasLine) {menu.addLine(); }
rcvr = rcvr || this.scriptTarget(true);
if (rcvr && !rcvr.parentThatIsA(IDE_Morph).config.noRingify) {
menu.addItem("ringify", 'ringify');
if (!(top instanceof PrototypeHatBlockMorph)) {
if (!hasLine) {menu.addLine(); }
rcvr = rcvr || this.scriptTarget(true);
if (rcvr && !rcvr.parentThatIsA(IDE_Morph).config.noRingify) {
menu.addItem("ringify", 'ringify');
}
}
if (StageMorph.prototype.enableCodeMapping) {
menu.addLine();
Expand Down Expand Up @@ -12321,14 +12322,8 @@ InputSlotMorph.prototype.mappedCode = function () {
// InputSlotMorph evaluating:

InputSlotMorph.prototype.evaluate = function () {
/*
answer my contents, which can be a "wish", i.e. a block that refers to
another sprite's local method, or a text string. If I am numerical convert
that string to a number. If the conversion fails answer the string
(e.g. for special choices like 'random', 'all' or 'last') otherwise
the numerical value.
*/
var num, contents;
// answer my contents, which can be a "wish", i.e. a block that refers to
// another sprite's local method, or a text string.

if (this.selectedBlock) {
return this.selectedBlock;
Expand All @@ -12342,14 +12337,7 @@ InputSlotMorph.prototype.evaluate = function () {
if (this.constant) {
return this.constant;
}
contents = this.contents();
if (this.isNumeric) {
num = parseFloat(contents.text || '0');
if (!isNaN(num)) {
return num;
}
}
return contents.text;
return this.contents().text;
};

InputSlotMorph.prototype.evaluateOption = function () {
Expand Down
18 changes: 16 additions & 2 deletions src/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

written by Jens Mönig

Copyright (C) 2024 by Jens Mönig
Copyright (C) 2025 by Jens Mönig

This file is part of Snap!.

Expand Down Expand Up @@ -35,7 +35,7 @@ BigUint64Array*/

/*jshint esversion: 11, bitwise: false*/

modules.extensions = '2024-December-07';
modules.extensions = '2025-January-09';

// Global stuff

Expand Down Expand Up @@ -349,6 +349,20 @@ SnapExtensions.primitives.set(
}
);

SnapExtensions.primitives.set(
'snap_quicksteps?',
function () {
return StageMorph.prototype.enableQuicksteps;
}
);

SnapExtensions.primitives.set(
'snap_quicksteps(on?)',
function (bool) {
StageMorph.prototype.enableQuicksteps = (bool === true);
}
);

// errors & exceptions (err_):

SnapExtensions.primitives.set(
Expand Down
26 changes: 20 additions & 6 deletions src/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
written by Jens Mönig
[email protected]

Copyright (C) 2024 by Jens Mönig
Copyright (C) 2025 by Jens Mönig

This file is part of Snap!.

Expand Down Expand Up @@ -87,11 +87,11 @@ HatBlockMorph*/

// Global stuff ////////////////////////////////////////////////////////

modules.gui = '2024-December-30';
modules.gui = '2025-January-21';

// Declarations

var SnapVersion = '10.3.6';
var SnapVersion = '10.4-rc9';

var IDE_Morph;
var ProjectDialogMorph;
Expand Down Expand Up @@ -4642,6 +4642,15 @@ IDE_Morph.prototype.settingsMenu = function () {
'check to cache\nsprite renderings',
true
);
addPreference(
'Dynamic scheduling',
() => StageMorph.prototype.enableQuicksteps =
!StageMorph.prototype.enableQuicksteps,
StageMorph.prototype.enableQuicksteps,
'uncheck to schedule\nthreads framewise',
'check to quickstep\nthreads atomically',
true
);
addPreference(
'Performer mode',
() => this.togglePerformerMode(),
Expand Down Expand Up @@ -5576,7 +5585,7 @@ IDE_Morph.prototype.aboutSnap = function () {
world = this.world();

aboutTxt = 'Snap! ' + SnapVersion + '\nBuild Your Own Blocks\n\n'
+ 'Copyright \u24B8 2008-2024 Jens M\u00F6nig and '
+ 'Copyright \u24B8 2008-2025 Jens M\u00F6nig and '
+ 'Brian Harvey\n'
+ '[email protected], [email protected]\n\n'
+ ' Snap! is developed by the University of California, '
Expand Down Expand Up @@ -6012,6 +6021,7 @@ IDE_Morph.prototype.exportProject = function (name) {
throw err;
}
}
this.scene.applyGlobalSettings();
}
};

Expand Down Expand Up @@ -6600,6 +6610,9 @@ IDE_Morph.prototype.openProjectString = function (str, callback, noPrims) {
if (callback) {callback(); }
return;
}
// reset prims
SpriteMorph.prototype.initBlocks();

this.nextSteps([
() => msg = this.showMessage('Opening project...'),
() => {
Expand Down Expand Up @@ -8008,6 +8021,7 @@ IDE_Morph.prototype.setBlocksScale = function (num) {
new Project(this.scenes, this.scene)
);
}
SpriteMorph.prototype.initBlocks();
SyntaxElementMorph.prototype.setScale(num);
CommentMorph.prototype.refreshScale();
this.spriteBar.tabBar.tabTo('scripts');
Expand Down Expand Up @@ -8409,6 +8423,7 @@ IDE_Morph.prototype.buildProjectRequest = function () {
};
this.serializer.isCollectingMedia = false;
this.serializer.flushMedia();
this.scene.applyGlobalSettings();

return body;
};
Expand Down Expand Up @@ -9656,6 +9671,7 @@ ProjectDialogMorph.prototype.addCloudScene = function (project, delta) {
ProjectDialogMorph.prototype.openCloudProject = function (project, delta) {
this.ide.backup(
() => {
SpriteMorph.prototype.initBlocks(); // reset prims
this.ide.nextSteps([
() => this.ide.showMessage('Fetching project\nfrom the cloud...'),
() => this.rawOpenCloudProject(project, delta)
Expand Down Expand Up @@ -10677,8 +10693,6 @@ LibraryImportDialogMorph.prototype.importLibrary = function () {
this.isLoadingLibrary = true;
}
);

ide.refreshIDE();
};

LibraryImportDialogMorph.prototype.displayBlocks = function (libraryKey) {
Expand Down
Loading

0 comments on commit 2cc6f6c

Please sign in to comment.