home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00391_Updater.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  2.9 KB  |  133 lines

  1. global gPDL, gNopeSND, gNewSetIsHereF, gBtnHitSND, gUpdateAttribFld
  2.  
  3. on hDetectNewUpdate
  4.   if the number of castMembers > 3999 then
  5.     if the name of cast 4000 = "CORRESPONDENCE MAP" then
  6.       if the name of cast 4001 <> the name of cast 510 then
  7.         go("UpA")
  8.         return 1
  9.       else
  10.         return 0
  11.       end if
  12.     else
  13.       return 0
  14.     end if
  15.   else
  16.     return 0
  17.   end if
  18. end
  19.  
  20. on hNeverMind
  21.   go("UpNo")
  22.   hAnnounce("Acknowledged 1")
  23.   go("OpC2")
  24.   hPrepareAll()
  25. end
  26.  
  27. on hDoTheUpdate
  28.   go("UpY1")
  29.   hReportStatus("Thank you. Update begins...")
  30.   hAnnounce("Init. Ency Update")
  31.   set Ltemplist to [:]
  32.   set Ltemplist to value(field 4000)
  33.   if not objectp(Ltemplist) then
  34.     hReportStatus("Correspondence Map for update not created.")
  35.     go("UpOops")
  36.     hAnnounce("Ency update Error")
  37.     return 
  38.   end if
  39.   set Lnum to count(Ltemplist)
  40.   repeat with i = 1 to Lnum
  41.     set Lcstfrom to getPropAt(Ltemplist, i)
  42.     set Lcstto to getAt(Ltemplist, i)
  43.     hReplaceFields(Lcstfrom, Lcstto)
  44.   end repeat
  45.   go("UpY2")
  46.   hearit(gBtnHitSND)
  47.   set Lpass to 1
  48.   hAnnounce("Working 1")
  49.   repeat with i = 1 to Lnum
  50.     if the name of cast Lcstfrom <> the name of cast Lcstto then
  51.       hReportStatus("The name of field number" && i && "does not match the update.")
  52.       hearit(gNopeSND)
  53.       set Lpass to 0
  54.     end if
  55.   end repeat
  56.   if not (the name of cast gUpdateAttribFld starts "UPDATE") then
  57.     alert("The UPDATE text field does not appear where it was expected. Updates may not work.")
  58.   else
  59.     set Lmyname to the name of cast gUpdateAttribFld
  60.     set Lthiscode to char 8 to length(Lmyname) of Lmyname
  61.     put RETURN & Lthiscode after field "History of Updates"
  62.   end if
  63.   put "Adjusting internal data table..." into field "Status"
  64.   hUpdateCastTable()
  65.   go("UpY3")
  66.   hearit(gBtnHitSND)
  67.   if Lpass then
  68.     put "Update complete. Saving..." into field "Status"
  69.     go("UpY4")
  70.     hearit(gBtnHitSND)
  71.     put "One moment please..." into field "Status"
  72.     saveMovie()
  73.     go("UpY5")
  74.     hAnnounce("Update Complete")
  75.     repeat while soundBusy(1)
  76.     end repeat
  77.     repeat while soundBusy(0)
  78.     end repeat
  79.     go("UpY5zap")
  80.   else
  81.     put "That didnt work..." into field "Status"
  82.     hAnnounce("Ency update Error")
  83.     go("OpC2")
  84.     hPrepareAll()
  85.   end if
  86. end
  87.  
  88. on hZapTheShare
  89.   set Lf to the pathName & "Control" & gPDL & "zapshare.dir"
  90.   if hFileIsHere(Lf) then
  91.     play movie Lf
  92.   end if
  93. end
  94.  
  95. on hOpenContinues
  96.   global oVidCD
  97.   set gNewSetIsHereF to 1
  98.   mCreateCDlist(oVidCD)
  99.   go("OpC2")
  100.   hPrepareAll()
  101. end
  102.  
  103. on hReplaceFields pFrom, pTo
  104.   copyToClipBoard(cast pFrom)
  105.   pasteClipBoardInto(cast pTo)
  106. end
  107.  
  108. on hLUmode pWhat
  109.   if pWhat = #EN then
  110.     return "ENCY"
  111.   end if
  112.   if pWhat = #EP then
  113.     return "EPIS"
  114.   end if
  115.   if pWhat = #CH then
  116.     return "CHRO"
  117.   end if
  118.   if pWhat = #to then
  119.     return "TOPI"
  120.   end if
  121.   if pWhat = #RE then
  122.     return "RESO"
  123.   end if
  124. end
  125.  
  126. on hZapSharedCast
  127.   play movie the pathName & "hidingplace:sharedzapper"
  128. end
  129.  
  130. on hSaveMeSaveMe
  131.   saveMovie()
  132. end
  133.