home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 February / WPCFEB97.ISO / multi / times / data / shared.dir / 00991.ls < prev    next >
Encoding:
Text File  |  1996-08-11  |  14.8 KB  |  513 lines

  1. on startMovie
  2.   global blockPos, overLay, moviesList, frameList, choiceMade, CRLF
  3.   set the exitLock to 1
  4.   set the keyDownScript to "quitcheck"
  5.   set CRLF to RETURN & numToChar(10)
  6.   set choiceMade to 0
  7.   set frameList to "pre71,72-75,76-79,80-83,84-87,88-91,92-95"
  8.   set moviesList to "air.dir,land.dir,water.dir,animals.dir,people.dir,energy.dir,response.dir,dev.dir"
  9.   set blockPos to "27,139,249,361"
  10.   set overLay to "966,967,968,969"
  11.   repeat with n = 1 to 8
  12.     if the movieName = item n of moviesList then
  13.       setVari(string(the movieName))
  14.     end if
  15.   end repeat
  16. end
  17.  
  18. on quitCheck
  19.   global moviesList
  20.   set shortCutMovies to "NMM.dir,choice.dir,intro.dir,credits.dir"
  21.   set theKeysList to "L,S,P,B,Q,A,I,N,K,H"
  22.   set allowKey to 0
  23.   repeat with n = 1 to 10
  24.     if the controlDown and (the key = item n of theKeysList) then
  25.       set allowKey to 1
  26.       exit repeat
  27.     end if
  28.   end repeat
  29.   if allowKey = 0 then
  30.     exit
  31.   else
  32.     if the controlDown and (the key = "Q") then
  33.       doQuit()
  34.     end if
  35.     set allowShortCut to 1
  36.     repeat with n = 1 to the number of items in shortCutMovies
  37.       if the movieName = item n of shortCutMovies then
  38.         set allowShortCut to 0
  39.       end if
  40.     end repeat
  41.     if allowShortCut = 1 then
  42.       if the controlDown and (the key = "L") then
  43.         doLoadSess()
  44.       end if
  45.       if the controlDown and (the key = "S") then
  46.         doSaveSess()
  47.       end if
  48.       if the controlDown and (the key = "P") then
  49.         doPrintScr()
  50.       end if
  51.       if the controlDown and (the key = "B") then
  52.         doPrevScr()
  53.       end if
  54.       if the controlDown and (the key = "A") then
  55.         doArtMenu()
  56.       end if
  57.       if the controlDown and (the key = "I") then
  58.         doImgMenu()
  59.       end if
  60.       if the controlDown and (the key = "N") then
  61.         notepadOpen()
  62.       end if
  63.       if the controlDown and (the key = "K") then
  64.         keywordOpen()
  65.       end if
  66.       if the controlDown and (the key = "H") then
  67.         helpOpen()
  68.       end if
  69.     end if
  70.   end if
  71. end
  72.  
  73. on setVari subject
  74.   global theSection, theSectionT, theSLine, lineheight, spHoriz, spVert, col1amount, col2amount, col1width, col2width, theimageLink, mapLinePos
  75.   set the ink of sprite 44 to 36
  76.   set theSection to 1
  77.   set theSectionT to 1
  78.   set theSLine to 1
  79.   set lineheight to 20
  80.   set spHoriz to 132
  81.   set spVert to 74
  82.   set theimageLink to field "imageLink"
  83.   if subject = "air.dir" then
  84.     set mapLinePos to 75
  85.     set col1amount to 7
  86.     set col2amount to 4
  87.     set col1width to 178
  88.     set col2width to 142
  89.   end if
  90.   if subject = "land.dir" then
  91.     set mapLinePos to 93
  92.     set col1amount to 8
  93.     set col2amount to 6
  94.     set col1width to 147
  95.     set col2width to 173
  96.   end if
  97.   if subject = "water.dir" then
  98.     set mapLinePos to 111
  99.     set col1amount to 6
  100.     set col2amount to 8
  101.     set col1width to 168
  102.     set col2width to 152
  103.   end if
  104.   if subject = "animals.dir" then
  105.     set mapLinePos to 129
  106.     set col1amount to 5
  107.     set col2amount to 4
  108.     set col1width to 186
  109.     set col2width to 134
  110.   end if
  111.   if subject = "people.dir" then
  112.     set mapLinePos to 147
  113.     set col1amount to 5
  114.     set col2amount to 0
  115.     set col1width to 154
  116.     set col2width to 166
  117.   end if
  118.   if subject = "energy.dir" then
  119.     set mapLinePos to 165
  120.     set col1amount to 6
  121.     set col2amount to 7
  122.     set col1width to 145
  123.     set col2width to 175
  124.   end if
  125.   if subject = "response.dir" then
  126.     set mapLinePos to 183
  127.     set col1amount to 7
  128.     set col2amount to 3
  129.     set col1width to 181
  130.     set col2width to 139
  131.   end if
  132.   if subject = "dev.dir" then
  133.     set mapLinePos to 201
  134.     set col1amount to 6
  135.     set col2amount to 0
  136.     set col1width to 196
  137.     set col2width to 124
  138.   end if
  139. end
  140.  
  141. on createLocationPhoto
  142.   global theImage
  143.   if char 10 of item 1 of theImage = "p" then
  144.     if the number of items in theImage = 1 then
  145.       put "," & the frame - 1 after theImage
  146.       put "," & the movieName after theImage
  147.     end if
  148.   end if
  149. end
  150.  
  151. on clearLists
  152.   global choiceMade
  153.   set the foreColor of field 971 to 255
  154.   set the foreColor of field 973 to 255
  155.   set the castNum of sprite 29 to 36
  156.   setOffStage("20,21,23,24,25,31,33,34,43,44,45,46")
  157.   if choiceMade = 1 then
  158.     if the frame = 1 then
  159.       set the castNum of sprite 35 to 977
  160.     else
  161.       set the castNum of sprite 35 to 978
  162.     end if
  163.     set the blend of sprite 44 to 100
  164.     set the castNum of sprite 40 to 17
  165.     set the locH of sprite 35 to 454
  166.     set the locV of sprite 35 to 72
  167.     set the locV of sprite 32 to 42
  168.     set the castNum of sprite 29 to 36
  169.   else
  170.     set the castNum of sprite 40 to 39
  171.   end if
  172.   updateStage()
  173. end
  174.  
  175. on createPath folder, fileName
  176.   set delimiter to "\"
  177.   set fullPath to the pathName & char 2 of fileName & folder & delimiter & fileName
  178.   return fullPath
  179. end
  180.  
  181. on MMopen
  182.   set the castNum of sprite 44 to 980
  183.   set the locH of sprite 44 to 0
  184.   set the locV of sprite 44 to 75
  185. end
  186.  
  187. on setDelimOn
  188.   set the itemDelimiter to ">"
  189. end
  190.  
  191. on setDelimOff
  192.   set the itemDelimiter to ","
  193. end
  194.  
  195. on setPuppets start, end, boolVal
  196.   repeat with channel = start to end
  197.     puppetSprite(channel, boolVal)
  198.   end repeat
  199. end
  200.  
  201. on setOffStage whichSprite
  202.   repeat with n = 1 to the number of items in whichSprite
  203.     set the locH of sprite value(item n of whichSprite) to -20000
  204.   end repeat
  205. end
  206.  
  207. on setTopicField
  208.   set the textSize of field "topicHead" to 9
  209.   set the textHeight of field "topicHead" to 14
  210.   set the textFont of field "topicHead" to "geneva"
  211.   set the foreColor of cast "topicHead" to 32
  212. end
  213.  
  214. on photoLinkCheck
  215.   global theSection, theimageLink, choiceMade
  216.   if choiceMade = 1 then
  217.     repeat with n = 2 to 12
  218.       if the castNum of sprite n <> 0 then
  219.         puppetSprite(n, 1)
  220.         repeat with i = 1 to the number of items in line value(theSection) of theimageLink
  221.           if item i of line theSection of theimageLink = the name of cast the castNum of sprite n then
  222.             set the castNum of sprite n to the castNum of sprite n + 60
  223.           end if
  224.         end repeat
  225.       end if
  226.     end repeat
  227.   end if
  228. end
  229.  
  230. on photoLinkCheckOff
  231.   repeat with n = 2 to 12
  232.     if the castNum of sprite n <> 0 then
  233.       if (the castNum of sprite n > 310) and (the castNum of sprite n < 820) then
  234.         puppetSprite(n, 1)
  235.         set the castNum of sprite n to the castNum of sprite n - 60
  236.       end if
  237.     end if
  238.   end repeat
  239. end
  240.  
  241. on moveGreenBlockOff whblock
  242.   repeat with n = 1 to the number of items in whblock
  243.     set the locV of sprite (value(item n of whblock) + 34) to -2000
  244.   end repeat
  245. end
  246.  
  247. on moveGreenBlockOn whblock
  248.   repeat with n = 1 to the number of items in whblock
  249.     set the locV of sprite (value(item n of whblock) + 34) to 110
  250.   end repeat
  251. end
  252.  
  253. on setGreenLine start, end
  254.   set linepos to "-10,32,150,267,385,460,505,650"
  255.   spriteBox(34, value(item start of linepos), 116, value(item end of linepos), 118)
  256. end
  257.  
  258. on doPrintScr
  259.   global theCaption
  260.   openXLib("Pmatic.dll")
  261.   set printTemp to "┬⌐ 1996 News Multimedia Ltd"
  262.   if objectp(myPrinter) then
  263.     myPrinter(mdispose)
  264.   end if
  265.   set myPrinter to PrintOMatic(mnew)
  266.   if objectp(myPrinter) then
  267.     myPrinter(mRegister, "PMAT130-221-01294")
  268.     myPrinter(mSetProgressMsg, "Now printing from Planet Earth...")
  269.     myPrinter(mSetDocumentName, "Planet Earth Screen")
  270.     myPrinter(mReset)
  271.     myPrinter(mSetMargins, 50, 50, 50, 50)
  272.     myPrinter(mSetTextFont, "times")
  273.     myPrinter(mSetTextSize, 12)
  274.     myPrinter(mNewPage)
  275.     myPrinter(mDrawText, printTemp, 0, 440)
  276.     myPrinter(mStagePicture, 0, 40, 480, 480)
  277.     if myPrinter(mDoJobSetup) = 1 then
  278.       myPrinter(mPrint)
  279.     else
  280.       exit
  281.     end if
  282.   else
  283.     alert("Sorry there is a printing problem")
  284.   end if
  285.   if objectp(myPrinter) then
  286.     myPrinter(mdispose)
  287.   end if
  288. end
  289.  
  290. on doSaveSess
  291.   global prevList, theImage, theImageList, theArticle, theArticleList, toolWindow, CRLF
  292.   set theSess to "Planet Earth Session File 412370098747357" & CRLF
  293.   put "<theImageVar>" & CRLF after theSess
  294.   if voidp(theImage) = 1 then
  295.     put "Void" & CRLF after theSess
  296.   else
  297.     put theImage & CRLF after theSess
  298.   end if
  299.   put "<theImageListVar>" & CRLF after theSess
  300.   if voidp(theImageList) = 1 then
  301.     put "Void" & CRLF after theSess
  302.   else
  303.     put theImageList & CRLF after theSess
  304.   end if
  305.   put "<theArticleVar>" & CRLF after theSess
  306.   if voidp(theArticle) = 1 then
  307.     put "Void" & CRLF after theSess
  308.   else
  309.     put theArticle & CRLF after theSess
  310.   end if
  311.   put "<theArticleListVar>" & CRLF after theSess
  312.   if voidp(theArticleList) = 1 then
  313.     put "Void" & CRLF after theSess
  314.   else
  315.     put theArticleList & CRLF after theSess
  316.   end if
  317.   put "<notepadVar>" & CRLF after theSess
  318.   if objectp(toolWindow) then
  319.     tell toolWindow
  320.       if the text of field "noteField" = EMPTY then
  321.         put " " & CRLF after theSess
  322.       else
  323.         put the text of field "noteField" & CRLF after theSess
  324.       end if
  325.     end tell
  326.   end if
  327.   put "<theLastScreen>" & CRLF & line 1 of prevList & CRLF after theSess
  328.   put "<end>" after theSess
  329.   openXLib("fileio")
  330.   set thetextfile to FileIO(mnew, "?write", "Session1.txt")
  331.   if objectp(thetextfile) then
  332.     put thetextfile(mWriteString, theSess)
  333.     thetextfile(mdispose)
  334.     closeXLib("fileio")
  335.   else
  336.   end if
  337. end
  338.  
  339. on doLoadSess
  340.   global theImage, theImageList, theArticle, theArticleList, toolWindow, articleWindow, ImageWindow, whWindow
  341.   openXLib("fileio")
  342.   set thetextfile to FileIO(mnew, "?read", "TXT")
  343.   if objectp(thetextfile) then
  344.     set theSessIn to thetextfile(mReadFile)
  345.     thetextfile(mdispose)
  346.     closeXLib("fileio")
  347.     repeat with n = 1 to the number of chars in theSessIn
  348.       if charToNum(char n of theSessIn) = 10 then
  349.         delete char n of theSessIn
  350.       end if
  351.     end repeat
  352.     set theTagsList to EMPTY
  353.     if line 1 of theSessIn <> "Planet Earth Session File 412370098747357" then
  354.       alert("Sorry - this is not a valid session File")
  355.     else
  356.       repeat with n = 1 to the number of lines in theSessIn
  357.         if char 1 of line n of theSessIn = "<" then
  358.           put n & "," & line n of theSessIn & RETURN after theTagsList
  359.         end if
  360.       end repeat
  361.       set theImageTemp to line value(item 1 of line 1 of theTagsList) + 1 of theSessIn
  362.       if (theImageTemp = "Void") or (theImageTemp = EMPTY) then
  363.         nothing()
  364.       else
  365.         set theImage to theImageTemp
  366.       end if
  367.       set theImageListTemp to line value(item 1 of line 2 of theTagsList) + 1 to value(item 1 of line 3 of theTagsList) - 1 of theSessIn
  368.       if (theImageListTemp = "Void") or (theImageListTemp = EMPTY) then
  369.         nothing()
  370.       else
  371.         set theImageList to theImageListTemp
  372.         tell ImageWindow
  373.           if char 10 to 12 of theImage = "pct" then
  374.             set photoRect to rect(26, 40, 474, 396)
  375.             set the rect of ImageWindow to photoRect
  376.             setPuppets(1, 48, 0)
  377.             go(1)
  378.             set whWindow to "small"
  379.           else
  380.             set graphicRect to rect(10, 35, 618, 485)
  381.             set the rect of ImageWindow to graphicRect
  382.             setPuppets(1, 48, 0)
  383.             go("graphic")
  384.             set whWindow to "large"
  385.           end if
  386.         end tell
  387.       end if
  388.       set theArticleTemp to line value(item 1 of line 3 of theTagsList) + 1 of theSessIn
  389.       if (theArticleTemp = "Void") or (theArticleTemp = EMPTY) then
  390.         nothing()
  391.       else
  392.         set theArticle to theArticleTemp
  393.       end if
  394.       set theArticleListTemp to line value(item 1 of line 4 of theTagsList) + 1 to value(item 1 of line 5 of theTagsList) - 1 of theSessIn
  395.       if (theArticleListTemp = "Void") or (theArticleListTemp = EMPTY) then
  396.         nothing()
  397.       else
  398.         set theArticleList to theArticleListTemp
  399.         tell articleWindow
  400.           go(1)
  401.         end tell
  402.       end if
  403.       set noteTemp to line value(item 1 of line 5 of theTagsList) + 1 to value(item 1 of line 6 of theTagsList) - 1 of theSessIn
  404.       tell toolWindow
  405.         if noteTemp = "<theLastScreen>" then
  406.           set the text of field "noteField" to EMPTY
  407.         else
  408.           set the text of field "noteField" to noteTemp
  409.         end if
  410.       end tell
  411.       set lastscreenTemp to line value(item 1 of line 6 of theTagsList) + 1 to value(item 1 of line 7 of theTagsList) - 1 of theSessIn
  412.       puppetSprite(48, 1)
  413.       set the type of sprite 48 to 2
  414.       set the castNum of sprite 48 to 910
  415.       set the foreColor of sprite 48 to 255
  416.       spriteBox(48, 0, 0, 640, 480)
  417.       updateStage()
  418.       go(value(item 1 of lastscreenTemp), string(item 2 of lastscreenTemp))
  419.     end if
  420.   else
  421.   end if
  422. end
  423.  
  424. on doPrevScr
  425.   global prevList, choiceMade
  426.   tell the stage
  427.     if item 2 of line 2 of prevList = "choice.dir" then
  428.       clearAllWindows()
  429.     end if
  430.     if the movieName = item 2 of line 2 of prevList then
  431.       if the frame < 5 then
  432.         puppetSprite(48, 1)
  433.         set the type of sprite 48 to 2
  434.         set the castNum of sprite 48 to 910
  435.         set the foreColor of sprite 48 to 255
  436.         spriteBox(48, 0, 0, 640, 480)
  437.         updateStage()
  438.         if the locH of sprite 31 > 0 then
  439.           clearLists()
  440.         end if
  441.         if choiceMade = 0 then
  442.           set the castNum of sprite 40 to cast "sectionChoose"
  443.           setOffStage("35")
  444.         else
  445.           set the castNum of sprite 35 to 978
  446.         end if
  447.         setOffStage("25,34")
  448.         setOffStage("43")
  449.         setPuppets(1, 1, 0)
  450.         setPuppets(7, 13, 0)
  451.         setPuppets(26, 26, 0)
  452.         go(value(item 1 of line 2 of prevList))
  453.         setPuppets(15, 18, 1)
  454.         setPuppets(20, 21, 1)
  455.         setPuppets(23, 25, 1)
  456.         setPuppets(27, 35, 1)
  457.         setPuppets(40, 46, 1)
  458.         setOffStage("48")
  459.         setPuppets(48, 48, 0)
  460.         if choiceMade = 1 then
  461.           set the locH of sprite 35 to 454
  462.           set the locV of sprite 35 to 72
  463.           set the castNum of sprite 35 to 978
  464.         end if
  465.       else
  466.         setPuppets(1, 48, 0)
  467.         set choiceMade to 0
  468.         go(value(item 1 of line 2 of prevList))
  469.       end if
  470.     else
  471.       puppetSprite(48, 1)
  472.       set the type of sprite 48 to 2
  473.       set the castNum of sprite 48 to 910
  474.       set the foreColor of sprite 48 to 255
  475.       spriteBox(48, 0, 0, 640, 480)
  476.       updateStage()
  477.       if the movieName = "topLevel.dir" then
  478.         go(value(item 1 of line 2 of prevList), string(item 2 of line 2 of prevList))
  479.         setOffStage("48")
  480.         setPuppets(48, 48, 0)
  481.       end if
  482.       go(value(item 1 of line 2 of prevList), string(item 2 of line 2 of prevList))
  483.     end if
  484.     if the number of lines in prevList > 4 then
  485.       delete line 5 to the number of lines in prevList of prevList
  486.     end if
  487.   end tell
  488. end
  489.  
  490. on doQuit
  491.   global toolWindow, articleWindow, ImageWindow
  492.   sound stop 1
  493.   sound stop 2
  494.   puppetSprite(48, 1)
  495.   set the type of sprite 48 to 2
  496.   set the castNum of sprite 48 to 910
  497.   set the foreColor of sprite 48 to 255
  498.   spriteBox(48, 0, 0, 640, 480)
  499.   updateStage()
  500.   if objectp(ImageWindow) then
  501.     set the visible of ImageWindow to 0
  502.   end if
  503.   if objectp(articleWindow) then
  504.     set the visible of articleWindow to 0
  505.   end if
  506.   if objectp(toolWindow) then
  507.     set the visible of toolWindow to 0
  508.   end if
  509.   tell the stage
  510.     go(1, "credits")
  511.   end tell
  512. end
  513.