

// Hopefully in a future update the entire spawn menu will be moved to Lua
// For now, in your gamemode, you could use the spawn menu keys to do something else


/*---------------------------------------------------------
	If false is returned then the spawn menu is never created.
	This saves load times if your mod doesn't actually use the
	spawn menu for any reason.
---------------------------------------------------------*/
function GM:SpawnMenuEnabled()
	return false	
end


/*---------------------------------------------------------
  Called when spawnmenu is trying to be opened. 
   Return false to dissallow it.
---------------------------------------------------------*/
function GM:SpawnMenuOpen()
	return true	
end

/*---------------------------------------------------------
  Called when context menu is trying to be opened. 
   Return false to dissallow it.
---------------------------------------------------------*/
function GM:ContextMenuOpen()
	return false	
end


/*---------------------------------------------------------
  Called to populate the Scripted Tool menu. Overridden
   by the sandbox gamemode.
---------------------------------------------------------*/
function GM:PopulateSTOOLMenu()
end


/*---------------------------------------------------------
  Called right before the Lua Loaded tool menus are reloaded
---------------------------------------------------------*/
function GM:PreReloadToolsMenu()

	// Start fresh
	spawnmenu.ClearToolMenus()
	
	// Add defaults for the gamemode. In sandbox these defaults
	// are the Main/Postprocessing/Options tabs.
	// They're added first in sandbox so they're always first
	hook.Call( "AddGamemodeToolMenuTabs", GAMEMODE )

	// Use this hook to add your custom tools
	// This ensures that the default tabs are always
	// first.
	hook.Call( "AddToolMenuTabs", GAMEMODE )
	
	// Use this hook to add your custom tools
	// We add the gamemode tool menu categories first
	// to ensure they're always at the top.
	hook.Call( "AddGamemodeToolMenuCategories", GAMEMODE )
	hook.Call( "AddToolMenuCategories", GAMEMODE )
	
	// Add the tabs to the tool menu before trying
	// to populate them with tools.
	hook.Call( "PopulateToolMenu", GAMEMODE )

end

/*---------------------------------------------------------
  Called right after the Lua Loaded tool menus are reloaded
  This is a good place to set up any ControlPanels
---------------------------------------------------------*/
function GM:PostReloadToolsMenu()
end

/*---------------------------------------------------------
	Guess what this does. See the bottom of stool.lua
---------------------------------------------------------*/
function GM:PopulateToolMenu()
end


