home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
shared.cst
/
00025_Script_AreaObjectParentScript
< prev
next >
Wrap
Text File
|
1997-07-24
|
4KB
|
121 lines
--o: AreaObj
property pAreaHotspotList, pFunctionalityObjectList
property pActiveFunctObject, pAvailableFunctions
property pFirstSpriteNum, pLastSpriteNum, pNumOfHotSpotSprites
property pReturnSpriteStart
property pAreaHS, pFrameLabel, pAtAnArea
property pAmbientSnd, pCurrArea
global gModeManager, gInterfaceMgrObj, gAreaManagerObj
--------------------------------------------------------------------------------------------------------
-- argAreaDBline is corresponding line from the AREA DB
--------------------------------------------------------------------------------------------------------
on birth me, argHSdatapaksIndex, argAreaDBline
set pFirstSpriteNum = 4 -- First virtual HS sprite
set pLastSpriteNum = 17 --/ Last virtual HS sprite...need to get actual number from db
set pFunctionalityObjectList = [:]
set pAreaHotspotList = getat( argAreaDBline, 3)
set pFrameLabel = getat(argAreaDBline, 1)
set pNumOfHotSpotSprites = pLastSpriteNum - pFirstSpriteNum
set pNumOfHS = Count(pAreaHotspotList)
set pAreaHS = getat(argAreaDBline, 2)
set pAtAnArea = FALSE
repeat with CurrentHotSpotNumber in pAreaHotspotList
set LinkedObject = getaprop(argHSdatapaksIndex, CurrentHotSpotNumber) --- temp changes to CurrHSNumber
addProp(pFunctionalityObjectList, CurrentHotSpotNumber, LinkedObject)
mSetAreaHotSpotID(LinkedObject, pAreaHS )
end repeat
return( me )
end birth me
----------------------------------------------------------------------------ò
on mPassPerform me
set HotSpotIndex = 0
repeat with SpriteNumToCheck = pFirstSpriteNum to pLastSpriteNum --Area Rollover Text Display
if rollover (SpriteNumToCheck) then
set HotSpotIndex = SpriteNumToCheck - pFirstSpriteNum + 1
exit repeat
end if
end repeat
if (HotSpotIndex) > 0 and HotSpotIndex < count (pAreaHotspotList) then
set RollOverHS = getAt(pAreaHotspotList, HotSpotIndex)
mDisplayText(gInterfaceMgrObj, RollOverHS)
else mDisplayText(gInterfaceMgrObj, 0)
end mPassPerform
----------------------------------------------------------------------------ò
on mContainsHS me, HS
set newFunctType = 0
if (pAreaHS <> HS) then
set newHSPos = getpos( pAreaHotspotList,HS)
if newHSPos <> 0 then
set newFunctType = mDiscloseFunctionalityType (getProp( pFunctionalityObjectList,HS))
if (newFunctType = #TEXT) then
mActivate(getProp(pFunctionalityObjectList, HS))
else
if objectP(pActiveFunctObject) then mClose(pActiveFunctObject)
set pActiveFunctObject = getProp(pFunctionalityObjectList, HS)
end if
end if
else set newFunctType = #AREA
return( newFunctType )
end mContainsHS
----------------------------------------------------------------------------ò
on mTriggerFunctionality me, argFunctType
if argFunctType = #Area then
set pAtAnArea = true
if objectP(pActiveFunctObject) then
mClose(pActiveFunctObject)
end if
set pActiveFunctObject = getProp(pFunctionalityObjectList, pAreaHS)
mActivate(pActiveFunctObject)
else
set pAtAnArea = false
mActivate(pActiveFunctObject)
end if
end mTriggerFunctionality
----------------------------------------------------------------------------ò
on mClickEvent me
if pAtAnArea then -- area abstract, not necessarily AREA FUNCT
if (the clickon = 21) or (the clickon = 22) then
if objectP(pActiveFunctObject) then mClose(pActiveFunctObject)
mChangeMode(gModeManager, #QTVR)
else
set HSinIndexClicked = the clickon - pFirstSpriteNum + 1
set HotSpotClicked = getAt(pAreaHotspotList, HSinIndexClicked)
mDistributeHS(gAreaManagerObj, HotSpotClicked)
end if
else if objectp(pActiveFunctObject) then mClickEvent( pActiveFunctObject ) -- case in QTVR...passes event
end mClickEvent
----------------------------------------------------------------------------ò