home *** CD-ROM | disk | FTP | other *** search
- global gDepth, gPath, gR, gW, gLang, gFields, gLangNames, gOpenField, gFieldInfo, gBtns1, gCasts1, gBtns2, gCasts2, gBtns3, gCasts3, gHilite, gCopierPics, gCopySpr, gCopierMsgs, gMsgSpr, gBtns4, gCasts4, gMode, gDelay, gTrigger, gHiliteDelay, gWaitCursor, gStandardDelay, gReturnChar, gDONT_ANIMATE
-
- on startMovie
- clearGlobals()
- set gDepth to the colorDepth
- set the colorDepth to 4
- set the exitLock to 1
- if the machineType = 256 then
- set s to "\"
- else
- set s to ":"
- end if
- set gPath to the pathName
- set gLang to 0
- set gFields to []
- set gLangNames to []
- set gFieldInfo to []
- set gOpenField to 0
- set gBtns1 to [12, 13, 14, 15, 16, 17]
- set gCasts1 to [101, 111, 121, 131, 141, 151, 271]
- set gBtns2 to [12, 13]
- set gCasts2 to [161, 171]
- set gBtns3 to [12, 13, 14, 15, 16, 17, 18, 19, 20, 47]
- set gCasts3 to [181, 191, 201, 211, 221, 231, 241, 251, 261, 291]
- set gHilite to 1
- set gCopierPics to [184, 194, 204, 214, 224, 234, 244, 254, 254, 0]
- set gCopySpr to 21
- set gCopierMsgs to []
- set n to "04.01.0"
- repeat with i = 1 to 9
- add(gCopierMsgs, the number of cast (n & i & "b"))
- end repeat
- add(gCopierMsgs, 0)
- set gMsgSpr to 41
- set gBtns4 to [45, 46, 47, 48]
- set gCasts4 to [271, 281, 291, 301]
- set gMode to 1
- set gDelay to 0
- set gTrigger to 0
- set gHiliteDelay to 0
- set gWaitCursor to [91, 92]
- set gStandardDelay to 660
- set gReturnChar to RETURN & numToChar(10)
- set gDONT_ANIMATE to 0
- getLanguageNames()
- set the checkboxType to 1
- end
-
- on getLanguageNames
- if objectp(gR) then
- gR(mdispose)
- end if
- set gR to FileIO(mnew, "read", gPath & "0.txt")
- set data to gR(mReadFile)
- gR(mdispose)
- set c to the number of lines in data
- set i to 1
- repeat while voidp(ï)
- set n to line i of data
- set n to charTest(n)
- if char 1 of n = "#" then
- delete char 1 of n
- add(gLangNames, n)
- set i to i + 1
- set s to line i of data
- set the text of cast n to charTest(s)
- end if
- set i to i + 1
- if i > c then
- exit
- end if
- end repeat
- end
-
- on charTest n1
- if charToNum(char 1 of n1) = 10 then
- delete char 1 of n1
- end if
- return n1
- end
-
- on kdScript
- if gOpenField then
- exit
- end if
- if the key = "m" then
- set gMode to 1
- else
- if the frameLabel contains "11.06" then
- exitjob2()
- else
- if the key = "a" then
- autoJob()
- else
- if the key = "q" then
- exitJob()
- else
- if the key = "l" then
- languageJob()
- end if
- end if
- end if
- end if
- end if
- end
-
- on autoJob
- puppetJob1(0)
- puppetJob2(0)
- set gTrigger to 0
- set gMode to 0
- end
-
- on exitJob
- global f
- if f contains "14.15" then
- stopMovie()
- quit()
- end if
- if f contains "14.01" then
- set f to "14.15"
- go(f)
- else
- set f to "14.01"
- end if
- if not f contains "14.01" then
- set f to "14.01"
- end if
- puppetJob1(0)
- puppetJob2(0)
- set gTrigger to 0
- go(f)
- end
-
- on exitjob2
- set f to the frameLabel
- if (f contains "11.06") and (the key = "q") then
- set f to "11.10"
- end if
- puppetJob1(0)
- puppetJob2(0)
- set gTrigger to 0
- go(f)
- end
-
- on languageJob
- set f to the frameLabel
- if f = "01.01" then
- exit
- end if
- puppetJob1(0)
- puppetJob2(0)
- set gTrigger to 0
- disableEdit()
- storeLangText()
- go("01.01")
- end
-
- on setLanguage n1
- if objectp(gR) then
- gR(mdispose)
- end if
- set gR to FileIO(mnew, "read", gPath & n1 & ".txt")
- if not objectp(gR) then
- alert("Sorry - no language file was found.")
- exit
- else
- cursor(gWaitCursor)
- end if
- set data to gR(mReadFile)
- gR(mdispose)
- set gFields to []
- set i to 1
- repeat while voidp(ï)
- set n to line i of data
- set n to charTest(n)
- if n = "<<" then
- exit repeat
- end if
- if char 1 of n = "#" then
- delete char 1 of n
- add(gFields, n)
- set f to EMPTY
- set i to i + 1
- repeat while voidp(ï)
- set s to line i of data
- set s to charTest(s)
- if (s = "<<") or (s = "**") then
- delete char -30003 of f
- set the text of cast n to f
- exit repeat
- next repeat
- end if
- put s & RETURN after f
- set i to i + 1
- end repeat
- next repeat
- end if
- set i to i + 1
- next repeat
- end repeat
- set gLang to n1
- puppetJob1(0)
- cursor(0)
- go(marker(1))
- end
-
- on stopMovie
- cursor(gWaitCursor)
- storeLangNames()
- storeLangText()
- set the colorDepth to gDepth
- cursor(0)
- clearGlobals()
- end
-
- on storeLangNames
- if objectp(gW) then
- gW(mdispose)
- end if
- if not gLang then
- exit
- end if
- set gW to FileIO(mnew, "write", gPath & "0.txt")
- set data to EMPTY
- repeat with i in gLangNames
- put "#" & i & gReturnChar & the text of cast i after data
- if i = getLast(gLangNames) then
- set s to gReturnChar & "<<"
- else
- set s to gReturnChar & "**" & gReturnChar
- end if
- put s after data
- end repeat
- gW(mWriteString, data)
- gW(mdispose)
- end
-
- on storeLangText
- if objectp(gW) then
- gW(mdispose)
- end if
- if not gLang then
- exit
- end if
- set gW to FileIO(mnew, "write", gPath & gLang & ".txt")
- set data to EMPTY
- repeat with i in gFields
- set t1 to the text of cast i
- set c1 to the number of lines in t1
- set t2 to EMPTY
- repeat with j = 1 to c1
- put line j of t1 & gReturnChar after t2
- end repeat
- put "#" & i & gReturnChar & t2 after data
- if i = getLast(gFields) then
- set s to "<<"
- else
- set s to "**" & gReturnChar
- end if
- put s after data
- end repeat
- gW(mWriteString, data)
- gW(mdispose)
- end
-
- on puppetJob1 n1
- repeat with i = 12 to 21
- set the puppet of sprite i to n1
- end repeat
- end
-
- on puppetJob2 n1
- repeat with i = 30 to 48
- set the puppet of sprite i to n1
- end repeat
- end
-
- on editClick
- if not gMode then
- exit
- end if
- if not (the controlDown) then
- exit
- end if
- if gOpenField then
- exit
- end if
- pause()
- set f to the clickOn
- set the ink of sprite f to 0
- set the editableText of sprite f to 1
- set c to the castNum of sprite f
- set gFieldInfo to [f, c]
- add(gFieldInfo, the foreColor of cast c)
- add(gFieldInfo, the backColor of cast c)
- set the foreColor of cast c to 15
- set the backColor of cast c to 4
- set gOpenField to 1
- updateStage()
- end
-
- on disableEdit
- if not gMode or (gFieldInfo = []) then
- exit
- end if
- set L to gFieldInfo
- set s to getAt(L, 1)
- set c to getAt(L, 2)
- set the editableText of sprite s to 0
- set the foreColor of cast c to getAt(L, 3)
- set the backColor of cast c to getAt(L, 4)
- set the ink of sprite s to 36
- set gFieldInfo to []
- set gOpenField to 0
- end
-