home *** CD-ROM | disk | FTP | other *** search
/ PC go! 1996 July / Image.iso / mrmore / mrmore.dir / 00001.ls next >
Encoding:
Text File  |  1996-04-11  |  15.8 KB  |  551 lines

  1. on startMovie
  2.   global gnFirstSprite, gnLastSprite, gnHilite, glAllFrames, glThisLevel, glAutoList, gbPlayTheMusic, gsThisFrame, gnThisFrame, glLastFrames, glSoundList, gbSpeaker, gnMusicSprite, gnPopupFrame, gnEinkaufsknopf, gbPopIsOn, gnPopupGrafik, gnPopupAus, gnAnimSprite, gnMMSprite, gnLastRollTime, gnPopupInstall, gnBackAndForth, gsPopupType, gsPopupCont, goUtil, gnPopupText, gnAnimatePopup, gnLastPopupAnim, glInstallList, gnInstallActive, goGBTools, gnTextHeight, gsDefPath, gbInstallEinkauf, gnLastMouseH, gnHiliteBar, gnScrollText, gnFirstButton, gnLastButton, gnBubbleSprite, gbDoAnim, gsOldFrame, goPopup, gbInstallActive
  3.   set the visible of sprite 21 to 0
  4.   set gbInstallActive to 0
  5.   set goPopup to 0
  6.   set gsOldFrame to EMPTY
  7.   if voidp(gbDoAnim) then
  8.     set gbDoAnim to 1
  9.   end if
  10.   set gnBackAndForth to 1
  11.   set glAutoList to list("Main", "Help1", "Help2", "Help3", "fonts", "design", "backgrounds", "game", "fax", "utility")
  12.   set gnFirstButton to 31
  13.   set gnLastButton to 39
  14.   set gnBubbleSprite to 48
  15.   set gnHiliteBar to 7
  16.   set gnScrollText to 6
  17.   set gnLastMouseH to the mouseH
  18.   set gbInstallEinkauf to 0
  19.   if the pathName contains "MrMore" then
  20.     set gsDefPath to the pathName
  21.   else
  22.     set gsDefPath to the pathName & "\mrmore\"
  23.   end if
  24.   set gnTextHeight to 18
  25.   set the textHeight of field "BusiFListe" to gnTextHeight
  26.   set the textHeight of field "ArtFListe" to gnTextHeight
  27.   set the textHeight of field "FunFListe" to gnTextHeight
  28.   set the textHeight of field "BusiUListe" to gnTextHeight
  29.   set the textHeight of field "HomeUListe" to gnTextHeight
  30.   set the textHeight of field "FreiUListe" to gnTextHeight
  31.   openXLib("fileIO")
  32.   openXLib("dllGlue")
  33.   openXLib("movutils")
  34.   openXLib("gb_XLib")
  35.   set n to the timer mod 10
  36.   set s to numToChar(n) & numToChar(n * 2) & numToChar(n + 2)
  37.   set goGBTools to gb_XLib(mnew, s)
  38.   if not CheckObject(goGBTools, "Installations-Tool") then
  39.     quit()
  40.   end if
  41.   set goUtil to MovUtils(mnew)
  42.   if not CheckObject(goUtil, "Utility") then
  43.     quit()
  44.   end if
  45.   if GetWinVersion() = "3.95" then
  46.     set the exitLock to 0
  47.   else
  48.     set the exitLock to 0
  49.   end if
  50.   ReadVars()
  51.   ResetKorb()
  52.   set glInstallList to list()
  53.   set gnInstallActive to 0
  54.   set gnLastPopupAnim to 0
  55.   set gnAnimatePopup to 0
  56.   set gsPopupType to EMPTY
  57.   set gsPopupCont to EMPTY
  58.   set gnLastRollTime to the timer + (60 * 60)
  59.   set gbSpeaker to 0
  60.   if not objectp(glSoundList) then
  61.     set glSoundList to list("Help1", "Help2", "Help3", "busifont", "funfont", "artfont", "sounds", "backgrounds", "clipart", "lemminge3d", "lemmingewin", "lovefax", "busifax", "rockfax", "homeutil", "freiutil", "busiutil")
  62.   end if
  63.   set gbPopIsOn to 0
  64.   set gnPopupFrame to 41
  65.   set gnEinkaufsknopf to 42
  66.   set gnPopupGrafik to 45
  67.   set gnPopupAus to 44
  68.   set gnPopupInstall to 43
  69.   set gnPopupText to 46
  70.   set gnMMSprite to 40
  71.   set gnMusicSprite to 38
  72.   set gbPlayTheMusic to 1
  73.   set gnAnimSprite to 15
  74.   set gnThisFrame to 1
  75.   set gsThisFrame to "Main"
  76.   set glLastFrames to list()
  77.   set glAllFrames to list()
  78.   set l to list("main")
  79.   append(glAllFrames, l)
  80.   set l to list("Help1", "Help2", "Help3")
  81.   append(glAllFrames, l)
  82.   set l to list("Install", "DeInstall")
  83.   append(glAllFrames, l)
  84.   set l to list("fonts", "design", "game", "fax", "utility", "tonline")
  85.   append(glAllFrames, l)
  86.   set l to list("busifont", "funfont", "artfont")
  87.   append(glAllFrames, l)
  88.   set l to list("sounds", "backgrounds", "clipart")
  89.   append(glAllFrames, l)
  90.   set l to list("lemminge3d", "lemmingewin")
  91.   append(glAllFrames, l)
  92.   set l to list("lovefax", "busifax", "rockfax")
  93.   append(glAllFrames, l)
  94.   set l to list("homeutil", "freiutil", "busiutil")
  95.   append(glAllFrames, l)
  96.   set l to list("busiclip", "freiclip", "techclip")
  97.   append(glAllFrames, l)
  98.   set glThisLevel to list("main")
  99.   set gnLastSprite to 0
  100.   set gnFirstSprite to 5
  101.   set gnHilite to 33
  102. end
  103.  
  104. on ResetKorb
  105.   set the text of field "InstallFont" to "Keine Daten gew├ñhlt"
  106.   set the text of field "InstallDesi" to "Keine Daten gew├ñhlt"
  107.   set the text of field "InstallGame" to "Keine Daten gew├ñhlt"
  108.   set the text of field "InstallClip" to "Keine Daten gew├ñhlt"
  109.   set the text of field "InstallFaxe" to "Keine Daten gew├ñhlt"
  110.   set the text of field "InstallUtil" to "Keine Daten gew├ñhlt"
  111. end
  112.  
  113. on stopMovie
  114.   global goUtil, goGBTools
  115.   set s to the text of field "DesiDir"
  116.   if IsValidDir(s) then
  117.     WriteIni("Dirs", "Design", s, "MRMORE.INI")
  118.   end if
  119.   set s to the text of field "ClipDir"
  120.   if IsValidDir(s) then
  121.     WriteIni("Dirs", "ClipArt", s, "MRMORE.INI")
  122.   end if
  123.   set s to the text of field "FaxeDir"
  124.   if IsValidDir(s) then
  125.     WriteIni("Dirs", "Fax", s, "MRMORE.INI")
  126.   end if
  127.   goGBTools(mdispose)
  128.   goUtil(mdispose)
  129.   closeXLib("movutils")
  130.   closeXLib("dllGlue")
  131.   closeXLib("GB_XLib")
  132.   closeXLib("fileIO")
  133. end
  134.  
  135. on ReadVars
  136.   global gsWinDir, goUtil, gsSysDir
  137.   set gsWinDir to goUtil(mGetWindowsPath) & "\"
  138.   set gsSysDir to goUtil(mGetSystemPath) & "\"
  139.   set the text of field "DesiDir" to ReadIni("Dirs", "Design", "MRMORE.INI")
  140.   set the text of field "ClipDir" to ReadIni("Dirs", "ClipArt", "MRMORE.INI")
  141.   set the text of field "FaxeDir" to ReadIni("Dirs", "Fax", "MRMORE.INI")
  142. end
  143.  
  144. on CheckSound
  145.   global gbSpeaker, gbPlayTheMusic
  146.   if not soundBusy(1) then
  147.     set gbSpeaker to 0
  148.     if gbPlayTheMusic then
  149.       SafeSound(1, "diverse\musik")
  150.     end if
  151.   end if
  152. end
  153.  
  154. on CheckRollOver
  155.   global gnFirstSprite, gnLastSprite, gnFirstButton, gnLastButton, gnBubbleSprite
  156.   repeat with i = gnFirstSprite to gnLastSprite
  157.     if the castNum of sprite i > 0 then
  158.       set sName to the name of cast the castNum of sprite i
  159.       set n to the number of cast (char 1 to 4 of sName & "s")
  160.       set c to char 5 of sName
  161.       if rollOver(i) then
  162.         if (c = "n") and (n > 0) then
  163.           set the castNum of sprite i to n
  164.           exit repeat
  165.         else
  166.           if (c = "h") and (n > 0) then
  167.             set the castNum of sprite i to n
  168.             BlendIn(i)
  169.             exit repeat
  170.           end if
  171.         end if
  172.         next repeat
  173.       end if
  174.       if c <> "h" then
  175.         set the castNum of sprite i to the number of cast (char 1 to 4 of sName & "n")
  176.       end if
  177.     end if
  178.   end repeat
  179.   set the puppet of sprite gnBubbleSprite to 1
  180.   repeat with i = gnFirstButton to gnLastButton
  181.     if rollOver(i) then
  182.       if the castNum of sprite i > 0 then
  183.         if the text of cast "BubbleText" <> the name of cast the castNum of sprite i then
  184.           set the text of cast "BubbleText" to the name of cast the castNum of sprite i
  185.           set the locV of sprite gnBubbleSprite to the locV of sprite i - the height of sprite i
  186.           if the locH of sprite i > 550 then
  187.             set the locH of sprite gnBubbleSprite to the locH of sprite i - (2 * the width of sprite i)
  188.           else
  189.             if the locH of sprite i < 50 then
  190.               set the locH of sprite gnBubbleSprite to the locH of sprite i - (the width of sprite i / 2)
  191.             else
  192.               set the locH of sprite gnBubbleSprite to the locH of sprite i - the width of sprite i
  193.             end if
  194.           end if
  195.           updateStage()
  196.         end if
  197.         exit
  198.       end if
  199.     end if
  200.   end repeat
  201.   set the locH of sprite gnBubbleSprite to -2000
  202. end
  203.  
  204. on CheckForTimeOut
  205.   global gnLastRollTime, gnLastMouseH, gnFirstSprite, gsThisFrame, glAutoList, gbPlayTheMusic, gsOldFrame, gbSpeaker
  206.   if (the timer mod 500) = 0 then
  207.     if gsThisFrame <> "install" then
  208.       DoFrameAnim(21 + random(5))
  209.     end if
  210.   end if
  211.   if abs(the mouseH - gnLastMouseH) > 10 then
  212.     set gnLastRollTime to the timer
  213.     set gnLastMouseH to the mouseH
  214.     if not gbSpeaker and not gbPlayTheMusic and ((the timer mod 60) = 0) then
  215.       SafeSound(1, "gag\" & string(random(10)))
  216.     end if
  217.     if gsOldFrame <> EMPTY then
  218.       GoFrame(gsOldFrame)
  219.       set gsOldFrame to EMPTY
  220.     end if
  221.   else
  222.     if the timer > (gnLastRollTime + (60 * 45)) then
  223.       set nNumbers to count(glAutoList)
  224.       set n to the timer - (gnLastRollTime + (60 * 45))
  225.       set n to (n / (15 * 60) mod nNumbers) + 1
  226.       if gsOldFrame = EMPTY then
  227.         set gsOldFrame to gsThisFrame
  228.       end if
  229.       if getAt(glAutoList, n) <> gsThisFrame then
  230.         GoFrame(getAt(glAutoList, n))
  231.       end if
  232.     else
  233.       if ((the timer - gnLastRollTime) / 60 mod 30) = 29 then
  234.         set s to string(random(15))
  235.         if length(s) = 1 then
  236.           set s to "0" & s
  237.         end if
  238.         DoMrMore("langew\MMLang" & s, "more aktiv" & string(random(4)), 9, 0)
  239.       else
  240.         if the timer > (gnLastRollTime + (60 * 9)) then
  241.           set n to the castNum of sprite gnFirstSprite
  242.           if n > 0 then
  243.             set sName to the name of cast n
  244.             if (char 5 of sName <> "h") and (gsThisFrame <> "Main") and not rollOver(gnFirstSprite) then
  245.               BlendOut(gnFirstSprite)
  246.               set the castNum of sprite gnFirstSprite to the number of cast (char 1 to 4 of sName & "h")
  247.             end if
  248.           end if
  249.         end if
  250.       end if
  251.     end if
  252.   end if
  253. end
  254.  
  255. on BlendIn nSprite
  256.   cursor(4)
  257.   repeat with nBlend = 1 to 3
  258.     set the blend of sprite nSprite to (nBlend * 20) + 40
  259.     updateStage()
  260.   end repeat
  261.   cursor(0)
  262. end
  263.  
  264. on BlendOut nSprite
  265.   cursor(4)
  266.   repeat with nBlend = 1 to 12
  267.     set the blend of sprite nSprite to 100 - (nBlend * 5)
  268.     updateStage()
  269.   end repeat
  270.   cursor(0)
  271. end
  272.  
  273. on GoFrame sFrame
  274.   global glAllFrames, glThisLevel, gnThisFrame, gsThisFrame, gbPopIsOn
  275.   if CheckForPopup() then
  276.     exit
  277.   end if
  278.   cursor(4)
  279.   repeat with i = 1 to 37
  280.     set the puppet of sprite i to 0
  281.   end repeat
  282.   repeat with i = 39 to 48
  283.     set the puppet of sprite i to 0
  284.   end repeat
  285.   ClosePopup()
  286.   set nAll to count(glAllFrames)
  287.   repeat with i = 1 to nAll
  288.     set l to getAt(glAllFrames, i)
  289.     set nThis to count(l)
  290.     repeat with j = 1 to nThis
  291.       if sFrame = getAt(l, j) then
  292.         set glThisLevel to l
  293.         set gnThisFrame to j
  294.         set gsThisFrame to sFrame
  295.         go(sFrame)
  296.         CheckForHinweis(sFrame)
  297.         exit
  298.       end if
  299.     end repeat
  300.   end repeat
  301.   alert("Frame " & sFrame & " nicht gefunden!")
  302. end
  303.  
  304. on CheckForHinweis sFrame
  305.   global glSoundList, glAllFrames
  306.   if sFrame = "Main" then
  307.     set l to getAt(glAllFrames, 4)
  308.     repeat with i = 1 to count(l)
  309.       set s to getAt(l, i)
  310.       set b to 0
  311.       repeat with j = 1 to count(glSoundList)
  312.         if getAt(glSoundList, j) = s then
  313.           set b to 1
  314.           exit repeat
  315.         end if
  316.       end repeat
  317.       if not b then
  318.         DoMrMore("hinweis\hinw" & char 1 to 4 of s, "more aktiv" & string(random(4)), 9, 0)
  319.         exit repeat
  320.       end if
  321.     end repeat
  322.   end if
  323. end
  324.  
  325. on SafeSound nChannel, sFile
  326.   global gsDefPath
  327.   if soundBusy(nChannel) then
  328.     StopSound(nChannel)
  329.   end if
  330.   puppetSound(0)
  331.   set the volume of sound nChannel to 255
  332.   sound playFile nChannel, gsDefPath & "sounds\" & sFile
  333. end
  334.  
  335. on StopSound nChannel
  336.   sound stop nChannel
  337. end
  338.  
  339. on ClickButton nSprite
  340.   cursor(4)
  341.   set s to the name of cast the castNum of sprite nSprite
  342.   set the puppet of sprite nSprite to 1
  343.   set the castNum of sprite nSprite to the number of cast (s & "i")
  344.   updateStage()
  345.   repeat while the mouseDown
  346.   end repeat
  347.   if s <> EMPTY then
  348.     set the castNum of sprite nSprite to the number of cast s
  349.     updateStage()
  350.   end if
  351. end
  352.  
  353. on LoadAnim sFrame
  354.   cursor(4)
  355.   preLoad(label(sFrame), label(sFrame) + 9)
  356.   cursor(0)
  357. end
  358.  
  359. on DoAnim nSprite, nFrames, bBackAndForth
  360.   global gnBackAndForth
  361.   set n to the castNum of sprite nSprite
  362.   if n <= 0 then
  363.     exit
  364.   end if
  365.   set sName to the name of cast n
  366.   set s to char length(sName) of sName
  367.   set sName to char 1 to length(sName) - 1 of sName
  368.   if bBackAndForth then
  369.     set n to value(s) + gnBackAndForth
  370.     if (n > nFrames) or (n < 1) then
  371.       set gnBackAndForth to -gnBackAndForth
  372.       set n to n + gnBackAndForth
  373.     end if
  374.   else
  375.     set n to value(s) + random(4)
  376.     if n > nFrames then
  377.       set n to 1
  378.     end if
  379.   end if
  380.   if (the castNum of sprite nSprite > 0) and (sName <> EMPTY) then
  381.     set the castNum of sprite nSprite to the number of cast (sName & string(n))
  382.     updateStage()
  383.   end if
  384. end
  385.  
  386. on DoMrMore sSound, sSprite, nFrames, bBackAndForth
  387.   global gnMMSprite, gbDoAnim
  388.   StartMrMore(sSound, sSprite)
  389.   set nTime to the timer
  390.   repeat while soundBusy(1)
  391.     if the timer > (nTime + 4) then
  392.       DoAnim(gnMMSprite, nFrames, bBackAndForth)
  393.       set nTime to the timer
  394.     end if
  395.     updateStage()
  396.     if the mouseDown then
  397.       exit repeat
  398.     end if
  399.   end repeat
  400.   StopMrMore()
  401. end
  402.  
  403. on StopMrMore
  404.   global gnMMSprite
  405.   StopSound(1)
  406.   set the puppet of sprite gnMMSprite to 0
  407.   updateStage()
  408.   cursor(0)
  409. end
  410.  
  411. on StartMrMore sSound, sSprite
  412.   global gnMMSprite, gnBackAndForth
  413.   cursor(4)
  414.   set gnBackAndForth to 1
  415.   if the castNum of sprite gnMMSprite > 0 then
  416.     set the puppet of sprite gnMMSprite to 1
  417.     set the castNum of sprite gnMMSprite to the number of cast (sSprite & " 1")
  418.     updateStage()
  419.     SafeSound(1, sSound)
  420.     updateStage()
  421.   end if
  422. end
  423.  
  424. on DoFrameAnim nSprite
  425.   global gbDoAnim
  426.   set the puppet of sprite nSprite to 1
  427.   set n to the castNum of sprite nSprite
  428.   set s to char 1 to 4 of the name of cast n
  429.   set nTime to the timer
  430.   repeat with i = 1 to 5
  431.     repeat while (the timer < (nTime + 20)) and not (the mouseDown)
  432.     end repeat
  433.     if the mouseDown then
  434.       exit
  435.     end if
  436.     set nTime to the timer
  437.     set the castNum of sprite nSprite to the number of cast (s & string(i))
  438.     updateStage()
  439.     CheckRollOver()
  440.   end repeat
  441.   repeat with i = 0 to 4
  442.     repeat while (the timer < (nTime + 15)) and not (the mouseDown)
  443.     end repeat
  444.     if the mouseDown then
  445.       exit
  446.     end if
  447.     set nTime to the timer
  448.     set the castNum of sprite nSprite to the number of cast (s & string(5 - i))
  449.     updateStage()
  450.     CheckRollOver()
  451.   end repeat
  452.   set the puppet of sprite nSprite to 0
  453. end
  454.  
  455. on DoMainAnim sSprite
  456.   global gnAnimSprite, gbDoAnim
  457.   if not gbDoAnim then
  458.     exit
  459.   end if
  460.   cursor(4)
  461.   unLoad()
  462.   repeat with i = 1 to 5
  463.     preLoadCast(char 1 to 4 of sSprite & "s" & string(i))
  464.   end repeat
  465.   cursor(0)
  466.   set the puppet of sprite gnAnimSprite to 1
  467.   set the locH of sprite gnAnimSprite to the locH of sprite the clickOn
  468.   set the locV of sprite gnAnimSprite to the locV of sprite the clickOn
  469.   set the puppet of sprite the clickOn to 1
  470.   set the locH of sprite the clickOn to -2000
  471.   set nTime to the timer
  472.   repeat with i = 1 to 5
  473.     repeat while the timer < (nTime + 5)
  474.     end repeat
  475.     set nTime to the timer
  476.     set the castNum of sprite gnAnimSprite to the number of cast (char 1 to 4 of sSprite & "s" & string(i))
  477.     updateStage()
  478.   end repeat
  479. end
  480.  
  481. on MsgBox sType, sTitle, sText
  482.   global goPopup, gsPopupStyle, gsPopupText, gsPopupTitle
  483.   set goPopup to window "Popup"
  484.   set the rect of goPopup to rect(the stageLeft + 72, the stageTop + 82, the stageLeft + 568, the stageTop + 397)
  485.   set the titleVisible of goPopup to 0
  486.   set gsPopupStyle to sType
  487.   set gsPopupText to sText
  488.   set gsPopupTitle to sTitle
  489.   open(goPopup)
  490. end
  491.  
  492. on CheckObject o, s
  493.   if not objectp(o) then
  494.     alert("Error:" & RETURN & "Object " & s & " not available!")
  495.     return 0
  496.   end if
  497.   return 1
  498. end
  499.  
  500. on MerkeLetztesFrame
  501.   global gsThisFrame, glLastFrames
  502.   append(glLastFrames, gsThisFrame)
  503. end
  504.  
  505. on ButtonGoto sFrame
  506.   if (sFrame = "fonts") or (sFrame = "design") or (sFrame = "fax") or (sFrame = "game") or (sFrame = "utility") then
  507.     LoadAnim(sFrame)
  508.   end if
  509.   if CheckForPopup() then
  510.     exit
  511.   end if
  512.   cursor(4)
  513.   MerkeLetztesFrame()
  514.   ClickButton(the clickOn)
  515.   GoFrame(sFrame)
  516. end
  517.  
  518. on alltrim sString
  519.   set s to ltrim(sString)
  520.   set s to rtrim(s)
  521.   return s
  522. end
  523.  
  524. on rtrim sString
  525.   set nLen to length(sString)
  526.   set n to 0
  527.   repeat while (char nLen - n of sString = " ") and (n <= nLen)
  528.     set n to n + 1
  529.   end repeat
  530.   set s to char 1 to nLen - n of sString
  531.   if s = " " then
  532.     set s to EMPTY
  533.   end if
  534.   return s
  535. end
  536.  
  537. on ltrim sString
  538.   set nLen to length(sString)
  539.   set n to 1
  540.   repeat while (char n of sString = " ") and (n <= nLen)
  541.     set n to n + 1
  542.   end repeat
  543.   return char n to nLen of sString
  544. end
  545.  
  546. on Wait n
  547.   set nTime to the timer
  548.   repeat while the timer < (n + nTime)
  549.   end repeat
  550. end
  551.