kopia lustrzana https://github.com/backface/turtlestitch
Resolved conflicts and JSLinted
rodzic
a7f0de880f
commit
36bbcdd5ef
54
objects.js
54
objects.js
|
@ -4083,32 +4083,36 @@ SpriteMorph.prototype.reactToDropOf = function (morph, hand) {
|
||||||
|
|
||||||
var re = /\((\d+)\)$/; // RegExp to match costume names
|
var re = /\((\d+)\)$/; // RegExp to match costume names
|
||||||
SpriteMorph.prototype.newCostumeName = function (name) {
|
SpriteMorph.prototype.newCostumeName = function (name) {
|
||||||
var foundSameName = false,
|
var foundSameName = false,
|
||||||
foundIndex = false,
|
foundIndex = false,
|
||||||
lastIndex = 0;
|
lastIndex = 0,
|
||||||
for (i = 1; i <= this.costumes.length(); i++) {
|
i = 1,
|
||||||
var costume = this.costumes.at(i);
|
p = null,
|
||||||
if (costume != null) {
|
costume = null;
|
||||||
if (costume.name === name) {
|
|
||||||
foundSameName = true;
|
for (i = 1; i <= this.costumes.length(); i++) {
|
||||||
}
|
costume = this.costumes.at(i);
|
||||||
if (foundSameName) {
|
if (costume !== null) {
|
||||||
var p = re.exec(costume.name);
|
if (costume.name === name) {
|
||||||
if (p) {
|
foundSameName = true;
|
||||||
lastIndex = Number(p[1]);
|
}
|
||||||
foundIndex = true;
|
if (foundSameName) {
|
||||||
|
p = re.exec(costume.name);
|
||||||
|
if (p) {
|
||||||
|
lastIndex = Number(p[1]);
|
||||||
|
foundIndex = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
if (foundSameName) {
|
||||||
if (foundSameName) {
|
if (foundIndex) {
|
||||||
if (foundIndex) {
|
lastIndex += 1;
|
||||||
lastIndex += 1;
|
return name + '(' + lastIndex + ')'; // New index with a +1
|
||||||
return name + '(' + lastIndex + ')'; // New index with a +1
|
}
|
||||||
|
return name + '(2)'; // No indexing has started so start it off with a (1)
|
||||||
}
|
}
|
||||||
return name + '(2)'; // No indexing has started so start it off with a (1)
|
return name;
|
||||||
}
|
|
||||||
return name;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SpriteMorph.prototype.doScreenshot = function (imgSource, data) {
|
SpriteMorph.prototype.doScreenshot = function (imgSource, data) {
|
||||||
|
@ -4805,12 +4809,10 @@ StageMorph.prototype.blockTemplates = function (category) {
|
||||||
blocks.push(block('setEffect'));
|
blocks.push(block('setEffect'));
|
||||||
blocks.push(block('clearEffects'));
|
blocks.push(block('clearEffects'));
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
<<<<<<< HEAD
|
|
||||||
blocks.push(block('doScreenshot'));
|
blocks.push(block('doScreenshot'));
|
||||||
=======
|
blocks.push('-');
|
||||||
blocks.push(block('show'));
|
blocks.push(block('show'));
|
||||||
blocks.push(block('hide'));
|
blocks.push(block('hide'));
|
||||||
>>>>>>> master
|
|
||||||
|
|
||||||
// for debugging: ///////////////
|
// for debugging: ///////////////
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue