home *** CD-ROM | disk | FTP | other *** search
/ Mac Ga Ichiban! 1996 October / macgaichiban199610.bin / MOVIES / RINKAI.Dxr / 00016.ls < prev    next >
Encoding:
Text File  |  1996-08-14  |  9.9 KB  |  357 lines

  1. on startMovie
  2.   global gPanoMovieID, gNavMovieID, gLastTimeRollover, gPanoFrame
  3.   set gPanoMovieID to EMPTY
  4.   set gNavMovieID to EMPTY
  5.   set gLastTimeRollover to 0
  6.   set gPanoFrame to EMPTY
  7.   openXLib("QuickTime VR XCMDs")
  8.   RegisterComponent(the pathName & "QuickTime VR Components", EMPTY)
  9.   initdata()
  10. end
  11.  
  12. on stopMovie
  13.   global glastmoviename
  14.   ClosePanoMovie()
  15.   CloseNavMovie()
  16.   cursor(0)
  17.   closeXLib("QuickTime VR XCMDs")
  18.   clearGlobals()
  19.   set glastmoviename to the movieName
  20. end
  21.  
  22. on OpenNavMovie pFilename, pSpriteNum, pShowOnOpen
  23.   global gNavMovieID
  24.   CloseNavMovie()
  25.   set tFileName to the pathName & pFilename
  26.   set gNavMovieID to NavMovie("openMovie", "Direct", tFileName, the left of sprite pSpriteNum & "," & the top of sprite pSpriteNum, "ShowPoster", "Invisible")
  27.   if gNavMovieID contains "error" then
  28.     put gNavMovieID
  29.     set gNavMovieID to EMPTY
  30.     beep()
  31.     exit
  32.   end if
  33.   if pShowOnOpen then
  34.     NavMovie("Direct", gNavMovieID, "update")
  35.   end if
  36. end
  37.  
  38. on ShowNavMovie
  39.   global gNavMovieID
  40.   if gNavMovieID <> EMPTY then
  41.     NavMovie("Direct", gNavMovieID, "update")
  42.   end if
  43. end
  44.  
  45. on SetNavMovieView pHPan, pVPan
  46.   global gNavMovieID
  47.   if gNavMovieID <> EMPTY then
  48.     NavMovie("Direct", gNavMovieID, "set", "hPanAngle", pHPan)
  49.     NavMovie("Direct", gNavMovieID, "set", "vPanAngle", pVPan)
  50.   end if
  51. end
  52.  
  53. on CloseNavMovie
  54.   global gNavMovieID
  55.   if gNavMovieID <> EMPTY then
  56.     NavMovie("Direct", gNavMovieID, "dispose")
  57.     set gNavMovieID to EMPTY
  58.   end if
  59. end
  60.  
  61. on NavFrameScript pSpriteNum
  62.   global gNavMovieID
  63.   if (gNavMovieID <> EMPTY) and (RunningInForeground() = "true") then
  64.     if rollOver(pSpriteNum) then
  65.       NavMovie("Direct", gNavMovieID, "mouseOver")
  66.       cursor(200)
  67.       cursor(0)
  68.     else
  69.       NavMovie("Direct", gNavMovieID, "idle")
  70.     end if
  71.   end if
  72. end
  73.  
  74. on OpenPanoMovie pFilename, pSpriteNum, pShowOnOpen
  75.   global gPanoMovieID
  76.   ClosePanoMovie()
  77.   set tPanoRect to the left of sprite pSpriteNum & "," & the top of sprite pSpriteNum & "," & the right of sprite pSpriteNum & "," & the bottom of sprite pSpriteNum
  78.   set tFileName to the pathName & pFilename
  79.   set gPanoMovieID to PanoMovie("openMovie", "Direct", tFileName, tPanoRect)
  80.   if gPanoMovieID contains "error" then
  81.     put gPanoMovieID
  82.     set gPanoMovieID to EMPTY
  83.     beep()
  84.     exit
  85.   end if
  86.   PanoMovie("Direct", gPanoMovieID, "set", "warpMode", 2)
  87. end
  88.  
  89. on InitPanoCallbacks
  90.   global gPanoMovieID
  91.   if gPanoMovieID <> EMPTY then
  92.     PanoMovie("Direct", gPanoMovieID, "set", "mouseOverHandler", EMPTY)
  93.     PanoMovie("Direct", gPanoMovieID, "set", "rolloverHotSpotHandler", EMPTY)
  94.     PanoMovie("Direct", gPanoMovieID, "set", "mouseDownHandler", EMPTY)
  95.     PanoMovie("Direct", gPanoMovieID, "set", "panZoomStartHandler", EMPTY)
  96.     PanoMovie("Direct", gPanoMovieID, "set", "mouseStillDownHandler", EMPTY)
  97.     PanoMovie("Direct", gPanoMovieID, "set", "nodeLeaveHandler", EMPTY)
  98.   end if
  99. end
  100.  
  101. on ShowPanoMovie pQuality
  102.   global gPanoMovieID
  103.   if gPanoMovieID <> EMPTY then
  104.     if not voidp(pQuality) then
  105.       PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
  106.     end if
  107.     PanoMovie("Direct", gPanoMovieID, "update")
  108.   end if
  109. end
  110.  
  111. on SetPanoNode pNodeID, pUpdate, pQuality
  112.   global gPanoMovieID
  113.   if gPanoMovieID <> EMPTY then
  114.     PanoMovie("Direct", gPanoMovieID, "set", "nodeID", pNodeID)
  115.     if not voidp(pQuality) then
  116.       PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
  117.     end if
  118.     if pUpdate then
  119.       PanoMovie("Direct", gPanoMovieID, "Update")
  120.     end if
  121.   end if
  122. end
  123.  
  124. on SwingPanoMovie pHPan, pVPan, pZoom, pSwingSpeed, pSwingQuality, pFinalQuality
  125.   global gPanoMovieID
  126.   if gPanoMovieID <> EMPTY then
  127.     PanoMovie("Direct", gPanoMovieID, "set", "zoomAngle", pZoom)
  128.     PanoMovie("Direct", gPanoMovieID, "set", "vPanAngle", pVPan)
  129.     PanoMovie("Direct", gPanoMovieID, "set", "hPanAngle", pHPan)
  130.     PanoMovie("Direct", gPanoMovieID, "set", "quality", pSwingQuality)
  131.     PanoMovie("Direct", gPanoMovieID, "set", "transitionMode", "swing")
  132.     PanoMovie("Direct", gPanoMovieID, "set", "transitionSpeed", pSwingSpeed)
  133.     PanoMovie("Direct", gPanoMovieID, "update")
  134.     PanoMovie("Direct", gPanoMovieID, "set", "transitionMode", "normal")
  135.     if pFinalQuality <> pSwingQuality then
  136.       PanoMovie("Direct", gPanoMovieID, "set", "quality", pFinalQuality)
  137.       PanoMovie("Direct", gPanoMovieID, "update")
  138.     end if
  139.   end if
  140. end
  141.  
  142. on CollapsePanoMovie
  143.   global gPanoMovieID
  144.   if gPanoMovieID <> EMPTY then
  145.     PanoMovie("Direct", gPanoMovieID, "CollapseToHotSpotRgn")
  146.   end if
  147. end
  148.  
  149. on SetPanoMovieView pHPan, pVPan, pZoom, pQuality
  150.   global gPanoMovieID
  151.   if gPanoMovieID <> EMPTY then
  152.     PanoMovie("Direct", gPanoMovieID, "set", "zoomAngle", pZoom)
  153.     PanoMovie("Direct", gPanoMovieID, "set", "vPanAngle", pVPan)
  154.     PanoMovie("Direct", gPanoMovieID, "set", "hPanAngle", pHPan)
  155.     if not voidp(pQuality) then
  156.       PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
  157.     end if
  158.     PanoMovie("Direct", gPanoMovieID, "update")
  159.   end if
  160. end
  161.  
  162. on ClosePanoMovie
  163.   global gPanoMovieID
  164.   if gPanoMovieID <> EMPTY then
  165.     PanoMovie("Direct", gPanoMovieID, "dispose")
  166.     set gPanoMovieID to EMPTY
  167.   end if
  168. end
  169.  
  170. on PanoFrameScript pSpriteNum
  171.   global gLastTimeRollover, gPanoMovieID, gcurnodeid, gjumpdata, gcrhotspotnum
  172.   if rollOver(pSpriteNum) then
  173.     if (gPanoMovieID <> EMPTY) and (RunningInForeground() = "true") then
  174.       PanoMovie("Direct", gPanoMovieID, "mouseOver")
  175.       set gcurnodeid to PanoMovie("Direct", gPanoMovieID, "get", "nodeID")
  176.       set tMouseOverResult to the result
  177.       if tMouseOverResult <> 0 then
  178.         set tAction to item 1 of tMouseOverResult
  179.         if tAction = "jump" then
  180.         else
  181.           if tAction = "undf" then
  182.             set gcrhotspotnum to item 2 of tMouseOverResult
  183.             jumpmovie()
  184.           else
  185.             if tAction = "jpvr" then
  186.               set gcrhotspotnum to item 2 of tMouseOverResult
  187.               jumpupnode()
  188.             else
  189.               if tAction = "qtmv" then
  190.               else
  191.                 if tAction = "misc" then
  192.                 else
  193.                   if tAction = "navg" then
  194.                   else
  195.                     if tAction = "stil" then
  196.                     else
  197.                       if tAction = "pan " then
  198.                       end if
  199.                     end if
  200.                   end if
  201.                 end if
  202.               end if
  203.             end if
  204.           end if
  205.         end if
  206.         set gLastTimeRollover to 1
  207.       else
  208.         if rollOver(pSpriteNum) then
  209.           set gLastTimeRollover to 1
  210.         else
  211.           cursor(200)
  212.           cursor(0)
  213.           set gLastTimeRollover to 0
  214.         end if
  215.       end if
  216.     end if
  217.   else
  218.     if gLastTimeRollover then
  219.       cursor(200)
  220.       cursor(0)
  221.       set gLastTimeRollover to 0
  222.       if gPanoMovieID <> EMPTY then
  223.         PanoMovie("Direct", gPanoMovieID, "idle")
  224.       end if
  225.     end if
  226.   end if
  227. end
  228.  
  229. on SampleMouseOverHandler
  230.   global gPanoMovieID
  231.   put "Mouse over panoramic movie"
  232.   if gPanoMovieID <> EMPTY then
  233.   end if
  234. end
  235.  
  236. on SampleRolloverHandler pHotSpotID
  237.   global gplatelist
  238.   set hpnum to pHotSpotID
  239.   set cname to getaProp(gplatelist, hpnum)
  240.   set the castNum of sprite 1 to the number of cname
  241. end
  242.  
  243. on SampleMouseDownHandler
  244.   global gPanoMovieID
  245.   put "Mouse down during mouseOver call"
  246.   if gPanoMovieID <> EMPTY then
  247.     PanoMovie("Direct", gPanoMovieID, "PassMouseDown")
  248.   end if
  249. end
  250.  
  251. on SamplePanZoomStartHandler
  252.   put "About to pan or zoom in panoramic movie"
  253. end
  254.  
  255. on SampleMouseStillDownHandler
  256.   global gPanoMovieID
  257.   put "Enter mouse still down from panoramic movie"
  258.   if gPanoMovieID <> EMPTY then
  259.   end if
  260.   put "Leave mouse still down from panoramic movie"
  261. end
  262.  
  263. on SampleNodeLeaveHandler pToNode
  264.   put "Jumping to node " & pToNode & " in panoramic movie"
  265. end
  266.  
  267. on ExtractPathName pPathName
  268.   set tDelimiter to ":"
  269.   if pPathName contains tDelimiter then
  270.     set tCharPos to length(pPathName)
  271.     repeat while tCharPos >= 1
  272.       if char tCharPos of pPathName = tDelimiter then
  273.         return char 1 to tCharPos - 1 of pPathName
  274.       end if
  275.       set tCharPos to tCharPos - 1
  276.     end repeat
  277.     return EMPTY
  278.   else
  279.     return EMPTY
  280.   end if
  281. end
  282.  
  283. on SetupHandler pHandlerName
  284.   global gPanoMovieID
  285.   if the hilite of cast (pHandlerName && "Check") then
  286.     PanoMovie("Direct", gPanoMovieID, "set", pHandlerName, "test" & pHandlerName)
  287.   else
  288.     PanoMovie("Direct", gPanoMovieID, "set", pHandlerName, EMPTY)
  289.   end if
  290. end
  291.  
  292. on TestMouseOverHandler
  293.   global gPanoMovieID
  294.   if gPanoMovieID <> EMPTY then
  295.     put "In mouse over at: " & the ticks into field "MouseOverHandler Message"
  296.   end if
  297. end
  298.  
  299. on TestRolloverHotSpotHandler pHotSpotID
  300.   global gPanoMovieID
  301.   if gPanoMovieID <> EMPTY then
  302.     put "Rolling over hot spot: " & pHotSpotID into field "RolloverHotSpotHandler Message"
  303.   end if
  304. end
  305.  
  306. on TestMouseDownHandler
  307.   global gPanoMovieID
  308.   if gPanoMovieID <> EMPTY then
  309.     put "In mouse down at: " & the ticks into field "MouseDownHandler Message"
  310.     PanoMovie("Direct", gPanoMovieID, "PassMouseDown")
  311.   end if
  312. end
  313.  
  314. on testPanZoomStartHandler
  315.   global gPanoMovieID
  316.   if gPanoMovieID <> EMPTY then
  317.     put "In pan zoom start at: " & the ticks into field "PanZoomStartHandler Message"
  318.   end if
  319. end
  320.  
  321. on TestMouseStillDownHandler
  322.   global gPanoMovieID
  323.   if gPanoMovieID <> EMPTY then
  324.     put "In mouse still down at: " & the ticks into field "MouseStillDownHandler Message"
  325.     put PanoMovie("Direct", gPanoMovieID, "get", "hpanangle") into field "MouseStillDownHandler Message"
  326.   end if
  327. end
  328.  
  329. on TestNodeLeaveHandler pToNode
  330.   global gPanoMovieID
  331.   if gPanoMovieID <> EMPTY then
  332.     put "Leaving node ID: " & pToNode into field "NodeLeaveHandler Message"
  333.   end if
  334. end
  335.  
  336. factory CallBackTracer
  337. method mnew
  338.  
  339. method mEvalExpr pExpr
  340.  
  341. method mSendHCMessage pMessage
  342.  
  343. method mSendCardMessage pMessage
  344.   do(pMessage)
  345.  
  346. method mGetFieldByName pCard, pName
  347.  
  348. method mGetFieldByNum pCard, pNum
  349.  
  350. method mGetFieldByID pCard, pID
  351.  
  352. method mSetFieldByName pCard, pName, pValue
  353.  
  354. method mSetFieldByNum pCard, pNum, pValue
  355.  
  356. method mSetFieldByID pCard, pID, pValue
  357.