home *** CD-ROM | disk | FTP | other *** search
- property continueHandler, continueObj, defaultBtn, defaultCancelBtn
- global gDialogPresent, gObj3, gObj2, gObj5, gPlatForm
-
- on startMovie
- end
-
- on st
- set theStr to EMPTY
- repeat with i = 1 to 255
- put numToChar(i) after theStr
- end repeat
- put theStr
- end
-
- on promptToOverwrite me, theSprite, state
- if state then
- puppetSound(1, "alertSnd")
- end if
- repeat with i = 26 to 33
- set the locV of sprite i to the locV of sprite i - (((state * 2) - 1) * 300)
- end repeat
- if state then
- set the rect of sprite 25 to the rect of sprite 2
- else
- set the locH of sprite 25 to 9000
- end if
- set the editableText of sprite 23 to abs(state - 1)
- updateStage()
- end
-
- on displayDialog num, param1, param2, param3
- tell the stage
- set the idleHandlerPeriod to 9999
- end tell
- set the idleHandlerPeriod to 0
- set the cpuHogTicks to 0
- set gDialogPresent to num
- cursor(0)
- case num of
- 9:
- set the text of member "directoryIndex" to the pDataFileDirectoryContents of gObj5
- set the textHeight of member "directoryIndex" to 15
- 10:
- set the text of member "directoryIndex2" to the pDataFileDirectoryContents of gObj5
- set the textHeight of member "directoryIndex2" to 15
- if the pCurrentFileName of gObj5 = 0 then
- set the text of member "fileName" to the pDefaultFileName of gObj5
- else
- set the text of member "fileName" to the pCurrentFileName of gObj5
- end if
- 20:
- set the text of member "theTitle" to param1
- set the text of member "theName" to param2
- end case
- if num > 20 then
- prepareDlog(gObj3, num - 20, param1, param2, param3)
- else
- set the continueHandler of script "DialogScripts" to param1
- set the continueObj of script "DialogScripts" to param2
- end if
- if getOne([2, 3, 4, 7, 8, 12, 13, 14, 16], num) then
- preloadMember("alertSnd")
- puppetSound(1, "alertSnd")
- else
- if num = 15 then
- puppetSound(1, "testSnd")
- end if
- end if
- preLoad(num, num)
- go(num)
- if (num = 12) or (num = 13) then
- set the myParams of sprite(4) to param1
- end if
- end
-
- on terminateDialog me, returnMessage, whichObj, param1
- tell the stage
- set the idleHandlerPeriod to 0
- end tell
- set the idleHandlerPeriod to 9999
- set the cpuHogTicks to 9999
- set the visible of sprite 20 to 1
- set the modal of the activeWindow to 0
- set the visible of the activeWindow to 0
- go(#loop)
- tell the stage
- set the stageColor to the stageColor
- end tell
- set the keyDownScript to EMPTY
- case returnMessage of
- #editText:
- set balloonType to gDialogPresent - 20
- set param1 to duplicate(getAt(getAt(getAt(the allBalloonInfoList of gObj3, balloonType), the cBalloonTypeSize of gObj3), 1))
- addAt(param1, 1, getPropAt(getAt(the allBalloonInfoList of gObj3, balloonType), the cBalloonTypeSize of gObj3))
- add(param1, [the cBalloonString of gObj3, the text of member (balloonType + 70)])
- set param2 to the cBalloonTypeSize of gObj3
- #Cancel:
- set returnMessage to 0
- #continueHandler:
- if not continueHandler then
- alert("Error: no continueHandler present!")
- end if
- set returnMessage to continueHandler
- set whichObj to continueObj
- #saveFile:
- if not (gDialogPresent = 7) then
- set param1 to the text of member "fileName"
- end if
- set param2 to continueHandler
- set param3 to continueObj
- #editTitleAndName:
- set param1 to the text of member "theTitle"
- set param2 to the text of member "theName"
- end case
- set defaultBtn to 0
- set defaultCancelBtn to 0
- set gDialogPresent to 0
- set continueHandler to 0
- set continueObj to 0
- if returnMessage = 0 then
- exit
- end if
- if whichObj = #none then
- tell the stage
- call(returnMessage, script 1, 1, param1, param2, param3)
- end tell
- else
- tell the stage
- call(returnMessage, whichObj, 1, param1, param2, param3)
- end tell
- end if
- end
-
- on handleDefaultKeyDown me, force
- if defaultBtn and ((the key = RETURN) or (the key = ENTER) or force) then
- mouseDown(sprite(defaultBtn))
- set x to the ticks + 5
- repeat while the ticks < x
- end repeat
- mouseUp(sprite(defaultBtn))
- stopEvent()
- else
- set keyNum to charToNum(the key)
- if keyNum < 5 then
- stopEvent()
- else
- pass()
- end if
- end if
- end
-
- on modKeyPressed
- if gPlatForm then
- return the commandDown
- else
- return the controlDown
- end if
- end
-
- on checkBtnLocations dialogBottom, buttonList
- if voidp(buttonList) then
- set buttonList to []
- repeat with i = 1 to 3
- if the memberNum of sprite ((i * 2) + 2) then
- add(buttonList, (i * 2) + 2)
- end if
- end repeat
- end if
- repeat with i in buttonList
- set textSprite to i - 1
- set the locV of sprite i to dialogBottom - 50
- set the locV of sprite textSprite to dialogBottom - 53 + the height of the member of sprite i
- set the locH of sprite textSprite to the locH of sprite i - (the width of the member of sprite textSprite / 2) + 10
- end repeat
- end
-
- on Del t
- set x to the ticks + t
- repeat while the ticks < x
- end repeat
- end
-
- on zetup
- repeat with i = 2 to the lastFrame
- go(i)
- if the memberNum of sprite 1 then
- repeat with q = 1 to 3
- set btnSprite to (q * 2) + 2
- if the memberNum of sprite btnSprite then
- beginRecording()
- set the locV of sprite btnSprite to the locV of sprite 1 - 10
- if the memberNum of sprite (btnSprite - 1) then
- set the locV of sprite (btnSprite - 1) to the locV of sprite 1 + 9
- end if
- endRecording()
- end if
- end repeat
- end if
- end repeat
- end
-