made "pen color model" and "disable click-to-run" settings persistent per scene

snap7
jmoenig 2021-11-11 19:10:21 +01:00
rodzic 6513c9c6e8
commit 62e0bc4545
6 zmienionych plików z 34 dodań i 25 usunięć

Wyświetl plik

@ -16,6 +16,8 @@
* block-instances can be dragged off from templates in the "export blocks", "unused blocks" and "hide blocks" dialogs * block-instances can be dragged off from templates in the "export blocks", "unused blocks" and "hide blocks" dialogs
* added "enter" key to key-pressed dropdown * added "enter" key to key-pressed dropdown
* added "green flag" symbol to message drop-down * added "green flag" symbol to message drop-down
* new preference setting per scene for pen color model and graphic effects, HSV or HSL, default is HSL
* new preference setting per scene to "disable click-to-run" on blocks, for use in micro-world extensions
* **Notable Changes:** * **Notable Changes:**
* saved projects remember the last edited sprite * saved projects remember the last edited sprite
* libraries no longer rely on the JSF primitive, project may need to re-import their libraries to run without having to enable JS extensions * libraries no longer rely on the JSF primitive, project may need to re-import their libraries to run without having to enable JS extensions
@ -24,7 +26,7 @@
* codification and js-func blocks don't appear in search results unless enabled * codification and js-func blocks don't appear in search results unless enabled
* migrated SEND blocks to be BROADCAST TO blocks * migrated SEND blocks to be BROADCAST TO blocks
* "when I receive 'any message'" hat scripts are threadsafe (uninterruptable by other messages) * "when I receive 'any message'" hat scripts are threadsafe (uninterruptable by other messages)
* changed the color model for pen/background colors from HSV to HSL * changed the default color model for pen/background colors and graphic effects from HSV to HSL
* changed the scale of the graphics color effect from 0-200 to 0-100 * changed the scale of the graphics color effect from 0-200 to 0-100
* new Birdbrain Technology extensions for Finch and Hummingbird, thanks, Kristina and Bambi! * new Birdbrain Technology extensions for Finch and Hummingbird, thanks, Kristina and Bambi!
* retired Leap Motion library * retired Leap Motion library
@ -57,6 +59,7 @@
* German translation update, changed %hsva -> %clrdim * German translation update, changed %hsva -> %clrdim
* Brazilian Portuguese translation update, thank you, Cassiano D'Andrea!! * Brazilian Portuguese translation update, thank you, Cassiano D'Andrea!!
* threads, gui: experimental "disalbe click-to-run" preference * threads, gui: experimental "disalbe click-to-run" preference
* gui, scenes, store: made "pen color model" and "disable click-to-run" settings persistent per scene
### 2021-11-10 ### 2021-11-10
* objects, store: new "penColorModel" setting, can e 'hsv' or 'hsl' * objects, store: new "penColorModel" setting, can e 'hsv' or 'hsl'

Wyświetl plik

@ -19,7 +19,7 @@
<script src="src/blocks.js?version=2021-11-09"></script> <script src="src/blocks.js?version=2021-11-09"></script>
<script src="src/threads.js?version=2021-11-11"></script> <script src="src/threads.js?version=2021-11-11"></script>
<script src="src/objects.js?version=2021-11-10"></script> <script src="src/objects.js?version=2021-11-10"></script>
<script src="src/scenes.js?version=2021-10-12"></script> <script src="src/scenes.js?version=2021-11-11"></script>
<script src="src/gui.js?version=2021-11-11"></script> <script src="src/gui.js?version=2021-11-11"></script>
<script src="src/paint.js?version=2021-07-05"></script> <script src="src/paint.js?version=2021-07-05"></script>
<script src="src/lists.js?version=2021-07-19"></script> <script src="src/lists.js?version=2021-07-19"></script>
@ -30,7 +30,7 @@
<script src="src/maps.js?version=2021-06-15"></script> <script src="src/maps.js?version=2021-06-15"></script>
<script src="src/extensions.js?version=2021-11-08"></script> <script src="src/extensions.js?version=2021-11-08"></script>
<script src="src/xml.js?version=2021-07-05"></script> <script src="src/xml.js?version=2021-07-05"></script>
<script src="src/store.js?version=2021-11-10"></script> <script src="src/store.js?version=2021-11-11"></script>
<script src="src/locale.js?version=2021-11-11"></script> <script src="src/locale.js?version=2021-11-11"></script>
<script src="src/cloud.js?version=2021-02-04"></script> <script src="src/cloud.js?version=2021-02-04"></script>
<script src="src/api.js?version=2021-07-05"></script> <script src="src/api.js?version=2021-07-05"></script>

