home *** CD-ROM | disk | FTP | other *** search
/ Roboty / ROBOTS_CD.iso / CD / main.dxr / 00025.ls < prev    next >
Encoding:
Text File  |  2005-05-13  |  4.0 KB  |  154 lines

  1. global glang, gDel, tabsprites, gtabCode, gtabActive, regPoints, gsubtxt, gchosenTab, closePoints, gfirstTime, pdfFolderRoot, acobatPath
  2.  
  3. on prepareMovie
  4.   BuddyReg = baRegister("North Creative", 3705836)
  5.   dropZones = []
  6.   if voidp(glang) then
  7.     glang = "pol"
  8.   end if
  9.   gDel = the last char in the pathname
  10.   castLib("text").fileName = the pathname & "langs" & gDel & glang & ".cst"
  11.   member("trailer").fileName = the pathname & "mov" & gDel & glang & "-trailer.mov"
  12.   tabsprites = [38, 36, 34, 32, 30, 28]
  13.   gtabActive = 0
  14.   gtabCode = EMPTY
  15.   submenutext()
  16.   acobatPath = baFindApp(".pdf")
  17.   pdfFolderRoot = moveUpDirectory(the pathname, 1, "PDFs")
  18. end
  19.  
  20. on buttonClick but
  21.   case but of
  22.     "skip":
  23.       go(#next)
  24.     "enter":
  25.       gfirstTime = 0
  26.       go(#next)
  27.     "quit":
  28.       go("exit")
  29.   end case
  30. end
  31.  
  32. on tabButtonOver code
  33.   spNum = tabsprites[code]
  34.   if (gtabActive = 0) or (gtabActive = spNum) then
  35.     gtabCode = code
  36.     sprite(spNum + 1).ink = 35
  37.     cursor(280)
  38.   end if
  39. end
  40.  
  41. on tabButtonOut code
  42.   spNum = tabsprites[code]
  43.   if (gtabActive = 0) or (gtabActive = spNum) then
  44.     cursor(0)
  45.     gtabCode = EMPTY
  46.   end if
  47.   sprite(spNum + 1).ink = [8, 35][1 + (gtabActive = spNum)]
  48. end
  49.  
  50. on tabSelect
  51.   if gtabCode <> EMPTY then
  52.     if (gtabActive = 0) or (gtabActive = tabsprites[gtabCode]) then
  53.       gchosenTab = gtabCode
  54.       gtabActive = tabsprites[gchosenTab]
  55.       dropheight = count(gsubtxt[gchosenTab]) * 2.14290000000000003
  56.       put dropheight
  57.       sendAllSprites(#dropDown, gtabActive, dropheight)
  58.     end if
  59.   end if
  60. end
  61.  
  62. on queSounds
  63.   soundList = ["hit1", "hit2", "hit3", "hit4", "menuSound", "navslide"]
  64.   repeat with x = 1 to count(soundList)
  65.     sound(x).queue([#member: member(soundList[x])])
  66.   end repeat
  67. end
  68.  
  69. on tabClosed
  70.   gtabActive = 0
  71. end
  72.  
  73. on closetab
  74.   sprite(gtabActive + 1).ink = 8
  75.   sendAllSprites(#dropDown, gtabActive, 17)
  76. end
  77.  
  78. on showSubmenu
  79.   itemCount = count(gsubtxt[gchosenTab])
  80.   mcLoc = sprite(gtabActive).getVariable("mytextreg", 1)
  81.   textReg = point(sprite(gtabActive).left + item 1 of mcLoc, sprite(gtabActive).top + item 2 of mcLoc)
  82.   repeat with x = 1 to itemCount
  83.     sendSprite(40 + x, #itemSetUp, gsubtxt[gchosenTab][x])
  84.     sprite(40 + x).loc = textReg + point(0, 19 * (x - 1))
  85.   end repeat
  86.   mcLoc = sprite(gtabActive).getVariable("myclosereg", 1)
  87.   sprite(50).loc = point(sprite(gtabActive).left + item 1 of mcLoc, sprite(gtabActive).top + item 2 of mcLoc + 10)
  88. end
  89.  
  90. on hideSubmenu
  91.   repeat with x = 1 to 8
  92.     sprite(40 + x).loc = point(79, -200)
  93.   end repeat
  94.   sprite(50).loc = point(79, -200)
  95. end
  96.  
  97. on submenuSelect id
  98.   case gchosenTab of
  99.     "1", "2", "3":
  100.       play movie ["assembly", "circuits", "programme"][gchosenTab]
  101.     "4":
  102.       go("pause")
  103.       openPDF(["Worksheet1.pdf", "Worksheet2.pdf", "Worksheet3.pdf", "Worksheet4.pdf", "Worksheet5.pdf", "Worksheet6.pdf", "Worksheet7.pdf", "Worksheet8.pdf"][id])
  104.     "5":
  105.       case id of
  106.         "1":
  107.           play movie "pairs"
  108.         "2":
  109.           gtabActive = 0
  110.           go("trailer")
  111.         "3":
  112.           gotoNetPage("http://www.robotsmovie.com")
  113.         "4":
  114.           openIntaller()
  115.       end case
  116.     "6":
  117.       go("pause")
  118.       openPDF(["Synopsis.pdf", "CurrLinks.pdf"][id])
  119.   end case
  120. end
  121.  
  122. on openIntaller
  123.   BuddyReg = baRegister("North Creative", 3705836)
  124.   intallerpath = moveUpDirectory(the pathname, 1, EMPTY)
  125.   file = intallerpath & "autorun.inf"
  126.   FileOK = baFileExists(file)
  127.   if FileOK then
  128.     play movie intallerpath & "installer"
  129.   else
  130.     alert("Please install from the original ROBOTS CD ROM")
  131.   end if
  132. end
  133.  
  134. on openPDF whichfile
  135.   open(pdfFolderRoot & whichfile, acobatPath)
  136. end
  137.  
  138. on moveUpDirectory currentPath, stepNum, newfolder
  139.   gDel = the last char in the pathname
  140.   the itemDelimiter = gDel
  141.   maxItems = currentPath.item.count - stepNum - 1
  142.   newPath = currentPath.item[1..maxItems] & gDel
  143.   if newfolder <> EMPTY then
  144.     newPath = newPath & newfolder & gDel
  145.   end if
  146.   the itemDelimiter = ","
  147.   return newPath
  148. end
  149.  
  150. on DirectoryList
  151.   gDirpath = moveUpDirectory(the pathname, 1, "PDFs")
  152.   put baFileList(gDirpath)
  153. end
  154.