kopia lustrzana https://github.com/backface/turtlestitch
fixed unified palette for multi-scene projects
rodzic
7abc954e76
commit
ed2dff6c23
|
|
@ -17,6 +17,7 @@
|
|||
### 2021-07-03
|
||||
* objects: arranged the blocks in the unified palette column-wise
|
||||
* gui: fixed the paletteHandle for the unified palette
|
||||
* gui, scenes, store: fixed unified palette for multi-scene projects
|
||||
|
||||
### 2021-07-02
|
||||
* gui, object, store, etc.: unified blocks palette option, thanks, Michael!
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<script src="src/blocks.js?version=2021-07-02"></script>
|
||||
<script src="src/threads.js?version=2021-06-24"></script>
|
||||
<script src="src/objects.js?version=2021-07-03"></script>
|
||||
<script src="src/scenes.js?version=2021-07-02"></script>
|
||||
<script src="src/scenes.js?version=2021-07-03"></script>
|
||||
<script src="src/gui.js?version=2021-07-03"></script>
|
||||
<script src="src/paint.js?version=2020-05-17"></script>
|
||||
<script src="src/lists.js?version=2021-03-15"></script>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<script src="src/maps.js?version=2021-06-15"></script>
|
||||
<script src="src/extensions.js?version=2021-07-02"></script>
|
||||
<script src="src/xml.js?version=2020-04-27"></script>
|
||||
<script src="src/store.js?version=2021-07-02"></script>
|
||||
<script src="src/store.js?version=2021-07-03"></script>
|
||||
<script src="src/locale.js?version=2021-06-11"></script>
|
||||
<script src="src/cloud.js?version=2021-02-04"></script>
|
||||
<script src="src/api.js?version=2021-01-25"></script>
|
||||
|
|
|
|||
26
src/gui.js
26
src/gui.js
|
|
@ -5583,15 +5583,9 @@ IDE_Morph.prototype.switchToScene = function (scene, refreshAlbum) {
|
|||
}
|
||||
});
|
||||
scene.applyGlobalSettings();
|
||||
this.world().keyboardFocus = this.stage;
|
||||
|
||||
if (this.currentCategory != 'unified' && scene.unifiedPalette) {
|
||||
this.toggleUnifiedPalette();
|
||||
} else if (this.currentCategory == 'unified' && !scene.unifiedPalette) {
|
||||
this.toggleUnifiedPalette();
|
||||
}
|
||||
|
||||
this.setUnifiedPalette(scene.unifiedPalette);
|
||||
this.fixLayout();
|
||||
this.world().keyboardFocus = this.stage;
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.setURL = function (str) {
|
||||
|
|
@ -6031,13 +6025,17 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall, forcedRatio) {
|
|||
};
|
||||
|
||||
IDE_Morph.prototype.toggleUnifiedPalette = function () {
|
||||
this.scene.unifiedPalette = !this.scene.unifiedPalette;
|
||||
if (this.scene.unifiedPalette) {
|
||||
this.currentCategory = 'unified';
|
||||
} else {
|
||||
this.currentCategory = 'motion';
|
||||
}
|
||||
this.setUnifiedPalette(!this.scene.unifiedPalette);
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.setUnifiedPalette = function (bool) {
|
||||
if (this.scene.unifiedPalette === bool &&
|
||||
(bool === (this.currentCategory === 'unified'))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.scene.unifiedPalette = bool;
|
||||
this.currentCategory = bool ? 'unified' : 'motion';
|
||||
this.createCategories();
|
||||
this.createPaletteHandle();
|
||||
this.categories.fixLayout();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
/*global modules, VariableFrame, StageMorph, SpriteMorph, Process, List,
|
||||
normalizeCanvas, SnapSerializer*/
|
||||
|
||||
modules.scenes = '2021-July-02';
|
||||
modules.scenes = '2021-July-03';
|
||||
|
||||
|
||||
// Projecct /////////////////////////////////////////////////////////
|
||||
|
|
@ -180,7 +180,6 @@ Scene.prototype.addDefaultSprite = function () {
|
|||
|
||||
Scene.prototype.captureGlobalSettings = function () {
|
||||
this.hiddenPrimitives = StageMorph.prototype.hiddenPrimitives;
|
||||
this.unifiedPalette = StageMorph.prototype.unifiedPalette;
|
||||
this.codeMappings = StageMorph.prototype.codeMappings;
|
||||
this.codeHeaders = StageMorph.prototype.codeHeaders;
|
||||
this.enableCodeMapping = StageMorph.prototype.enableCodeMapping;
|
||||
|
|
@ -194,7 +193,6 @@ Scene.prototype.captureGlobalSettings = function () {
|
|||
|
||||
Scene.prototype.applyGlobalSettings = function () {
|
||||
StageMorph.prototype.hiddenPrimitives = this.hiddenPrimitives;
|
||||
StageMorph.prototype.unifiedPalette = this.unifiedPalette;
|
||||
StageMorph.prototype.codeMappings = this.codeMappings;
|
||||
StageMorph.prototype.codeHeaders = this.codeHeaders;
|
||||
StageMorph.prototype.enableCodeMapping = this.enableCodeMapping;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ Project*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.store = '2021-July-02';
|
||||
modules.store = '2021-July-03';
|
||||
|
||||
// XML_Serializer ///////////////////////////////////////////////////////
|
||||
/*
|
||||
|
|
@ -374,14 +374,13 @@ SnapSerializer.prototype.loadScene = function (xmlNode, remixID) {
|
|||
}
|
||||
scene.name = 'Untitled ' + nameID;
|
||||
}
|
||||
scene.unifiedPalette = model.scene.attributes.palette === 'single';
|
||||
model.notes = model.scene.childNamed('notes');
|
||||
if (model.notes) {
|
||||
scene.notes = model.notes.contents;
|
||||
}
|
||||
model.globalVariables = model.scene.childNamed('variables');
|
||||
|
||||
scene.unifiedPalette = model.scene.attributes.unifiedPalette === 'true';
|
||||
|
||||
/* Stage */
|
||||
|
||||
model.stage = model.scene.require('stage');
|
||||
|
|
@ -1680,7 +1679,7 @@ Scene.prototype.toXML = function (serializer) {
|
|||
tmp.captureGlobalSettings();
|
||||
this.applyGlobalSettings();
|
||||
xml = serializer.format(
|
||||
'<scene name="@" unifiedPalette="@">' +
|
||||
'<scene name="@"%>' +
|
||||
'<notes>$</notes>' +
|
||||
'<hidden>$</hidden>' +
|
||||
'<headers>%</headers>' +
|
||||
|
|
@ -1690,7 +1689,7 @@ Scene.prototype.toXML = function (serializer) {
|
|||
'%' + // stage
|
||||
'</scene>',
|
||||
this.name || localize('Untitled'),
|
||||
this.unifiedPalette,
|
||||
this.unifiedPalette ? ' palette="single"' : '',
|
||||
this.notes || '',
|
||||
Object.keys(StageMorph.prototype.hiddenPrimitives).reduce(
|
||||
(a, b) => a + ' ' + b,
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue