home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 5 / CD-ROM Today - The Disc (Issue 5)(November 1994).ISO / mac / TrekDemo / TrekForMac / PROTOX9B.mac / 00410.ls < prev    next >
Encoding:
Text File  |  1994-09-21  |  15.5 KB  |  746 lines

  1. on startMovie
  2.   global qtSprite, firsttime, detectOK, gospot
  3.   put "AT startmovie"
  4.   set qtSprite to 16
  5.   set firsttime to 1
  6.   set detectOK to 1
  7.   set gospot to 0
  8.   getready()
  9.   morestarters()
  10.   put "Finished with startmovie"
  11. end
  12.  
  13. on getready
  14.   global allowclick
  15.   put "AT getready"
  16.   cursor(209)
  17.   set allowclick to 1
  18. end
  19.  
  20. on waitforQT x
  21.   global qtSprite
  22.   set n to the movieTime of sprite qtSprite / 60
  23.   if n >= x then
  24.     go(the frame + 1)
  25.   else
  26.     holding()
  27.   end if
  28. end
  29.  
  30. on waitforend
  31.   global qtSprite
  32.   set x to the duration of cast the castNum of sprite qtSprite
  33.   set n to the movieTime of sprite qtSprite
  34.   if n >= x then
  35.     go(the frame + 1)
  36.   else
  37.     holding()
  38.   end if
  39. end
  40.  
  41. on beginsegtime
  42.   global inittime
  43.   set inittime to the ticks
  44.   unLoad()
  45. end
  46.  
  47. on count x
  48.   global inittime
  49.   if the ticks > (inittime + (x * 60)) then
  50.     go(the frame + 1)
  51.   else
  52.     holding()
  53.   end if
  54. end
  55.  
  56. on holduntil x
  57.   global inittime
  58.   whatcurs()
  59.   if the soundBusy of 1 then
  60.     if the ticks > (inittime + (x * 60)) then
  61.       go(the frame + 1)
  62.     else
  63.       holding()
  64.     end if
  65.   end if
  66. end
  67.  
  68. on presetQT fr
  69.   global qtSprite
  70.   set the movieTime of sprite qtSprite to fr
  71.   set the movieRate of sprite qtSprite to 0
  72. end
  73.  
  74. on playQT
  75.   global qtSprite
  76.   set the movieRate of sprite qtSprite to 1
  77. end
  78.  
  79. on playQTuntil nn
  80.   global qtSprite
  81.   set the movieRate of sprite qtSprite to 1
  82.   set the stopTime of sprite qtSprite to nn
  83. end
  84.  
  85. on initQTmousecoords Vcor, Hcor
  86.   global SH, SV, BH, BV, HL, HR, Vu, Vd, qtSprite
  87.   put "AT initQTmousecoords"
  88.   set SH to the left of sprite qtSprite
  89.   set SV to the top of sprite qtSprite
  90.   set BV to the bottom of sprite qtSprite
  91.   set BH to the right of sprite qtSprite
  92.   set HL to SH + Hcor
  93.   set HR to BH - Hcor
  94.   set Vu to SV + Vcor
  95.   set Vd to BV - Vcor
  96. end
  97.  
  98. on cursover
  99.   global Xguy, Yang, SH, SV, BH, BV, HL, HR, Vu, Vd
  100.   set MH to the mouseH
  101.   set MV to the mouseV
  102.   if MH < HL then
  103.     if MV < Vu then
  104.       showNW()
  105.     end if
  106.     if MV > Vd then
  107.       showSW()
  108.     end if
  109.     if (MV > Vu) and (MV < Vd) then
  110.       showLEFT()
  111.     end if
  112.   end if
  113.   if MH > HR then
  114.     if MV < Vu then
  115.       showNE()
  116.     end if
  117.     if MV > Vd then
  118.       showSE()
  119.     end if
  120.     if (MV > Vu) and (MV < Vd) then
  121.       showRIGHT()
  122.     end if
  123.   end if
  124.   if (MH > HL) and (MH < HR) then
  125.     if MV < Vu then
  126.       showUP()
  127.     end if
  128.     if MV > Vd then
  129.       showDOWN()
  130.     end if
  131.     if (MV > Vu) and (MV < Vd) then
  132.       cursor(209)
  133.     end if
  134.   end if
  135. end
  136.  
  137. on whatcursqtPan
  138.   global sndlvl
  139.   set nameodacm to the mouseCast
  140.   if nameodacm = -1 then
  141.     exit
  142.   end if
  143.   if (nameodacm >= 1) and (nameodacm <= 999) then
  144.     if the name of cast nameodacm starts "Bullet" then
  145.       if the mouseUp then
  146.         cursor(128)
  147.       else
  148.         cursor(136)
  149.       end if
  150.     else
  151.       if the name of cast nameodacm starts "QT" then
  152.         cursover()
  153.       else
  154.         if the name of cast nameodacm = "Ahead" then
  155.           if the mouseUp then
  156.             cursor(132)
  157.           else
  158.             cursor(133)
  159.           end if
  160.         else
  161.           if the name of cast nameodacm = "Reverse" then
  162.             if the mouseUp then
  163.               cursor(130)
  164.             else
  165.               cursor(131)
  166.             end if
  167.           else
  168.             if the name of cast nameodacm = "PathZone" then
  169.               if the mouseUp then
  170.                 if char the mouseChar of field "PathZone" <> RETURN then
  171.                   cursor(128)
  172.                 else
  173.                   cursor(209)
  174.                 end if
  175.               else
  176.                 cursor(136)
  177.               end if
  178.             else
  179.               cursor(209)
  180.             end if
  181.           end if
  182.         end if
  183.       end if
  184.     end if
  185.   end if
  186. end
  187.  
  188. on showUP
  189.   if the mouseUp then
  190.     cursor(206)
  191.   else
  192.     cursor(205)
  193.     GoUp()
  194.   end if
  195. end
  196.  
  197. on showDOWN
  198.   if the mouseUp then
  199.     cursor(202)
  200.   else
  201.     cursor(204)
  202.     GoDown()
  203.   end if
  204. end
  205.  
  206. on showLEFT
  207.   if the mouseUp then
  208.     cursor(196)
  209.   else
  210.     cursor(199)
  211.     GoLeft()
  212.   end if
  213. end
  214.  
  215. on showRIGHT
  216.   if the mouseUp then
  217.     cursor(190)
  218.   else
  219.     cursor(193)
  220.     GoRight()
  221.   end if
  222. end
  223.  
  224. on showNW
  225.   if the mouseUp then
  226.     cursor(144)
  227.   else
  228.     cursor(145)
  229.     GoNW()
  230.   end if
  231. end
  232.  
  233. on showSW
  234.   if the mouseUp then
  235.     cursor(146)
  236.   else
  237.     cursor(147)
  238.     GoSW()
  239.   end if
  240. end
  241.  
  242. on showNE
  243.   if the mouseUp then
  244.     cursor(142)
  245.   else
  246.     cursor(143)
  247.     GoNE()
  248.   end if
  249. end
  250.  
  251. on showSE
  252.   if the mouseUp then
  253.     cursor(140)
  254.   else
  255.     cursor(141)
  256.     GoSE()
  257.   end if
  258. end
  259.  
  260. on initQTselfRot xmax, ymax, ticked, sttick
  261.   global xtotal, ytotal, tperf, qtSprite, Xguy, Yang
  262.   put "AT initQTselfRot"
  263.   set xtotal to xmax - 1
  264.   set ytotal to ymax - 1
  265.   set tperf to ticked
  266.   set the movieRate of sprite qtSprite to 1
  267.   set the movieTime of sprite qtSprite to sttick
  268.   set Yang to ytotal / 3
  269.   set Xguy to 2
  270. end
  271.  
  272. on initQTrot xmax, ymax, ticked
  273.   global xtotal, ytotal, tperf, qtSprite, Xguy, Yang
  274.   put "AT initQTrot"
  275.   set xtotal to xmax - 1
  276.   set ytotal to ymax - 1
  277.   set tperf to ticked
  278.   set the movieRate of sprite qtSprite to 0
  279.   set Yang to ytotal / 3
  280.   set Xguy to 2
  281.   refresh()
  282. end
  283.  
  284. on alignQT x, y
  285.   global Xguy, Yang
  286.   set Xguy to x
  287.   set Yang to y
  288.   refresh()
  289. end
  290.  
  291. on GoRight
  292.   global Xguy, xtotal, qtSprite
  293.   if the movieRate of sprite qtSprite = 1 then
  294.     set the movieRate of sprite qtSprite to 0
  295.   end if
  296.   set Xguy to Xguy + 1
  297.   if Xguy > xtotal then
  298.     set Xguy to 0
  299.   end if
  300.   refresh()
  301. end
  302.  
  303. on GoLeft
  304.   global Xguy, xtotal, qtSprite
  305.   if the movieRate of sprite qtSprite = 1 then
  306.     set the movieRate of sprite qtSprite to 0
  307.   end if
  308.   set Xguy to Xguy - 1
  309.   if Xguy < 0 then
  310.     set Xguy to xtotal
  311.   end if
  312.   refresh()
  313. end
  314.  
  315. on GoDown
  316.   global Yang, ytotal, qtSprite
  317.   if the movieRate of sprite qtSprite = 1 then
  318.     set the movieRate of sprite qtSprite to 0
  319.   end if
  320.   set Yang to Yang + 1
  321.   if Yang > ytotal then
  322.     set Yang to ytotal
  323.   end if
  324.   refresh()
  325. end
  326.  
  327. on GoUp
  328.   global Yang, qtSprite
  329.   if the movieRate of sprite qtSprite = 1 then
  330.     set the movieRate of sprite qtSprite to 0
  331.   end if
  332.   set Yang to Yang - 1
  333.   if Yang < 0 then
  334.     set Yang to 0
  335.   end if
  336.   refresh()
  337. end
  338.  
  339. on GoNE
  340.   global Yang, Xguy, xtotal, qtSprite
  341.   if the movieRate of sprite qtSprite = 1 then
  342.     set the movieRate of sprite qtSprite to 0
  343.   end if
  344.   set Yang to Yang - 1
  345.   if Yang < 0 then
  346.     set Yang to 0
  347.   end if
  348.   set Xguy to Xguy + 1
  349.   if Xguy > xtotal then
  350.     set Xguy to 0
  351.   end if
  352.   refresh()
  353. end
  354.  
  355. on GoSE
  356.   global Yang, ytotal, Xguy, xtotal, qtSprite
  357.   if the movieRate of sprite qtSprite = 1 then
  358.     set the movieRate of sprite qtSprite to 0
  359.   end if
  360.   set Yang to Yang + 1
  361.   if Yang > ytotal then
  362.     set Yang to ytotal
  363.   end if
  364.   set Xguy to Xguy + 1
  365.   if Xguy > xtotal then
  366.     set Xguy to 0
  367.   end if
  368.   refresh()
  369. end
  370.  
  371. on GoNW
  372.   global Xguy, xtotal, Yang, qtSprite
  373.   if the movieRate of sprite qtSprite = 1 then
  374.     set the movieRate of sprite qtSprite to 0
  375.   end if
  376.   set Yang to Yang - 1
  377.   set Xguy to Xguy - 1
  378.   if Xguy < 0 then
  379.     set Xguy to xtotal
  380.   end if
  381.   if Yang < 0 then
  382.     set Yang to 0
  383.   end if
  384.   refresh()
  385. end
  386.  
  387. on GoSW
  388.   global Xguy, xtotal, Yang, ytotal, qtSprite
  389.   if the movieRate of sprite qtSprite = 1 then
  390.     set the movieRate of sprite qtSprite to 0
  391.   end if
  392.   set Yang to Yang + 1
  393.   set Xguy to Xguy - 1
  394.   if Xguy < 0 then
  395.     set Xguy to xtotal
  396.   end if
  397.   if Yang > ytotal then
  398.     set Yang to ytotal
  399.   end if
  400.   refresh()
  401. end
  402.  
  403. on refresh
  404.   global Xguy, Yang, tperf, xtotal, qtSprite
  405.   set temp to Xguy + (Yang * (xtotal + 1))
  406.   set the movieTime of sprite qtSprite to temp * tperf
  407. end
  408.  
  409. on spinguy
  410.   global gospot, xstop, ystop, lablname, Xguy, Yang, detectOK, xtotal, allowclick, tperf, qtSprite
  411.   if gospot then
  412.     set diffspot to Xguy - xstop
  413.     if abs(diffspot) > (xtotal / 2) then
  414.       set diffspot to -diffspot
  415.     end if
  416.     if diffspot > 0 then
  417.       GoLeft()
  418.     end if
  419.     if diffspot < 0 then
  420.       GoRight()
  421.     end if
  422.     if Yang > ystop then
  423.       GoUp()
  424.     end if
  425.     if Yang < ystop then
  426.       GoDown()
  427.     end if
  428.     if (Yang = ystop) and (Xguy = xstop) then
  429.       go(lablname)
  430.       set gospot to 0
  431.       set detectOK to 1
  432.       set allowclick to 1
  433.     end if
  434.   end if
  435. end
  436.  
  437. on rotme placename
  438.   global wherearewe, allowclick
  439.   set wherearewe to placename
  440.   spinguy()
  441.   go(the frame)
  442.   whatcursqtPan()
  443.   set allowclick to 1
  444. end
  445.  
  446. on goplace x, y, wh
  447.   global gospot, ystop, xstop, lablname, detectOK, allowclick
  448.   set allowclick to 0
  449.   set gospot to 1
  450.   set ystop to y
  451.   set xstop to x
  452.   set lablname to wh
  453.   set detectOK to 0
  454.   hearit("readout 2")
  455. end
  456.  
  457. on holding
  458.   global allowclick
  459.   set allowclick to 1
  460.   whatcurs()
  461.   go(the frame)
  462. end
  463.  
  464. on whatcurs
  465.   global sndlvl
  466.   set nameodacm to the mouseCast
  467.   if nameodacm = -1 then
  468.     exit
  469.   end if
  470.   if (nameodacm >= 1) and (nameodacm <= 999) then
  471.     if the name of cast nameodacm = "Bullet" then
  472.       if the mouseUp then
  473.         cursor(128)
  474.       else
  475.         cursor(136)
  476.       end if
  477.     else
  478.       if the name of cast nameodacm = "Ahead" then
  479.         if the mouseUp then
  480.           cursor(132)
  481.         else
  482.           cursor(133)
  483.         end if
  484.       else
  485.         if the name of cast nameodacm = "Reverse" then
  486.           if the mouseUp then
  487.             cursor(130)
  488.           else
  489.             cursor(131)
  490.           end if
  491.         else
  492.           if the name of cast nameodacm = "PathZone" then
  493.             if the mouseUp then
  494.               if char the mouseChar of field "PathZone" <> RETURN then
  495.                 cursor(128)
  496.               else
  497.                 cursor(209)
  498.               end if
  499.             else
  500.               cursor(136)
  501.             end if
  502.           else
  503.             if sndlvl then
  504.               set sndlvl to 0
  505.             else
  506.               cursor(209)
  507.             end if
  508.           end if
  509.         end if
  510.       end if
  511.     end if
  512.   end if
  513. end
  514.  
  515. on moveahead
  516.   global allowclick
  517.   if not allowclick then
  518.     exit
  519.   end if
  520.   cursor(209)
  521.   set allowclick to 0
  522.   go(marker(1))
  523. end
  524.  
  525. on movereverse
  526.   global allowclick
  527.   if not allowclick then
  528.     exit
  529.   end if
  530.   cursor(209)
  531.   set allowclick to 0
  532.   go(marker(0) - 2)
  533. end
  534.  
  535. on moverevTo nn
  536.   global allowclick
  537.   if not allowclick then
  538.     exit
  539.   end if
  540.   cursor(209)
  541.   set allowclick to 0
  542.   go(nn)
  543. end
  544.  
  545. on textclick ln1mrkr, lnBmrkr, lnCmrkr
  546.   if the mouseLine = 1 then
  547.     go(ln1mrkr)
  548.   end if
  549.   if the mouseLine = 2 then
  550.     go(lnBmrkr)
  551.   end if
  552.   if the mouseLine = 3 then
  553.     go(lnCmrkr)
  554.   end if
  555. end
  556.  
  557. on morestarters
  558.   global babbleOK, clickok, sndlvl, theTextSprite, scrollincrement
  559.   put "AT MoreStarters"
  560.   initJibberish()
  561.   set babbleOK to 1
  562.   set clickok to 1
  563.   set scrollincrement to 5
  564. end
  565.  
  566. on stopMovie
  567.   global theTextSprite
  568. end
  569.  
  570. on babbleOFF
  571.   global babbleOK
  572.   set babbleOK to 0
  573. end
  574.  
  575. on babbleON
  576.   global babbleOK
  577.   set babbleOK to 1
  578. end
  579.  
  580. on initJibberish
  581.   global babblelength, gobbledygook
  582.   set gobbledygook to "444┬╗ LocH:72464 LocV:43454 Deck 5-1655-0727 LCARS Index 5502 55696 Frame:30.38.5.03 313202 Access 701154 2"
  583.   set babblelength to length(gobbledygook)
  584.   put gobbledygook into field "infobabbleSQ"
  585.   put gobbledygook into field "infobabbleLN"
  586.   put gobbledygook into field "infobabbleLN2"
  587.   put "Finished with initjibberish"
  588. end
  589.  
  590. on blinker
  591.   global blinkstate
  592.   if blinkstate then
  593.     set the ink of sprite 15 to 33
  594.     set blinkstate to 0
  595.   else
  596.     set the ink of sprite 15 to 0
  597.     set blinkstate to 1
  598.   end if
  599.   updateStage()
  600. end
  601.  
  602. on jibberish
  603.   global babbleOK, babblelength, gobbledygook
  604.   if babbleOK then
  605.     set thetext to field "infobabbleSQ"
  606.     set seed to char babblelength of thetext
  607.     put " " into char babblelength of thetext
  608.     put seed before thetext
  609.     put thetext into field "infobabbleSQ"
  610.     put thetext into field "infobabbleLN"
  611.     put thetext into field "infobabbleLN2"
  612.     blinker()
  613.   end if
  614. end
  615.  
  616. on LoadText fileName, castholder
  617.   global theProblem
  618.   put "AT LoadText"
  619.   set TxtReader to FileIO(mnew, "read", the pathName & fileName)
  620.   if not objectp(TxtReader) then
  621.     set theProblem to string(TxtReader)
  622.     tellerror("Text:" && fileName)
  623.     exit
  624.   end if
  625.   set the text of cast castholder to TxtReader(mReadFile)
  626.   TxtReader(mdispose)
  627. end
  628.  
  629. on PrepTxtScroll srctxt, Lnsz, Lh, Lv
  630.   global currentTxtWind, stndbyTxtWind, maxLines, sourceText, linesize, wordsSprite, scrollBar
  631.   put "AT PrepTxtScroll"
  632.   puppetSound("readout 2")
  633.   set sourceText to srctxt
  634.   set linesize to Lnsz
  635.   set currentTxtWind to "TxtWinA" & string(linesize)
  636.   set stndbyTxtWind to "TxtWinB" & string(linesize)
  637.   set scrollBar to 17
  638.   PrepScrollArrows()
  639.   set wordsSprite to 18
  640.   puppetSprite(wordsSprite, 1)
  641.   set the castNum of sprite wordsSprite to the number of cast currentTxtWind
  642.   set the locH of sprite wordsSprite to Lh
  643.   set the locV of sprite wordsSprite to Lv
  644.   updateStage()
  645.   FillTextWindow(1)
  646.   set maxLines to the number of lines in field sourceText
  647.   puppetSound(0)
  648. end
  649.  
  650. on cleartxtpuppets
  651.   global wordsSprite, upArrSprite, dwnArrSprite
  652.   puppetSprite(upArrSprite, 0)
  653.   puppetSprite(dwnArrSprite, 0)
  654.   puppetSprite(wordsSprite, 0)
  655.   updateStage()
  656. end
  657.  
  658. on FillTextWindow firstLine
  659.   global topLineNow, currentTxtWind, stndbyTxtWind, linesize, sourceText
  660.   set topLineNow to firstLine
  661.   put " " into field currentTxtWind
  662.   repeat with n = 0 to linesize - 1
  663.     put line firstLine + n of field sourceText into line n + 1 of field currentTxtWind
  664.   end repeat
  665.   put field currentTxtWind into field stndbyTxtWind
  666. end
  667.  
  668. on PrepScrollArrows
  669.   global upArrSprite, dwnArrSprite, scrollBar
  670.   set upArrSprite to 19
  671.   set dwnArrSprite to 20
  672.   puppetSprite(upArrSprite, 1)
  673.   puppetSprite(dwnArrSprite, 1)
  674.   set the castNum of sprite upArrSprite to the number of cast "UpDullS"
  675.   set the locH of sprite upArrSprite to the locH of sprite scrollBar
  676.   set the locV of sprite upArrSprite to the locV of sprite scrollBar - 21
  677.   set the castNum of sprite dwnArrSprite to the number of cast "ButtonDownS"
  678.   set the locH of sprite dwnArrSprite to the locH of sprite scrollBar
  679.   set the locV of sprite dwnArrSprite to the locV of sprite scrollBar + 21
  680.   updateStage()
  681. end
  682.  
  683. on shuffleUp
  684.   global topLineNow, currentTxtWind, stndbyTxtWind, maxLines, sourceText, linesize
  685.   if topLineNow > (maxLines - linesize) then
  686.     CheckScrollPos()
  687.     return 
  688.   end if
  689.   set start to topLineNow
  690.   repeat with n = 1 to linesize
  691.     put line start + n of field sourceText into line n of field stndbyTxtWind
  692.   end repeat
  693.   SwapTxtWindows()
  694.   set topLineNow to start + 1
  695.   CheckScrollPos()
  696. end
  697.  
  698. on CheckScrollPos
  699.   global topLineNow, maxLines, upArrSprite, dwnArrSprite, linesize
  700.   if topLineNow > (maxLines - linesize) then
  701.     set the castNum of sprite dwnArrSprite to the number of cast "DownDullS"
  702.     updateStage()
  703.   else
  704.     set the castNum of sprite dwnArrSprite to the number of cast "ButtonDownS"
  705.     updateStage()
  706.     if topLineNow < 1 then
  707.       set the castNum of sprite upArrSprite to the number of cast "UpDullS"
  708.       updateStage()
  709.     else
  710.       set the castNum of sprite upArrSprite to the number of cast "ButtonUpS"
  711.       updateStage()
  712.     end if
  713.   end if
  714. end
  715.  
  716. on shuffleDown
  717.   global topLineNow, currentTxtWind, stndbyTxtWind, sourceText, linesize
  718.   if topLineNow < 1 then
  719.     CheckScrollPos()
  720.     return 
  721.   end if
  722.   set k to -1
  723.   set start to topLineNow
  724.   repeat with n = 1 to linesize
  725.     put line start + k + n of field sourceText into line n of field stndbyTxtWind
  726.   end repeat
  727.   SwapTxtWindows()
  728.   set topLineNow to start + k
  729.   CheckScrollPos()
  730. end
  731.  
  732. on SwapTxtWindows
  733.   global currentTxtWind, stndbyTxtWind, wordsSprite, linesize
  734.   puppetSound("Chirlip 1")
  735.   if currentTxtWind = ("TxtWinA" & string(linesize)) then
  736.     set currentTxtWind to "TxtWinB" & string(linesize)
  737.     set stndbyTxtWind to "TxtWinA" & string(linesize)
  738.   else
  739.     set currentTxtWind to "TxtWinA" & string(linesize)
  740.     set stndbyTxtWind to "TxtWinB" & string(linesize)
  741.   end if
  742.   set the castNum of sprite wordsSprite to the number of cast currentTxtWind
  743.   updateStage()
  744.   puppetSound(0)
  745. end
  746.