Wyświetl plik

@ -3845,22 +3845,6 @@ IDE_Morph.prototype.settingsMenu = function () {
true true
); );
} }
addPreference(
'HSV pen color model',
() => SpriteMorph.prototype.penColorModel = 'hsv',
SpriteMorph.prototype.penColorModel === 'hsv',
null,
null,
true
);
addPreference(
'HSL pen color model',
() => SpriteMorph.prototype.penColorModel = 'hsl',
SpriteMorph.prototype.penColorModel === 'hsl',
null,
null,
true
);
addPreference( addPreference(
'Input sliders', 'Input sliders',
'toggleInputSliders', 'toggleInputSliders',
@ -4248,6 +4232,17 @@ IDE_Morph.prototype.settingsMenu = function () {
'check to enable\ndropping commands in all rings', 'check to enable\ndropping commands in all rings',
true true
); );
addPreference(
'HSV pen color model',
() => SpriteMorph.prototype.penColorModel =
SpriteMorph.prototype.penColorModel === 'hsv' ? 'hsl' : 'hsv',
SpriteMorph.prototype.penColorModel === 'hsv',
'uncheck to switch pen colors\nand graphic effects\nto HSL (default)',
'check to switch pen colors\nand graphic effects\nfrom HSL to HSV',
false
);
addPreference( addPreference(
'Disable click-to-run', 'Disable click-to-run',
() => ThreadManager.prototype.disableClickToRun = () => ThreadManager.prototype.disableClickToRun =
@ -4255,7 +4250,7 @@ IDE_Morph.prototype.settingsMenu = function () {
ThreadManager.prototype.disableClickToRun, ThreadManager.prototype.disableClickToRun,
'uncheck to enable\ndirectly running blocks\nby clicking on them', 'uncheck to enable\ndirectly running blocks\nby clicking on them',
'check to disable\ndirectly running blocks\nby clicking on them', 'check to disable\ndirectly running blocks\nby clicking on them',
true false
); );
menu.popup(world, pos); menu.popup(world, pos);
}; };

Wyświetl plik

