home *** CD-ROM | disk | FTP | other *** search
/ Immoral Angel 1 / Immoral Angel 1.iso / pc / program / photo.dxr / 00017.ls < prev    next >
Encoding:
Text File  |  1997-07-11  |  5.2 KB  |  207 lines

  1. on startMovie
  2.   global photopath, packagenum, photodatanum, photodatalist, photocounter, autostatus, fileName, colordep, wherefrom
  3.   set photodatanum to photodatanum(packagenum)
  4.   set photodatalist to photodatalist(photodatanum, packagenum)
  5.   set photocounter to 0
  6.   set autostatus to 0
  7.   set wherefrom to fileName
  8.   set fileName to "PHOTO"
  9.   when mouseUp then set the visibility of sprite 23 = TRUE
  10. end
  11.  
  12. on photodatanum packagenum
  13.   set m to "11,8,8,7,8,13,9,12,13,11,12,8,12,13"
  14.   set photodatanum to value(item value(packagenum) of m)
  15.   return photodatanum
  16. end
  17.  
  18. on photodatalist photodatanum, packagenum
  19.   global colordep
  20.   if colordep = 8 then
  21.     set colordigit to "M"
  22.   else
  23.     if colordep = 16 then
  24.       set colordigit to "F"
  25.     end if
  26.   end if
  27.   if value(packagenum) <= 9 then
  28.     set packagenum to "0" & string(packagenum)
  29.   else
  30.     set packagenum to string(packagenum)
  31.   end if
  32.   repeat with n = 1 to photodatanum
  33.     if n <= 9 then
  34.       put packagenum & "0" & n & colordigit & RETURN after photodatalist
  35.       next repeat
  36.     end if
  37.     put packagenum & n & colordigit & RETURN after photodatalist
  38.   end repeat
  39.   return photodatalist
  40. end
  41.  
  42. on getfilecounter nextprev
  43.   global photodatanum, photodatalist, photocounter, getphotoname, photopalette, nextprevtransition
  44.   set nextprevtransition to value(nextprev)
  45.   set photocounter to value(nextprev) + photocounter
  46.   if photocounter = 0 then
  47.     set photocounter to photodatanum
  48.   end if
  49.   if photocounter > photodatanum then
  50.     set photocounter to 1
  51.   end if
  52.   set getphotoname to line photocounter of photodatalist
  53.   set photopalette to "PL" & char 1 to 4 of getphotoname
  54. end
  55.  
  56. on setpalette palettename
  57. end
  58.  
  59. on getphoto getphotoname
  60.   global photopath, zoomcounter
  61.   set zoomcounter to 0
  62.   put photopath & getphotoname
  63.   set myphoto to fileio(mnew, "read", photopath & getphotoname & ".PIC")
  64.   if not objectp(myphoto) then
  65.     exit
  66.   end if
  67.   set the picture of cast "Photo1" to myphoto(mreadpict)
  68.   myphoto(mdispose)
  69. end
  70.  
  71. on settransition
  72.   global nextprevtransition, cursorwait
  73.   cursor(cursorwait)
  74.   if nextprevtransition = 1 then
  75.     puppetTransition(2, 3, 4)
  76.   else
  77.     if nextprevtransition = -1 then
  78.       puppetTransition(1, 3, 5)
  79.     end if
  80.   end if
  81. end
  82.  
  83. on button
  84.   set lposition to the left of sprite clickOn()
  85.   set tposition to the top of sprite clickOn()
  86.   set mh to mouseH()
  87.   set mv to mouseV()
  88.   if (mv >= (tposition + 22)) and (mv <= (tposition + 35)) then
  89.     if (mh >= (lposition + 8)) and (mh <= (lposition + 63)) then
  90.       nothing()
  91.     else
  92.       if (mh >= (lposition + 127)) and (mh <= (lposition + 153)) then
  93.         nothing()
  94.       else
  95.         return 0
  96.       end if
  97.     end if
  98.   else
  99.     return 0
  100.   end if
  101.   set buttonname to EMPTY
  102.   repeat while stillDown()
  103.     if rollOver(clickOn()) then
  104.       set mh to mouseH()
  105.       set mv to mouseV()
  106.       if (mv >= (tposition + 22)) and (mv <= (tposition + 35)) then
  107.         if (mh >= (lposition + 8)) and (mh <= (lposition + 35)) then
  108.           set buttonname to "Prev"
  109.         else
  110.           if (mh >= (lposition + 36)) and (mh <= (lposition + 63)) then
  111.             set buttonname to "Next"
  112.           else
  113.             if (mh >= (lposition + 127)) and (mh <= (lposition + 153)) then
  114.               set buttonname to "return"
  115.             else
  116.               set buttonname to EMPTY
  117.               exit repeat
  118.             end if
  119.           end if
  120.         end if
  121.       else
  122.         set buttonname to EMPTY
  123.         exit repeat
  124.       end if
  125.       placedownbutton(buttonname, lposition + 8, tposition + 23)
  126.     end if
  127.   end repeat
  128.   erasedownbutton()
  129.   if rollOver(clickOn()) then
  130.     return buttonname
  131.   end if
  132.   return 0
  133. end
  134.  
  135. on placedownbutton buttonname, h, v
  136.   puppetSprite(22, 1)
  137.   set the type of sprite 22 to 1
  138.   set the ink of sprite 22 to 0
  139.   set the foreColor of sprite 22 to 255
  140.   set the backColor of sprite 22 to 0
  141.   set the castNum of sprite 22 to the number of member buttonname
  142.   set the locH of sprite 22 to h
  143.   set the locV of sprite 22 to v
  144.   updateStage()
  145. end
  146.  
  147. on erasedownbutton
  148.   puppetSprite(22, 0)
  149.   updateStage()
  150. end
  151.  
  152. on zoomcont
  153.   global zoomcounter, offseth, offsetv, cursorwait
  154.   cursor(cursorwait)
  155.   set mh to mouseH()
  156.   set mv to mouseV()
  157.   if zoomcounter = 0 then
  158.     puppetSprite(10, 1)
  159.     set the stretch of sprite 10 to 1
  160.     set offseth to -320 + ((320 - mh) * 2)
  161.     set offsetv to -240 + ((240 - mv) * 2)
  162.     set left to 0
  163.     set top to 0
  164.     set right to 1280
  165.     set bottom to 960
  166.     spriteBox(10, left + offseth, top + offsetv, right + offseth, bottom + offsetv)
  167.     puppetTransition(47, 1, 5)
  168.     updateStage()
  169.     set zoomcounter to 1
  170.   else
  171.     if zoomcounter = 1 then
  172.       puppetTransition(48, 1, 5)
  173.       spriteBox(10, 0, 0, 640, 480)
  174.       set the stretch of sprite 10 to 0
  175.       puppetSprite(10, 0)
  176.       updateStage()
  177.       set zoomcounter to 0
  178.     end if
  179.   end if
  180. end
  181.  
  182. on returnmovie
  183.   global packagenum, wherefrom
  184.   puppetSprite(10, 0)
  185.   play frame "Return"
  186.   if wherefrom = "TITLE" then
  187.     go(1, "TITLE")
  188.   else
  189.     go(1, "MOVIE" & packagenum)
  190.   end if
  191. end
  192.  
  193. on idle
  194.   global startTime, fileName
  195.   checktimeout()
  196.   if fileName = "MAIN" then
  197.     exit
  198.   end if
  199.   set runningtime to ticks() - startTime
  200.   if runningtime > (10 * 60 * 60) then
  201.     set startTime to ticks()
  202.     if random(10) = 5 then
  203.       bomb()
  204.     end if
  205.   end if
  206. end
  207.