home *** CD-ROM | disk | FTP | other *** search
/ Better Homes & Gardens: …oking for Today - Chicken / Image.iso / pc / shared.dxr / 01003_resources.ls < prev    next >
Encoding:
Text File  |  1995-11-21  |  4.3 KB  |  146 lines

  1. on loadPIC aType, aFolder, aFileName, castName
  2.   if the machineType = 256 then
  3.     set aFile to the pathName & "PIC\" & aType & "\" & aFolder & "\" & aFileName & ".PIC"
  4.   else
  5.     set aFile to the pathName & "PIC:" & aType & ":" & aFolder & ":" & aFileName & ".PIC"
  6.   end if
  7.   set theCast to the number of cast castName
  8.   set the fileName of cast theCast to aFile
  9.   updateStage()
  10. end
  11.  
  12. on loadLILPIC aType, aFolder, aFileName, castName
  13.   put "L" into char 1 of aFileName
  14.   if the machineType = 256 then
  15.     set aFile to the pathName & "LILPIC\" & aType & "\" & aFolder & "\" & aFileName & ".PIC"
  16.   else
  17.     set aFile to the pathName & "LILPIC:" & aType & ":" & aFolder & ":" & aFileName & ".PIC"
  18.   end if
  19.   set theCast to the number of cast castName
  20.   set the fileName of cast theCast to aFile
  21.   updateStage()
  22. end
  23.  
  24. on loadSound aFolder, aFileName, castName
  25.   if the machineType = 256 then
  26.     set aFile to the pathName & "AUDIO\" & aFolder & "\" & aFileName & ".AIF"
  27.   else
  28.     set aFile to the pathName & "AUDIO:" & aFolder & ":" & aFileName & ".AIF"
  29.   end if
  30.   set theCast to the number of cast castName
  31.   set the fileName of cast theCast to aFile
  32.   updateStage()
  33. end
  34.  
  35. on updateIndexPhoto
  36.   global gCurrentBook, gPhotoSprite, gCurrentRecipe, gCFTBook
  37.   cursor(4)
  38.   puppetSprite(gPhotoSprite, 1)
  39.   if gCurrentBook = "personal" then
  40.     set the castNum of sprite gPhotoSprite to the number of cast "personal filler"
  41.   else
  42.     if gCurrentBook = "Pasta" then
  43.       set aFileName to DBMain()
  44.       set aFolder to "PASTA"
  45.       loadLILPIC("BEAUTY", aFolder, "l" & aFileName, "index photo")
  46.     else
  47.       if gCurrentBook = "Vegi" then
  48.         set aFileName to DBMain()
  49.         set aFolder to "VEGI"
  50.         loadLILPIC("BEAUTY", aFolder, "l" & aFileName, "index photo")
  51.       else
  52.         if gCurrentBook = "Stir" then
  53.           set aFileName to DBMain()
  54.           set aFolder to "STIR"
  55.           loadLILPIC("BEAUTY", aFolder, "l" & aFileName, "index photo")
  56.         else
  57.           if gCurrentBook = "Chick" then
  58.             set aFileName to DBMain()
  59.             set aFolder to "CHICK"
  60.             loadLILPIC("BEAUTY", aFolder, "l" & aFileName, "index photo")
  61.           end if
  62.         end if
  63.       end if
  64.     end if
  65.   end if
  66.   updateStage()
  67.   cursor(-1)
  68. end
  69.  
  70. on namePalettes beginCast, endCast
  71.   repeat with i = beginCast to endCast
  72.     set aName to the name of cast i
  73.     if word 1 of aName = "palette" then
  74.       nothing()
  75.       next repeat
  76.     end if
  77.     set newName to char 1 to offset(".", aName) - 1 of aName
  78.     set the name of cast (i - 1) to newName
  79.     move(cast i, cast (endCast + i))
  80.     move(cast (i - 1), cast (((i - 1) / 2) + 1))
  81.   end repeat
  82. end
  83.  
  84. on loadPersonalIndexes
  85.   global gDBResult, gCategory1, gCategory2, gCategory3, gCategory4, gCategory5, gPersonalBrowser, gPersonalIDDB, gRecipeIDDB
  86.   set category1 to []
  87.   set category2 to []
  88.   set category3 to []
  89.   set category4 to []
  90.   set category5 to []
  91.   set gPersonalIDDB to [:]
  92.   DBBeginSaveSession()
  93.   repeat while 1
  94.     DBNextSetRecord("personal recipe")
  95.     if gDBResult = 0 then
  96.       set category to integer(DBGetSetField(3004))
  97.       set title to DBGetSetField(3001)
  98.       set id to integer(DBGetSetField(3000))
  99.       addProp(gPersonalIDDB, title, id)
  100.       if category = 1 then
  101.         add(category1, title & RETURN)
  102.       else
  103.         if category = 2 then
  104.           add(category2, title & RETURN)
  105.         else
  106.           if category = 3 then
  107.             add(category3, title & RETURN)
  108.           else
  109.             if category = 4 then
  110.               add(category4, title & RETURN)
  111.             else
  112.               if category = 5 then
  113.                 add(category5, title & RETURN)
  114.               end if
  115.             end if
  116.           end if
  117.         end if
  118.       end if
  119.       nothing()
  120.       next repeat
  121.     end if
  122.     exit repeat
  123.   end repeat
  124.   sort(category1)
  125.   sort(category2)
  126.   sort(category3)
  127.   sort(category4)
  128.   sort(category5)
  129.   set gCategory1 to listToString3(category1)
  130.   set gCategory2 to listToString3(category2)
  131.   set gCategory3 to listToString3(category3)
  132.   set gCategory4 to listToString3(category4)
  133.   set gCategory5 to listToString3(category5)
  134.   set gPersonalBrowser to [:]
  135.   set lists to [category1, category2, category3, category4, category5]
  136.   set num to 0
  137.   repeat with aList in lists
  138.     repeat with anItem in aList
  139.       set title to line 1 of anItem
  140.       set num to num + 1
  141.       addProp(gPersonalBrowser, title, num)
  142.     end repeat
  143.   end repeat
  144.   DBEndSession()
  145. end
  146.