home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / mac / FILES / SHARED.CST / 00025_Script_AreaObjectParentScript < prev    next >
Text File  |  1997-07-24  |  4KB  |  121 lines

  1. --o:  AreaObj
  2.  
  3.  
  4. property pAreaHotspotList, pFunctionalityObjectList
  5. property pActiveFunctObject, pAvailableFunctions
  6. property pFirstSpriteNum, pLastSpriteNum, pNumOfHotSpotSprites
  7. property pReturnSpriteStart
  8. property pAreaHS, pFrameLabel, pAtAnArea
  9. property pAmbientSnd, pCurrArea
  10.  
  11. global gModeManager, gInterfaceMgrObj, gAreaManagerObj
  12.  
  13. --------------------------------------------------------------------------------------------------------
  14. -- argAreaDBline is corresponding line from the AREA DB
  15. --------------------------------------------------------------------------------------------------------
  16. on birth me, argHSdatapaksIndex, argAreaDBline
  17.   
  18.   set pFirstSpriteNum = 4          -- First virtual HS sprite
  19.   set pLastSpriteNum = 17         --/ Last virtual HS sprite...need to get actual number from db
  20.   
  21.   set pFunctionalityObjectList = [:]
  22.   set pAreaHotspotList = getat( argAreaDBline, 3)
  23.   set pFrameLabel = getat(argAreaDBline, 1)
  24.   
  25.   set pNumOfHotSpotSprites = pLastSpriteNum - pFirstSpriteNum
  26.   set pNumOfHS = Count(pAreaHotspotList)
  27.   set pAreaHS = getat(argAreaDBline, 2)
  28.   set pAtAnArea = FALSE
  29.   
  30.   repeat with CurrentHotSpotNumber in  pAreaHotspotList
  31.     set LinkedObject = getaprop(argHSdatapaksIndex, CurrentHotSpotNumber)  --- temp changes to CurrHSNumber
  32.     addProp(pFunctionalityObjectList, CurrentHotSpotNumber, LinkedObject)
  33.     mSetAreaHotSpotID(LinkedObject, pAreaHS )
  34.   end repeat
  35.   
  36.   return( me )
  37.   
  38. end birth me
  39. ----------------------------------------------------------------------------ò
  40. on mPassPerform me
  41.   
  42.   set HotSpotIndex = 0
  43.   
  44.   repeat with SpriteNumToCheck = pFirstSpriteNum to pLastSpriteNum    --Area Rollover Text Display
  45.     if rollover (SpriteNumToCheck) then 
  46.       set HotSpotIndex = SpriteNumToCheck - pFirstSpriteNum + 1
  47.       exit repeat
  48.     end if
  49.   end repeat
  50.   
  51.   if (HotSpotIndex) > 0 and HotSpotIndex < count (pAreaHotspotList) then      
  52.     set RollOverHS = getAt(pAreaHotspotList, HotSpotIndex)
  53.     mDisplayText(gInterfaceMgrObj, RollOverHS)
  54.   else mDisplayText(gInterfaceMgrObj, 0)
  55.   
  56.   
  57. end mPassPerform
  58. ----------------------------------------------------------------------------ò
  59. on mContainsHS me, HS
  60.   
  61.   set newFunctType = 0
  62.   if (pAreaHS <> HS) then
  63.     
  64.     set newHSPos = getpos( pAreaHotspotList,HS)
  65.     if newHSPos <> 0 then
  66.       
  67.       set newFunctType = mDiscloseFunctionalityType (getProp( pFunctionalityObjectList,HS))
  68.       if (newFunctType = #TEXT) then 
  69.         mActivate(getProp(pFunctionalityObjectList, HS))
  70.       else
  71.         if objectP(pActiveFunctObject) then mClose(pActiveFunctObject)
  72.         set pActiveFunctObject = getProp(pFunctionalityObjectList, HS)
  73.       end if
  74.       
  75.     end if
  76.     
  77.   else set newFunctType = #AREA
  78.   
  79.   return( newFunctType )
  80.   
  81. end mContainsHS
  82. ----------------------------------------------------------------------------ò
  83. on mTriggerFunctionality me, argFunctType
  84.   
  85.   
  86.   if argFunctType = #Area then
  87.     set pAtAnArea = true
  88.     if objectP(pActiveFunctObject) then 
  89.       mClose(pActiveFunctObject)
  90.     end if
  91.     set pActiveFunctObject = getProp(pFunctionalityObjectList, pAreaHS)   
  92.     mActivate(pActiveFunctObject)
  93.   else 
  94.     set pAtAnArea = false
  95.     mActivate(pActiveFunctObject)
  96.   end if
  97.   
  98.   
  99.   
  100. end mTriggerFunctionality
  101. ----------------------------------------------------------------------------ò
  102. on mClickEvent me
  103.   
  104.   if pAtAnArea then                           -- area abstract, not necessarily AREA FUNCT
  105.     
  106.     if (the clickon = 21) or (the clickon = 22) then
  107.       if objectP(pActiveFunctObject) then mClose(pActiveFunctObject)
  108.       mChangeMode(gModeManager, #QTVR)
  109.     else
  110.       set HSinIndexClicked = the clickon - pFirstSpriteNum + 1
  111.       set HotSpotClicked = getAt(pAreaHotspotList, HSinIndexClicked)
  112.       mDistributeHS(gAreaManagerObj, HotSpotClicked)
  113.     end if
  114.     
  115.   else if objectp(pActiveFunctObject) then mClickEvent( pActiveFunctObject )        -- case in QTVR...passes event
  116.   
  117.   
  118. end mClickEvent
  119. ----------------------------------------------------------------------------ò
  120.  
  121.