allow parens in project names

snap7
jmoenig 2021-12-14 18:09:15 +01:00
rodzic 853b01c8e9
commit 1dfee04381
2 zmienionych plików z 19 dodań i 2 usunięć

Wyświetl plik

@ -4,13 +4,15 @@
* **New Features:**
* **Notable Changes:**
* **Notable Fixes:**
* keep the order of sprites in the corral for newly created projects
* keep the order of sprites in the corral when saving newly created projects
* allow parens in project names
* **Documentation Updates:**
* **Translation Updates:**
### 2021-12-14
* new dev version
* store: keep the order of sprites in the corral for newly created projects
* store: keep the order of sprites in the corral when saving newly created projects
* gui: allow parens in project names
## 7.0.0:
* **New Features:**

Wyświetl plik

@ -3506,6 +3506,9 @@ IDE_Morph.prototype.newSceneName = function (name, ignoredScene) {
return this.newName(sName, all);
};
/* // nicer version, commented out because some teachers
// require parens in project names. Sigh.
IDE_Morph.prototype.newName = function (name, elements) {
var ix = name.indexOf('('),
stem = (ix < 0) ? name : name.substring(0, ix),
@ -3518,6 +3521,18 @@ IDE_Morph.prototype.newName = function (name, elements) {
}
return newName;
};
*/
IDE_Morph.prototype.newName = function (name, elements) {
var count = 1,
newName = name;
while (contains(elements, newName)) {
count += 1;
newName = name + '(' + count + ')';
}
return newName;
};
// IDE_Morph deleting scripts