home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2007 February / maximum-cd-2007-02.iso / main.dxr / Internal_137_bottomButton.b.ls < prev    next >
Encoding:
Text File  |  2006-07-19  |  7.9 KB  |  261 lines

  1. property myButton, myAsset, myType, mem, memOn, memDn
  2. global seed, menuIndex, submenuIndex, fd, currentAsset, Tile, isWallpaper, dTemplate, lastTemplate
  3.  
  4. on getPropertyDescriptionList me
  5.   description = [:]
  6.   addProp(description, #myButton, [#default: 1, #format: #integer, #comment: "My Button #: "])
  7.   return description
  8. end
  9.  
  10. on beginSprite me
  11.   sprite(me.spriteNum).cursor = [3, 4]
  12.   selfUpdate(me)
  13. end
  14.  
  15. on selfUpdate me
  16.   if menuIndex = 0 then
  17.     sprite(me.spriteNum).visible = 0
  18.   else
  19.     if submenuIndex <> 0 then
  20.       if seed[#mainmenu][menuIndex][#submenu][submenuIndex][#buttonList] <> VOID then
  21.         if seed[#mainmenu][menuIndex][#submenu][submenuIndex][#buttonList].count < myButton then
  22.           sprite(me.spriteNum).visible = 0
  23.         else
  24.           b = seed[#mainmenu][menuIndex][#submenu][submenuIndex][#buttonList][myButton]
  25.           case b[1] of
  26.             #open:
  27.               sprite(me.spriteNum).member = member("button_open")
  28.               if b.count > 1 then
  29.                 myAsset = b[2]
  30.               else
  31.                 myAsset = EMPTY
  32.               end if
  33.               myType = 3
  34.               sprite(me.spriteNum).visible = 1
  35.             #installbkg:
  36.               sprite(me.spriteNum).member = member("button_install")
  37.               myAsset = EMPTY
  38.               myType = 5
  39.               sprite(me.spriteNum).visible = 1
  40.             #watch:
  41.               sprite(me.spriteNum).member = member("button_watch")
  42.               myAsset = seed[#mainmenu][menuIndex][#submenu][submenuIndex][#videos]
  43.               myType = 6
  44.               sprite(me.spriteNum).visible = 1
  45.             #install:
  46.               sprite(me.spriteNum).member = member("button_install")
  47.               myAsset = b[2]
  48.               myType = 7
  49.               sprite(me.spriteNum).visible = 1
  50.             #view:
  51.               sprite(me.spriteNum).member = member("button_view")
  52.               if b.count > 1 then
  53.                 myAsset = b[2]
  54.               else
  55.                 myAsset = EMPTY
  56.               end if
  57.               myType = 10
  58.               sprite(me.spriteNum).visible = 1
  59.             #web:
  60.               sprite(me.spriteNum).member = member("button_web")
  61.               myAsset = b[2]
  62.               myType = 11
  63.               sprite(me.spriteNum).visible = 1
  64.             #save:
  65.               sprite(me.spriteNum).member = member("button_save")
  66.               if b.count > 1 then
  67.                 myAsset = b[2]
  68.               else
  69.                 myAsset = EMPTY
  70.               end if
  71.               myType = 12
  72.             otherwise:
  73.               sprite(me.spriteNum).member = member("button_open")
  74.               myAsset = b[2]
  75.               myType = 0
  76.               sprite(me.spriteNum).visible = 1
  77.           end case
  78.           mem = sprite(me.spriteNum).member.name
  79.           memOn = mem & "_on"
  80.           memDn = mem & "_dn"
  81.         end if
  82.       else
  83.         sprite(me.spriteNum).visible = 0
  84.       end if
  85.     else
  86.       if seed[#mainmenu][menuIndex][#buttonList] <> VOID then
  87.         if seed[#mainmenu][menuIndex][#buttonList].count < myButton then
  88.           sprite(me.spriteNum).visible = 0
  89.         else
  90.           b = seed[#mainmenu][menuIndex][#buttonList][myButton]
  91.           case b[1] of
  92.             #open:
  93.               sprite(me.spriteNum).member = member("button_open")
  94.               if b.count > 1 then
  95.                 myAsset = b[2]
  96.               else
  97.                 myAsset = EMPTY
  98.               end if
  99.               myType = 3
  100.               sprite(me.spriteNum).visible = 1
  101.             #installbkg:
  102.               sprite(me.spriteNum).member = member("button_install")
  103.               myAsset = EMPTY
  104.               myType = 5
  105.               sprite(me.spriteNum).visible = 1
  106.             #watch:
  107.               sprite(me.spriteNum).member = member("button_watch")
  108.               myAsset = seed[#mainmenu][menuIndex][#submenu][submenuIndex][#videos]
  109.               myType = 6
  110.               sprite(me.spriteNum).visible = 1
  111.             #install:
  112.               sprite(me.spriteNum).member = member("button_install")
  113.               myAsset = b[2]
  114.               myType = 7
  115.               sprite(me.spriteNum).visible = 1
  116.             #view:
  117.               sprite(me.spriteNum).member = member("button_view")
  118.               if b.count > 1 then
  119.                 myAsset = b[2]
  120.               else
  121.                 myAsset = EMPTY
  122.               end if
  123.               myType = 10
  124.               sprite(me.spriteNum).visible = 1
  125.             #web:
  126.               sprite(me.spriteNum).member = member("button_web")
  127.               myAsset = b[2]
  128.               myType = 11
  129.               sprite(me.spriteNum).visible = 1
  130.             #save:
  131.               sprite(me.spriteNum).member = member("button_save")
  132.               if b.count > 1 then
  133.                 myAsset = b[2]
  134.               else
  135.                 myAsset = EMPTY
  136.               end if
  137.               myType = 12
  138.             otherwise:
  139.               sprite(me.spriteNum).member = member("button_open")
  140.               myAsset = b[2]
  141.               myType = 0
  142.               sprite(me.spriteNum).visible = 1
  143.           end case
  144.           mem = sprite(me.spriteNum).member.name
  145.           memOn = mem & "_on"
  146.           memDn = mem & "_dn"
  147.         end if
  148.       else
  149.         sprite(me.spriteNum).visible = 0
  150.       end if
  151.     end if
  152.   end if
  153. end
  154.  
  155. on endSprite me
  156.   sprite(me.spriteNum).visible = 1
  157. end
  158.  
  159. on mouseLeave me
  160.   sprite(me.spriteNum).member = member(mem)
  161.   pass()
  162. end
  163.  
  164. on mouseDown me
  165.   sprite(me.spriteNum).member = member(memDn)
  166.   updateStage()
  167. end
  168.  
  169. on mouseEnter me
  170.   sprite(me.spriteNum).member = member(memOn)
  171.   pass()
  172. end
  173.  
  174. on mouseUp me
  175.   if rollover(me.spriteNum) then
  176.     sprite(me.spriteNum).member = member(memOn)
  177.   else
  178.     sprite(me.spriteNum).member = member(mem)
  179.   end if
  180.   case myType of
  181.     0:
  182.       open(the pathname & "assets" & fd & parsePath(myAsset))
  183.     5:
  184.       ca = stripExtension(parsePath(currentAsset)) & ".bmp"
  185.       if baFileExists(ca) then
  186.         baSetWallpaper(ca, Tile)
  187.       end if
  188.     6:
  189.       if QuickTimeVersion() >= 6 then
  190.         lastTemplate = dTemplate
  191.         dTemplate = "vid"
  192.         isReady = 0
  193.         go(the frame + 1)
  194.       else
  195.         displayMessage("QuickTime Not Installed", "You have chosen to continue using this disc without QuickTime installed.  Until you do so, you may not view any video on this disc.")
  196.       end if
  197.     7:
  198.       if sprite(184).member = member(58) then
  199.         sprite(184).movieRate = 0
  200.         sprite(184).visible = 0
  201.       end if
  202.       open(the pathname & "assets" & fd & parsePath(myAsset))
  203.       sprite(197).visible = 1
  204.       sprite(198).visible = 1
  205.     8:
  206.       open(the pathname & "assets" & fd & parsePath(myAsset))
  207.     9:
  208.       open(the pathname & "assets" & fd & parsePath(myAsset))
  209.     3, 10:
  210.       if isWallpaper then
  211.         if myAsset = EMPTY then
  212.           gotoNetPage(stripExtension(parsePath(currentAsset)) & ".bmp")
  213.         else
  214.           gotoNetPage(the pathname & "assets" & fd & parsePath(myAsset))
  215.         end if
  216.       else
  217.         if myAsset = EMPTY then
  218.           c = parsePath(currentAsset)
  219.           if c contains ".jpg" then
  220.             gotoNetPage(c)
  221.           else
  222.             if c contains ".pdf" then
  223.               openDoc(c)
  224.             end if
  225.           end if
  226.         else
  227.           c = parsePath(myAsset)
  228.           if c contains ".jpg" then
  229.             gotoNetPage(the pathname & "assets" & fd & c)
  230.           else
  231.             if c contains ".pdf" then
  232.               openDoc(the pathname & "assets" & fd & c)
  233.             end if
  234.           end if
  235.         end if
  236.       end if
  237.     11:
  238.       gotoNetPage(parsePath(myAsset))
  239.     12:
  240.       if myAsset = EMPTY then
  241.         if isWallpaper then
  242.           copyFile(stripExtension(parsePath(currentAsset)) & ".bmp")
  243.         else
  244.           c = parsePath(currentAsset)
  245.           if baFolderExists(c) then
  246.             copyFolder(c)
  247.           else
  248.             copyFile(c)
  249.           end if
  250.         end if
  251.       else
  252.         c = parsePath(the pathname & "assets" & fd & myAsset)
  253.         if baFolderExists(c) then
  254.           copyFolder(c)
  255.         else
  256.           copyFile(c)
  257.         end if
  258.       end if
  259.   end case
  260. end
  261.