home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Stickerpedia Stickerbook
/
Stickerbook.iso
/
pc
/
DATA
/
objects.cxt
/
00011_Script_oHQ
< prev
next >
Wrap
Text File
|
2003-03-19
|
5KB
|
204 lines
--¨
oHQ
global oHQ
global oFileIO
global gPathDelim
global oMarvin
property pObjectList
property pObjectNameList
property pObjectListString
property pVersionInfoList
property pVersion
property pRunInDebugMode
property pDebugLogNum
property pDebugLogText
property pDebugLogName
property pDebugLogPath
property pPropertyDumpIDentifier
on new me
pObjectList = []
pObjectListString = "[]"
pObjectNameList = []
pDebugLogText = ""
pDebugLogNum = 0
pDebugLogName = "~report_"
pDebugLogPath = the pathname & "~debug" & gPathDelim
pPropertyDumpIDentifier = "|| "
if gPathDelim = "\" then
-- Win:
logfiles = baFileList( pDebugLogPath, "*.log" )
else
-- Mac:
logfiles = baFileList( pDebugLogPath, "TEXT" )
end if
pDebugLogNum = logfiles.count
writeDebugInfo me, "----------" & return & "Log started" && the time && RETURN
loFileIO = new(script "oFileIO")
versionTempText = getFile(loFileIO, #default, "~version.txt")
pVersionInfoList = [:]
numOfLines = versionTempText.lines.count
saveDelim = the itemDelimiter
the itemDelimiter = "="
repeat with n = 1 to numOfLines
pVersionInfoList.addProp((versionTempText.line[n].item[1]),(versionTempText.line[n].item[2]))
tempText = tempText & pVersionInfoList[n] & RETURN
end repeat
pRunInDebugMode = value(pVersionInfoList["debug"])
the itemDelimiter = saveDelim
member("versionInfo", "shared").text = versionTempText
loFileIO = void
-- updateProgressBar ("Object loading", oHQ && "status #ok")
addObject me
return me
end
on debug me
pRunInDebugMode = 1
sendAllSprites #debug
end
on addObject me, anObject, addToAL, newInstance
set objectName = objectToName(me, anObject)
if newInstance or (not(offset(objectName, pObjectListString))) then
add pObjectList, anObject
set pObjectListString = string(pObjectList)
add pObjectNameList, objectName
if addToAL then
add the actorlist, anObject
end if
end if
end
on objectToName me, anObject
set objectText = string(anObject)
set objectName = char 13 to length(objectText) of objectText
set retVal = char 1 to ((offset(quote, objectName))-1) of objectName
return retVal
end
on showMyProps me
showProps me, me
end
on showProps me, anObject, outPutTo
put anObject
if outPutTo = void then set outPutTo = #message
set objectName = objectToName(me, anObject)
set numOfProps = count(anObject)
set output = RETURN
set output = output & RETURN & pPropertyDumpIDentifier & "Properties of" && objectName && anObject
set output = output & RETURN & pPropertyDumpIDentifier & "Time:" && the long time & ", " & the short date
set output = output & RETURN & pPropertyDumpIDentifier & "Number of properties:" && numOfProps & RETURN & pPropertyDumpIDentifier
set propList = []
repeat with n = 1 to numOfProps
add propList, (getPropAt(anObject, n) & ":" && getAt(anObject, n))
end repeat
sort propList
repeat with n = 1 to numOfProps
set outPut = output & RETURN & pPropertyDumpIDentifier & getAt(propList,n)
end repeat
case outPutTo of
#message:
put output
#file:
writeDebugInfo me, output
end case
end
on clearUp me
set the actorlist = []
set the windowList = []
end
on deleteObject me, objectRef
end
on addToActorList me, anObject
add the actorlist, anObject
end
on handleError me, error, description
theMessage = theMessage && "Error:" && error & RETURN
theMessage = theMessage && "Description:" && description & RETURN
theMessage = theMessage && "Time:" && the time & RETURN
theMessage = theMessage && "Platform:" && the platform & RETURN
theMessage = theMessage && "Memory:" && (checkRAM())[2] & RETURN
theMessage = theMessage && "File:" && the moviename & RETURN
if pVersionInfoList[#releasetype] <> "release" then
customAlert theMessage
end if
if the runMode = "author" then
put theMessage
else
writeDebugInfo me, theMessage
end if
end
on writeDebugInfo me, output
pDebugLogText = pDebugLogText & RETURN & output & RETURN & "----------"
writeFile oFileIO, pDebugLogPath, (pDebugLogName & doublePad(oMarvin, pDebugLogNum) & ".log" ), pDebugLogText
end