@@ -1720,9 +1720,19 @@ on revInitialiseTutorial
17201720 revIDESetPreference "cToolbarIcons" , true
17211721 revIDESetPreference "idePropertyInspector_labels" , false
17221722
1723+ -- Ensure we know when stack names change
1724+ revIDESubscribe "ideNameChanged"
1725+
17231726 unlock screen
17241727end revInitialiseTutorial
17251728
1729+ on ideNameChanged pOldName, pNewName, pTarget
1730+ if word 1 of pTarget is "stack" then
1731+ -- Update all our long IDs if we're tracking this stack
1732+ revTutorialStackNameChanged pOldName , pNewName
1733+ end if
1734+ end ideNameChanged
1735+
17261736on revTutorialInitialiseStep
17271737 put false into sWaiting
17281738 put false into sIsInterlude
@@ -3401,6 +3411,30 @@ function revTutorialReparentChild pObject
34013411 return the long id of pObject
34023412end revTutorialReparentChild
34033413
3414+ command revTutorialStackNameChanged pOldName, pNewName
3415+ -- Update the tagged objects
3416+ repeat for each key tType in sTaggedObjects
3417+ repeat for each key tTag in sTaggedObjects [tType ]
3418+ replace "stack" && quote & pOldName & quote \
3419+ with "stack" && quote & pNewName & quote \
3420+ in sTaggedObjects [tType ][tTag ]
3421+ end repeat
3422+ end repeat
3423+
3424+ -- Update any wait state if we are waiting. Now that the tagged objects
3425+ -- are updated just call DoWait again with the current wait state.The
3426+ -- type/tag in the sWait array will resolve to the updated long ID
3427+ if sWait is not empty then
3428+ -- if new condition is immediately satisified (i.e. if we are waiting for a
3429+ -- stack name change) then sWaiting will still be false after revTutorialDoWait
3430+ put false into sWaiting
3431+ revTutorialDoWait sWait
3432+ if not sWaiting then
3433+ revTutorialWaitConditionSatisfied
3434+ end if
3435+ end if
3436+ end revTutorialStackNameChanged
3437+
34043438# Take a tutorial tagged object (an array with 'type' and 'tag' keys)
34053439# and return the corresponding long ID (or list of long IDs for 'set' types)
34063440function revTutorialResolveObjectToLongID pTaggedObject, pUpdate
0 commit comments