kopia lustrzana https://github.com/backface/turtlestitch
commit
12035f0c01
|
@ -149,7 +149,7 @@ isSnapObject, copy*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.blocks = '2016-May-10';
|
modules.blocks = '2016-May-30';
|
||||||
|
|
||||||
var SyntaxElementMorph;
|
var SyntaxElementMorph;
|
||||||
var BlockMorph;
|
var BlockMorph;
|
||||||
|
@ -2227,7 +2227,8 @@ BlockMorph.prototype.userMenu = function () {
|
||||||
myself = this,
|
myself = this,
|
||||||
shiftClicked = world.currentKey === 16,
|
shiftClicked = world.currentKey === 16,
|
||||||
proc = this.activeProcess(),
|
proc = this.activeProcess(),
|
||||||
vNames = proc ? proc.context.outerContext.variables.names() : [],
|
vNames = proc && proc.context && proc.context.outerContext ?
|
||||||
|
proc.context.outerContext.variables.names() : [],
|
||||||
alternatives,
|
alternatives,
|
||||||
top,
|
top,
|
||||||
blck;
|
blck;
|
||||||
|
@ -3397,13 +3398,13 @@ BlockMorph.prototype.scriptPic = function () {
|
||||||
if (anchor) {
|
if (anchor) {
|
||||||
ctx.drawImage(
|
ctx.drawImage(
|
||||||
anchor.image,
|
anchor.image,
|
||||||
anchor.left() - fb.left(),
|
anchor.left() - fb.left() - 4,
|
||||||
anchor.top() - fb.top()
|
anchor.top() - fb.top()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ctx.drawImage(
|
ctx.drawImage(
|
||||||
comment.fullImageClassic(),
|
comment.fullImageClassic(),
|
||||||
comment.left() - fb.left(),
|
comment.left() - fb.left() - 4,
|
||||||
comment.top() - fb.top()
|
comment.top() - fb.top()
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
15
gui.js
15
gui.js
|
@ -71,7 +71,7 @@ isRetinaSupported*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.gui = '2016-May-13';
|
modules.gui = '2016-May-30';
|
||||||
|
|
||||||
// Declarations
|
// Declarations
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ IDE_Morph.prototype.openIn = function (world) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.userLanguage) {
|
if (this.userLanguage) {
|
||||||
this.setLanguage(this.userLanguage, interpretUrlAnchors);
|
this.setLanguage(this.userLanguage, interpretUrlAnchors, true);
|
||||||
} else {
|
} else {
|
||||||
interpretUrlAnchors.call(this);
|
interpretUrlAnchors.call(this);
|
||||||
}
|
}
|
||||||
|
@ -4329,7 +4329,7 @@ IDE_Morph.prototype.languageMenu = function () {
|
||||||
menu.popup(world, pos);
|
menu.popup(world, pos);
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.setLanguage = function (lang, callback) {
|
IDE_Morph.prototype.setLanguage = function (lang, callback, forStartUp) {
|
||||||
var translation = document.getElementById('language'),
|
var translation = document.getElementById('language'),
|
||||||
src = this.resourceURL('lang-' + lang + '.js'),
|
src = this.resourceURL('lang-' + lang + '.js'),
|
||||||
myself = this;
|
myself = this;
|
||||||
|
@ -4343,16 +4343,16 @@ IDE_Morph.prototype.setLanguage = function (lang, callback) {
|
||||||
translation = document.createElement('script');
|
translation = document.createElement('script');
|
||||||
translation.id = 'language';
|
translation.id = 'language';
|
||||||
translation.onload = function () {
|
translation.onload = function () {
|
||||||
myself.reflectLanguage(lang, callback);
|
myself.reflectLanguage(lang, callback, forStartUp);
|
||||||
};
|
};
|
||||||
document.head.appendChild(translation);
|
document.head.appendChild(translation);
|
||||||
translation.src = src;
|
translation.src = src;
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.reflectLanguage = function (lang, callback) {
|
IDE_Morph.prototype.reflectLanguage = function (lang, callback, forStartUp) {
|
||||||
var projectData;
|
var projectData;
|
||||||
SnapTranslator.language = lang;
|
SnapTranslator.language = lang;
|
||||||
if (!this.loadNewProject) {
|
if (!this.loadNewProject && !forStartUp) {
|
||||||
if (Process.prototype.isCatchingErrors) {
|
if (Process.prototype.isCatchingErrors) {
|
||||||
try {
|
try {
|
||||||
projectData = this.serializer.serialize(this.stage);
|
projectData = this.serializer.serialize(this.stage);
|
||||||
|
@ -4370,6 +4370,9 @@ IDE_Morph.prototype.reflectLanguage = function (lang, callback) {
|
||||||
this.fixLayout();
|
this.fixLayout();
|
||||||
if (this.loadNewProject) {
|
if (this.loadNewProject) {
|
||||||
this.newProject();
|
this.newProject();
|
||||||
|
} else if (forStartUp) {
|
||||||
|
this.stage.setName(localize('Stage'));
|
||||||
|
this.currentSprite.setName(localize('Sprite'));
|
||||||
} else {
|
} else {
|
||||||
this.openProjectString(projectData);
|
this.openProjectString(projectData);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue