DermaMenu:AddSubMenu() not working


I have a dermamenu that is opened on a button click. It is a menu of two submenus, and those submenus each have two options. However, the menus of the two submenus are not being built.

Here’s the code:

[lua] optBtn.DoClick = function()
local optMenu = DermaMenu()

	local shuffleMenu = function(menu)
		menu:AddOption("On", function() RunConsoleCommand("mp3_shuffle", "1") end)
		menu:AddOption("Off", function() RunConsoleCommand("mp3_shuffle", "0") end)
	local repMenu = function(menu)
		menu:AddOption("On", function() RunConsoleCommand("mp3_repeat", "1") end)
		menu:AddOption("Off", function() RunConsoleCommand("mp3_repeat", "0") end)
	optMenu:AddSubMenu("Shuffle", nil, function(NEWMENU) shuffleMenu(NEWMENU) end)
	optMenu:AddSubMenu("Repeat", nil, function(NEWMENU) repMenu(NEWMENU) end)

There are no errors.


And how in blazes does assmod do SetImage on the thing returned by :AddSubMenu? When I do it, it says there’s no such thing as SetImage. Andy is a wizard with the DermaMenu. Actually nevermind, I see how he did it in the ass_client.lua. It’s still awesome though.