@@ -1571,6 +1571,17 @@ on revTutorialStartAtStep pCourse, pTutorial, pLesson, pLocation, pStepName
15711571 revTutorialStartWithState pStepName , sTaggedObjects
15721572end revTutorialStartAtStep
15731573
1574+ command revTutorialGoBackToSelectStep
1575+ // At the moment it should be a safe assumption that the relevant
1576+ // 'select' step is the previous one
1577+ local tPreviousStep
1578+ put revTutorialPreviousStep() into tPreviousStep
1579+ if sSteps [tPreviousStep ]["actions" ]["wait" ]["wait condition" ] is "state" and \
1580+ sSteps [tPreviousStep ]["actions" ]["wait" ]["state" ] is "selected" then
1581+ revTutorialGoBackToPreviousStep
1582+ end if
1583+ end revTutorialGoBackToSelectStep
1584+
15741585command revTutorialSkipCurrentStep
15751586 revTutorialSkipStep sStepName
15761587end revTutorialSkipCurrentStep
@@ -1686,7 +1697,7 @@ on revTutorialClearAllPalettes
16861697 end repeat
16871698end revTutorialClearAllPalettes
16881699
1689- on revTutorialContinue
1700+ on revTutorialContinue pBack
16901701 repeat forever
16911702 if sWaiting then
16921703 exit repeat
@@ -1698,7 +1709,7 @@ on revTutorialContinue
16981709 else if sSteps [sStepName ]["actions" ]["go" ] is empty then
16991710 revTutorialFinish
17001711 exit repeat
1701- else
1712+ else if not pBack then
17021713 // Otherwise we're here after a wait, so go to the next step
17031714 revTutorialExecuteAction sSteps [sStepName ]["actions" ]["go" ]
17041715 end if
@@ -1953,7 +1964,23 @@ end revTutorialCanSkipStep
19531964#
19541965# #############################################################################
19551966
1956- on revTutorialDoGoToStep pStep
1967+ local sPreviousStep
1968+ private function revTutorialPreviousStep
1969+ return sPreviousStep
1970+ end revTutorialPreviousStep
1971+
1972+ command revTutorialGoBackToPreviousStep
1973+ if sPreviousStep is empty then
1974+ exit revTutorialGoBackToPreviousStep
1975+ end if
1976+ revTutorialDoGoToStep sPreviousStep , true
1977+ send "revTutorialContinue true" to stack "revTutorial" in 0 millisecs
1978+ end revTutorialGoBackToPreviousStep
1979+
1980+ on revTutorialDoGoToStep pStep, pBack
1981+ if not pBack then
1982+ put sStepName into sPreviousStep
1983+ end if
19571984 revTutorialInitialiseStep
19581985 revTutorialClearHighlights
19591986 revTutorialClearGuides
@@ -2184,6 +2211,7 @@ on revTutorialWaitUntilThereIsAPaletteForObject pPalette
21842211 revIDEHighlightPaletteObject "menubar" , "standard"
21852212 revIDESubscribe "ideEditScript"
21862213 end if
2214+ revIDESubscribe "ideSelectedObjectChanged"
21872215end revTutorialWaitUntilThereIsAPaletteForObject
21882216
21892217on revTutorialWaitUntilTheToolIs
@@ -2549,6 +2577,20 @@ end revTutorialReShow
25492577
25502578on ideActiveStacksChanged
25512579 revTutorialReShow
2580+
2581+ local tObject
2582+ put revIDESelectedObjects() into tObject
2583+ if sWait ["wait condition" ] is "there is a palette for object" then
2584+ -- If the object became deselected, go back a step
2585+ if not revTutorialObjectIsTaggedObject(tObject , sWait ["object" ]) then
2586+ revTutorialGoBackToSelectStep
2587+ end if
2588+ else if sWait ["wait condition" ] is "state" and sWait ["state" ] is "selected" then
2589+ if revTutorialObjectIsTaggedObject(tObject , sWait ["object" ]) then
2590+ revIDEUnsubscribe "ideSelectedObjectChanged"
2591+ revTutorialWaitConditionSatisfied
2592+ end if
2593+ end if
25522594end ideActiveStacksChanged
25532595
25542596on ideCloseStackRequest pStack
@@ -2780,19 +2822,26 @@ on ideMouseDoubleUp pWhich, pTarget
27802822end ideMouseDoubleUp
27812823
27822824on ideSelectedObjectChanged
2825+ local tObject
2826+ put revIDESelectedObjects() into tObject
27832827 if sWait ["wait condition" ] is "state" and sWait ["state" ] is "selected" then
2784- local tObject
2785- put revIDESelectedObjects() into tObject
27862828 if revTutorialObjectIsTaggedObject(tObject , sWait ["object" ]) then
2829+ revIDEUnsubscribe "ideSelectedObjectChanged"
27872830 revTutorialWaitConditionSatisfied
27882831 end if
2832+ else if sWait ["wait condition" ] is "there is a palette for object" then
2833+ -- If the object became deselected, go back a step
2834+ if not revTutorialObjectIsTaggedObject(tObject , sWait ["object" ]) then
2835+ revTutorialGoBackToSelectStep
2836+ end if
27892837 end if
27902838end ideSelectedObjectChanged
27912839
27922840on ideInspectObjects pObjects
27932841 if sWait ["wait condition" ] is "there is a palette for object" and sWait ["palette" ] is "inspector" then
27942842 if revTutorialObjectIsTaggedObject(pObjects , sWait ["object" ]) then
27952843 revIDEUnsubscribe "ideInspectObjects"
2844+ revIDEUnsubscribe "ideSelectedObjectChanged"
27962845 put pObjects into sLastObjects [sWait ["palette" ]]
27972846 revTutorialWaitConditionSatisfied
27982847 end if
@@ -2803,6 +2852,7 @@ on ideEditScript pObject
28032852 if sWait ["wait condition" ] is "there is a palette for object" and sWait ["palette" ] is "script editor" then
28042853 if revTutorialObjectIsTaggedObject(the long id of pObject , sWait ["object" ]) then
28052854 revIDEUnsubscribe "ideEditScript"
2855+ revIDEUnsubscribe "ideSelectedObjectChanged"
28062856 put pObject into sLastObjects [sWait ["palette" ]]
28072857 revTutorialWaitConditionSatisfied
28082858 end if
0 commit comments