home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1998 May / CineCDW_02.iso / Datos / Datos.dat / Internal_1_General.ls < prev    next >
Encoding:
Text File  |  1998-04-13  |  6.9 KB  |  241 lines

  1. global numpeliculas, ficherolog, peliPuntoContinuacion, volumenpelicula, idioma, primerCursor, ultimoCursor, primerPuppet, ultimoPuppet, posicion, alias, ticksfinal
  2.  
  3. on startMovie
  4.   openXLib(the pathName & "Fileio.dll")
  5. end
  6.  
  7. on exitMovie
  8.   SeleccionaIdioma(1)
  9.   set the volume of member "Pelicula" of castLib "Multimedia" to 256
  10. end
  11.  
  12. on InicializarVariables
  13.   clearGlobals()
  14.   set numpeliculas to 5
  15.   set ticksfinal to 3 * 5
  16.   set ficherolog to "C:\CINECDW.DAT"
  17.   set primerPuppet to 1
  18.   set ultimoPuppet to 48
  19.   set volumenpelicula to 256
  20.   set the soundLevel to 7
  21.   set idioma to 1
  22. end
  23.  
  24. on DesactivarPuppets
  25.   set i to primerPuppet
  26.   repeat while i <= ultimoPuppet
  27.     puppetSprite(i, 0)
  28.     set i to i + 1
  29.   end repeat
  30.   set j to 2
  31. end
  32.  
  33. on ActivarCursores
  34.   set i to primerCursor
  35.   repeat while i <= ultimoCursor
  36.     set the cursor of sprite i to [cast "DEDO", cast "DEDOM"]
  37.     set i to i + 1
  38.   end repeat
  39. end
  40.  
  41. on DesactivarCursores
  42.   set i to primerCursor
  43.   repeat while i <= ultimoCursor
  44.     set the cursor of sprite i to 0
  45.     set i to i + 1
  46.   end repeat
  47. end
  48.  
  49. on BuscarRollOver inicio, fin
  50.   set res to 0
  51.   if inicio > fin then
  52.     repeat with i = inicio down to fin
  53.       if rollOver(i) then
  54.         set res to i
  55.         exit repeat
  56.       end if
  57.     end repeat
  58.   else
  59.     repeat with i = inicio to fin
  60.       if rollOver(i) then
  61.         set res to i
  62.         exit repeat
  63.       end if
  64.     end repeat
  65.   end if
  66.   return res
  67. end
  68.  
  69. on pausa longitud
  70.   set fin to the timer + longitud
  71.   repeat while the timer < fin
  72.     nothing()
  73.   end repeat
  74. end
  75.  
  76. on Volver
  77.   if not EsVaciaPila() then
  78.     set menu to ValorPila()
  79.     set parametro to PropiedadPila()
  80.     BorrarPila()
  81.     case menu of
  82.       "Principal":
  83.         SaltarAPrincipal()
  84.       "Cargas":
  85.         set situacion to parametro
  86.         SaltarACargas()
  87.     end case
  88.   else
  89.     SaltarAPrincipal()
  90.   end if
  91. end
  92.  
  93. on Transicion param
  94.   if param = 0 then
  95.     puppetTransition(52, 1, 1)
  96.   end if
  97. end
  98.  
  99. on RefrescarFotos
  100.   global primerafoto
  101.   repeat with spr1 = 6 to 9
  102.     set spr2 to spr1 + 4
  103.     set spr3 to spr2 + 4
  104.     puppetSprite(spr1, 1)
  105.     puppetSprite(spr2, 1)
  106.     puppetSprite(spr3, 1)
  107.     set incremento to 2 * (spr1 - 6)
  108.     set elmember to the number of member "Foto01a" of castLib "Entregas" + (2 * (primerafoto - 1)) + (2 * (spr1 - 6))
  109.     set the castNum of sprite spr1 to elmember
  110.     set elmember to the number of member "Num01a" of castLib "Entregas" + (2 * (primerafoto - 1)) + (2 * (spr1 - 6))
  111.     set the castNum of sprite spr2 to elmember
  112.     set elmember to the number of member "Tit01a" of castLib "Entregas" + (2 * (primerafoto - 1)) + (2 * (spr1 - 6))
  113.     set the castNum of sprite spr3 to elmember
  114.   end repeat
  115. end
  116.  
  117. on BuscarInicioPelicula
  118.   set textoLeido to EMPTY
  119.   set fichero to ficherolog
  120.   set ficheroLectura to FileIO(mnew, "read", fichero)
  121.   if objectp(ficheroLectura) then
  122.     set savedelimiter to the itemDelimiter
  123.     set the itemDelimiter to "|"
  124.     set peliPuntoContinuacion to 0
  125.     set longitudFichero to ficheroLectura(mGetLength)
  126.     repeat while ficheroLectura(mGetPosition) < longitudFichero
  127.       set auxbuffer to ficheroLectura(mReadLine)
  128.       set buffer to char 1 to length(auxbuffer) - 1 of auxbuffer
  129.       set basura to ficheroLectura(mReadChar)
  130.       set lapeli to item 1 of buffer
  131.       set eltiempo to item 2 of buffer
  132.       if lapeli = numpeliculas then
  133.         set peliPuntoContinuacion to value(eltiempo)
  134.         exit repeat
  135.       end if
  136.     end repeat
  137.     repeat while objectp(ficheroLectura)
  138.       ficheroLectura(mdispose)
  139.     end repeat
  140.     set Comprueba to FileIO(mnew, "read", fichero)
  141.     repeat while objectp(Comprueba)
  142.       Comprueba(mdispose)
  143.     end repeat
  144.     set the itemDelimiter to savedelimiter
  145.   else
  146.     set Comprueba to FileIO(mnew, "write", fichero)
  147.     repeat while objectp(Comprueba)
  148.       Comprueba(mdispose)
  149.     end repeat
  150.     set FicheroEscritura to FileIO(mnew, "write", fichero)
  151.     set peliPuntoContinuacion to 0
  152.     set auxbuffer to numpeliculas & "|0" & numToChar(13) & numToChar(10)
  153.     FicheroEscritura(mWriteString, auxbuffer)
  154.     FicheroEscritura(mdispose)
  155.     set Comprueba to FileIO(mnew, "read", fichero)
  156.     repeat while objectp(Comprueba)
  157.       Comprueba(mdispose)
  158.     end repeat
  159.   end if
  160. end
  161.  
  162. on GuardarInicioPelicula param1
  163.   set textoLeido to EMPTY
  164.   set fichero to ficherolog
  165.   set ficheroLectura to FileIO(mnew, "read", fichero)
  166.   set encontrado to 0
  167.   if objectp(ficheroLectura) then
  168.     set savedelimiter to the itemDelimiter
  169.     set the itemDelimiter to "|"
  170.     set longitudFichero to ficheroLectura(mGetLength)
  171.     repeat while ficheroLectura(mGetPosition) < longitudFichero
  172.       set auxbuffer to ficheroLectura(mReadLine)
  173.       set buffer to char 1 to length(auxbuffer) - 1 of auxbuffer
  174.       set basura to ficheroLectura(mReadChar)
  175.       set lapeli to item 1 of buffer
  176.       if lapeli = numpeliculas then
  177.         set peliPuntoContinuacion to param1
  178.         set auxbuffer to numpeliculas & "|" & peliPuntoContinuacion
  179.         set textoLeido to textoLeido & auxbuffer & numToChar(13) & numToChar(10)
  180.         set encontrado to 1
  181.         next repeat
  182.       end if
  183.       set textoLeido to textoLeido & buffer & numToChar(13) & numToChar(10)
  184.     end repeat
  185.     if not encontrado then
  186.       set peliPuntoContinuacion to param1
  187.       set auxbuffer to numpeliculas & "|" & peliPuntoContinuacion
  188.       set textoLeido to textoLeido & auxbuffer & numToChar(13) & numToChar(10)
  189.     end if
  190.     repeat while objectp(ficheroLectura)
  191.       ficheroLectura(mdispose)
  192.     end repeat
  193.     set Comprueba to FileIO(mnew, "read", fichero)
  194.     repeat while objectp(Comprueba)
  195.       Comprueba(mdispose)
  196.     end repeat
  197.     set FicheroEscritura to FileIO(mnew, "write", fichero)
  198.     FicheroEscritura(mWriteString, textoLeido)
  199.     FicheroEscritura(mdispose)
  200.     set Comprueba to FileIO(mnew, "read", fichero)
  201.     repeat while objectp(Comprueba)
  202.       Comprueba(mdispose)
  203.     end repeat
  204.     set the itemDelimiter to savedelimiter
  205.   end if
  206. end
  207.  
  208. on SeleccionaIdioma id
  209.   set idioma to id
  210.   if id = 1 then
  211.     puppetSprite(8, 1)
  212.     set the castNum of sprite 8 to cast "Bidiom1c"
  213.     set the cursor of sprite 8 to 0
  214.     puppetSprite(9, 0)
  215.     set the cursor of sprite 9 to [cast "DEDO", cast "DEDOM"]
  216.   else
  217.     puppetSprite(9, 1)
  218.     set the castNum of sprite 9 to cast "Bidiom2c"
  219.     set the cursor of sprite 9 to 0
  220.     puppetSprite(8, 0)
  221.     set the cursor of sprite 8 to [cast "DEDO", cast "DEDOM"]
  222.   end if
  223.   mci("setaudio " & alias & " stream to " & id)
  224. end
  225.  
  226. on ActualizaContador
  227.   set eltiempo to the movieTime of sprite 20
  228.   set minutos to eltiempo / 3600
  229.   set segundos to eltiempo mod 3600 / 60
  230.   if minutos < 10 then
  231.     set minutos to "0" & minutos
  232.   end if
  233.   if segundos < 10 then
  234.     set segundos to "0" & segundos
  235.   end if
  236.   set the text of member "Tiemposa" of castLib "Graficos" to minutos & ":" & segundos
  237.   set the text of member "Tiemposb" of castLib "Graficos" to minutos & ":" & segundos
  238.   puppetSprite(12, 1)
  239.   set the locH of sprite 12 to the locH of sprite 10 - 15
  240. end
  241.