'From Squeak3.1alpha of 28 February 2001 [latest update: #4036] on 17 May 2001 at 4:38:28 pm'! "Change Set: scriptName-sw Date: 17 May 2001 Author: Scott Wallace Replaces the header morphs in Scriptors loaded from disk with modernized ones, and fixes a bug that could clobber scripts if you started to edit a script name but then thought better of it"! !Player methodsFor: 'scripts-kernel' stamp: 'sw 5/17/2001 16:36'! renameScript: oldSelector newSelector: newSelector "Rename the given script to have the new selector" | aUserScript anInstantiation | oldSelector = newSelector ifTrue: [^ self]. aUserScript _ self class userScriptForPlayer: self selector: oldSelector. aUserScript renameScript: newSelector fromPlayer: self. "updates all script editors, and inserts the new script in my scripts directory" self class removeScriptNamed: oldSelector. self class allSubInstancesDo: [:aPlayer | anInstantiation _ aPlayer scriptInstantiationForSelector: oldSelector. anInstantiation changeSelectorTo: newSelector. aPlayer costume actorState instantiatedUserScriptsDictionary removeKey: oldSelector; at: newSelector put: anInstantiation. anInstantiation assureEventHandlerRepresentsStatus]. self updateAllViewersAndForceToShow: 'scripts'! ! !ScriptEditorMorph methodsFor: 'initialization' stamp: 'sw 5/17/2001 15:40'! updateHeader "Replace my header morph with another one assured of being structurally au courant" (firstTileRow notNil and: [firstTileRow > 1]) ifTrue: [self replaceRow1]! ! !ScriptEditorMorph methodsFor: 'other' stamp: 'sw 5/17/2001 16:33'! renameScriptTo: newSelector "Rename the receiver's script so that it has given new selector" | aMethodNodeMorph | scriptName _ newSelector. self updateHeader. Preferences universalTiles ifFalse: [self install] ifTrue: [(aMethodNodeMorph _ self methodNodeMorph) ifNotNil: [aMethodNodeMorph accept]]! ! !ScriptEditorMorph methodsFor: 'other' stamp: 'sw 5/17/2001 16:04'! unhibernate "Recreate my tiles from my method if I have new universal tiles." self topEditor == self ifFalse: [^ self]. "Part of a compound test" self updateHeader. self world ifNil: [(playerScripted == nil or: [playerScripted isUniversalTiles not]) ifTrue: [^ self]] ifNotNil: [Preferences universalTiles ifFalse: [^ self]]. self insertUniversalTiles. self showingMethodPane: false! !