mirror of
https://github.com/scratchfoundation/scratch-flash.git
synced 2024-12-04 21:21:06 -05:00
Prevented duplicate sprite names
This commit is contained in:
parent
716c064379
commit
bf9ce4a865
2 changed files with 3 additions and 0 deletions
|
@ -663,6 +663,8 @@ public class ScratchRuntime {
|
|||
|
||||
public function renameSprite(newName:String):void {
|
||||
var obj:ScratchObj = app.viewedObj();
|
||||
obj.objName = '';
|
||||
newName = app.stagePane.unusedSpriteName(newName);
|
||||
var oldName:String = obj.objName;
|
||||
obj.objName = newName;
|
||||
for each (var lw:ListWatcher in app.viewedObj().lists) {
|
||||
|
|
|
@ -341,6 +341,7 @@ public class SpriteInfoPart extends UIPart implements DragClient {
|
|||
|
||||
private function nameChanged():void {
|
||||
app.runtime.renameSprite(spriteName.contents());
|
||||
spriteName.setContents(app.viewedObj().objName);
|
||||
}
|
||||
|
||||
public function updateThumbnail():void {
|
||||
|
|
Loading…
Reference in a new issue