PDA

View Full Version : menu register help


xenry
05-30-2008, 08:06 AM
sorry if this is lame, but somehow can't get around it
I just want to add my menu in the 3ds main manu bar.
here is the script:



macroScript doStuffMacro
category:"my do stuff macros"
tooltip:"this macro does stuff"
(
messagebox "stuff done !"
)

macroScript doMoreStuffMacro
category:"my do stuff macros"
tooltip:"this macro does more stuff"
(
messagebox "more stuff done !"
)

macroScript doEvenMoreStuffMacro
category:"my do stuff macros"
tooltip:"this macro does even more stuff"
(
messagebox "even more stuff done !"
)

menuID = 0x481a48db

if(undefined == (menuMan.findMenu "do stuff menu")) do
(
local id = genClassID returnValue:true
menuID = id[2]
)

if menuMan.registerMenuContext menuID then
(

-- Get the main menu bar
local mainMenuBar = menuMan.getMainMenuBar()

-- Create a new menu
local subMenu = menuMan.createMenu "do stuff menu"

-- Create a menu item
local doStuffItem = menuMan.createActionItem "doStuffMacro" "my do stuff macros"
doStuffItem.setTitle "do stuff !"

-- Add the item to the menu
subMenu.addItem doStuffItem 0

-- create a menu item
local doMoreStuffItem = menuMan.createActionItem "doMoreStuffMacro" "my do stuff macros"
doMoreStuffItem.setTitle "do more stuff !"

-- Add the item to the menu
subMenu.addItem doMoreStuffItem 1

-- create a menu item
local doEvenMoreStuffItem = menuMan.createActionItem "doEvenMoreStuffMacro" "my do stuff macros"
doEvenMoreStuffItem.setTitle "do even more stuff !"

-- Add the item to the menu
subMenu.addItem doEvenMoreStuffItem 2

-- Create a new menu item with the menu as it's sub-menu
local subMenuItem = menuMan.createSubMenuItem "do stuff submenu" subMenu

-- compute the index of the next-to-last menu item in the main menu bar
local subMenuIndex = mainMenuBar.numItems() - 1

-- Add the sub-menu just at the second to last slot
mainMenuBar.addItem subMenuItem subMenuIndex

-- redraw the menu bar with the new item
menuMan.updateMenuBar()

)



menu registers but even though i have explicitly set the sub menu names, 3ds shows the macro names (look at the pic attached). Any suggestions would be appreciated !

ZeBoxx2
05-30-2008, 12:59 PM
Don't forget to apply <item>.setUseCustomTitle true

xenry
05-30-2008, 01:33 PM
wow that was tricky =) thanks man

CGTalk Moderation
05-30-2008, 01:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.