/******************************************************************************
	NINTENDO NITRO-System Maya Plugin

	File:         NNS_CreateMenu.mel
	Description:  create menu
	Date:         2006/03/13
	Author:       T.Endo

	Copyright 2003-2006 Nintendo. All rights reserved.
******************************************************************************/

/******************************************************************************
	show about plugin
******************************************************************************/
global proc NNS_ShowAboutPlugin()
{
	global string $nnsExport_Plugin_Latest_Version;
	global string $nnsExport_Plugin_Latest_Date;

	string $support_ver = `NNS_GetSupportMayaVer`;

	confirmDialog -t "About NINTENDO NITRO-System"
		-m ("NINTENDO NITRO-System Plugin for Maya " + $support_ver + "\n\n"
			+ "Ver " + $nnsExport_Plugin_Latest_Version
			+ "  ( " + $nnsExport_Plugin_Latest_Date + " )\n\n"
			+ "Copyright (C) 2003-2006 Nintendo Co.,Ltd.")
		-b "OK" -db "OK" -ma "center";
}

/******************************************************************************
	main
******************************************************************************/
global proc NNS_CreateMenu()
{
	global string $gMainWindow;

//-----------------------------------------------------------------------------
// check UI exist
	if ($gMainWindow == "" || !`window -ex $gMainWindow`)
		return;

//-----------------------------------------------------------------------------
// get version
	string $maya_ver_str = `about -v`;
	float $maya_ver = match("[0-9]+\\.[0-9]+", $maya_ver_str);

//-----------------------------------------------------------------------------
// set parent
	setParent $gMainWindow;

//-----------------------------------------------------------------------------
// delete old menu
	if (`menu -q -ex nnsMainMenu`)
		deleteUI nnsMainMenu;

//-----------------------------------------------------------------------------
// create menu
	menu -p $gMainWindow -l "NINTENDO NITRO-System"
	     -allowOptionBoxes 1 -tearOff 1
	     nnsMainMenu;

		//-----------------------------------------------------------------------------
		// export
		menuItem -l "NITRO Export"
			-ann "Export intermediate file & Use 3D Material Editor"
			-c "NNS_ExpDirect";

			menuItem -ob 1
				-ann "NITRO Export Options"
				-c "NNS_ExpDialog";

		menuItem -d 1;

		//-----------------------------------------------------------------------------
		// material attr
		menuItem -l "NITRO Set Material Attribute"
			-ann "Set material attributes of selected shadingEngine (material) node"
			-c "NNS_SetMaterialAttr";

		menuItem -l "NITRO Show Lighting"
			-ann "Show lighting mode by selection"
			-c "NNS_ShowLighting";

		menuItem -l "NITRO Show Display Face"
			-ann "Show display face mode by selection"
			-c "NNS_ShowDispFace";

		menuItem -d 1;

		//-----------------------------------------------------------------------------
		// render priority
		menuItem -l "NITRO Set Render Priority"
			-ann "Set render priority of selected shadingEngine (material) node"
			-c "NNS_SetRenderPriority";

		menuItem -l "NITRO Show Render Priority"
			-ann "Show render priority by selection"
			-c "NNS_ShowRenderPriority";

		menuItem -d 1;

		//-----------------------------------------------------------------------------
		// billboard
		menuItem -l "NITRO Set Billboard" 
			-ann "Set billboard mode of selected transform node"
			-c "NNS_SetBillboard";

		menuItem -l "NITRO Show Billboard" 
			-ann "Show billboard by selection"
			-c "NNS_ShowBillboard";

		menuItem -d 1;

		//-----------------------------------------------------------------------------
		// no cut node
		menuItem -l "NITRO Set No Cut Node" 
			-ann "Set no cut flag of selected transform node"
			-c "NNS_SetNoCutNode";

		menuItem -l "NITRO Show No Cut Node" 
			-ann "Show no cut node by selection"
			-c "NNS_ShowNoCutNode";

		menuItem -d 1;

		//-----------------------------------------------------------------------------
		// texture
		menuItem -l "NITRO Set Frame Extension List"
			-ann "Set output frame extension list for texture pattern animation"
			-c "NNS_SetFrameExtensionList";

		menuItem -d 1;

		//-----------------------------------------------------------------------------
		// utility
		menuItem -l "NITRO Replace Character"
			-ann "Replace characters of object & material name"
			-c "NNS_ReplaceCharacter";

		menuItem -l "NITRO Rename Over 16 Characters"
			-ann "Search & rename element over 16 characters"
			-c "NNS_RenameOver16";

		menuItem -d 1;

		//-----------------------------------------------------------------------------
		// about
		menuItem -l "About NINTENDO NITRO-System"
			-ann "Show infomation about this plugin"
			-c "NNS_ShowAboutPlugin";

	setParent -m ..;
}
