home *** CD-ROM | disk | FTP | other *** search
- global gScreenMgr, gLaunchPath, startPath
-
- on startMovie
- set gScreenMgr to new(script "screen mgr", getRangeList(101, 111))
- set gLaunchPath to the pathName
- if isPC() then
- go("PC")
- else
- go("MAC")
- end if
- end
-
- on testDB
- set gScreenMgr to new(script "screen mgr", getRangeList(101, 111))
- showAlldialogs(gScreenMgr)
- end
-
- on testMonDepth
- repeat with i = 0 to 10
- set gScreenMgr to new(script "screen mgr", getRangeList(101, 111))
- set the pCurMode of gScreenMgr to i
- CheckMonitorDepth(gScreenMgr)
- set the pCurMode of gScreenMgr to i
- mRestoreMonitor(gScreenMgr)
- end repeat
- end
-
- on DoEverything
- set MovieFile to "ISPYMAIN2.dxr"
- set productName to "Špión - Strašidelný dùm"
- set RegPathString to "Špión - Strašidelný dùm"
- set MacVolumeName to "Špión - Strašidelný dùm"
- if isPC() then
- cursor(4)
- updateStage()
- set cdLet to "D"
- set regVal to ReadRegistryValue("HKEY_LOCAL_MACHINE\Software\Scholastic Inc\" & RegPathString, "CDLet")
- if stringp(regVal) then
- set cdLet to char 1 of regVal
- end if
- set startPath to cdLet & ":\DATA\" & MovieFile
- if not FileExists(startPath) then
- go("Load")
- else
- set done to 0
- set cdRomDrives to sniffCDPlayers()
- repeat with i = 1 to count(cdRomDrives)
- set cdLet to getAt(cdRomDrives, i)
- set startPath to cdLet & "\DATA\" & MovieFile
- if not FileExists(startPath) then
- set done to 1
- exit repeat
- end if
- end repeat
- if not done then
- showInsertCDAlert(productName)
- go("bail")
- puppetPalette("System - Win", 60)
- updateStage()
- quit()
- end if
- end if
- go("Load")
- else
- set startPath to MacVolumeName & ":DATA:" & MovieFile
- if not FileExists(startPath) then
- go(1, startPath)
- else
- showInsertCDAlert(productName)
- go("bail")
- puppetPalette("System - Mac", 60)
- updateStage()
- quit()
- end if
- end if
- end
-
- on ReadPrefFile pFileName
- set prefList to [:]
- set tBuff to EMPTY
- set fullName to getOSDirectory() & "\" & pFileName
- set gFileObj to new(xtra("fileio"))
- openFile(gFileObj, fullName, 1)
- if Status(gFileObj) <> 0 then
- displayError(gFileObj)
- set gFileObj to 0
- return 0
- end if
- set tBuff to readFile(gFileObj)
- if Status(gFileObj) <> 0 then
- displayError(gFileObj)
- set gFileObj to 0
- return 0
- end if
- set the itemDelimiter to "="
- set curSection to "garbage"
- repeat with lineIdx = 1 to the number of lines in tBuff
- set curLine to line lineIdx of tBuff
- if StripEvilChar(curLine) <> EMPTY then
- if listp(value(curLine)) then
- set curSection to StripEvilChar(curLine)
- next repeat
- end if
- set value to StripEvilChar(curLine)
- addProp(prefList, curSection, StripBlanksAtBothEnds(item 2 of value))
- end if
- end repeat
- closeFile(gFileObj)
- set gFileObj to 0
- return prefList
- end
-
- on displayError fileobj
- end
-
- on showInsertCDAlert theProductName
- set MessageText to "Musíte vložit" && theProductName && "CD-ROM"
- setupSDialogue(MessageText, 120, 0)
- runSDialogue()
- end
-
- on StripEvilChar filthyString
- set evilCharList to ["[", "]", "
- "]
- set uBound to count(evilCharList)
- repeat with evilChar in evilCharList
- set done to 0
- repeat while not done
- set badChar to offset(evilChar, filthyString)
- if badChar then
- delete char badChar of filthyString
- next repeat
- end if
- set done to 1
- end repeat
- end repeat
- return filthyString
- end
-
- on StripBlanksAtBothEnds wonkyString
- set retString to EMPTY
- set firstNonBlank to 0
- repeat while 1
- if char 1 of wonkyString = " " then
- delete char 1 of wonkyString
- next repeat
- end if
- exit repeat
- end repeat
- repeat while 1
- set lastC to the number of chars in wonkyString
- if char lastC of wonkyString = " " then
- delete char lastC of wonkyString
- next repeat
- end if
- exit repeat
- end repeat
- return wonkyString
- end
-
- on sniffCDPlayers
- set cdList to []
- set driveList to DrivesToList()
- repeat with idx = 1 to count(driveList)
- set curLet to getAt(driveList, idx)
- if not DriveIsCDROM(curLet) then
- add(cdList, curLet)
- end if
- end repeat
- return cdList
- end
-
- on isPC
- if the platform contains "windows" then
- return 1
- else
- return 0
- end if
- end
-
- on getRangeList first, last
- set dList to []
- repeat with i = first to last
- add(dList, i)
- end repeat
- return dList
- end
-