home *** CD-ROM | disk | FTP | other *** search
- global gRootPath, dv, mFont, MMFSize, SMFSize, HDFSize, BDFSize, clickAction, bOpaqueMenubar, mTxtAlign, mTxtIndent, ShadowOffset, bWidth, bHeight, menuStartSp, FinalMMSp, MaxItems
-
- on exitFrame me
- mFont = "Arial"
- MMFSize = 18
- SMFSize = 14
- HDFSize = 24
- BDFSize = 14
- bWidth = 140
- bHeight = 40
- ShadowOffset = 15
- MaxItems = 18
- tempSettings = member("TempSettings")
- menuTree = member("menuTree")
- member("menuShadow").centerRegPoint = 1
- member("menuBack").centerRegPoint = 1
- repeat with i = 1 to tempSettings.line.count
- delete tempSettings.line[i]
- end repeat
- repeat with i = 1 to menuTree.line.count
- delete menuTree.line[i]
- end repeat
- repeat with i = 1 to the number of castMembers of castLib "menuText"
- castLib("menuText").member[i].erase()
- end repeat
- repeat with i = 1 to the number of castMembers of castLib "submenufields"
- castLib("submenufields").member[i].erase()
- end repeat
- settings = getNetText(gRootPath & "files" & dv & "menu" & dv & "settings.menu")
- if netDone(settings) then
- tempSettings.text = netTextresult(settings)
- repeat with i = 1 to tempSettings.line.count
- mess = tempSettings.line[i].word[1]
- case mess of
- "<interface_font>":
- mFont = tempSettings.line[i].char[18..tempSettings.line[i].char.count]
- "<main_menu_fontsize>":
- MMFSize = integer(tempSettings.line[i].word[2])
- "<submenu_fontsize>":
- SMFSize = integer(tempSettings.line[i].word[2])
- "<Header_Fontsize>":
- HDFSize = integer(tempSettings.line[i].word[2])
- "<body_fontsize>":
- BDFSize = integer(tempSettings.line[i].word[2])
- "<button_width>":
- bWidth = integer(tempSettings.line[i].word[2])
- "<button_height>":
- bHeight = integer(tempSettings.line[i].word[2])
- "<Item_Mode>":
- clickAction = string(tempSettings.line[i].word[2])
- "<opaque_menu_bar?>":
- bOpaqueMenubar = string(tempSettings.line[i].word[2])
- "<TextAlign>":
- mTxtAlign = string(tempSettings.line[i].word[2])
- case mTxtAlign of
- "left":
- mTxtAlign = #left
- "right":
- mTxtAlign = #right
- "center":
- mTxtAlign = #center
- end case
- "<textIndent>":
- mTxtIndent = integer(tempSettings.line[i].word[2])
- "<ShadowOffset>":
- ShadowOffset = integer(tempSettings.line[i].word[2])
- end case
- end repeat
- end if
- tempSp = sprite("menuplaceholder").spriteNum
- menuStartSp = sprite(tempSp)
- menuStartSp.visible = 0
- repeat with p = tempSp to _movie.channel.count
- channel(p).removeScriptedSprite()
- sprite(p).visible = 0
- end repeat
- dynItems = getNetText(gRootPath & "files" & dv & "menu" & dv & "items.menu")
- MMCount = 0
- SMCount = 0
- SpCount = 0
- pLocV = menuStartSp.locV
- sLocH = menuStartSp.left
- pLocH = sLocH
- if netDone(dynItems) then
- menuTree.text = netTextresult(dynItems)
- repeat with i = 1 to menuTree.line.count
- if menuTree.line[i] contains "---End---" then
- FinalMMSp = menuStartSp.spriteNum + MMCount
- exit repeat
- end if
- if menuTree.line[i] contains "---" then
- MMCount = MMCount + 1
- SpCount = SpCount + 1
- NewTxt = new(#text, castLib("menuText"))
- NewTxt.width = integer(bWidth)
- repeat with d = 1 to the number of chars in menuTree.line[i]
- if menuTree.line[i].char[d] = "@" then
- if menuTree.line[i].char[d + 1] = "@" then
- pEnd = d - 1
- exit repeat
- end if
- end if
- end repeat
- NewTxt.text = menuTree.line[i].char[4..pEnd]
- NewTxt.font = mFont
- NewTxt.fontSize = MMFSize
- NewTxt.alignment = mTxtAlign
- NewTxt.antialias = 1
- NewTxt.antiAliasThreshold = 0
- NewTxt.leftIndent = mTxtIndent
- NewTxt.rightIndent = mTxtIndent
- NewTxt.topSpacing = 0
- NewTxt.bottomSpacing = 0
- NewTxt.centerRegPoint = 1
- tempList = EMPTY
- repeat with k = i + 1 to menuTree.line.count
- if menuTree.line[k] contains "---" then
- pbEnd = k - 1
- exit repeat
- end if
- end repeat
- j = i + 1
- pbEnd = pbEnd
- pNumber = pbEnd - j
- holder = menuTree.line[j..pbEnd]
- repeat with f = 1 to holder.line.count
- popo = holder.line[f].word.count
- repeat with g = 1 to popo
- if holder.line[f].word[g] contains "@@" then
- delete holder.line[f].word[g..popo]
- job = holder.line[f].char.count
- delete holder.line[f].char[job]
- NewItemList = new(#text, castLib("submenufields"))
- NewItemList.width = bWidth
- NewItemList.centerRegPoint = 1
- NewItemList.width = bWidth
- NewItemList.text = holder.line[f]
- NewItemList.font = mFont
- NewItemList.fontSize = SMFSize
- NewItemList.alignment = mTxtAlign
- NewItemList.leftIndent = mTxtIndent
- NewItemList.rightIndent = mTxtIndent
- NewTxt.antialias = 1
- NewTxt.antiAliasThreshold = 0
- NewItemList.topSpacing = 0
- NewItemList.bottomSpacing = 0
- NewItemList.name = string(NewTxt.text & f)
- end if
- end repeat
- end repeat
- end if
- end repeat
- TmpSp = menuStartSp.spriteNum + 5
- sLocH = menuStartSp.left + (bWidth / 2)
- sLocV = menuStartSp.top
- repeat with k = 1 to the number of castMembers of castLib "MenuText"
- subBCount = 0
- repeat with o = 1 to the number of castMembers of castLib "submenuitems"
- if castLib("submenufields").member[o].name contains castLib("menuText").member[k].text then
- subBCount = subBCount + 1
- if subBCount = MaxItems then
- twoBox = 1
- exit repeat
- next repeat
- end if
- twoBox = 0
- end if
- end repeat
- pStarter = TmpSp
- pLocH = sLocH + (bWidth * (k - 1))
- if twoBox then
- channel(TmpSp).makeScriptedSprite(member("menuBack"), point(pLocH, pLocV))
- menuBack1 = TmpSp
- add(sprite(TmpSp).scriptInstanceList, new(script("HideMenuLeave"), 1))
- TmpSp = TmpSp + 1
- channel(TmpSp).makeScriptedSprite(member("menuBack"), point(pLocH, pLocV))
- add(sprite(TmpSp).scriptInstanceList, new(script("HideMenuLeave"), 1))
- menuBack2 = TmpSp
- else
- channel(TmpSp).makeScriptedSprite(member("menuBack"), point(pLocH, pLocV))
- add(sprite(TmpSp).scriptInstanceList, new(script("HideMenuLeave"), 1))
- menuBack1 = TmpSp
- menuBack2 = 0
- end if
- TmpSp = TmpSp + 1
- pMember = castLib("menuText").member[k]
- channel(TmpSp).makeScriptedSprite(pMember, point(pLocH, pLocV))
- add(sprite(TmpSp).scriptInstanceList, new(script("RollOverExpose"), 1))
- sprite(TmpSp).visible = 1
- sprite(TmpSp).ink = 36
- MMSp = TmpSp
- TmpSp = TmpSp + 1
- subCount = 0
- repeat with o = 1 to the number of castMembers of castLib "submenuitems"
- if castLib("submenufields").member[o].name contains castLib("menuText").member[k].text then
- subCount = subCount + 1
- if subCount < MaxItems then
- myH = pLocH
- myCount = subCount
- else
- myH = pLocH + bWidth
- myCount = subCount - (MaxItems - 1)
- end if
- channel(TmpSp).makeScriptedSprite(castLib("submenufields").member[o], point(myH, pLocV + (bHeight / 2) + (bHeight * myCount)))
- add(sprite(TmpSp).scriptInstanceList, new(script("showmyname"), 1))
- sprite(TmpSp).visible = 0
- sprite(TmpSp).ink = 36
- TmpSp = TmpSp + 1
- end if
- end repeat
- pEnder = TmpSp - 1
- pList = [:]
- lcount = 0
- repeat with j = pStarter to pEnder
- pString = string("item" && lcount)
- pList[pString] = sprite(j)
- lcount = lcount + 1
- end repeat
- sendSprite(MMSp, #pInit, pList, menuBack1, menuBack2, MMSp)
- end repeat
- end if
- end
-