home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global gFirstMainRun, gOldPage1, gOldPage2, gOldPage4, gCFTBundle, gShadowSprite, gScrollSprite, gPhotoSprite, gLastRecipeLine, gHelpSprite, gFromRecipeP, gLastIndexButton
- set the textHeight of field "current recipe" to 10
- if gFirstMainRun then
- set gFirstMainRun to 0
- if the machineType = 256 then
- set the textHeight of field "scroll" to 14
- set the textSize of field "scroll" to 12
- set the textStyle of field "scroll" to "plain"
- set the textFont of field "scroll" to "arial"
- set the textHeight of field "scrollShadow" to 14
- set the textSize of field "scrollShadow" to 12
- set the textStyle of field "scrollShadow" to "bold"
- set the textFont of field "scrollShadow" to "arial"
- else
- set the textHeight of field "scroll" to 14
- set the textSize of field "scroll" to 12
- set the textStyle of field "scroll" to "plain"
- set the textFont of field "scroll" to "helvetica"
- set the textHeight of field "scrollShadow" to 14
- set the textSize of field "scrollShadow" to 12
- set the textStyle of field "scrollShadow" to "bold"
- set the textFont of field "scrollShadow" to "helvetica"
- end if
- end if
- set gOldPage1 to 0
- set gOldPage2 to 0
- set gOldPage4 to 0
- cursor(-1)
- set gShadowSprite to 2
- set gScrollSprite to 3
- set gPhotoSprite to 12
- set gLastRecipeLine to 1
- set gHelpSprite to 44
- helpOff()
- if gFromRecipeP then
- backIndex()
- else
- set gLastIndexButton to EMPTY
- main()
- end if
- end
-
- on stopMovie
- unLoadCast()
- cleanLegos()
- helpOff()
- set the keyDownScript to EMPTY
- end
-
- on makeScroll
- global gIndexScroll, gScrollSprite, gShadowSprite
- set spriteList to [gShadowSprite]
- set track to new("Button", [#spriteChan: 7])
- set ball to new("Button", [#spriteChan: 8, #pressedCast: 64])
- set up to new("Button", [#spriteChan: 9, #pressedCast: 66])
- set down to new("Button", [#spriteChan: 10, #pressedCast: 68])
- set gIndexScroll to new("ScrollBar", [#scrollSprite: gScrollSprite, #scrollLinks: spriteList, #handler: "scrollRatio", #minButton: up, #maxButton: down, #thumbButton: ball, #trackButton: track])
- end
-
- on scrollRatio ratio
- global gCurrentIndexRatio
- set gCurrentIndexRatio to ratio
- end
-
- on resetScroll textIn
- global gIndexScroll
- setScroll(textIn)
- controlPosition(gIndexScroll, 0.0)
- selectRecipe(1)
- end
-
- on setScroll textIn
- global gLastRecipeLine, gLastIndexChapter, gPhotoSprite, gKeySequence
- set gKeySequence to EMPTY
- set the keyDownScript to "keyScroll"
- set gLastRecipeLine to 0
- set gLastIndexChapter to textIn
- set newText to field textIn
- put EMPTY into field "scrollShadow"
- put newText into field "scroll"
- set shadowField to textIn & "Shadow"
- set shadowText to field shadowField
- put shadowText into field "scrollShadow"
- set the textStyle of field "scrollShadow" to "bold"
- put " " into field "current recipe"
- set the visible of sprite gPhotoSprite to 0
- end
-
- on keyScroll
- global gKeySequence, gLastRecipeLine
- if "abcdefghijklmnopqrstuvwxyz " contains the key then
- put the key after gKeySequence
- if length(gKeySequence) > 1 then
- findKeyLine(gLastRecipeLine)
- else
- findKeyLine(1)
- end if
- else
- if the key = BACKSPACE then
- delete char -30000 of gKeySequence
- findKeyLine(1)
- end if
- end if
- end
-
- on findKeyLine begin
- global gIndexScroll, gKeySequence
- cursor(4)
- set Index to field "scroll"
- set num to the number of lines in Index
- if gKeySequence <> EMPTY then
- set keyCount to length(gKeySequence)
- repeat with i = begin to num
- if char 1 to keyCount of line i of Index = gKeySequence then
- set keyLine to i
- exit repeat
- end if
- end repeat
- end if
- if keyLine > 1 then
- set aRatio to float(keyLine - 1) / (num - 1)
- controlPosition(gIndexScroll, aRatio)
- selectRecipe(keyLine)
- else
- set gKeySequence to EMPTY
- controlPosition(gIndexScroll, 0.0)
- selectRecipe(1)
- end if
- cursor(-1)
- end
-
- on main
- global gCFTBook
- set the keyDownScript to EMPTY
- cleanLegos()
- go("main" & gCFTBook)
- mainPuppetsOn()
- end
-
- on backIndex
- global gLastIndexChapter, gIndexScroll, gCurrentMainFrame, gCurrentIndexLine, gCurrentIndexRatio
- setScroll(gLastIndexChapter)
- go(gCurrentMainFrame)
- makeScroll()
- if gCurrentMainFrame = "PastaIndex" then
- makePastaButtons()
- else
- if gCurrentMainFrame = "VegiIndex" then
- makeVegiButtons()
- else
- if gCurrentMainFrame = "StirIndex" then
- makeStirButtons()
- else
- if gCurrentMainFrame = "ChickIndex" then
- makeChickButtons()
- else
- if gCurrentMainFrame = "PastaIndexSolo" then
- makePastaButtons()
- else
- if gCurrentMainFrame = "VegiIndexSolo" then
- makeVegiButtons()
- else
- if gCurrentMainFrame = "StirIndexSolo" then
- makeStirButtons()
- else
- if gCurrentMainFrame = "ChickIndexSolo" then
- makeChickButtons()
- else
- if gCurrentMainFrame = "AZIndex" then
- makeAZButtons()
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- controlPosition(gIndexScroll, gCurrentIndexRatio)
- selectRecipe(gCurrentIndexLine)
- end
-
- on PastaIndex
- global gCFTBundle
- cleanButtons()
- cleanLegos()
- setScroll("Pasta A-E")
- if gCFTBundle = 1 then
- go("PastaIndex")
- else
- go("PastaIndexSolo")
- end if
- makeScroll()
- makePastaButtons()
- scrollRatio(0.0)
- selectRecipe(1)
- end
-
- on VegiIndex
- global gCFTBundle
- cleanButtons()
- cleanLegos()
- setScroll("Vegi A-F")
- if gCFTBundle = 1 then
- go("VegiIndex")
- else
- go("VegiIndexSolo")
- end if
- makeScroll()
- makeVegiButtons()
- scrollRatio(0.0)
- selectRecipe(1)
- end
-
- on StirIndex
- global gCFTBundle
- cleanButtons()
- cleanLegos()
- setScroll("Stir A-C")
- if gCFTBundle = 1 then
- go("StirIndex")
- else
- go("StirIndexSolo")
- end if
- makeScroll()
- makeStirButtons()
- scrollRatio(0.0)
- selectRecipe(1)
- end
-
- on ChickIndex
- global gCFTBundle
- cleanButtons()
- cleanLegos()
- setScroll("Chick A-B")
- if gCFTBundle = 1 then
- go("ChickIndex")
- else
- go("ChickIndexSolo")
- end if
- makeScroll()
- makeChickButtons()
- scrollRatio(0.0)
- selectRecipe(1)
- end
-
- on AZindex
- cleanButtons()
- cleanLegos()
- setScroll("A-C recipes")
- go("AZIndex")
- makeScroll()
- makeAZButtons()
- scrollRatio(0.0)
- selectRecipe(1)
- end
-
- on selectRecipe lineNum
- global gCurrentBook, gCurrentRecipe, gLastRecipeLine, gCurrentIndexLine, gRecipeIDDB, gPhotoSprite
- if lineNum < 1 then
- exit
- end if
- if lineNum = 1 then
- repeat while length(line lineNum of field "scroll") < 1
- set lineNum to lineNum + 1
- end repeat
- end if
- if gLastRecipeLine = lineNum then
- exit
- end if
- set theRecipe to line lineNum of field "scroll"
- if theRecipe = EMPTY then
- exit
- end if
- set gCurrentIndexLine to lineNum
- set gLastRecipeLine to lineNum
- set gCurrentRecipe to getProp(gRecipeIDDB, theRecipe)
- if gCurrentRecipe < 427 then
- set gCurrentBook to "healthy"
- else
- if gCurrentRecipe < 1457 then
- set gCurrentBook to "ABL"
- else
- if gCurrentRecipe < 1613 then
- set gCurrentBook to "guide"
- else
- if gCurrentRecipe <= 1772 then
- set gCurrentBook to "Pasta"
- else
- if gCurrentRecipe <= 1868 then
- set gCurrentBook to "Vegi"
- else
- if gCurrentRecipe <= 1968 then
- set gCurrentBook to "Stir"
- else
- if gCurrentRecipe <= 2068 then
- set gCurrentBook to "Chick"
- else
- set gCurrentBook to "personal"
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- updateIndexPhoto()
- set the visible of sprite gPhotoSprite to 1
- if the number of words in theRecipe > 3 then
- if length(word 1 to 3 of theRecipe) < 28 then
- put word 1 to 3 of theRecipe & "..." into field "current recipe"
- else
- put word 1 to 2 of theRecipe & "..." into field "current recipe"
- end if
- else
- if length(theRecipe) < 28 then
- put theRecipe into field "current recipe"
- else
- put word 1 to 2 of theRecipe & "..." into field "current recipe"
- end if
- end if
- end
-
- on newDoRoll
- repeat with i = 3 to 12
- if rollOver(i) then
- glow(i)
- next repeat
- end if
- noGlow(i)
- end repeat
- updateStage()
- end
-
- on glow i
- if the castNum of sprite i mod 2 then
- set the castNum of sprite i to the castNum of sprite i + 1
- else
- nothing()
- end if
- end
-
- on noGlow i
- if the castNum of sprite i mod 2 then
- nothing()
- else
- set the castNum of sprite i to the castNum of sprite i - 1
- end if
- end
-
- on mainPuppetsOn
- global gAnimationSprites, gRollTitle, gPlanDay, gPlanMonth
- repeat with spriteNum = 3 to 12
- puppetSprite(spriteNum, 1)
- end repeat
- end
-
- on darkScreen
- cleanLegos()
- puppetSound("switch")
- go("quit")
- end
-
- on makePastaButtons
- global gCFTBundle, gPastaButton1, gPastaButton2, gPastaButton3, gPastaButton4, gPastaButton5, gPastaButton6, gPastaButton7, gPastaButton8, gPastaButton9, gPastaButton10, gPastaButton11, gLastIndexButton
- set gPastaButton1 to indexButton(18)
- set gPastaButton2 to indexButton(19)
- set gPastaButton3 to indexButton(20)
- set gPastaButton4 to indexButton(21)
- set gPastaButton5 to indexButton(22)
- set gPastaButton6 to indexButton(23)
- set gPastaButton7 to indexButton(24)
- set gPastaButton8 to indexButton(25)
- set gPastaButton9 to indexButton(26)
- set gPastaButton10 to indexButton(27)
- set gPastaButton11 to indexButton(28)
- puppetSprite(29, 1)
- if gCFTBundle = 1 then
- makeBookButtons()
- end if
- if objectp(gLastIndexButton) then
- select(gLastIndexButton)
- else
- select(gPastaButton1)
- end if
- end
-
- on makeVegiButtons
- global gCFTBundle, gVegiButton1, gVegiButton2, gVegiButton3, gVegiButton4, gVegiButton5, gVegiButton6, gVegiButton7, gVegiButton8, gVegiButton9, gLastIndexButton
- set gVegiButton1 to indexButton(18)
- set gVegiButton2 to indexButton(19)
- set gVegiButton3 to indexButton(20)
- set gVegiButton4 to indexButton(21)
- set gVegiButton5 to indexButton(22)
- set gVegiButton6 to indexButton(23)
- set gVegiButton7 to indexButton(24)
- set gVegiButton8 to indexButton(25)
- set gVegiButton9 to indexButton(26)
- puppetSprite(27, 1)
- if gCFTBundle = 1 then
- makeBookButtons()
- end if
- if objectp(gLastIndexButton) then
- select(gLastIndexButton)
- else
- select(gVegiButton1)
- end if
- end
-
- on makeStirButtons
- global gCFTBundle, gStirButton1, gStirButton2, gStirButton3, gStirButton4, gStirButton5, gStirButton6, gStirButton7, gStirButton8, gStirButton9, gStirButton10, gLastIndexButton
- set gStirButton1 to indexButton(18)
- set gStirButton2 to indexButton(19)
- set gStirButton3 to indexButton(20)
- set gStirButton4 to indexButton(21)
- set gStirButton5 to indexButton(22)
- set gStirButton6 to indexButton(23)
- set gStirButton7 to indexButton(24)
- set gStirButton8 to indexButton(25)
- set gStirButton9 to indexButton(26)
- set gStirButton10 to indexButton(27)
- puppetSprite(28, 1)
- if gCFTBundle = 1 then
- makeBookButtons()
- end if
- if objectp(gLastIndexButton) then
- select(gLastIndexButton)
- else
- select(gStirButton1)
- end if
- end
-
- on makeChickButtons
- global gCFTBundle, gChickButton1, gChickButton2, gChickButton3, gChickButton4, gChickButton5, gChickButton6, gChickButton7, gChickButton8, gChickButton9, gChickButton10, gChickButton11, gChickButton12, gChickButton13, gLastIndexButton
- set gChickButton1 to indexButton(18)
- set gChickButton2 to indexButton(19)
- set gChickButton3 to indexButton(20)
- set gChickButton4 to indexButton(21)
- set gChickButton5 to indexButton(22)
- set gChickButton6 to indexButton(23)
- set gChickButton7 to indexButton(24)
- set gChickButton8 to indexButton(25)
- set gChickButton9 to indexButton(26)
- set gChickButton10 to indexButton(27)
- set gChickButton11 to indexButton(28)
- set gChickButton12 to indexButton(29)
- set gChickButton13 to indexButton(30)
- puppetSprite(31, 1)
- if gCFTBundle = 1 then
- makeBookButtons()
- end if
- if objectp(gLastIndexButton) then
- select(gLastIndexButton)
- else
- select(gChickButton1)
- end if
- end
-
- on makeAZButtons
- global gCFTBundle, gAZButton1, gAZButton2, gAZButton3, gAZButton4, gAZButton5, gAZButton6, gAZButton7, gAZButton8, gAZButton9, gAZButton10, gAZButton11, gAZButton12, gAZButton13, gAZButton14, gLastIndexButton
- set gAZButton1 to indexButton(18)
- set gAZButton2 to indexButton(19)
- set gAZButton3 to indexButton(20)
- set gAZButton4 to indexButton(21)
- set gAZButton5 to indexButton(22)
- set gAZButton6 to indexButton(23)
- set gAZButton7 to indexButton(24)
- set gAZButton8 to indexButton(25)
- set gAZButton9 to indexButton(26)
- set gAZButton10 to indexButton(27)
- set gAZButton11 to indexButton(28)
- set gAZButton12 to indexButton(29)
- set gAZButton13 to indexButton(30)
- set gAZButton14 to indexButton(31)
- if gCFTBundle = 1 then
- makeBookButtons()
- end if
- if objectp(gLastIndexButton) then
- select(gLastIndexButton)
- else
- select(gAZButton1)
- end if
- end
-
- on makeBookButtons
- global gPastaButton, gVegiButton, gChickButton, gStirButton, gAZButton
- set gPastaButton to radioButton(40)
- set gVegiButton to radioButton(42)
- set gStirButton to radioButton(41)
- set gChickButton to radioButton(39)
- set gAZButton to radioButton(43)
- end
-
- on cleanButtons
- global gLastIndexButton
- set gLastIndexButton to EMPTY
- end
-
- on goCredits
- cleanLegos()
- set the visible of sprite 44 to 0
- go("credits")
- puppetSprite(2, 1)
- startTimer()
- end
-
- on credits
- global gOriginalColorDepth
- if the mouseDown and (the mouseH < 5) and (the mouseV < 5) then
- set the visible of sprite 44 to 1
- else
- if the mouseDown then
- set the colorDepth to gOriginalColorDepth
- clearGlobals()
- DBEndSession()
- quit()
- else
- if the timer > 540 then
- set current to the castNum of sprite 2
- if current = 454 then
- set the colorDepth to gOriginalColorDepth
- clearGlobals()
- DBEndSession()
- else
- set the castNum of sprite 2 to current + 1
- end if
- startTimer()
- else
- set the visible of sprite 44 to 0
- end if
- end if
- end if
- end
-
- on helpOn
- global gLastHelp, gHelpLinks, gHelpActive, gHelpSprite
- if gHelpActive then
- helpOff()
- else
- set gHelpActive to 1
- set gLastHelp to 0
- set gHelpLinks to [3: 9, 4: 5, 5: 13, 6: 14, 7: 16, 8: 17, 9: 12, 10: 7, 11: 1]
- puppetSprite(gHelpSprite, 1)
- end if
- end
-