home *** CD-ROM | disk | FTP | other *** search
- on enterFrame
- global colorcrsr, domainIsReady
- if the machineType <> 256 then
- closeResFile()
- openResFile(the pathName & "ROXY cursors")
- end if
- end
-
- on exitFrame
- global oStoryteller, oPuppeteer, builderwindow, domainIsReady, building, fastLocationData, gVoid, gLocData
- if not objectp(oPuppeteer) then
- alert("Hey! There's no Puppeteer object")
- end if
- put "exitFrame(1 of ROXY): domainIsReady = " & domainIsReady
- enterNewDomain(oPuppeteer, [field "LocationStubList"], "multiFrames", "foreground.DATA", "inventory.DATA")
- set loadTime to the timer
- REPORT2(" enterNewDomain(oPuppeteer) done at " & loadTime & " ticks")
- set myMem to the freeBytes
- if fastLocationData then
- REPORT2("loading data from external data-files...")
- set gLocData to [:]
- set dataLoader to new(xtra("FileIO"))
- if not objectp(dataLoader) then
- alert("Sorry, unable to create the data-loader..")
- quit()
- end if
- repeat with i = 1 to count(the locationSublists of oPuppeteer)
- set roomName to getAt(the locationSublists of oPuppeteer, i)
- openFile(dataLoader, the pathName & "Roxy_" & i & ".DAT", 1)
- if error(dataLoader, status(dataLoader)) = "OK" then
- setPosition(dataLoader, 0)
- set timeStamp to readLine(dataLoader)
- if char 1 to 30 of timeStamp <> line 2 of field "LocationStublist.OLD" then
- alert("I wouldn't use this data if I were you... the time/date stamp doesn't match the current location stub-list in this domain...")
- set dataLoader to 0
- set gLocData to gVoid
- exit repeat
- else
- set roomString to readFile(dataLoader)
- addProp(gLocData, roomName, roomString)
- closefile(dataLoader)
- end if
- next repeat
- end if
- alert("Hm, there's some problem opening this file ('ROXY_" & i & ".DAT')..")
- put error(dataLoader, status(dataLoader))
- set gLocData to gVoid
- exit repeat
- end repeat
- set dataLoader to 0
- set timeElapsed to the timer
- REPORT2(">ΓÇó> Finished loading loc-data at " & timeElapsed & " ticks..")
- if voidp(gLocData) then
- put "gLocData is now <void>..."
- end if
- if listp(gLocData) then
- repeat with subString in gLocData
- end repeat
- end if
- else
- put "loading it from domain movie's cast..."
- preLoadCast(30, 820)
- end if
- set loadTime to the timer
- REPORT2(" preloading all location-data took about " & loadTime & " ticks")
- REPORT2(" it also consumed " & myMem - the freeBytes & " bytes of RAM (" & (myMem - the freeBytes) / 1024 & " K)")
- put "ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó"
- if not objectp(colorcrsr) then
- put "•••• Loading cast-cursors… ••••"
- preLoadCast(2501, 2738)
- put "ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó Cursors loaded ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó"
- end if
- if not objectp(oStoryteller) then
- alert("Hey! There's no Storyteller object")
- end if
- enablePeekAlert()
- setProp(the lsStateData of oStoryteller, #currentDomain, ["ROXY"])
- set the basePalette of oPuppeteer to the number of member "ROXY base"
- REPORT2("Domain is ready = TRUE, at " & the timer & " ticks")
- end
-