@ -47,13 +47,13 @@
*/ */
/*global modules, VariableFrame, StageMorph, SpriteMorph, Process, List, /*global modules, VariableFrame, StageMorph, SpriteMorph, Process, List,
normalizeCanvas, SnapSerializer, Costume*/ normalizeCanvas, SnapSerializer, Costume, ThreadManager*/
/*jshint esversion: 6*/ /*jshint esversion: 6*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.scenes = '2021-October-12'; modules.scenes = '2021-November-11';
// Projecct ///////////////////////////////////////////////////////// // Projecct /////////////////////////////////////////////////////////
@ -139,6 +139,8 @@ function Scene(aStageMorph) {
this.useFlatLineEnds = false; this.useFlatLineEnds = false;
this.enableLiveCoding = false; this.enableLiveCoding = false;
this.enableHyperOps = true; this.enableHyperOps = true;
this.disableClickToRun = false;
this.penColorModel = 'hsl'; // can also bei 'hsv'
// for deserializing - do not persist // for deserializing - do not persist
this.spritesDict = {}; this.spritesDict = {};
@ -193,6 +195,8 @@ Scene.prototype.captureGlobalSettings = function () {
this.enableLiveCoding = Process.prototype.enableLiveCoding; this.enableLiveCoding = Process.prototype.enableLiveCoding;
this.enableHyperOps = Process.prototype.enableHyperOps; this.enableHyperOps = Process.prototype.enableHyperOps;
this.customCategories = SpriteMorph.prototype.customCategories; this.customCategories = SpriteMorph.prototype.customCategories;
this.disableClickToRun = ThreadManager.prototype.disableClickToRun;
this.penColorModel = SpriteMorph.prototype.penColorModel;
}; };
Scene.prototype.applyGlobalSettings = function () { Scene.prototype.applyGlobalSettings = function () {
@ -208,6 +212,8 @@ Scene.prototype.applyGlobalSettings = function () {
Process.prototype.enableLiveCoding = this.enableLiveCoding; Process.prototype.enableLiveCoding = this.enableLiveCoding;
Process.prototype.enableHyperOps = this.enableHyperOps; Process.prototype.enableHyperOps = this.enableHyperOps;
SpriteMorph.prototype.customCategories = this.customCategories; SpriteMorph.prototype.customCategories = this.customCategories;
ThreadManager.prototype.disableClickToRun = this.disableClickToRun;
SpriteMorph.prototype.penColorModel = this.penColorModel;
}; };
Scene.prototype.updateTrash = function () { Scene.prototype.updateTrash = function () {

Wyświetl plik

@ -63,7 +63,7 @@ Project*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.store = '2021-November-10'; modules.store = '2021-November-11';
// XML_Serializer /////////////////////////////////////////////////////// // XML_Serializer ///////////////////////////////////////////////////////
/* /*
@ -380,6 +380,9 @@ SnapSerializer.prototype.loadScene = function (xmlNode, remixID) {
} }
scene.unifiedPalette = model.scene.attributes.palette === 'single'; scene.unifiedPalette = model.scene.attributes.palette === 'single';
scene.showCategories = model.scene.attributes.categories !== 'false'; scene.showCategories = model.scene.attributes.categories !== 'false';
scene.disableClickToRun = model.scene.attributes.clickrun === 'false';
scene.penColorModel = model.scene.attributes.colormodel === 'hsv' ?
'hsv' : 'hsl';
model.notes = model.scene.childNamed('notes'); model.notes = model.scene.childNamed('notes');
if (model.notes) { if (model.notes) {
scene.notes = model.notes.contents; scene.notes = model.notes.contents;
@ -1735,7 +1738,7 @@ Scene.prototype.toXML = function (serializer) {
} }
xml = serializer.format( xml = serializer.format(
'<scene name="@"%%>' + '<scene name="@"%%%%>' +
'<notes>$</notes>' + '<notes>$</notes>' +
'%' + '%' +
'<hidden>$</hidden>' + '<hidden>$</hidden>' +
@ -1749,6 +1752,8 @@ Scene.prototype.toXML = function (serializer) {
this.unifiedPalette ? ' palette="single"' : '', this.unifiedPalette ? ' palette="single"' : '',
this.unifiedPalette && !this.showCategories ? this.unifiedPalette && !this.showCategories ?
' categories="false"' : '', ' categories="false"' : '',
this.disableClickToRun ? ' clickrun="false"' : '',
this.penColorModel === 'hsv' ? ' colormodel="hsv"' : '',
this.notes || '', this.notes || '',
serializer.paletteToXML(this.customCategories), serializer.paletteToXML(this.customCategories),
Object.keys(this.hiddenPrimitives).reduce( Object.keys(this.hiddenPrimitives).reduce(

2
sw.js
Wyświetl plik

@ -1,4 +1,4 @@
var snapVersion = '7-dev211110' var snapVersion = '7-dev211111'
var cacheName = 'snap-pwa', var cacheName = 'snap-pwa',
filesToCache = [ filesToCache = [