home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / pc / files / shared.cst / 00002_Script_MainMS < prev    next >
Text File  |  1997-07-24  |  14KB  |  432 lines

  1. -- GLOBAL BEGIN
  2.  
  3.  
  4. global gActorListMgrObj, gInterfaceMgrObj, gModeManager, gAreaManagerObj
  5. global gUtilityObj, gInvestMgrObj
  6.  
  7. --/
  8. global gReturn, gBulbExpMgr, gQTNavMgr, gScoreEventObj
  9. global gWHSobjIndexedLst, gBHSobjIndexedLst, gEHSobjIndexedLst, gInventorIndexNum, gGHSobjIndexedLst
  10. --/
  11. global gSndPath, gQTpath, gBackDropObj, gFixPalletObj
  12. global gJournalObj, gPatentObj, gWattBIYobj, gLocal, gGalleryMgr
  13.  
  14. global gObjectCastLists, gDataBaseMgrObj, gMstrObjIndexedLst, gGeneralCastIndex
  15. global gInventorOrder, whatCastindex, gMstrPictIndex, gActiveInventor, gActiveAmbSnd, gClicksSuppressed
  16. global gAvailbleInv
  17. ----------------------------------------------------------------------------ò
  18. global gBellCastIndexlst, gGallerylCastIndexlst,gEdisonCastIndexlst,gWattCastIndexlst,gCompileMode
  19. global gQTVRpath, gInventorVisited
  20.  
  21. global gActiveQTVRhandler
  22. ------------------------------------------------------------------------------------------------
  23. on Idle
  24.   
  25.   if (not soundbusy(1)) and (gActiveAmbSnd <> 0) then puppetsound gActiveAmbSnd
  26.   if  gClicksSuppressed then
  27.     set gClicksSuppressed = FALSE
  28.     when mousedown then
  29.     when mouseup then
  30.   end if
  31.   
  32. end idle
  33. ------------------------------------------------------------------------------------------------
  34. on mVRHS HotSpotID                                      ---  displays text for QTVR hotspot; from QTVR callback
  35.   
  36.   --put "HotSpotID " & HotSpotID
  37.   mDisplayText( gInterfaceMgrObj, value( HotSpotID ) )
  38.   
  39. end 
  40. -------------------------------------------------------------------------------------------------
  41. on InitProgram
  42.   
  43.   if voidp(gAvailbleInv) then set gAvailbleInv = #All
  44.   if (gActiveQTVRhandler <> empty) and not voidp(gActiveQTVRhandler) then 
  45.     QTVRClose(gActiveQTVRhandler)
  46.     set gActiveQTVRhandler = empty
  47.   end if
  48.   
  49.   startProgessBar (4 )
  50.   if voidp(gQTVRpath) then set gQTVRpath = the pathname
  51.   
  52.   if the machinetype = 256 then set gSNDpath = the pathname & "Media\Snds\"
  53.   else set gSNDpath = the pathname & "Media:Snds:"
  54.   
  55.   set gInventorVisited = [0,0,0]
  56.   MoveBar( 5 )
  57.   
  58.   set gObjectCastLists = the text of cast "orderListOfObjectCastLists"
  59.   set gActorListMgrObj = mInit(script "ActorListMgrParent")
  60.   MoveBar( 5 )
  61.   
  62.   mSetUp ( gActorListMgrObj )
  63.   MoveBar( 5 )
  64.   
  65.   set rQTNavMgrCastList = value(line 1 of gObjectCastLists)
  66.   MoveBar( 5 )
  67.   
  68.   set gQTNavMgr = mInit (script "rQTNavMgr", rQTNavMgrCastList, gQTpath, gSndPath)
  69.   MoveBar( 5 )
  70.   
  71.   set gCompileMode = FALSE
  72.   
  73.   set gBellCastIndexlst = [:]
  74.   set gGallerylCastIndexlst = [:]
  75.   set gEdisonCastIndexlst = [:]
  76.   set gWattCastIndexlst = [:]
  77.   MoveBar( 5 )
  78.   
  79.   set gGeneralCastIndex = value( the text of cast "General Cast INDEX" )
  80.   set gInventorOrder = [#Edison,#Bell,#Watt,#Gallery]
  81.   
  82.   set gMstrPictIndex = [#Edison:value( the text of cast "Edison Pict Index"),#Bell:value( the text of cast "Bell Pict Index"),#Watt:value( the text of cast "Watt Pict Index"),#Gallery:value( the text of cast "Gallery Pict Index")]
  83.   MoveBar( 5 )
  84.   
  85.   
  86.   
  87.   set DatabaseMgrCastLst =  value(line 4 of gObjectCastLists)
  88.   set gDataBaseMgrObj = mInit ( script "DatabaseMgr",DatabaseMgrCastLst)
  89.   MoveBar( 5 )
  90.   
  91.   
  92.   set MainDBCast = getprop( gGeneralCastIndex, #MainDBs)
  93.   set whatCastindex = [:]
  94.   set gActiveInventor = #edison
  95.   set gEHSobjIndexedLst = mCreateDataPacks (gDataBaseMgrObj, getprop(MainDBCast,#Edison))
  96.   MoveBar( 5 )
  97.   
  98.   --/ compile
  99.   if gCompileMode then
  100.     set the text of cast "Edison Pict Index" = string ( whatCastindex )
  101.     set gEdisonCastIndexlst = value( the text of cast "Edison Pict Index")
  102.   end if
  103.   --/ 
  104.   
  105.   set whatCastindex = [:]
  106.   set gActiveInventor = #bell
  107.   set gBHSobjIndexedLst = mCreateDataPacks (gDataBaseMgrObj, getprop(MainDBCast,#Bell))
  108.   MoveBar( 5 )
  109.   
  110.   
  111.   set whatCastindex = [:]
  112.   set gActiveInventor = #watt
  113.   set gWHSobjIndexedLst = mCreateDataPacks (gDataBaseMgrObj, getprop(MainDBCast,#Watt))
  114.   MoveBar( 5 )
  115.   
  116.   
  117.   
  118.   set whatCastindex = [:]
  119.   set gActiveInventor = #gallery
  120.   set gGHSobjIndexedLst = mCreateDataPacks (gDataBaseMgrObj, getprop(MainDBCast,#Gallery))
  121.   MoveBar( 5 )
  122.   
  123.   
  124.   
  125.   
  126.   set gMstrObjIndexedLst = [#Edison:gEHSobjIndexedLst,#Bell:gBHSobjIndexedLst,#Watt:gWHSobjIndexedLst,¼
  127.                                            #Gallery:gGHSobjIndexedLst]
  128.   
  129.   
  130.   set gAreaManagerObj = mInit(script "AreaManagerObject", gInventorIndexNum)
  131.   MoveBar( 5 )
  132.   
  133.   set InterfaceCastList =  value(line 3 of gObjectCastLists)
  134.   MoveBar( 5 )
  135.   
  136.   set gInterfaceMgrObj = mInit(script "Interface Mgr Parent", InterfaceCastList, gQTpath)
  137.   MoveBar( 5 )
  138.   MoveBar( 5 )
  139.   mSetUp(gInterfaceMgrObj)
  140.   MoveBar( 5 )
  141.   
  142.   -- set QTVR rollover text
  143.   
  144.   set gModeManager = mInit ( script "modeMangerParent")
  145.   MoveBar( 5 )
  146.   MoveBar( 5 )
  147.   MoveBar( 5 )
  148.   set gUtilityObj = mInit( script "Utility Parent")
  149.   MoveBar( 5 )
  150.   MoveBar( 5 )
  151.   set gScoreEventObj = mInit(script "Score Event Object")
  152.   MoveBar( 5 )
  153.   MoveBar( 5 )
  154.   MoveBar( 5 )
  155.   set gJournalObj = mInit(script "Journal Object")
  156.   MoveBar( 5 )
  157.   MoveBar( 5 )
  158.   MoveBar( 5 )
  159.   MoveBar( 5 )
  160.   set gPatentObj = mInit(script "Patent Object Script")
  161.   MoveBar( 5 )
  162.   MoveBar( 5 )
  163.   MoveBar( 5 )
  164.   MoveBar( 5 )
  165.   set gGalleryMgr = mInit( script "GalleryMgr Parent")
  166.   FinishProgressBar( "Completing Intialization")
  167.   
  168. end
  169. ----------------------------------------------------------------------------ò
  170. on InitXobjs 
  171.   
  172.   
  173.   
  174.   if (the machinetype <> 256) then
  175.     
  176.     openxlib "PALFIX.XBJ"
  177.     -- openxlib "BCKDRP.XBJ"
  178.     
  179.     set gFixPalletObj=FixPalette(mNew, the stageLeft, the stageTop, the stageRight, the stageTop)
  180.     -- if objectP( gBackDropObj ) then gBackDropObj( mdispose )
  181.     
  182.     --  set gBackDropObj = backdrop (mNew)
  183.     --   gBackDropObj(mSetColor,255)
  184.     --  gBackDropObj(mShow)
  185.     --  closexlib "BCKDRP.XBJ"
  186.     
  187.   end if
  188.   
  189. end InitXobjs
  190.  
  191. ----------------------------------------------------------------------------ò
  192. on closeXobjs 
  193.   
  194.   if objectp(gFixPalletObj) then 
  195.     gFixPalletObj(mDispose)
  196.     closeXlib "PALFIX.XBJ"
  197.   end if
  198.   if objectp(gBackDropObj) then gBackDropObj(mdispose)
  199.   
  200.   
  201. end closeXobj
  202.  
  203. ----------------------------------------------------------------------------ò
  204. on patchpal
  205.   
  206.   global gFixPalletObj
  207.   
  208.   if objectp(gFixPalletObj) then gFixPalletObj(mPatchIt)
  209.   
  210. end patchpal
  211. ----------------------------------------------------------------------------ò
  212. on stopmovie
  213.   
  214.   cleanfile
  215.   --closeXobjs
  216.   
  217. end stopmovie
  218. ----------------------------------------------------------------------------ò
  219. on cleanfile
  220.   
  221.   global gActiveQTVRhandler, gQTVRCallBackFactory
  222.   
  223.   if (gActiveQTVRhandler <> empty) and not voidp(gActiveQTVRhandler) then 
  224.     QTVRClose(gActiveQTVRhandler)
  225.     set gActiveQTVRhandler = empty
  226.   end if
  227.   
  228. end cleanfile
  229. ----------------------------------------------------------------------------ò
  230. on startProgessBar argProgressBarSprite
  231.   global gProgressBarSprite, gProgressDisplayInt
  232.   
  233.   if not gLocal then 
  234.     cursor 4
  235.     set gProgressBarSprite = argProgressBarSprite
  236.   end if
  237.   
  238. end startProgessBar
  239. ----------------------------------------------------------------------------ò
  240. on startLoadBar argProgressBarSprite, Whatfile
  241.   global gProgressBarSprite, gProgressDisplayInt
  242.   
  243.   if not gLocal then 
  244.     set gProgressBarSprite = argProgressBarSprite
  245.   end if
  246.   
  247. end startLoadBar
  248. ----------------------------------------------------------------------------ò
  249. on MoveBar length
  250.   global gProgressBarSprite, gProgressDisplayInt
  251.   
  252.   if not gLocal then 
  253.     set the rect of sprite gProgressBarSprite = the rect of sprite gProgressBarSprite + rect(0,0,length * .5 ,0)
  254.     updatestage
  255.   end if
  256.   
  257. end MoveBar
  258. ----------------------------------------------------------------------------ò
  259. on FinishProgressBar argSectionStr
  260.   global gProgressBarSprite, gProgressDisplayInt
  261.   
  262.   if not gLocal then 
  263.     set lengthRemaining =   getat( the rect of sprite gProgressBarSprite, 3) 
  264.     repeat while  (lengthRemaining < 515)
  265.       set lengthRemaining = lengthRemaining + 10
  266.       set the rect of sprite gProgressBarSprite = the rect of sprite gProgressBarSprite + rect(0,0,10,0)
  267.       updatestage
  268.     end repeat
  269.     set progressBarRect =  the rect of sprite gProgressBarSprite
  270.     setat(progressBarRect,3,515)
  271.     set the rect of sprite gProgressBarSprite = progressBarRect
  272.     updatestage
  273.   end if
  274.   
  275. end FinishProgressBar
  276. ----------------------------------------------------------------------------ò
  277. on compilegObjectCastLists orderedObjectListCast, objectPropertyCastListCast, orderListOfgObjectCastListsCast
  278.   
  279.   beep 
  280.   
  281.   set orderedObjectListCast = the number of cast "orderedObjectList"
  282.   set objectPropertyCastListCast = the number of cast "objectPropertyCastList"
  283.   set orderListOfgObjectCastListsCast = the number of cast "orderListOfObjectCastLists"
  284.   
  285.   set objectList = the text of cast orderedObjectListCast
  286.   set numberOfObjects = the number of lines in objectList - 1
  287.   set objectCastList = the text of cast objectPropertyCastListCast
  288.   set tempText = " "
  289.   set theLine = " "
  290.   
  291.   -- determine the first line to evaluate
  292.   set currentCastLine = 1
  293.   set theLine = line currentCastLine of objectCastList
  294.   repeat while (theLine <> "^")
  295.     set currentCastLine = currentCastLine + 1
  296.     set theLine = line currentCastLine of objectCastList
  297.   end repeat
  298.   set currentCastLine = currentCastLine + 2
  299.   
  300.   repeat with objectLineNum = 1 to numberOfObjects
  301.     set tempList = [:]
  302.     set theLine = line currentCastLine of objectCastList
  303.     repeat while (theLine <> "^")
  304.       
  305.       -- convert first item to symbol
  306.       set propertySymbol = value("#"&(item 1 of theLine))
  307.       -- convert second item to string and find associated cast number
  308.       set propertyCast = the number of cast (item 2 of theLine)
  309.       
  310.       -- add the two items to temp property list
  311.       addProp (tempList, propertySymbol, propertyCast)
  312.       -- increment currentCastLine
  313.       set currentCastLine = currentCastLine + 1
  314.       set theLine = line currentCastLine of objectCastList
  315.     end repeat
  316.     -- put tempList in orderListOfgObjectCastLists cast at position objectLineNum - 1
  317.     set tempText = tempText & string (tempList) & RETURN
  318.     set currentCastLine = currentCastLine + 2
  319.   end repeat
  320.   -- remove last return
  321.   delete line objectLineNum of tempText
  322.   set the text of cast orderListOfgObjectCastListsCast = tempText
  323.   
  324.   beep
  325.   
  326. end
  327. ----------------------------------------------------------------------------ò
  328. -- Debug
  329. ----------------------------------------------------------------------------ò
  330. on getActorlist
  331.   
  332.   put mGetActorList (gActorListMgrObj)
  333.   
  334. end getActorlist
  335. ----------------------------------------------------------------------------ò
  336.  
  337. on getToolRects startsprite, endsprite
  338.   global gToolRects
  339.   
  340.   set gToolRects = []
  341.   repeat with counter = startsprite to endsprite
  342.     add(gToolRects, the rect of sprite counter)
  343.   end repeat
  344.   put gToolRects
  345.   
  346. end compileToolRects
  347. ----------------------------------------------------------------------------ò
  348. on reset
  349.   
  350.   clearglobals
  351.   set the actorlist = []
  352.   cleanfile
  353.   set gAvailbleInv = #All
  354.   
  355. end reset
  356. ----------------------------------------------------------------------------ò
  357. on setGlobalStrip argGlobalSpriteNum, argTopSpriteNum
  358.   
  359.   if gAvailbleInv <> #ALL then
  360.     
  361.     puppetsprite argGlobalSpriteNum, true
  362.     -- puppetsprite argTopSpriteNum, true
  363.     
  364.     case gAvailbleInv of
  365.       #Bell:  
  366.         set the member of sprite argGlobalSpriteNum = member "BELL STRIP.PIC"
  367.         --set the member of sprite argTopSpriteNum = member "BELL GALLERY BUY.PIC"
  368.       #Watt: 
  369.         set the member of sprite argGlobalSpriteNum = member "Watt STRIP.PIC"
  370.         --set the member of sprite argTopSpriteNum = member "WATT GALLERY BUY.PIC"
  371.       #Edison: 
  372.         set the member of sprite argGlobalSpriteNum = member "Edison STRIP.PIC"
  373.         --set the member of sprite argTopSpriteNum = member "EDISON GALLERY BUY.PIC"
  374.     end case
  375.     
  376.   end if
  377.   
  378.   
  379. end setGlobalStrip
  380. ----------------------------------------------------------------------------ò
  381. on setInventGlobalStrip 
  382.   
  383.   if gAvailbleInv <> #ALL then
  384.     
  385.     puppetsprite 34, true
  386.     case gAvailbleInv of
  387.       #Bell:  
  388.         set the member of sprite 34 = member "BELL STRIP.PIC"
  389.         
  390.       #Watt: 
  391.         set the member of sprite 34 = member "Watt STRIP.PIC"
  392.         
  393.       #Edison: 
  394.         set the member of sprite 34 = member "Edison STRIP.PIC"
  395.     end case
  396.     
  397.   end if
  398.   
  399.   
  400. end setInventGlobalStrip
  401. ----------------------------------------------------------------------------ò
  402. on ChangeTimeLnBckgrnd
  403.   global gActiveAmbSnd
  404.   patchpal
  405.   set gActiveAmbSnd = 0
  406.   
  407.   if  gAvailbleInv <> #ALL then
  408.     puppetsprite 1, true
  409.     
  410.     case gAvailbleInv of
  411.         
  412.       #Watt: 
  413.         set the member of sprite 1 = member "WATT TIME FULL.PIC"
  414.         updatestage
  415.         go "Watt" of movie "TIMELN.DIR"
  416.         setGlobalStrip 34
  417.       #Edison:
  418.         set the member of sprite 1 = member "Edison TIME FULL.PIC"
  419.         updatestage
  420.         go "Edison" of movie "TIMELN.DIR"
  421.         setGlobalStrip 34
  422.       #Bell:
  423.         set the member of sprite 1 = member "BELL TIME FULL.PIC"
  424.         updatestage
  425.         go "Bell" of movie "TIMELN.DIR"
  426.         setGlobalStrip 34
  427.     end case
  428.     
  429.   end if
  430.   
  431. end ChangeTimeLnBckgrnd
  432. ----------------------------------------------------------------------------ò