home *** CD-ROM | disk | FTP | other *** search
/ ATComputers Catalog / AutoCont+ATcomp.bin / Data / Data.dxr / Internal_2_Func&Menu.ls < prev    next >
Encoding:
Text File  |  2003-07-28  |  11.9 KB  |  314 lines

  1. global gVolume, gBTime, gATime, gFTime, gFadeMenuState, gProcessTime, gSoundTime, gRunChangePath, gCountPart, gPartMember, gPlay, gLevel, gLNum, gAllPath, gSqAnim, gVSprite, gTitle, gVideoBig, gNaviPath, gNaviPath1, gNaviPath2, gNaviPath3, gNaviPath4, gNaviPath5, gNaviPath2_, gNaviPath3_, gNaviPath4_, gMenuPath, gMenuPath1, gMenuPath2, gMenuPath3, gMenuPath4, gMenuPath5, gMenuPath2_, gMenuPath3_, gMenuPath4_, maxProc, Section
  2.  
  3. on generateBitrate BTempo
  4.   if gBTime = VOID then
  5.     gBTime = the ticks
  6.   end if
  7.   if (gRunChangePath = 0) and (gPlay = 1) then
  8.     if (gBTime + BTempo) < the ticks then
  9.       set the floatPrecision to 3
  10.       randNum = 864 + random(254)
  11.       result = 1000.float / randNum
  12.       member("Bitrate").text = string(result) & " Gb/s"
  13.       gBTime = the ticks
  14.     end if
  15.   else
  16.     if gPlay = 2 then
  17.       nothing()
  18.     else
  19.       if gPlay = 0 then
  20.         member("Bitrate").text = "0 Gb/s"
  21.       end if
  22.     end if
  23.   end if
  24. end
  25.  
  26. on AudioInt AName
  27.   puppetSound(2, AName)
  28.   sound(2).volume = gVolume
  29.   updateStage()
  30. end
  31.  
  32. on AudioSWA AName
  33.   member(AName).play()
  34.   member(AName).volume = gVolume
  35. end
  36.  
  37. on AudioStop AName
  38.   sound stop 1
  39.   sound stop 2
  40.   puppetSound(0)
  41.   repeat while soundBusy(1) or soundBusy(2)
  42.     nothing()
  43.   end repeat
  44.   updateStage()
  45. end
  46.  
  47. on SquareAnim ASprite, AName, ATempo
  48.   if gATime = VOID then
  49.     gATime = the ticks
  50.   end if
  51.   if (gRunChangePath = 0) and (gPlay <> 2) then
  52.     if (gATime + ATempo) < the ticks then
  53.       sprite(ASprite).member = string(AName & random(9))
  54.       gATime = the ticks
  55.     end if
  56.   else
  57.     if sprite(ASprite).member <> string(AName & "1") then
  58.       sprite(ASprite).member = string(AName & "1")
  59.     end if
  60.   end if
  61. end
  62.  
  63. on Effect eType
  64.   global eff
  65.   if (eType = 1) or (gCountPart = 1) or (gCountPart = 999) then
  66.     puppetTransition(member("FADE"))
  67.   else
  68.     puppetTransition(member(string("Effect" & gLNum[1])))
  69.   end if
  70. end
  71.  
  72. on FadeMenu FTempo
  73.   if gFTime = VOID then
  74.     gFTime = the ticks
  75.   end if
  76.   if (gRunChangePath = 0) and (gPlay <> 2) then
  77.     if (gFTime + FTempo) < the ticks then
  78.       if gFadeMenuState = 0 then
  79.         gFadeMenuState = 2
  80.       end if
  81.       cursor(200)
  82.       gFTime = the ticks
  83.     end if
  84.   end if
  85. end
  86.  
  87. on naviPath level1, level2, level3
  88.   if level1 <> VOID then
  89.     gLevel[1] = gNaviPath[level1]
  90.     if level2 <> VOID then
  91.       gLevel[2] = value("gNaviPath" & level1 & "[" & level2 & "]")
  92.       if level3 <> VOID then
  93.         gLevel[3] = value("gNaviPath" & level1 & "_[" & level2 & "][" & level3 & "]")
  94.         member("MediaPath").text = gLevel[1] & " > " & gLevel[2] & " > " & gLevel[3]
  95.       else
  96.         member("MediaPath").text = gLevel[1] & " > " & gLevel[2]
  97.       end if
  98.     else
  99.       member("MediaPath").text = gLevel[1]
  100.     end if
  101.   else
  102.     member("MediaPath").text = "home"
  103.   end if
  104. end
  105.  
  106. on MainMenu level1, level2, level3
  107.   BeginEndList = [0, 0, 0, 0]
  108.   rowCount = 0
  109.   repeat with i = 1 to gMenuPath.count
  110.     if level1 = i then
  111.       if level2 = VOID then
  112.         beginChars = "~ [ "
  113.       else
  114.         beginChars = "[ "
  115.       end if
  116.       if i = 1 then
  117.         menuText = beginChars & gMenuPath[i] & " ]"
  118.       else
  119.         menuText = menuText & RETURN & beginChars & gMenuPath[i] & " ]"
  120.       end if
  121.       rowCount = rowCount + 1
  122.       subMenu = value("gMenuPath" & level1)
  123.       if subMenu <> VOID then
  124.         repeat with isub = 1 to subMenu.count
  125.           if level2 = isub then
  126.             if level3 = VOID then
  127.               beginChars = "~ [ "
  128.             else
  129.               beginChars = "[ "
  130.             end if
  131.             menuText = menuText & RETURN & beginChars & subMenu[isub] & " ] - "
  132.             rowCount = rowCount + 1
  133.             if isub = 1 then
  134.               BeginEndList[1] = rowCount
  135.             else
  136.               BeginEndList[2] = rowCount
  137.             end if
  138.             subMenu2 = value("gMenuPath" & level1 & "_[" & level2 & "]")
  139.             if subMenu2 <> VOID then
  140.               repeat with isub2 = 1 to subMenu2.count
  141.                 if level3 = isub2 then
  142.                   beginChars = "~ [ "
  143.                 else
  144.                   beginChars = "[ "
  145.                 end if
  146.                 menuText = menuText & RETURN & beginChars & subMenu2[isub2] & " ] --     "
  147.                 rowCount = rowCount + 1
  148.                 if isub2 = 1 then
  149.                   BeginEndList[3] = rowCount
  150.                   next repeat
  151.                 end if
  152.                 BeginEndList[4] = rowCount
  153.               end repeat
  154.             end if
  155.             next repeat
  156.           end if
  157.           menuText = menuText & RETURN & "[ " & subMenu[isub] & " ] - "
  158.           rowCount = rowCount + 1
  159.           if isub = 1 then
  160.             BeginEndList[1] = rowCount
  161.             next repeat
  162.           end if
  163.           BeginEndList[2] = rowCount
  164.         end repeat
  165.       end if
  166.       next repeat
  167.     end if
  168.     if i = 1 then
  169.       menuText = "[ " & gMenuPath[i] & " ]"
  170.     else
  171.       menuText = menuText & RETURN & "[ " & gMenuPath[i] & " ]"
  172.     end if
  173.     rowCount = rowCount + 1
  174.   end repeat
  175.   member("MainMenu").text = menuText
  176.   member("MainMenu").fontStyle = [#bold]
  177.   member("MainMenu").fontSize = 14
  178.   member("MainMenu").fixedLineSpace = 16
  179.   if BeginEndList[1] <> 0 then
  180.     member("MainMenu").line[BeginEndList[1]..BeginEndList[2]].fontStyle = [#plain]
  181.     member("MainMenu").line[BeginEndList[1]..BeginEndList[2]].fontSize = 12
  182.     member("MainMenu").line[BeginEndList[1]..BeginEndList[2]].fixedLineSpace = 15
  183.   end if
  184.   if BeginEndList[3] <> 0 then
  185.     member("MainMenu").line[BeginEndList[3]..BeginEndList[4]].fontStyle = [#plain]
  186.     member("MainMenu").line[BeginEndList[3]..BeginEndList[4]].fontSize = 11
  187.     member("MainMenu").line[BeginEndList[3]..BeginEndList[4]].fixedLineSpace = 14
  188.   end if
  189. end
  190.  
  191. on title level1, level2, level3
  192.   if level3 <> VOID then
  193.     gTitle = value("gMenuPath" & level1 & "_[" & level2 & "][" & level3 & "]")
  194.   else
  195.     if level2 <> VOID then
  196.       gTitle = value("gMenuPath" & level1 & "[" & level2 & "]")
  197.     else
  198.       if level1 <> VOID then
  199.         gTitle = gMenuPath[level1]
  200.       else
  201.         gTitle = "home"
  202.       end if
  203.     end if
  204.   end if
  205.   if (level1 = 3) and ((level2 = VOID) or (level2 = 8)) then
  206.     member("Title").text = EMPTY
  207.   else
  208.     member("Title").text = "[ " & gTitle & " ]"
  209.   end if
  210. end
  211.  
  212. on ChangePath level1, level2, level3
  213.   gPlay = 0
  214.   AudioStop(string(gLNum[1] & gLNum[2] & gLNum[3]))
  215.   gCountPart = 0
  216.   gRunChangePath = 1
  217.   naviPath(level1, level2, level3)
  218.   MainMenu(level1, level2, level3)
  219.   if (gLNum = [3, VOID, VOID]) or (gLNum = [3, 8, VOID]) then
  220.     gVideoBig[4] = "GODOWN"
  221.   else
  222.     title(level1, level2, level3)
  223.   end if
  224.   gLNum[1] = level1
  225.   gLNum[2] = level2
  226.   gLNum[3] = level3
  227.   go(the frame + 1)
  228. end
  229.  
  230. on ChangeMenu me
  231.   if gRunChangePath = 0 then
  232.     gRunChangePath = 1
  233.     linePoint = the mouseLoc
  234.     currentMember = sprite(me.spriteNum).member
  235.     menuLine = sprite(me.spriteNum).pointToLine(linePoint)
  236.     if menuLine < 1 then
  237.       menuLine = 1
  238.     end if
  239.     tempSubMenu = value("gMenuPath" & gLNum[1])
  240.     if tempSubMenu = VOID then
  241.       countLineL2 = 0
  242.     else
  243.       countLineL2 = tempSubMenu.count
  244.     end if
  245.     tempSubMenu = value("gMenuPath" & gLNum[1] & "_[" & gLNum[2] & "]")
  246.     if gLNum[1] = VOID then
  247.       ChangePath(menuLine)
  248.     else
  249.       if (gLNum[2] = VOID) or ((gLNum[3] = VOID) and (tempSubMenu = VOID)) then
  250.         if (menuLine > gLNum[1]) and (menuLine <= (gLNum[1] + countLineL2)) then
  251.           ChangePath(gLNum[1], menuLine - gLNum[1])
  252.         else
  253.           if menuLine <= gLNum[1] then
  254.             ChangePath(menuLine)
  255.           else
  256.             if menuLine > (gLNum[1] + countLineL2) then
  257.               ChangePath(menuLine - countLineL2)
  258.             end if
  259.           end if
  260.         end if
  261.       else
  262.         countLineL3 = tempSubMenu.count
  263.         if (menuLine > (gLNum[1] + gLNum[2])) and (menuLine <= (gLNum[1] + gLNum[2] + countLineL3)) then
  264.           ChangePath(gLNum[1], gLNum[2], menuLine - (gLNum[1] + gLNum[2]))
  265.         else
  266.           if menuLine <= (gLNum[1] + gLNum[2]) then
  267.             if (menuLine > gLNum[1]) and (menuLine <= (gLNum[1] + countLineL2)) then
  268.               ChangePath(gLNum[1], menuLine - gLNum[1])
  269.             else
  270.               if menuLine <= gLNum[1] then
  271.                 ChangePath(menuLine)
  272.               else
  273.                 if menuLine > (gLNum[1] + countLineL2) then
  274.                   ChangePath(menuLine - countLineL2)
  275.                 end if
  276.               end if
  277.             end if
  278.           else
  279.             if menuLine > (gLNum[1] + countLineL2 + countLineL3) then
  280.               ChangePath(menuLine - (countLineL2 + countLineL3))
  281.             else
  282.               ChangePath(gLNum[1], menuLine - (gLNum[1] + countLineL3))
  283.             end if
  284.           end if
  285.         end if
  286.       end if
  287.     end if
  288.   end if
  289. end
  290.  
  291. on SetMenuData
  292.   gNaviPath = ["learnadventure", "PHYSIKUS", "CHEMICUS", "BIOSCOPIA", "proces", "data"]
  293.   gNaviPath1 = ["z├íbava", "u├¿en├¡_jinak", "zamlada", "hra&v├╜uka", "u├¿en├¡_pohled"]
  294.   gNaviPath2 = ["fyzika_advent", "PHYS_wrld", "v├╜uka_hrou", "dobrodru┼╛stv├¡", "v├╜uka", "3D_sv├¼t", "co_dobrodru┼╛stv├¡", "po┼╛adavky_sys"]
  295.   gNaviPath2_ = [VOID, VOID, VOID, VOID, ["mechanika", "termodyn", "akustika", "optika", "elektromgnt"], VOID, VOID, VOID]
  296.   gNaviPath3 = ["chemie_advent", "CHEMIC_wrld", "xperimnts", "lostincity", "cizo_m├¡sta", "v├╜uka", "atmosf", "co_dobrodru┼╛stv├¡", "po┼╛adavky_sys"]
  297.   gNaviPath3_ = [VOID, VOID, VOID, VOID, VOID, ["vlastn_ltk", "prom├¼n_ltk", "stavba_atom", "elektrochem", "kyseliny", "org_chem"], VOID, VOID, VOID]
  298.   gNaviPath4 = ["biologie_advent", "BIOSC_wrld", "peklo_statio", "z├íchr_d├¡vky", "v├╜uka", "atmosf", "z├íchr_prac", "po┼╛adavky_sys"]
  299.   gNaviPath4_ = [VOID, VOID, VOID, VOID, ["botanika", "cell_bio", "zoolo", "antropo", "genetika"], VOID, VOID, VOID]
  300.   gNaviPath5 = ["storyboard", "v├╜uka_prt", "hra_prt", "3D_wrlds", "programm"]
  301.   gNaviPath6 = []
  302.   gMenuPath = ["v├╜ukov├í adventura", "PHYSIKUS", "CHEMICUS", "BIOSCOPIA", "proces vzniku", "data"]
  303.   gMenuPath1 = ["smyslupln├í z├íbava?", "nov├╜ zp├╣sob u├¿en├¡", "zp├¼t do d├¼tsk├╜ch let", "spojen├¡ hry a v├╜uky", "nov├╜ v├╜znam slova u├¿en├¡"]
  304.   gMenuPath2 = ["rok PHYSIKUSe", "sv├¼t p├╕├¡rodn├¡ch z├íkon├╣", "v├╜uka hrou", "fascinuj├¡c├¡ dobrodru┼╛stv├¡!", "v├╜ukov├í ├¿├íst", "3D sv├¼ty ", "co je dobrodru┼╛stv├¡?", "po┼╛adavky na syst├⌐m"]
  305.   gMenuPath2_ = [VOID, VOID, VOID, VOID, ["mechanika", "termodynamika", "akustika", "optika", "elektromagnetismus"], VOID, VOID, VOID]
  306.   gMenuPath3 = ["sv├¼t CHEMICUSe", "v├╜uka a z├íbava", "fantastick├⌐ experimenty", "┼íachtou do laborato├╕e", "idylick├í i cizorod├í m├¡sta", "v├╜ukov├í ├¿├íst", "nezam├¼niteln├í atmosf├⌐ra", "hled├íte dobrodru┼╛stv├¡?", "po┼╛adavky na syst├⌐m"]
  307.   gMenuPath3_ = [VOID, VOID, VOID, VOID, VOID, ["l├ítky a vlastnosti", "l├ítky a prom├¼na", "stavba atomu, vazby", "elektrochemie", "kyseliny, hydroxidy...", "organick├í chemie"], VOID, VOID, VOID]
  308.   gMenuPath4 = ["sv├¼t BIOSCOPIE", "ryz├¡ nap├¼t├¡", "peklo v├╜zkumn├⌐ stanice", "zachra├▓te d├¡vku!", "v├╜ukov├í ├¿├íst", "neopakovateln├í atmosf├⌐ra", "biologie v├ís pobav├¡!", "po┼╛adavky na syst├⌐m"]
  309.   gMenuPath4_ = [VOID, VOID, VOID, VOID, ["botanika", "bun├¼├¿n├í biologie", "zoologie", "antropologie", "genetika"], VOID, VOID, VOID]
  310.   gMenuPath5 = ["storyboard", "v├╜ukov├í ├¿├íst", "hern├¡ ├¿├íst", "virtu├íln├¡ 3D sv├¼ty", "programov├ín├¡"]
  311.   gMenuPath6 = []
  312.   gAllPath = [[VOID, VOID, VOID], [1, VOID, VOID], [1, 1, VOID], [1, 2, VOID], [1, 3, VOID], [1, 4, VOID], [1, 5, VOID], [2, VOID, VOID], [2, 1, VOID], [2, 2, VOID], [2, 3, VOID], [2, 4, VOID], [2, 5, VOID], [2, 5, 1], [2, 5, 2], [2, 5, 3], [2, 5, 4], [2, 5, 5], [2, 6, VOID], [2, 7, VOID], [2, 8, VOID], [3, VOID, VOID], [3, 1, VOID], [3, 2, VOID], [3, 3, VOID], [3, 4, VOID], [3, 5, VOID], [3, 6, VOID], [3, 6, 1], [3, 6, 2], [3, 6, 3], [3, 6, 4], [3, 6, 5], [3, 6, 6], [3, 7, VOID], [3, 8, VOID], [3, 9, VOID], [4, VOID, VOID], [4, 1, VOID], [4, 2, VOID], [4, 3, VOID], [4, 4, VOID], [4, 5, VOID], [4, 5, 1], [4, 5, 2], [4, 5, 3], [4, 5, 4], [4, 5, 5], [4, 6, VOID], [4, 7, VOID], [4, 8, VOID], [5, VOID, VOID], [5, 1, VOID], [5, 2, VOID], [5, 3, VOID], [5, 4, VOID], [5, 5, VOID], [6, VOID, VOID]]
  313. end
  314.