home *** CD-ROM | disk | FTP | other *** search
/ Discover Planet Earth / EB.ISO / Installation.exe / Main / %ExecutableFullScreen% / %ExecutableFullScreen%.dxr / 00003_oPresentation.ls < prev    next >
Encoding:
Text File  |  2007-10-30  |  5.0 KB  |  219 lines

  1. property aID, aOKCancel, aBoucleVerif, aNoStartup
  2.  
  3. on new me, pId
  4.   aID = "QA-" & string(pId)
  5.   Subscribe(aID, me)
  6.   addFrameObj(aID)
  7.   aBoucleVerif = 0
  8.   aNoStartup = 0
  9.   return me
  10. end
  11.  
  12. on done me
  13.   if objectp(aOKCancel) then
  14.     done(aOKCancel)
  15.   end if
  16.   Unsubscribe(aID)
  17. end
  18.  
  19. on setTransition me
  20.   VisibleManager(0)
  21. end
  22.  
  23. on DoEnterFrame me
  24.   if aNoStartup = 0 then
  25.     startup(me)
  26.   end if
  27.   if aBoucleVerif = 1 then
  28.     CheckCD(me)
  29.     aBoucleVerif = 0
  30.     ContinueStartup(me)
  31.   end if
  32. end
  33.  
  34. on show me
  35.   if the colorDepth = 8 then
  36.     FixPaletteMLX("Logo  Q/A I  bogus Palette")
  37.   end if
  38.   VisibleManager(1, [1])
  39.   FixUpdateStage("QA-010")
  40. end
  41.  
  42. on StartEva me
  43.   global gCD
  44.   delMDLst(0)
  45.   delMDLst(1)
  46.   delKeyLst(aID, #all)
  47.   if gCD = 1 then
  48.     URLManager("E")
  49.   else
  50.     URLManager("S")
  51.   end if
  52. end
  53.  
  54. on DoTimeout me
  55.   StartEva()
  56. end
  57.  
  58. on DoMouseDown me, pSprite, pFirst, pPrevSprite
  59.   return #RIEN
  60. end
  61.  
  62. on doKeyDown me, pKey
  63.   return #RIEN
  64. end
  65.  
  66. on doKeyUp me, pKey
  67.   return #RIEN
  68. end
  69.  
  70. on setCursor me
  71.   nothing()
  72. end
  73.  
  74. on getProperties me
  75.   return 0
  76. end
  77.  
  78. on startup me
  79.   global gDriveCD, gDriveHD, cRecData, gLoaderObj, gCD, gHDDataPath, gHDRecPath
  80.   GeneralCursor(4)
  81.   FixUpdateStage("apres general cursor")
  82.   if the machineType = 256 then
  83.     PathDelimiter = "\"
  84.   else
  85.     PathDelimiter = ":"
  86.   end if
  87.   gHDRecPath = gDriveHD & getString(#HDRec, 1) & PathDelimiter
  88.   gHDDataPath = gDriveHD & getString(#HDData, 0) & PathDelimiter
  89.   checkRecettesFiles()
  90.   CheckCD(me)
  91.   if gCD = 0 then
  92.     CreatePalette(me)
  93.   else
  94.     ContinueStartup(me)
  95.   end if
  96. end
  97.  
  98. on CreatePalette me
  99.   global gDialogStrings
  100.   if not objectp(aOKCancel) then
  101.     aOKCancel = new(script("oCancelOK"), "QuitContinue", 1, 44, [479, 480, 484, 481], ["Continue", "QuitEva"], [point(320, 240), getaProp(gDialogStrings, "PalCQText"), getaProp(gDialogStrings, "PalCQQuit"), getaProp(gDialogStrings, "PalCQCont")], [#NoCDText, #NoCDGo, #NoCDQuit])
  102.     OpenDialog(aOKCancel, 1)
  103.     aNoStartup = 1
  104.   end if
  105. end
  106.  
  107. on checkRecettesFiles
  108.   global gHDRecPath, cRecData, gExtension
  109.   FileLst = GetFileLst(gHDRecPath)
  110.   repeat with i = 1 to count(FileLst)
  111.     setAt(FileLst, i, RemapWord(getAt(FileLst, i)))
  112.   end repeat
  113.   MasterChunkData = value(member(2, cRecData).text)
  114.   PackageLst = getAt(MasterChunkData, 3)
  115.   repeat with i = 1 to count(PackageLst)
  116.     setAt(PackageLst, i, RemapWord(getAt(PackageLst, i)))
  117.   end repeat
  118.   repeat with i = 2 to count(PackageLst)
  119.     if getPos(FileLst, getAt(PackageLst, i) & gExtension) = 0 then
  120.       if the machineType = 256 then
  121.         ShipError(getError(#FileMissing1) & getAt(PackageLst, i) & gExtension & getError(#FileMissing2) & getString(#HDRec, 1) & getError(#FileMissing4))
  122.       else
  123.         ShipError(getError(#FileMissing1) & getAt(PackageLst, i) & gExtension & getError(#FileMissing3) & getString(#HDRec, 1) & getError(#FileMissing4))
  124.       end if
  125.       QuitEva()
  126.       abort()
  127.     end if
  128.   end repeat
  129. end
  130.  
  131. on CheckCD me
  132.   global gCD, gDriveCD, gCDCastsPath, gCDDataPath, gCDRecPath, gCDTourPath, gFromProjector
  133.   BogusFileName = "speak.bab"
  134.   if the machineType = 256 then
  135.     gDriveCD = FindFile(BogusFileName)
  136.     if stringp(gDriveCD) then
  137.       gCD = 1
  138.     else
  139.       gCD = 0
  140.     end if
  141.   else
  142.     if voidp(gFromProjector) then
  143.       gDriveCD = "Station CD-ROM:00-Eva:CD-ROM:"
  144.       gCD = 1
  145.     else
  146.       gDriveCD = getString(#MacCDName, 1) & ":"
  147.       if FindFile(gDriveCD & BogusFileName) then
  148.         gCD = 1
  149.       else
  150.         gCD = 0
  151.       end if
  152.     end if
  153.   end if
  154. end
  155.  
  156. on SetPath me
  157.   global gCD, gDriveCD, gCDCastsPath, gCDDataPath, gCDRecPath, gCDTourPath
  158.   if the machineType = 256 then
  159.     PathDelimiter = "\"
  160.   else
  161.     PathDelimiter = ":"
  162.   end if
  163.   if gCD then
  164.     gCDCastsPath = gDriveCD & getString(#CDData, 0) & PathDelimiter
  165.     gCDDataPath = gDriveCD & getString(#CDData, 0) & PathDelimiter
  166.     gCDRecPath = gDriveCD & getString(#CDData, 0) & PathDelimiter
  167.     gCDTourPath = gDriveCD & getString(#CDTour, 0) & PathDelimiter
  168.   else
  169.     gCDCastsPath = 0
  170.     gCDDataPath = 0
  171.     gCDRecPath = 0
  172.     gCDTourPath = 0
  173.   end if
  174. end
  175.  
  176. on ContinueStartup me
  177.   global gCD, gLoaderObj, gAccesRecettes, cRecData, gDialogStrings
  178.   UpdateRecettes()
  179.   ReadChunkData(gLoaderObj)
  180.   gAccesRecettes = getAt(value(member(2, cRecData).text), 3)
  181.   if gCD = 1 then
  182.     LoadRecettesOnIdle(gLoaderObj)
  183.   else
  184.     repeat with i = 1 to 5
  185.       TerminateLoading(gLoaderObj, i, [point(320, 240), getaProp(gDialogStrings, "UnMomentPres")], 1)
  186.       CheckCD(me)
  187.       if gCD = 1 then
  188.         exit repeat
  189.       end if
  190.     end repeat
  191.   end if
  192.   SetPath(me)
  193.   initGlobals()
  194.   LoadNever()
  195.   addMDLst(aID, 0)
  196.   addMDLst(aID, 1)
  197.   addKeyLst(aID, #all)
  198.   delFrameObj(aID)
  199.   StartEva()
  200. end
  201.  
  202. on DoAction me, pAction
  203.   if voidp(pAction) then
  204.     put "Void comme action => oPresentation"
  205.   end if
  206.   case pAction of
  207.     "QuitEva":
  208.       CloseDialog(aOKCancel)
  209.       QuitEva()
  210.     "Continue":
  211.       CloseDialog(aOKCancel)
  212.       GeneralCursor(4)
  213.       aBoucleVerif = 1
  214.       FixUpdateStage("48-010")
  215.     otherwise:
  216.       put "oPresentation : " & string(pAction)
  217.   end case
  218. end
  219.