home *** CD-ROM | disk | FTP | other *** search
- global gRootPath, gDiv, gMenuList, bMember, finalChan, rollcolor, imageMember
-
- on prepareMovie
- ClearCastElements()
- end
-
- on ClearCastElements
- member("intro_text").text = EMPTY
- end
-
- on createBanner
- trace("Nothing")
- end
-
- on LoadIntroText
- int_Text = getNetText(gRootPath & "menu" & gDiv & "IntroText.txt")
- imageMember = member("imagebox")
- if netDone(int_Text) then
- member("intro_text").text = netTextResult(int_Text)
- member("intro_text").topSpacing = 0
- end if
- end
-
- on InitialiseList
- bMember = member("main_button", "GFX")
- gMenuList = [:]
- ListHolder = ReadListString()
- MakeMemoryList(ListHolder)
- MakeButtonTexts()
- MakeButtonSprites()
- end
-
- on ReadListString
- sPath = gRootPath & "Menu" & gDiv & "Menu_Items.txt"
- pNT = getNetText(sPath)
- if netDone(pNT) then
- tResult = netTextResult(pNT)
- end if
- return tResult
- end
-
- on MakeMemoryList ListHolder
- rollcolor = rgb(0, 100, 196)
- repeat with i = 1 to ListHolder.line.count
- if ListHolder.line[i] contains "---End---" then
- exit repeat
- end if
- if ListHolder.line[i].char[1..3] = "---" then
- LineEnd = ListHolder.line[i].char.count
- repeat with g = 1 to ListHolder.line[i].char.count
- endbit = g + 1
- if ListHolder.line[i].char[g..endbit] = "@@" then
- PathStartChar = g
- pEndChar = PathStartChar - 2
- pStartChar = PathStartChar + 2
- mainItemTitle = ListHolder.line[i].char[4..pEndChar]
- mainItemPath = ListHolder.line[i].char[pStartChar..LineEnd]
- gMenuList[mainItemTitle] = [:]
- gMenuList[mainItemTitle][#ItemTitle] = mainItemTitle
- gMenuList[mainItemTitle][#ItemPath] = mainItemPath
- gMenuList[mainItemTitle][#ItemList] = [:]
- end if
- end repeat
- pStartLine = i + 1
- repeat with h = pStartLine to ListHolder.line.count
- if ListHolder.line[h].char[1..3] = "---" then
- exit repeat
- next repeat
- end if
- repeat with g = 1 to ListHolder.line[h].char.count
- endbit = g + 1
- if ListHolder.line[h].char[g..endbit] = "@@" then
- PathStartChar = g
- pEndChar = PathStartChar - 2
- pStartChar = PathStartChar + 2
- LineEnd = the number of chars in ListHolder.line[h]
- subItemTitle = ListHolder.line[h].char[1..pEndChar]
- subItemPath = ListHolder.line[h].char[pStartChar..LineEnd]
- gMenuList[mainItemTitle][#ItemList][subItemTitle] = [:]
- gMenuList[mainItemTitle][#ItemList][subItemTitle][#ItemTitle] = subItemTitle
- gMenuList[mainItemTitle][#ItemList][subItemTitle][#ItemPath] = subItemPath
- exit repeat
- end if
- end repeat
- end repeat
- end if
- end repeat
- end
-
- on MakeButtonTexts
- repeat with i = 1 to the number of castMembers of castLib "MainItems"
- castLib("MainItems").member[i].erase()
- end repeat
- repeat with i = 1 to the number of castMembers of castLib "SubItems"
- castLib("SubItems").member[i].erase()
- end repeat
- repeat with i = 1 to gMenuList.count
- g = new(#text, castLib("MainItems"))
- g.width = 100
- g.text = gMenuList[i].ItemTitle
- g.name = gMenuList[i].ItemTitle
- g.antialias = 1
- g.antiAliasThreshold = 0
- g.fontSize = 12
- g.font = "Arial *"
- g.fontStyle = [#bold]
- g.alignment = #center
- g.color = rgb(0, 0, 0)
- g.width = bMember.width
- repeat with u = 1 to gMenuList[i][#ItemList].count
- p = new(#text, castLib("SubItems"))
- p.name = gMenuList[i].ItemTitle && string(u)
- p.text = gMenuList[i][#ItemList][u].ItemTitle
- p.antialias = 1
- p.antiAliasThreshold = 0
- p.fontSize = 12
- p.fontStyle = [#bold]
- p.font = "Arial *"
- p.width = 280
- p.charSpacing = -0.5
- end repeat
- end repeat
- end
-
- on MakeButtonSprites
- repeat with i = 1 to _movie.channel.count
- if sprite(i).member = member("MenuPlacer") then
- FS = sprite(i)
- exit repeat
- end if
- end repeat
- bCount = 1
- sCount = 1
- bH = bMember.height
- bW = bMember.width
- bMember.regPoint = point(0, 0)
- member("main_over", "gfx").regPoint = point(0, 0)
- lV = FS.top
- repeat with i = 1 to the number of castMembers of castLib "MainItems"
- if bCount > 4 then
- lV = lV + (bH + 1)
- bCount = 1
- end if
- lH = FS.left + (bW * (bCount - 1))
- Sp = channel(FS.spriteNum + sCount)
- chan = FS.spriteNum + sCount
- Sp.makeScriptedSprite(bMember, point(lH + (bCount * 4), lV))
- add(sprite(chan).scriptInstanceList, new(script("Main Button Rollover"), 1))
- _movie.sendSprite(chan, #Initialize, chan, gMenuList[i].ItemPath, i, gMenuList[i].ItemTitle)
- sCount = sCount + 1
- Sp = channel(FS.spriteNum + sCount)
- chan = FS.spriteNum + sCount
- Sp.makeScriptedSprite(member(i, "MainItems"), point(lH + (bCount * 4), lV + 5))
- sprite(chan).ink = 36
- sprite(chan).color = rgb(0, 0, 0)
- bCount = bCount + 1
- sCount = sCount + 1
- end repeat
- FS.visible = 0
- finalChan = chan + 1
- put finalChan
- end
-